From 085fd12543d9e867b6bbe6e3501aa519d4e6da5e Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Fri, 7 Oct 2016 11:26:05 +0100 Subject: [PATCH] Handle case in commands. --- bot.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 -- 2.7.4