Handle case in commands.
authorCMDR furrycat <elite@furrycat.net>
Fri, 7 Oct 2016 10:26:05 +0000 (11:26 +0100)
committerCMDR furrycat <elite@furrycat.net>
Fri, 7 Oct 2016 10:26:05 +0000 (11:26 +0100)
bot.py

diff --git a/bot.py b/bot.py
index 074c4ca..9591b47 100755 (executable)
--- a/bot.py
+++ b/bot.py
@@ -1092,25 +1092,26 @@ def manage_announcements(message, command, raw):
     return
   text = m.group(1)
   args = shlex.split(text)
+  command = args[0].lower()
   if len(args) == 1:
-    if args[0] == 'list':
+    if command == 'list':
       yield from list_announcements(message)
       return
     else:
       yield from say(message.channel, 'yelp!')
       return
 
-  if args[0] == 'show':
+  if command == 'show':
     yield from show_announcement(message, args[1])
-  elif args[0] == 'delete':
+  elif command == 'delete':
     yield from delete_announcement(message, args[1])
-  elif args[0] == 'asap':
+  elif command == 'asap':
     yield from schedule_announcement(message, args[1], asap = True)
-  elif args[0] == 'pause':
+  elif command == 'pause':
     yield from schedule_announcement(message, args[1], pause = True)
-  elif args[0] == 'resume':
+  elif command == 'resume':
     yield from schedule_announcement(message, args[1], pause = False)
-  elif args[0] == 'create':
+  elif command == 'create':
     yield from create_announcement(message, text)
 
 @asyncio.coroutine