ignore unknown commands
This commit is contained in:
parent
dbc6f562ab
commit
c627f05837
1 changed files with 5 additions and 4 deletions
|
@ -53,10 +53,11 @@ 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):
|
if not ctx.invoked_with.startswith(customPrefix): # si commande inconnu
|
||||||
print(error)
|
if ctx.message: # si pas une commande slash
|
||||||
if ctx.message:
|
await addReaction(ctx.message, 1) # ajout réaction
|
||||||
await addReaction(ctx.message, 1)
|
else:
|
||||||
|
raise error
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
async def on_message(message):
|
async def on_message(message):
|
||||||
|
|
Reference in a new issue