I have a kick command in a cog and it works. But the error event that I put for the kick command triggers all the other error events that I have set up in my other cogs. For example, I have a ban command (ban.py) and a kick command (kick.py). each have their own code for the error event like the code below. But I want them to have its own error like
@ban.error because when I get an error on one of the commands, it shows the error for both of them. But sadly
@ban.error doesn't work in cogs. Please help me fix this.
@commands.Cog.listener() async def on_command _error(self, ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send('(text here)') if isinstance(error, commands.MissingPermissions): await ctx.send("(text here)")