From: CMDR furrycat Date: Fri, 7 Oct 2016 10:26:05 +0000 (+0100) Subject: Handle case in commands. X-Git-Url: http://git.furryclan.net/?a=commitdiff_plain;h=085fd12543d9e867b6bbe6e3501aa519d4e6da5e;p=furrycat%2Fcatbot.git Handle case in commands. --- diff --git a/bot.py b/bot.py index 074c4ca..9591b47 100755 --- 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