From 93dc1cd92e60e40e118abd5de27115480ea915d5 Mon Sep 17 00:00:00 2001 From: eternnoir Date: Wed, 6 Jan 2016 14:31:21 +0800 Subject: [PATCH] Add comment. --- telebot/__init__.py | 10 ++++++++++ telebot/types.py | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/telebot/__init__.py b/telebot/__init__.py index 07590f3..d315af9 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -416,6 +416,16 @@ class TeleBot: return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) def answer_inline_query(self, inline_query_id, results, cache_time=None, is_personal=None, next_offset=None): + """ + Use this method to send answers to an inline query. On success, True is returned. + No more than 50 results per query are allowed. + :param inline_query_id: Unique identifier for the answered query + :param results: Array of results for the inline query + :param cache_time: The maximum amount of time in seconds that the result of the inline query may be cached on the server. + :param is_personal: Pass True, if results may be cached on the server side only for the user that sent the query. + :param next_offset: Pass the offset that a client should send in the next query with the same text to receive more results. + :return: True means success. + """ return apihelper.answer_inline_query(self.token, inline_query_id, results, cache_time, is_personal, next_offset) def register_for_reply(self, message, callback): diff --git a/telebot/types.py b/telebot/types.py index e52fdf0..cc915ef 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -562,6 +562,21 @@ class ChosenInlineResult(JsonDeserializable): class InlineQueryResultArticle(JsonSerializable): def __init__(self, id, title, message_text, parse_mode=None, disable_web_page_preview=None, url=None, hide_url=None, description=None, thumb_url=None, thumb_width=None, thumb_height=None): + """ + Represents a link to an article or web page. + :param id: Unique identifier for this result, 1-64 Bytes. + :param title: Title of the result. + :param message_text: Text of the message to be sent. + :param parse_mode: Send “Markdown”, if you want Telegram apps to show bold, italic and inline URLs in your bot's message. + :param disable_web_page_preview: Disables link previews for links in the sent message. + :param url: URL of the result. + :param hide_url: Pass True, if you don't want the URL to be shown in the message. + :param description: Short description of the result. + :param thumb_url: Url of the thumbnail for the result. + :param thumb_width: Thumbnail width. + :param thumb_height: Thumbnail height + :return: + """ self.type = 'article' self.id = id self.title = title