Pārlūkot izejas kodu

Verify message validity if empty

Lucas Villeneuve 5 gadi atpakaļ
vecāks
revīzija
5f6df0491c
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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: