diff --git a/src/error.py b/src/error.py index 8f6526a..7bca386 100644 --- a/src/error.py +++ b/src/error.py @@ -14,7 +14,9 @@ class ErrorHandler(commands.Cog): @commands.Cog.listener() async def on_command_error(self, ctx: commands.Context, error: commands.CommandError): + command_name = ctx.command.name if isinstance(error, commands.CommandNotFound): + self.logger.error(error) return if isinstance(error, commands.MissingPermissions): message = "You are missing the required permissions to run this command!" @@ -25,6 +27,7 @@ class ErrorHandler(commands.Cog): else: message = "Oh no! Something went wrong while running the command!" + self.logger.error('Error during command "%s": %s', command_name, message) embed = ErrorMessage(message) await ctx.send(embed=embed)