From 7eefcf007518a5b60546cda424a8709e36444824 Mon Sep 17 00:00:00 2001 From: Juni Date: Mon, 5 Dec 2022 14:22:43 -0500 Subject: [PATCH] test --- chatGpt/chatgpt.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/chatGpt/chatgpt.py b/chatGpt/chatgpt.py index 55e697b..a01412b 100644 --- a/chatGpt/chatgpt.py +++ b/chatGpt/chatgpt.py @@ -14,15 +14,21 @@ class ChatGpt(commands.Cog): @commands.command() async def testchat(self, ctx: commands.Context): """Test""" + config = await this.setCredentials(ctx) + + email = config.get("email") + password = config.get("password") + await ctx.send(f"email {email}, password {password}") + + async def setCredentials(self, ctx: commands.Context): openAiKeys = await self.bot.get_shared_api_tokens("openai") if openAiKeys.get("email") is None or openAiKeys.get("password") is None: return await ctx.send("The openai email and password keys have not been set.") - self.config = { + config = { "email": openAiKeys.get("email"), "password": openAiKeys.get("password"), } - email = openAiKeys.get("email") - password = openAiKeys.get("password") - await ctx.send(f"email {email}, password {password}") + return config + \ No newline at end of file