mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
fix(makeprompt.py): add try-except block to handle errors when sending warning message if guild_data["images_limit_reached"] is True
This commit is contained in:
@@ -496,12 +496,15 @@ async def gpt_prompt(bot, messages, message, data_dict, prompt, guild_data):
|
||||
await message.channel.trigger_typing()
|
||||
response = response.choices[0].message.content
|
||||
|
||||
if guild_data["images_limit_reached"]:
|
||||
hist = await historicator(message)
|
||||
await hist.send(
|
||||
f"```diff\n-Warning: You have reached the image limit for this server. You can upgrade to premium to get more images recognized. More info in our server: https://discord.gg/sxjHtmqrbf```",
|
||||
delete_after=10,
|
||||
)
|
||||
try:
|
||||
if guild_data["images_limit_reached"]:
|
||||
hist = await historicator(message)
|
||||
await hist.send(
|
||||
f"```diff\n-Warning: You have reached the image limit for this server. You can upgrade to premium to get more images recognized. More info in our server: https://discord.gg/sxjHtmqrbf```",
|
||||
delete_after=10,
|
||||
)
|
||||
except:
|
||||
pass
|
||||
return response
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user