瀏覽代碼

Verify message validity if empty

Lucas Villeneuve 5 年之前
父節點
當前提交
5f6df0491c
共有 1 個文件被更改,包括 4 次插入0 次删除
  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: