From c75ce81d451e800fef33d0c8b58dbea59b559e0e Mon Sep 17 00:00:00 2001 From: Juni Date: Mon, 5 Dec 2022 14:08:16 -0500 Subject: [PATCH] error handling for keys --- chatGpt/chatgpt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chatGpt/chatgpt.py b/chatGpt/chatgpt.py index c68c8ec..bb02e47 100644 --- a/chatGpt/chatgpt.py +++ b/chatGpt/chatgpt.py @@ -15,6 +15,8 @@ class ChatGpt(commands.Cog): async def testchat(self, ctx: commands.Context): """Test""" 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 = { "email": openAiKeys.get("email"), "password": openAiKeys.get("password"),