This commit is contained in:
insert 2024-08-11 13:12:28 -04:00
parent 64ac4268f0
commit 8804bc6d75
Signed by: insert
GPG key ID: A70775C389ACF105

View file

@ -19,10 +19,10 @@ class misc(commands.Cog):
@commands.Cog.listener('on_application_command_error') @commands.Cog.listener('on_application_command_error')
async def errorhandler(self, interaction: nextcord.Interaction, error: nextcord.DiscordException): async def errorhandler(self, interaction: nextcord.Interaction, error: nextcord.DiscordException):
strerror = traceback.format_exc(error)
error = traceback.format_exception(type(error), error, error.__traceback__) error = traceback.format_exception(type(error), error, error.__traceback__)
print(error, file=sys.stderr) print(error, file=sys.stderr)
random.shuffle(errormsg) random.shuffle(errormsg)
strerror = "".join(error)
message = f"{errormsg[0]}\n```py\n{strerror[-1800:]}\n```\n Contact <@{self.bot.owner_id}> if the error persists" message = f"{errormsg[0]}\n```py\n{strerror[-1800:]}\n```\n Contact <@{self.bot.owner_id}> if the error persists"
try: try:
await interaction.response.send_message(message, ephemeral=True) await interaction.response.send_message(message, ephemeral=True)