add initial test message

This commit is contained in:
Juni
2022-12-05 14:27:09 -05:00
parent ca5da69d14
commit 95329d7f53

View File

@@ -12,13 +12,16 @@ class ChatGpt(commands.Cog):
self.bot = bot
@commands.command()
async def testchat(self, ctx: commands.Context):
async def testchat(self, ctx: commands.Context, msg):
"""Test"""
config = await self.setCredentials(ctx)
email = config.get("email")
password = config.get("password")
await ctx.send(f"email {email}, password {password}")
chatbot = Chatbot(config, conversation_id=None)
chatbot.reset_chat()
chatbot.refresh_session()
resp = chatbot.get_chat_response(msg, output="text")
await ctx.send(f"{resp['message']}")
async def setCredentials(self, ctx: commands.Context):
openAiKeys = await self.bot.get_shared_api_tokens("openai")