telegram.Message

class telegram.Message(message_id: int, date: datetime.datetime, chat: telegram.chat.Chat, from_user: telegram.user.User = None, forward_from: telegram.user.User = None, forward_from_chat: telegram.chat.Chat = None, forward_from_message_id: int = None, forward_date: datetime.datetime = None, reply_to_message: Message = None, edit_date: datetime.datetime = None, text: str = None, entities: List[MessageEntity] = None, caption_entities: List[MessageEntity] = None, audio: telegram.files.audio.Audio = None, document: telegram.files.document.Document = None, game: telegram.games.game.Game = None, photo: List[telegram.files.photosize.PhotoSize] = None, sticker: telegram.files.sticker.Sticker = None, video: telegram.files.video.Video = None, voice: telegram.files.voice.Voice = None, video_note: telegram.files.videonote.VideoNote = None, new_chat_members: List[telegram.user.User] = None, caption: str = None, contact: telegram.files.contact.Contact = None, location: telegram.files.location.Location = None, venue: telegram.files.venue.Venue = None, left_chat_member: telegram.user.User = None, new_chat_title: str = None, new_chat_photo: List[telegram.files.photosize.PhotoSize] = None, delete_chat_photo: bool = False, group_chat_created: bool = False, supergroup_chat_created: bool = False, channel_chat_created: bool = False, migrate_to_chat_id: int = None, migrate_from_chat_id: int = None, pinned_message: Message = None, invoice: telegram.payment.invoice.Invoice = None, successful_payment: telegram.payment.successfulpayment.SuccessfulPayment = None, forward_signature: str = None, author_signature: str = None, media_group_id: str = None, connected_website: str = None, animation: telegram.files.animation.Animation = None, passport_data: telegram.passport.passportdata.PassportData = None, poll: telegram.poll.Poll = None, forward_sender_name: str = None, reply_markup: telegram.inline.inlinekeyboardmarkup.InlineKeyboardMarkup = None, bot: Bot = None, dice: telegram.dice.Dice = None, via_bot: telegram.user.User = None, proximity_alert_triggered: telegram.proximityalerttriggered.ProximityAlertTriggered = None, sender_chat: telegram.chat.Chat = None, **_kwargs)

Bases: telegram.base.TelegramObject

This object represents a message.

Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their message_id and chat are equal.

Note

In Python from is a reserved word, use from_user instead.

Parameters:
  • message_id (int) – Unique message identifier inside this chat.
  • from_user (telegram.User, optional) – Sender, empty for messages sent to channels.
  • sender_chat (telegram.Chat, optional) – Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group.
  • date (datetime.datetime) – Date the message was sent in Unix time. Converted to datetime.datetime.
  • chat (telegram.Chat) – Conversation the message belongs to.
  • forward_from (telegram.User, optional) – For forwarded messages, sender of the original message.
  • forward_from_chat (telegram.Chat, optional) – For messages forwarded from channels or from anonymous administrators, information about the original sender chat.
  • forward_from_message_id (int, optional) – For forwarded channel posts, identifier of the original message in the channel.
  • forward_sender_name (str, optional) – Sender’s name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
  • forward_date (datetime.datetime, optional) – For forwarded messages, date the original message was sent in Unix time. Converted to datetime.datetime.
  • reply_to_message (telegram.Message, optional) – For replies, the original message.
  • edit_date (datetime.datetime, optional) – Date the message was last edited in Unix time. Converted to datetime.datetime.
  • media_group_id (str, optional) – The unique identifier of a media message group this message belongs to.
  • text (str, optional) – For text messages, the actual UTF-8 text of the message, 0-4096 characters. Also found as telegram.constants.MAX_MESSAGE_LENGTH.
  • entities (List[telegram.MessageEntity], optional) – For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text. See parse_entity and parse_entities methods for how to use properly.
  • caption_entities (List[telegram.MessageEntity]) – Optional. For Messages with a Caption. Special entities like usernames, URLs, bot commands, etc. that appear in the caption. See Message.parse_caption_entity and parse_caption_entities methods for how to use properly.
  • audio (telegram.Audio, optional) – Message is an audio file, information about the file.
  • document (telegram.Document, optional) – Message is a general file, information about the file.
  • animation (telegram.Animation, optional) – Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
  • game (telegram.Game, optional) – Message is a game, information about the game.
  • photo (List[telegram.PhotoSize], optional) – Message is a photo, available sizes of the photo.
  • sticker (telegram.Sticker, optional) – Message is a sticker, information about the sticker.
  • video (telegram.Video, optional) – Message is a video, information about the video.
  • voice (telegram.Voice, optional) – Message is a voice message, information about the file.
  • video_note (telegram.VideoNote, optional) – Message is a video note, information about the video message.
  • new_chat_members (List[telegram.User], optional) – New members that were added to the group or supergroup and information about them (the bot itself may be one of these members).
  • caption (str, optional) – Caption for the animation, audio, document, photo, video or voice, 0-1024 characters.
  • contact (telegram.Contact, optional) – Message is a shared contact, information about the contact.
  • location (telegram.Location, optional) – Message is a shared location, information about the location.
  • venue (telegram.Venue, optional) – Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set.
  • left_chat_member (telegram.User, optional) – A member was removed from the group, information about them (this member may be the bot itself).
  • new_chat_title (str, optional) – A chat title was changed to this value.
  • new_chat_photo (List[telegram.PhotoSize], optional) – A chat photo was changed to this value.
  • delete_chat_photo (bool, optional) – Service message: The chat photo was deleted.
  • group_chat_created (bool, optional) – Service message: The group has been created.
  • supergroup_chat_created (bool, optional) – Service message: The supergroup has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
  • channel_chat_created (bool, optional) – Service message: The channel has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
  • migrate_to_chat_id (int, optional) – The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
  • migrate_from_chat_id (int, optional) – The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
  • pinned_message (telegram.Message, optional) – Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
  • invoice (telegram.Invoice, optional) – Message is an invoice for a payment, information about the invoice.
  • successful_payment (telegram.SuccessfulPayment, optional) – Message is a service message about a successful payment, information about the payment.
  • connected_website (str, optional) – The domain name of the website on which the user has logged in.
  • forward_signature (str, optional) – For messages forwarded from channels, signature of the post author if present.
  • author_signature (str, optional) – Signature of the post author for messages in channels, or the custom title of an anonymous group administrator.
  • passport_data (telegram.PassportData, optional) – Telegram Passport data.
  • poll (telegram.Poll, optional) – Message is a native poll, information about the poll.
  • dice (telegram.Dice, optional) – Message is a dice with random value from 1 to 6.
  • via_bot (telegram.User, optional) – Message was sent through an inline bot.
  • proximity_alert_triggered (telegram.ProximityAlertTriggered, optional) – Service message. A user in the chat triggered another user’s proximity alert while sharing Live Location.
  • reply_markup (telegram.InlineKeyboardMarkup, optional) – Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
  • bot (telegram.Bot, optional) – The Bot to use for instance methods.
message_id

Unique message identifier inside this chat.

Type:int
from_user

Optional. Sender.

Type:telegram.User
sender_chat

Optional. Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group.

Type:telegram.Chat
date

Date the message was sent.

Type:datetime.datetime
chat

Conversation the message belongs to.

Type:telegram.Chat
forward_from

Optional. Sender of the original message.

Type:telegram.User
forward_from_chat

Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat.

Type:telegram.Chat
forward_from_message_id

Optional. Identifier of the original message in the channel.

Type:int
forward_date

Optional. Date the original message was sent.

Type:datetime.datetime
reply_to_message

Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

Type:telegram.Message
edit_date

Optional. Date the message was last edited.

Type:datetime.datetime
media_group_id

Optional. The unique identifier of a media message group this message belongs to.

Type:str
text

Optional. The actual UTF-8 text of the message.

Type:str
entities

Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the text. See Message.parse_entity and parse_entities methods for how to use properly.

Type:List[telegram.MessageEntity]
caption_entities

Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the caption. See Message.parse_caption_entity and parse_caption_entities methods for how to use properly.

Type:List[telegram.MessageEntity]
audio

Optional. Information about the file.

Type:telegram.Audio
document

Optional. Information about the file.

Type:telegram.Document
animation

For backward compatibility, when this field is set, the document field will also be set.

Type:telegram.Animation
game

Optional. Information about the game.

Type:telegram.Game
photo

Optional. Available sizes of the photo.

Type:List[telegram.PhotoSize]
sticker

Optional. Information about the sticker.

Type:telegram.Sticker
video

Optional. Information about the video.

Type:telegram.Video
voice

Optional. Information about the file.

Type:telegram.Voice
video_note

Optional. Information about the video message.

Type:telegram.VideoNote
new_chat_members

Optional. Information about new members to the chat. (the bot itself may be one of these members).

Type:List[telegram.User]
caption

Optional. Caption for the document, photo or video, 0-1024 characters.

Type:str
contact

Optional. Information about the contact.

Type:telegram.Contact
location

Optional. Information about the location.

Type:telegram.Location
venue

Optional. Information about the venue.

Type:telegram.Venue
left_chat_member

Optional. Information about the user that left the group. (this member may be the bot itself).

Type:telegram.User
new_chat_title

Optional. A chat title was changed to this value.

Type:str
new_chat_photo

Optional. A chat photo was changed to this value.

Type:List[telegram.PhotoSize]
delete_chat_photo

Optional. The chat photo was deleted.

Type:bool
group_chat_created

Optional. The group has been created.

Type:bool
supergroup_chat_created

Optional. The supergroup has been created.

Type:bool
channel_chat_created

Optional. The channel has been created.

Type:bool
migrate_to_chat_id

Optional. The group has been migrated to a supergroup with the specified identifier.

Type:int
migrate_from_chat_id

Optional. The supergroup has been migrated from a group with the specified identifier.

Type:int
pinned_message

Optional. Specified message was pinned.

Type:telegram.message
invoice

Optional. Information about the invoice.

Type:telegram.Invoice
successful_payment

Optional. Information about the payment.

Type:telegram.SuccessfulPayment
connected_website

Optional. The domain name of the website on which the user has logged in.

Type:str
forward_signature

Optional. Signature of the post author for messages forwarded from channels.

Type:str
forward_sender_name

Optional. Sender’s name for messages forwarded from users who disallow adding a link to their account in forwarded messages.

Type:str
author_signature

Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator.

Type:str
passport_data

Optional. Telegram Passport data.

Type:telegram.PassportData
poll

Optional. Message is a native poll, information about the poll.

Type:telegram.Poll
dice

Optional. Message is a dice.

Type:telegram.Dice
via_bot

Optional. Bot through which the message was sent.

Type:telegram.User
proximity_alert_triggered

Optional. Service message. A user in the chat triggered another user’s proximity alert while sharing Live Location.

Type:telegram.ProximityAlertTriggered
reply_markup

Optional. Inline keyboard attached to the message.

Type:telegram.InlineKeyboardMarkup
bot

Optional. The Bot to use for instance methods.

Type:telegram.Bot
caption_html

Creates an HTML-formatted string from the markup entities found in the message’s caption.

Use this if you want to retrieve the message caption with the caption entities formatted as HTML in the same way the original message was formatted.

Returns:Message caption with caption entities formatted as HTML.
Return type:str
caption_html_urled

Creates an HTML-formatted string from the markup entities found in the message’s caption.

Use this if you want to retrieve the message caption with the caption entities formatted as HTML. This also formats telegram.MessageEntity.URL as a hyperlink.

Returns:Message caption with caption entities formatted as HTML.
Return type:str
caption_markdown

Creates an Markdown-formatted string from the markup entities found in the message’s caption using telegram.ParseMode.MARKDOWN.

Use this if you want to retrieve the message caption with the caption entities formatted as Markdown in the same way the original message was formatted.

Note

telegram.ParseMode.MARKDOWN is is a legacy mode, retained by Telegram for backward compatibility. You should use caption_markdown_v2() instead.

Returns:Message caption with caption entities formatted as Markdown.
Return type:str
caption_markdown_urled

Creates an Markdown-formatted string from the markup entities found in the message’s caption using telegram.ParseMode.MARKDOWN.

Use this if you want to retrieve the message caption with the caption entities formatted as Markdown. This also formats telegram.MessageEntity.URL as a hyperlink.

Note

telegram.ParseMode.MARKDOWN is is a legacy mode, retained by Telegram for backward compatibility. You should use caption_markdown_v2_urled() instead.

Returns:Message caption with caption entities formatted as Markdown.
Return type:str
caption_markdown_v2

Creates an Markdown-formatted string from the markup entities found in the message’s caption using telegram.ParseMode.MARKDOWN_V2.

