1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Add url param in answer inline query.

This commit is contained in:
eternnoir 2016-10-08 21:55:28 +08:00
parent b8e5c43598
commit 740d7f44cf
2 changed files with 6 additions and 4 deletions

View File

@ -552,7 +552,7 @@ class TeleBot:
def send_game(self, chat_id, game_short_name, disable_notification=None, reply_to_message_id=None,
reply_markup=None):
result = apihelper.send_game(self.token, chat_id, game_short_name, disable_notification, reply_to_message_id,
reply_markup)
reply_markup)
return types.Message.de_json(result)
def edit_message_caption(self, caption, chat_id=None, message_id=None, inline_message_id=None, reply_markup=None):
@ -586,7 +586,7 @@ class TeleBot:
return apihelper.answer_inline_query(self.token, inline_query_id, results, cache_time, is_personal, next_offset,
switch_pm_text, switch_pm_parameter)
def answer_callback_query(self, callback_query_id, text=None, show_alert=None):
def answer_callback_query(self, callback_query_id, text=None, show_alert=None, url=None):
"""
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to
the user as a notification at the top of the chat screen or as an alert.
@ -595,7 +595,7 @@ class TeleBot:
:param show_alert:
:return:
"""
return apihelper.answer_callback_query(self.token, callback_query_id, text, show_alert)
return apihelper.answer_callback_query(self.token, callback_query_id, text, show_alert, url)
def register_for_reply(self, message, callback):
"""

View File

@ -434,13 +434,15 @@ def send_game(token, chat_id, game_short_name, disable_notification=None, reply_
# InlineQuery
def answer_callback_query(token, callback_query_id, text=None, show_alert=None):
def answer_callback_query(token, callback_query_id, text=None, show_alert=None, url=None):
method_url = 'answerCallbackQuery'
payload = {'callback_query_id': callback_query_id}
if text:
payload['text'] = text
if show_alert:
payload['show_alert'] = show_alert
if url:
payload['url'] = url
return _make_request(token, method_url, params=payload, method='post')