📝 Better functioning error handling

This commit is contained in:
NikolajDanger
2021-04-03 22:35:11 +02:00
parent 0fb7887745
commit 1a2ead8448
2 changed files with 8 additions and 6 deletions

View File

@ -4,6 +4,7 @@ from discord.ext import commands
class EventCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.bot.on_error = self.on_error
# Syncs commands, sets the game, and logs when the bot logs in
@commands.Cog.listener()
@ -20,9 +21,8 @@ class EventCog(commands.Cog):
async def on_slash_command_error(self, ctx, error):
await self.bot.errorHandler.on_slash_command_error(ctx, error)
# Logs if an error occurs
@commands.Cog.listener()
async def on_error(self, method):
# Logs if on error occurs
async def on_error(self, method, *args, **kwargs):
await self.bot.errorHandler.on_error(method)
def setup(bot):