mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-28 07:20:17 +01:00
Adding switch_pm_text and switch_pm_parameter to answerInlineQuery #232
This commit is contained in:
parent
e1de7220df
commit
c411ef7822
1 changed files with 28 additions and 12 deletions
|
@ -648,7 +648,9 @@ class Bot(TelegramObject):
|
|||
results,
|
||||
cache_time=None,
|
||||
is_personal=None,
|
||||
next_offset=None):
|
||||
next_offset=None,
|
||||
switch_pm_text=None,
|
||||
switch_pm_parameter=None):
|
||||
"""Use this method to reply to an inline query.
|
||||
|
||||
Args:
|
||||
|
@ -658,17 +660,27 @@ class Bot(TelegramObject):
|
|||
A list of results for the inline query
|
||||
|
||||
Keyword Args:
|
||||
cache_time (Optional[int]): The maximum amount of time the result
|
||||
of the inline query may be cached on the server
|
||||
is_personal (Optional[bool]): Pass True, if results may be cached
|
||||
on the server side only for the user that sent the query. By
|
||||
default, results may be returned to any user who sends the same
|
||||
query
|
||||
next_offset (Optional[str]): Pass the offset that a client should
|
||||
send in the next query with the same text to receive more
|
||||
results. Pass an empty string if there are no more results or
|
||||
if you don't support pagination. Offset length can't exceed 64
|
||||
bytes.
|
||||
cache_time (Optional[int]):
|
||||
The maximum amount of time the result of the inline query
|
||||
may be cached on the server
|
||||
is_personal (Optional[bool]):
|
||||
Pass True, if results may be cached on the server side only
|
||||
for the user that sent the query. By default, results may be
|
||||
returned to any user who sends the same query.
|
||||
next_offset (Optional[str]):
|
||||
Pass the offset that a client should send in the next query
|
||||
with the same text to receive more results. Pass an empty
|
||||
string if there are no more results or if you don't support
|
||||
pagination. Offset length can't exceed 64 bytes.
|
||||
switch_pm_text (Optional[str]):
|
||||
If passed, clients will display a button with specified text
|
||||
that switches the user to a private chat with the bot and
|
||||
sends the bot a start message with the parameter
|
||||
switch_pm_parameter.
|
||||
switch_pm_parameter (Optional[str]):
|
||||
Parameter for the start message sent to the bot when user
|
||||
presses the switch button.
|
||||
|
||||
|
||||
Returns:
|
||||
A boolean if answering was successful
|
||||
|
@ -690,6 +702,10 @@ class Bot(TelegramObject):
|
|||
data['is_personal'] = bool(is_personal)
|
||||
if next_offset is not None:
|
||||
data['next_offset'] = next_offset
|
||||
if switch_pm_text:
|
||||
data['switch_pm_text'] = switch_pm_text
|
||||
if switch_pm_parameter:
|
||||
data['switch_pm_parameter'] = switch_pm_parameter
|
||||
|
||||
result = request.post(url, data)
|
||||
|
||||
|
|
Loading…
Reference in a new issue