diff --git a/pokemongo_bot/event_handlers/telegram_handler.py b/pokemongo_bot/event_handlers/telegram_handler.py index 79f66939f4..2f694f5ddc 100644 --- a/pokemongo_bot/event_handlers/telegram_handler.py +++ b/pokemongo_bot/event_handlers/telegram_handler.py @@ -92,7 +92,11 @@ def deauthenticate(self, update): return def authenticate(self, update): - (command, password) = update.message.text.split(' ') + args = update.message.text.split(' ') + if len(args) != 2: + self.chat_handler.sendMessage(chat_id=update.message.chat_id, parse_mode='Markdown', text="Invalid password") + return + password = args[1] if password != self.config.get('password', None): self.chat_handler.sendMessage(chat_id=update.message.chat_id, parse_mode='Markdown', text="Invalid password") else: