From 2271bf3a8442c49e85300915d836726c44e650ec Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Mar 2023 19:05:31 +0100 Subject: [PATCH] Debugging again --- reginaldCog/reginald.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reginaldCog/reginald.py b/reginaldCog/reginald.py index 763a8f8..f986dcd 100644 --- a/reginaldCog/reginald.py +++ b/reginaldCog/reginald.py @@ -30,7 +30,8 @@ class ReginaldCog(commands.Cog): try: api_key = await self.config.guild(ctx.guild).openai_api_key() if api_key is None: - raise ValueError('OpenAI API key not set. Please use the "setreginaldcogapi" command to set the key.') + await ctx.author.send('OpenAI API key not set. Please use the "!setreginaldcogapi" command to set the key.') + return model = await self.config.openai_model() openai.api_key = api_key max_tokens = min(len(prompt) * 2, 2048)