X Tutup
Skip to content

Commit 48c1673

Browse files
committed
fix additional args for inline queries
1 parent af6eb45 commit 48c1673

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

telegram/dispatcher.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ class Dispatcher:
108108
a list that contains the content of the message split on spaces,
109109
except the first word (usually the command).
110110
Example: '/add item1 item2 item3' -> ['item1', 'item2', 'item3']
111+
For updates that contain inline queries, they will contain the
112+
whole query split on spaces.
111113
For other updates, args will be None
112114
113115
For regex-based handlers, you can also request information about the match.
@@ -658,8 +660,10 @@ def call_handler(self, handler, update, **kwargs):
658660
target_kwargs['update_queue'] = self.update_queue
659661

660662
if is_async or 'args' in fargs:
661-
if isinstance(update, Update):
663+
if isinstance(update, Update) and update.message:
662664
args = update.message.text.split(' ')[1:]
665+
elif isinstance(update, Update) and update.inline_query:
666+
args = update.inline_query.query.split(' ')
663667
elif isinstance(update, str):
664668
args = update.split(' ')[1:]
665669
else:

0 commit comments

Comments
 (0)
X Tutup