From 474ff8ae414ee17d024aacc679d89919dcdc8101 Mon Sep 17 00:00:00 2001 From: Jasmin Bom Date: Fri, 5 Apr 2019 12:59:50 +0200 Subject: [PATCH] Add missing message.text check in PrefixHandler check_update (#1375) * Add missing message.text check in PrefixHandler check_update * Remove message length check --- telegram/ext/commandhandler.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/telegram/ext/commandhandler.py b/telegram/ext/commandhandler.py index eff32f0ed..3dd4900f3 100644 --- a/telegram/ext/commandhandler.py +++ b/telegram/ext/commandhandler.py @@ -332,14 +332,15 @@ class PrefixHandler(CommandHandler): if isinstance(update, Update) and update.effective_message: message = update.effective_message - text_list = message.text.split() - if text_list[0].lower() not in self.command: - return None - filter_result = self.filters(update) - if filter_result: - return text_list[1:], filter_result - else: - return False + if message.text: + text_list = message.text.split() + if text_list[0].lower() not in self.command: + return None + filter_result = self.filters(update) + if filter_result: + return text_list[1:], filter_result + else: + return False def collect_additional_context(self, context, update, dispatcher, check_result): context.args = check_result[0]