소스 검색

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: