telegram.inlinequeryresultcacheddocument module

This module contains the classes that represent Telegram InlineQueryResultCachedDocument

class telegram.inlinequeryresultcacheddocument.InlineQueryResultCachedDocument(id, title, document_file_id, description=None, caption=None, reply_markup=None, input_message_content=None, **kwargs)

Bases: telegram.inlinequeryresult.InlineQueryResult

Represents a link to a file stored on the Telegram servers. 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-files and zip archives can be sent using this method.


str – Title for the result.


str – A valid file identifier for the file.


Optional[str] – Short description of the result.


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


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


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

  • id (str) –
  • title (str) –
  • document_file_id (str) –
  • description (Optional[str]) –
  • caption (Optional[str]) –
  • reply_markup (Optional[telegram.InlineKeyboardMarkup]) –
  • input_message_content (Optional[telegram.InputMessageContent]) –
  • **kwargs (dict) – Arbitrary keyword arguments.
static de_json(data, bot)