fix: send another message if reply fails

This commit is contained in:
Ryan 2025-01-22 23:16:21 -05:00
parent 03a8014d2f
commit 3930175c79
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3

View File

@ -27,13 +27,21 @@ async def reply(message, *args, **kwargs):
kwargs["content"] = None
elif len(kwargs) == 0:
kwargs["embeds"] = []
try:
await message_responses[message.id].edit(
*args, **kwargs, allowed_mentions=disnake.AllowedMentions.none()
)
else:
return
except Exception:
pass
try:
response = await message.reply(
*args, **kwargs, allowed_mentions=disnake.AllowedMentions.none()
)
except Exception:
response = await channel_send(message, *args, **kwargs)
message_responses[message.id] = response
return message_responses[message.id]