📝 Better functioning error handling
This commit is contained in:
@ -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):
|
||||
|
Reference in New Issue
Block a user