Handle empty API responses gracefully
This commit is contained in:
@@ -110,6 +110,10 @@ class Assistant(commands.Cog):
|
||||
await message.reply("No response from the assistant.")
|
||||
return
|
||||
|
||||
if not reply.strip():
|
||||
await message.reply("*(The assistant returned an empty response.)*")
|
||||
return
|
||||
|
||||
if len(reply) <= 2000:
|
||||
await message.reply(reply)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user