Parcourir la source

Verify message validity if empty

Lucas Villeneuve il y a 5 ans
Parent
commit
5f6df0491c
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      myanimebot/discord.py

+ 4 - 0
myanimebot/discord.py

@@ -45,6 +45,10 @@ class MyAnimeBot(discord.Client):
         channel = message.channel
         author = str('{0.author.mention}'.format(message))
 
+        # Check input validity
+        if len(words) == 0:
+            return
+
         # A user is trying to get help
         if words[0] == globals.prefix:
             if len(words) > 1: