Adding debugging logs
This commit is contained in:
parent
98004a67dd
commit
e0019a2dc2
@ -32,8 +32,9 @@ class ReginaldCog(commands.Cog):
|
|||||||
)
|
)
|
||||||
await ctx.send(response.choices[0].text.strip())
|
await ctx.send(response.choices[0].text.strip())
|
||||||
except openai.error.OpenAIError as e:
|
except openai.error.OpenAIError as e:
|
||||||
await ctx.send("I apologize, sir, but I am unable to generate a response at this time.")
|
import traceback
|
||||||
print(f"OpenAI API Error: {e}")
|
traceback.print_exc()
|
||||||
|
await ctx.send(f"I apologize, sir, but I am unable to generate a response at this time. Error message: {str(e)}")
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
cog = ReginaldCog(bot)
|
cog = ReginaldCog(bot)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user