telegram.inlinequeryresultdocument module

This module contains the classes that represent Telegram InlineQueryResultDocument

class telegram.inlinequeryresultdocument.InlineQueryResultDocument(id, document_url, title, mime_type, caption=None, description=None, reply_markup=None, input_message_content=None, thumb_url=None, thumb_width=None, thumb_height=None, **kwargs)

Bases: telegram.inlinequeryresult.InlineQueryResult

Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

title

str – Title for the result.

caption

Optional[str] – Caption of the document to be sent, 0-200 characters.

document_url

Optional[str] – A valid URL for the file.

mime_type

Optional[str] – Mime type of the content of the file, either “application/pdf” or “application/zip”.

description

Optional[str] – Short description of the result.

reply_markup

Optional[telegram.InlineKeyboardMarkup] – Inline keyboard attached to the message.

input_message_content

Optional[telegram.InputMessageContent] – Content of the message to be sent instead of the file.

thumb_url

Optional[str] – URL of the thumbnail (jpeg only) for the file.

thumb_width

Optional[int] – Thumbnail width.

thumb_height

Optional[int] – Thumbnail height.

Parameters:
  • id (str) –
  • document_url (str) –
  • title (str) –
  • mime_type (str) –
  • caption (Optional[str]) –
  • description (Optional[str]) –
  • reply_markup (Optional[telegram.InlineKeyboardMarkup]) –
  • input_message_content (Optional[telegram.InputMessageContent]) –
  • thumb_url (Optional[str]) –
  • thumb_width (Optional[int]) –
  • thumb_height (Optional[int]) –
  • **kwargs (dict) – Arbitrary keyword arguments.
static de_json(data, bot)