ignore unknown commands

This commit is contained in:
Mylloon 2021-08-19 11:00:52 +02:00
parent dbc6f562ab
commit c627f05837

View file

@ -53,10 +53,11 @@ async def on_ready():
@client.event
async def on_command_error(ctx, error):
"""Triggered when a command enconter an error"""
if not ctx.invoked_with.startswith(customPrefix):
print(error)
if ctx.message:
await addReaction(ctx.message, 1)
if not ctx.invoked_with.startswith(customPrefix): # si commande inconnu
if ctx.message: # si pas une commande slash
await addReaction(ctx.message, 1) # ajout réaction
else:
raise error
@client.event
async def on_message(message):