-
my error handling: @commands.Cog.listener()
async def on_command_error(self, ctx, error):
if isinstance(error, commands.NotOwner):
await ctx.send(f"Not owner.")
elif isinstance(error, commands.CheckFailure):
await ctx.send(f"Check failure.") my cog check: class adminusage(commands.Cog, name="Admin Usage"):
def __init__(self, bot):
self.bot = bot
async def cog_check(self, ctx):
return await self.bot.is_owner(ctx.author) so when the check fails it sends does the job for CheckFailure. But it should send NotOwner. (CheckFailure always denies to work with me :( is this because i am ugly?) |
Beta Was this translation helpful? Give feedback.
Answered by
LostLuma
Oct 31, 2022
Replies: 1 comment 2 replies
-
Hello, this is because the You can modify your |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
aurkaxi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, this is because the
is_owner
method only returns a bool, rather than an exception like the built inis_owner
check.You can modify your
cog_check
to instead of simply returning a bool, which will make the library raiseCheckFailure
, raise theNotOwner
error yourself to handle it elsewhere.