mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-02-16 18:31:45 +01:00
Add missing message.text check in PrefixHandler check_update (#1375)
* Add missing message.text check in PrefixHandler check_update * Remove message length check
This commit is contained in:
parent
2ed4cbd26d
commit
474ff8ae41
1 changed files with 9 additions and 8 deletions
|
@ -332,14 +332,15 @@ class PrefixHandler(CommandHandler):
|
||||||
if isinstance(update, Update) and update.effective_message:
|
if isinstance(update, Update) and update.effective_message:
|
||||||
message = update.effective_message
|
message = update.effective_message
|
||||||
|
|
||||||
text_list = message.text.split()
|
if message.text:
|
||||||
if text_list[0].lower() not in self.command:
|
text_list = message.text.split()
|
||||||
return None
|
if text_list[0].lower() not in self.command:
|
||||||
filter_result = self.filters(update)
|
return None
|
||||||
if filter_result:
|
filter_result = self.filters(update)
|
||||||
return text_list[1:], filter_result
|
if filter_result:
|
||||||
else:
|
return text_list[1:], filter_result
|
||||||
return False
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
def collect_additional_context(self, context, update, dispatcher, check_result):
|
def collect_additional_context(self, context, update, dispatcher, check_result):
|
||||||
context.args = check_result[0]
|
context.args = check_result[0]
|
||||||
|
|
Loading…
Add table
Reference in a new issue