From 073fd9243a0b41930ab3b6961390d4444acaa82e Mon Sep 17 00:00:00 2001 From: insert Date: Sun, 11 Aug 2024 14:04:53 -0400 Subject: [PATCH] Update --- speechbubble.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/speechbubble.py b/speechbubble.py index 360c6ca..66855f7 100644 --- a/speechbubble.py +++ b/speechbubble.py @@ -110,6 +110,16 @@ class ApplicationModal(nextcord.ui.Modal): ) await interaction.send(f"<@{self.victim.id}> {interaction.user.name} proposes the following speech bubble for you:", embed=embed, view=ApplicationView(self.bot)) + async def on_error(self, interaction: nextcord.Interaction, error: nextcord.DiscordException): + error = traceback.format_exception(type(error), error, error.__traceback__) + strerror = "".join(error) + print(strerror, file=sys.stderr) + message = f"```py\n{strerror[-1800:]}\n```\n Contact <@{self.bot.owner_id}> if the error persists" + try: + await interaction.send(message, ephemeral=True) + except: + await interaction.followup.send(message, ephemeral=True) + class speechbubble(commands.Cog):