From 58256a317f5db68aadb36df888616e7cae597e18 Mon Sep 17 00:00:00 2001 From: nex <53234499+EEKIM10@users.noreply.github.com> Date: Sat, 15 Oct 2022 15:31:21 +0100 Subject: [PATCH] Add error handlers --- main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.py b/main.py index f34500e..fd18203 100644 --- a/main.py +++ b/main.py @@ -35,6 +35,11 @@ async def on_application_command_error(ctx: discord.ApplicationContext, error: E await ctx.respond("Application Command Error: `%r`" % error) +@bot.listen("on_command_error") +async def on_command_error(ctx: discord.ApplicationContext, error: Exception): + await ctx.respond("Command Error: `%r`" % error) + + @bot.event async def on_ready(): console.log("Logged in as", bot.user)