fix: added alternate temporary error handling to say cog

This commit is contained in:
Seaswimmer 2023-08-07 21:34:45 -04:00
parent 715cab831e
commit abd45f1f43
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -21,10 +21,11 @@ class Say(commands.Cog):
else:
await interaction.response.send_message(content=f"Message sent to {target.mention}!\nMessage contents:\n```{message}```", ephemeral=True)
except (discord.HTTPException, discord.Forbidden) as error:
if target_type == "member":
await interaction.response.send_message(content="That user has their direct messages closed!", ephemeral=True)
elif target_type == "textchannel":
await interaction.response.send_message(content="I cannot access that channel!", ephemeral=True)
# if target_type == "member":
# await interaction.response.send_message(content="That user has their direct messages closed!", ephemeral=True)
# elif target_type == "textchannel":
# await interaction.response.send_message(content="I cannot access that channel!", ephemeral=True)
await interaction.response.send_message(content=error)
class MessageModal(discord.ui.Modal, title="Sending message..."):
def __init__(self, target):