fix error handler
This commit is contained in:
parent
ccc738f901
commit
c4a16bfbd8
1 changed files with 2 additions and 1 deletions
|
@ -53,9 +53,10 @@ async def on_ready():
|
||||||
@client.event
|
@client.event
|
||||||
async def on_command_error(ctx, error):
|
async def on_command_error(ctx, error):
|
||||||
"""Triggered when a command enconter an error"""
|
"""Triggered when a command enconter an error"""
|
||||||
if not ctx.invoked_with.startswith(customPrefix): # si commande inconnu
|
if isinstance(error, commands.errors.CommandNotFound): # si commande inconnu
|
||||||
if ctx.message: # si pas une commande slash
|
if ctx.message: # si pas une commande slash
|
||||||
await addReaction(ctx.message, 1) # ajout réaction
|
await addReaction(ctx.message, 1) # ajout réaction
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
raise error
|
raise error
|
||||||
|
|
||||||
|
|
Reference in a new issue