From c627f058376b0b3c5f3ebb7d4748ae5573449caa Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 19 Aug 2021 11:00:52 +0200 Subject: [PATCH] ignore unknown commands --- src/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 6a524b7..a9e1d01 100644 --- a/src/main.py +++ b/src/main.py @@ -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):