Use this if you want to retrieve the message caption with the caption entities formatted as Markdown in the same way the original message was formatted.

Returns:Message caption with caption entities formatted as Markdown.
Return type:str
caption_markdown_v2_urled

Creates an Markdown-formatted string from the markup entities found in the message’s caption using telegram.ParseMode.MARKDOWN_V2.

Use this if you want to retrieve the message caption with the caption entities formatted as Markdown. This also formats telegram.MessageEntity.URL as a hyperlink.

Returns:Message caption with caption entities formatted as Markdown.
Return type:str
chat_id

Shortcut for telegram.Chat.id for chat.

Type:int
copy(chat_id: Union[int, str], caption: str = None, parse_mode: str = None, caption_entities: Union[Tuple[MessageEntity, ...], List[MessageEntity]] = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, allow_sending_without_reply: bool = False, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None) → MessageId

Shortcut for:

bot.copy_message(chat_id=chat_id,
                 from_chat_id=update.effective_message.chat_id,
                 message_id=update.effective_message.message_id,
                 *args,
                 **kwargs)

For the documentation of the arguments, please see telegram.Bot.copy_message().

Returns:On success, returns the MessageId of the sent message.
Return type:telegram.MessageId
delete(timeout: float = None, api_kwargs: Dict[str, Any] = None) → bool

Shortcut for:

bot.delete_message(chat_id=message.chat_id,
                   message_id=message.message_id,
                   *args,
                   **kwargs)

For the documentation of the arguments, please see telegram.Bot.delete_message().

Returns:On success, True is returned.
Return type:bool
edit_caption(caption: str = None, reply_markup: telegram.inline.inlinekeyboardmarkup.InlineKeyboardMarkup = None, timeout: float = None, parse_mode: str = None, api_kwargs: Dict[str, Any] = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None) → Union[telegram.message.Message, bool]

Shortcut for:

bot.edit_message_caption(chat_id=message.chat_id,
                         message_id=message.message_id,
                         *args,
                         **kwargs)

For the documentation of the arguments, please see telegram.Bot.edit_message_caption().

Note

