telegram.InlineQueryResultGif

class telegram.InlineQueryResultGif(id, gif_url, thumb_url, gif_width=None, gif_height=None, title=None, caption=None, reply_markup=None, input_message_content=None, gif_duration=None, parse_mode=None, **kwargs)

Bases: telegram.inline.inlinequeryresult.InlineQueryResult

Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

type

str – ‘gif’.

id

str – Unique identifier for this result, 1-64 bytes.

gif_url

str – A valid URL for the GIF file. File size must not exceed 1MB.

gif_width

int – Optional. Width of the GIF.

gif_height

int – Optional. Height of the GIF.

gif_duration

int – Optional. Duration of the GIF.

thumb_url

str – URL of the static thumbnail for the result (jpeg or gif).

title

str – Optional. Title for the result.

caption

str – Optional. Caption, 0-1024 characters

parse_mode

str – Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. See the constants in telegram.ParseMode for the available modes.

reply_markup

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

input_message_content

telegram.InputMessageContent – Optional. Content of the message to be sent instead of the gif.

Parameters:
  • id (str) – Unique identifier for this result, 1-64 bytes.
  • gif_url (str) – A valid URL for the GIF file. File size must not exceed 1MB.
  • gif_width (int, optional) – Width of the GIF.
  • gif_height (int, optional) – Height of the GIF.
  • gif_duration (int, optional) – Duration of the GIF
  • thumb_url (str) – URL of the static thumbnail for the result (jpeg or gif).
  • title (str, optional) – Title for the result.caption (str, optional):
  • caption (str, optional) – Caption, 0-1024 characters
  • parse_mode (str, optional) – Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. See the constants in telegram.ParseMode for the available modes.
  • reply_markup (telegram.InlineKeyboardMarkup, optional) – Inline keyboard attached to the message.
  • input_message_content (telegram.InputMessageContent, optional) – Content of the message to be sent instead of the gif.
  • **kwargs (dict) – Arbitrary keyword arguments.