This commit is contained in:
insert 2024-08-11 13:50:30 -04:00
parent 7d0646d957
commit 516dc0ad8f
Signed by: insert
GPG key ID: A70775C389ACF105

View file

@ -29,11 +29,13 @@ class misc(commands.Cog):
except:
await interaction.followup.send(message, ephemeral=True)
@commands.Cog.listener('on_error')
async def seconderrorhandler(self, event_method, *args, **kwargs):
@commands.Cog.event
async def on_error(self, event_method, *args, **kwargs):
error = traceback.format_exc()
random.shuffle(errormsg)
print(error, file=sys.stderr)
print(args, file=sys.stderr)
print(kwargs, file=sys.stderr)
message = f"{errormsg[0]}\n```py\n{error[-1800:]}\n```\n Contact <@{self.bot.owner_id}> if the error persists"
try:
await interaction.response.send_message(message, ephemeral=True)