You can only edit messages that the bot sent itself (i.e. of the bot.send_* family of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram.

Returns:On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Return type:telegram.Message
edit_live_location(latitude: float = None, longitude: float = None, location: telegram.files.location.Location = None, reply_markup: telegram.inline.inlinekeyboardmarkup.InlineKeyboardMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None, horizontal_accuracy: float = None, heading: int = None, proximity_alert_radius: int = None) → Union[telegram.message.Message, bool]

Shortcut for:

bot.edit_message_live_location(chat_id=message.chat_id,
                               message_id=message.message_id,
                               *args,
                               **kwargs)

For the documentation of the arguments, please see telegram.Bot.edit_message_live_location().

Note

You can only edit messages that the bot sent itself (i.e. of the bot.send_* family of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram.

Returns:On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Return type:telegram.Message
edit_media(media: InputMedia = None, reply_markup: telegram.inline.inlinekeyboardmarkup.InlineKeyboardMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None) → Union[Message, bool]

Shortcut for:

bot.edit_message_media(chat_id=message.chat_id,
                       message_id=message.message_id,
                       *args,
                       **kwargs)

For the documentation of the arguments, please see telegram.Bot.edit_message_media().

Note

You can only edit messages that the bot sent itself(i.e. of the bot.send_* family of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram.

Returns:On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Return type:telegram.Message
edit_reply_markup(reply_markup: Optional[InlineKeyboardMarkup] = None, timeout: float = None, api_kwargs: Dict[str, Any] = None) → Union[telegram.message.Message, bool]

Shortcut for:

bot.edit_message_reply_markup(chat_id=message.chat_id,
                              message_id=message.message_id,
                              *args,
                              **kwargs)

For the documentation of the arguments, please see telegram.Bot.edit_message_reply_markup().

Note

You can only edit messages that the bot sent itself (i.e. of the bot.send_* family of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram.

Returns:On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Return type:telegram.Message
edit_text(text: str, parse_mode: str = None, disable_web_page_preview: bool = None, reply_markup: telegram.inline.inlinekeyboardmarkup.InlineKeyboardMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None, entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None) → Union[telegram.message.Message, bool]

Shortcut for:

bot.edit_message_text(chat_id=message.chat_id,
                      message_id=message.message_id,
                      *args,
                      **kwargs)

For the documentation of the arguments, please see telegram.Bot.edit_message_text().

Note

You can only edit messages that the bot sent itself (i.e. of the bot.send_* family of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram.

Returns:On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Return type:telegram.Message
effective_attachment

telegram.Audio or telegram.Contact or telegram.Document or telegram.Animation or telegram.Game or telegram.Invoice or telegram.Location or List[telegram.PhotoSize] or telegram.Sticker or telegram.SuccessfulPayment or telegram.Venue or telegram.Video or telegram.VideoNote or telegram.Voice: The attachment that this message was sent with. May be None if no attachment was sent.

forward(chat_id: Union[int, str], disable_notification: bool = False, timeout: float = None, api_kwargs: Dict[str, Any] = None) → telegram.message.Message

Shortcut for:

bot.forward_message(chat_id=chat_id,
                    from_chat_id=update.effective_message.chat_id,
                    message_id=update.effective_message.message_id,
                    *args,
                    **kwargs)

For the documentation of the arguments, please see telegram.Bot.forward_message().

Returns:On success, instance representing the message forwarded.
Return type:telegram.Message
get_game_high_scores(user_id: Union[int, str], timeout: float = None, api_kwargs: Dict[str, Any] = None) → List[GameHighScore]

Shortcut for:

bot.get_game_high_scores(chat_id=message.chat_id,
                         message_id=message.message_id,
                         *args,
                         **kwargs)

For the documentation of the arguments, please see telegram.Bot.get_game_high_scores().

Note

You can only edit messages that the bot sent itself (i.e. of the bot.send_* family of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram.

Returns:List[telegram.GameHighScore]

Convenience property. If the chat of the message is not a private chat or normal group, returns a t.me link of the message.

Type:str
parse_caption_entities(types: List[str] = None) → Dict[telegram.messageentity.MessageEntity, str]

Returns a dict that maps telegram.MessageEntity to str. It contains entities from this message’s caption filtered by their telegram.MessageEntity.type attribute as the key, and the text that each entity belongs to as the value of the dict.

Note

This method should always be used instead of the caption_entities attribute, since it calculates the correct substring from the message text based on UTF-16 codepoints. See parse_entity for more info.

Parameters:types (List[str], optional) – List of telegram.MessageEntity types as strings. If the type attribute of an entity is contained in this list, it will be returned. Defaults to a list of all types. All types can be found as constants in telegram.MessageEntity.
Returns:A dictionary of entities mapped to the text that belongs to them, calculated based on UTF-16 codepoints.
Return type:Dict[telegram.MessageEntity, str]
parse_caption_entity(entity: telegram.messageentity.MessageEntity) → str

Returns the text from a given telegram.MessageEntity.

Note

This method is present because Telegram calculates the offset and length in UTF-16 codepoint pairs, which some versions of Python don’t handle automatically. (That is, you can’t just slice Message.caption with the offset and length.)

Parameters:entity (telegram.MessageEntity) – The entity to extract the text from. It must be an entity that belongs to this message.
Returns:The text of the given entity.
Return type:str
Raises:RuntimeError – If the message has no caption.
parse_entities(types: List[str] = None) → Dict[telegram.messageentity.MessageEntity, str]

Returns a dict that maps telegram.MessageEntity to str. It contains entities from this message filtered by their telegram.MessageEntity.type attribute as the key, and the text that each entity belongs to as the value of the dict.

Note

This method should always be used instead of the entities attribute, since it calculates the correct substring from the message text based on UTF-16 codepoints. See parse_entity for more info.

Parameters:types (List[str], optional) – List of telegram.MessageEntity types as strings. If the type attribute of an entity is contained in this list, it will be returned. Defaults to a list of all types. All types can be found as constants in telegram.MessageEntity.
Returns:A dictionary of entities mapped to the text that belongs to them, calculated based on UTF-16 codepoints.
Return type:Dict[telegram.MessageEntity, str]
parse_entity(entity: telegram.messageentity.MessageEntity) → str

Returns the text from a given telegram.MessageEntity.

Note

This method is present because Telegram calculates the offset and length in UTF-16 codepoint pairs, which some versions of Python don’t handle automatically. (That is, you can’t just slice Message.text with the offset and length.)

Parameters:entity (telegram.MessageEntity) – The entity to extract the text from. It must be an entity that belongs to this message.
Returns:The text of the given entity.
Return type:str
Raises:RuntimeError – If the message has no text.
pin(disable_notification: bool = None, timeout: float = None, api_kwargs: Dict[str, Any] = None) → bool

Shortcut for:

bot.pin_chat_message(chat_id=message.chat_id,
                     message_id=message.message_id,
                     *args,
                     **kwargs)

For the documentation of the arguments, please see telegram.Bot.pin_chat_message().

Returns:On success, True is returned.
Return type:bool
reply_animation(animation: Union[str, bytes, IO, InputFile, pathlib.Path, Animation], duration: int = None, width: int = None, height: int = None, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, caption: str = None, parse_mode: str = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = 20, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_animation(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_animation().

Parameters:quote (bool, optional) – If set to True, the animation is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_audio(audio: Union[str, bytes, IO, InputFile, pathlib.Path, Audio], duration: int = None, performer: str = None, title: str = None, caption: str = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = 20, parse_mode: str = None, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_audio(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_audio().

Parameters:quote (bool, optional) – If set to True, the audio is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_chat_action(action: str, timeout: float = None, api_kwargs: Dict[str, Any] = None) → bool

Shortcut for:

bot.send_chat_action(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_chat_action().

New in version 13.2.

Returns:On success, True is returned.
Return type:bool
reply_contact(phone_number: str = None, first_name: str = None, last_name: str = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, contact: telegram.files.contact.Contact = None, vcard: str = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_contact(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_contact().

Parameters:quote (bool, optional) – If set to True, the contact is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_copy(from_chat_id: Union[str, int], message_id: Union[str, int], caption: str = None, parse_mode: str = None, caption_entities: Union[Tuple[MessageEntity, ...], List[MessageEntity]] = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, allow_sending_without_reply: bool = False, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None, quote: bool = None) → MessageId

Shortcut for:

bot.copy_message(chat_id=message.chat.id,
                 from_chat_id=from_chat_id,
                 message_id=message_id,
                 *args,
                 **kwargs)

For the documentation of the arguments, please see telegram.Bot.copy_message().

Parameters:quote (bool, optional) –

If set to True, the copy is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.

New in version 13.1.

Returns:On success, returns the MessageId of the sent message.
Return type:telegram.MessageId
reply_dice(disable_notification: bool = None, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, emoji: str = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_dice(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_dice().

Parameters:quote (bool, optional) – If set to True, the dice is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_document(document: Union[str, bytes, IO, InputFile, pathlib.Path, Document], filename: str = None, caption: str = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = 20, parse_mode: str = None, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, api_kwargs: Dict[str, Any] = None, disable_content_type_detection: bool = None, allow_sending_without_reply: bool = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_document(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_document().

Parameters:quote (bool, optional) – If set to True, the document is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_game(game_short_name: str, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: Optional[telegram.inline.inlinekeyboardmarkup.InlineKeyboardMarkup] = None, timeout: float = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_game(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_game().

Parameters:quote (bool, optional) – If set to True, the game is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.

New in version 13.2.

Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_html(text: str, disable_web_page_preview: bool = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_message(
    update.effective_message.chat_id,
    parse_mode=ParseMode.HTML,
    *args,
    **kwargs,
)

Sends a message with HTML formatting.

For the documentation of the arguments, please see telegram.Bot.send_message().

Parameters:quote (bool, optional) – If set to True, the message is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_invoice(title: str, description: str, payload: str, provider_token: str, start_parameter: str, currency: str, prices: List[LabeledPrice], photo_url: str = None, photo_size: int = None, photo_width: int = None, photo_height: int = None, need_name: bool = None, need_phone_number: bool = None, need_email: bool = None, need_shipping_address: bool = None, is_flexible: bool = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: InlineKeyboardMarkup = None, provider_data: Union[str, object] = None, send_phone_number_to_provider: bool = None, send_email_to_provider: bool = None, timeout: float = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, quote: bool = None) → Message

Shortcut for:

bot.send_invoice(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_invoice().

Parameters:quote (bool, optional) – If set to True, the invoice is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.

New in version 13.2.

Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_location(latitude: float = None, longitude: float = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, location: telegram.files.location.Location = None, live_period: int = None, api_kwargs: Dict[str, Any] = None, horizontal_accuracy: float = None, heading: int = None, proximity_alert_radius: int = None, allow_sending_without_reply: bool = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_location(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_location().

Parameters:quote (bool, optional) – If set to True, the location is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_markdown(text: str, disable_web_page_preview: bool = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_message(
    update.effective_message.chat_id,
    parse_mode=ParseMode.MARKDOWN,
    *args,
    **kwargs,
)

Sends a message with Markdown version 1 formatting.

For the documentation of the arguments, please see telegram.Bot.send_message().

Note

telegram.ParseMode.MARKDOWN is a legacy mode, retained by Telegram for backward compatibility. You should use reply_markdown_v2() instead.

Parameters:quote (bool, optional) – If set to True, the message is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_markdown_v2(text: str, disable_web_page_preview: bool = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_message(
    update.effective_message.chat_id,
    parse_mode=ParseMode.MARKDOWN_V2,
    *args,
    **kwargs,
)

Sends a message with markdown version 2 formatting.

For the documentation of the arguments, please see telegram.Bot.send_message().

Parameters:quote (bool, optional) – If set to True, the message is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_media_group(media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: bool = None, reply_to_message_id: Union[int, str] = None, timeout: float = 20, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, quote: bool = None) → List[Message]

Shortcut for:

bot.send_media_group(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_media_group().

Parameters:quote (bool, optional) – If set to True, the media group is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:An array of the sent Messages.
Return type:List[telegram.Message]
Raises:telegram.error.TelegramError
reply_photo(photo: Union[str, bytes, IO, InputFile, pathlib.Path, PhotoSize], caption: str = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = 20, parse_mode: str = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_photo(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_photo().

Parameters:quote (bool, optional) – If set to True, the photo is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_poll(question: str, options: List[str], is_anonymous: bool = True, type: str = 'regular', allows_multiple_answers: bool = False, correct_option_id: int = None, is_closed: bool = None, disable_notification: bool = None, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, explanation: str = None, explanation_parse_mode: Union[str, telegram.utils.helpers.DefaultValue, None] = <telegram.utils.helpers.DefaultValue object>, open_period: int = None, close_date: Union[int, datetime.datetime] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, explanation_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_poll(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_poll().

Parameters:quote (bool, optional) – If set to True, the poll is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_sticker(sticker: Union[str, bytes, IO, InputFile, pathlib.Path, Sticker], disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = 20, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_sticker(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_sticker().

Parameters:quote (bool, optional) – If set to True, the sticker is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_text(text: str, parse_mode: str = None, disable_web_page_preview: bool = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_message(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_message().

Parameters:quote (bool, optional) – If set to True, the message is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_venue(latitude: float = None, longitude: float = None, title: str = None, address: str = None, foursquare_id: str = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = None, venue: telegram.files.venue.Venue = None, foursquare_type: str = None, api_kwargs: Dict[str, Any] = None, google_place_id: str = None, google_place_type: str = None, allow_sending_without_reply: bool = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_venue(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_venue().

Parameters:quote (bool, optional) – If set to True, the venue is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_video(video: Union[str, bytes, IO, InputFile, pathlib.Path, Video], duration: int = None, caption: str = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = 20, width: int = None, height: int = None, parse_mode: str = None, supports_streaming: bool = None, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_video(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_video().

Parameters:quote (bool, optional) – If set to True, the video is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_video_note(video_note: Union[str, bytes, IO, InputFile, pathlib.Path, VideoNote], duration: int = None, length: int = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = 20, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, filename: str = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_video_note(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_video_note().

Parameters:quote (bool, optional) – If set to True, the video note is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
reply_voice(voice: Union[str, bytes, IO, InputFile, pathlib.Path, Voice], duration: int = None, caption: str = None, disable_notification: bool = False, reply_to_message_id: Union[int, str] = None, reply_markup: telegram.replymarkup.ReplyMarkup = None, timeout: float = 20, parse_mode: str = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: bool = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None, quote: bool = None) → telegram.message.Message

Shortcut for:

bot.send_voice(update.effective_message.chat_id, *args, **kwargs)

For the documentation of the arguments, please see telegram.Bot.send_voice().

Parameters:quote (bool, optional) – If set to True, the voice note is sent as an actual reply to this message. If reply_to_message_id is passed in kwargs, this parameter will be ignored. Default: True in group chats and False in private chats.
Returns:On success, instance representing the message posted.
Return type:telegram.Message
set_game_score(user_id: Union[int, str], score: int, force: bool = None, disable_edit_message: bool = None, timeout: float = None, api_kwargs: Dict[str, Any] = None) → Union[telegram.message.Message, bool]

Shortcut for:

bot.set_game_score(chat_id=message.chat_id,
                   message_id=message.message_id,
                   *args,
                   **kwargs)

For the documentation of the arguments, please see telegram.Bot.set_game_score().

Note

You can only edit messages that the bot sent itself (i.e. of the bot.send_* family of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram.

Returns:On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Return type:telegram.Message
stop_live_location(reply_markup: telegram.inline.inlinekeyboardmarkup.InlineKeyboardMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None) → Union[telegram.message.Message, bool]

Shortcut for:

bot.stop_message_live_location(chat_id=message.chat_id,
                               message_id=message.message_id,
                               *args,
                               **kwargs)

For the documentation of the arguments, please see telegram.Bot.stop_message_live_location().

Note

You can only edit messages that the bot sent itself (i.e. of the bot.send_* family of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram.

Returns:On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Return type:telegram.Message
stop_poll(reply_markup: telegram.inline.inlinekeyboardmarkup.InlineKeyboardMarkup = None, timeout: float = None, api_kwargs: Dict[str, Any] = None) → telegram.poll.Poll

Shortcut for:

bot.stop_poll(chat_id=message.chat_id,
              message_id=message.message_id,
              *args,
              **kwargs)

For the documentation of the arguments, please see telegram.Bot.stop_poll().

Returns:On success, the stopped Poll with the final results is returned.
Return type:telegram.Poll
text_html

Creates an HTML-formatted string from the markup entities found in the message.

Use this if you want to retrieve the message text with the entities formatted as HTML in the same way the original message was formatted.

Returns:Message text with entities formatted as HTML.
Return type:str
text_html_urled

Creates an HTML-formatted string from the markup entities found in the message.

Use this if you want to retrieve the message text with the entities formatted as HTML. This also formats telegram.MessageEntity.URL as a hyperlink.

Returns:Message text with entities formatted as HTML.
Return type:str
text_markdown

Creates an Markdown-formatted string from the markup entities found in the message using telegram.ParseMode.MARKDOWN.

Use this if you want to retrieve the message text with the entities formatted as Markdown in the same way the original message was formatted.

Note

telegram.ParseMode.MARKDOWN is is a legacy mode, retained by Telegram for backward compatibility. You should use text_markdown_v2() instead.

Returns:Message text with entities formatted as Markdown.
Return type:str
text_markdown_urled

Creates an Markdown-formatted string from the markup entities found in the message using telegram.ParseMode.MARKDOWN.

Use this if you want to retrieve the message text with the entities formatted as Markdown. This also formats telegram.MessageEntity.URL as a hyperlink.

Note

telegram.ParseMode.MARKDOWN is is a legacy mode, retained by Telegram for backward compatibility. You should use text_markdown_v2_urled() instead.

Returns:Message text with entities formatted as Markdown.
Return type:str
text_markdown_v2

Creates an Markdown-formatted string from the markup entities found in the message using telegram.ParseMode.MARKDOWN_V2.

Use this if you want to retrieve the message text with the entities formatted as Markdown in the same way the original message was formatted.

Returns:Message text with entities formatted as Markdown.
Return type:str
text_markdown_v2_urled

Creates an Markdown-formatted string from the markup entities found in the message using telegram.ParseMode.MARKDOWN_V2.

Use this if you want to retrieve the message text with the entities formatted as Markdown. This also formats telegram.MessageEntity.URL as a hyperlink.

Returns:Message text with entities formatted as Markdown.
Return type:str
unpin(timeout: float = None, api_kwargs: Dict[str, Any] = None) → bool

Shortcut for:

bot.unpin_chat_message(chat_id=message.chat_id,
                       message_id=message.message_id,
                       *args,
                       **kwargs)

For the documentation of the arguments, please see telegram.Bot.unpin_chat_message().

Returns:On success, True is returned.
Return type:bool