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()
|
await message.channel.trigger_typing()
|
||||||
response = response.choices[0].message.content
|
response = response.choices[0].message.content
|
||||||
|
|
||||||
if guild_data["images_limit_reached"]:
|
try:
|
||||||
hist = await historicator(message)
|
if guild_data["images_limit_reached"]:
|
||||||
await hist.send(
|
hist = await historicator(message)
|
||||||
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```",
|
await hist.send(
|
||||||
delete_after=10,
|
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
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user