Message#

class aiogram.types.message.Message(*, message_id: int, date: datetime, chat: Chat, message_thread_id: Optional[int] = None, from_user: Optional[User] = None, sender_chat: Optional[Chat] = None, forward_from: Optional[User] = None, forward_from_chat: Optional[Chat] = None, forward_from_message_id: Optional[int] = None, forward_signature: Optional[str] = None, forward_sender_name: Optional[str] = None, forward_date: Optional[int] = None, is_topic_message: Optional[bool] = None, is_automatic_forward: Optional[bool] = None, reply_to_message: Optional[Message] = None, via_bot: Optional[User] = None, edit_date: Optional[int] = None, has_protected_content: Optional[bool] = None, media_group_id: Optional[str] = None, author_signature: Optional[str] = None, text: Optional[str] = None, entities: Optional[List[MessageEntity]] = None, animation: Optional[Animation] = None, audio: Optional[Audio] = None, document: Optional[Document] = None, photo: Optional[List[PhotoSize]] = None, sticker: Optional[Sticker] = None, video: Optional[Video] = None, video_note: Optional[VideoNote] = None, voice: Optional[Voice] = None, caption: Optional[str] = None, caption_entities: Optional[List[MessageEntity]] = None, has_media_spoiler: Optional[bool] = None, contact: Optional[Contact] = None, dice: Optional[Dice] = None, game: Optional[Game] = None, poll: Optional[Poll] = None, venue: Optional[Venue] = None, location: Optional[Location] = None, new_chat_members: Optional[List[User]] = None, left_chat_member: Optional[User] = None, new_chat_title: Optional[str] = None, new_chat_photo: Optional[List[PhotoSize]] = None, delete_chat_photo: Optional[bool] = None, group_chat_created: Optional[bool] = None, supergroup_chat_created: Optional[bool] = None, channel_chat_created: Optional[bool] = None, message_auto_delete_timer_changed: Optional[MessageAutoDeleteTimerChanged] = None, migrate_to_chat_id: Optional[int] = None, migrate_from_chat_id: Optional[int] = None, pinned_message: Optional[Message] = None, invoice: Optional[Invoice] = None, successful_payment: Optional[SuccessfulPayment] = None, connected_website: Optional[str] = None, write_access_allowed: Optional[WriteAccessAllowed] = None, passport_data: Optional[PassportData] = None, proximity_alert_triggered: Optional[ProximityAlertTriggered] = None, forum_topic_created: Optional[ForumTopicCreated] = None, forum_topic_edited: Optional[ForumTopicEdited] = None, forum_topic_closed: Optional[ForumTopicClosed] = None, forum_topic_reopened: Optional[ForumTopicReopened] = None, general_forum_topic_hidden: Optional[GeneralForumTopicHidden] = None, general_forum_topic_unhidden: Optional[GeneralForumTopicUnhidden] = None, video_chat_scheduled: Optional[VideoChatScheduled] = None, video_chat_started: Optional[VideoChatStarted] = None, video_chat_ended: Optional[VideoChatEnded] = None, video_chat_participants_invited: Optional[VideoChatParticipantsInvited] = None, web_app_data: Optional[WebAppData] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **extra_data: Any)[source]#

This object represents a message.

Source: https://core.telegram.org/bots/api#message

message_id: int#

Unique message identifier inside this chat

date: datetime.datetime#

Date the message was sent in Unix time

chat: Chat#

Conversation the message belongs to

message_thread_id: Optional[int]#

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

from_user: Optional[User]#

Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

sender_chat: Optional[Chat]#

Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

forward_from: Optional[User]#

Optional. For forwarded messages, sender of the original message

forward_from_chat: Optional[Chat]#

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

forward_from_message_id: Optional[int]#

Optional. For messages forwarded from channels, identifier of the original message in the channel

forward_signature: Optional[str]#

Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present

forward_sender_name: Optional[str]#

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

forward_date: Optional[int]#

Optional. For forwarded messages, date the original message was sent in Unix time

is_topic_message: Optional[bool]#

Optional. True, if the message is sent to a forum topic

is_automatic_forward: Optional[bool]#

Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group

reply_to_message: Optional[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.

via_bot: Optional[User]#

Optional. Bot through which the message was sent

edit_date: Optional[int]#

Optional. Date the message was last edited in Unix time

has_protected_content: Optional[bool]#

Optional. True, if the message can’t be forwarded

media_group_id: Optional[str]#

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

author_signature: Optional[str]#

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

text: Optional[str]#

Optional. For text messages, the actual UTF-8 text of the message

entities: Optional[List[MessageEntity]]#

Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text

animation: Optional[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

audio: Optional[Audio]#

Optional. Message is an audio file, information about the file

document: Optional[Document]#

Optional. Message is a general file, information about the file

photo: Optional[List[PhotoSize]]#

Optional. Message is a photo, available sizes of the photo

sticker: Optional[Sticker]#

Optional. Message is a sticker, information about the sticker

video: Optional[Video]#

Optional. Message is a video, information about the video

video_note: Optional[VideoNote]#

Optional. Message is a video note, information about the video message

voice: Optional[Voice]#

Optional. Message is a voice message, information about the file

caption: Optional[str]#

Optional. Caption for the animation, audio, document, photo, video or voice

caption_entities: Optional[List[MessageEntity]]#

Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption

has_media_spoiler: Optional[bool]#

Optional. True, if the message media is covered by a spoiler animation

contact: Optional[Contact]#

Optional. Message is a shared contact, information about the contact

dice: Optional[Dice]#

Optional. Message is a dice with random value

game: Optional[Game]#

Optional. Message is a game, information about the game. More about games »

poll: Optional[Poll]#

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

venue: Optional[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

location: Optional[Location]#

Optional. Message is a shared location, information about the location

new_chat_members: Optional[List[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)

left_chat_member: Optional[User]#

Optional. A member was removed from the group, information about them (this member may be the bot itself)

new_chat_title: Optional[str]#

Optional. A chat title was changed to this value

new_chat_photo: Optional[List[PhotoSize]]#

Optional. A chat photo was change to this value

delete_chat_photo: Optional[bool]#

Optional. Service message: the chat photo was deleted

group_chat_created: Optional[bool]#

Optional. Service message: the group has been created

supergroup_chat_created: Optional[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: Optional[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.

message_auto_delete_timer_changed: Optional[MessageAutoDeleteTimerChanged]#

Optional. Service message: auto-delete timer settings changed in the chat

migrate_to_chat_id: Optional[int]#

Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

migrate_from_chat_id: Optional[int]#

Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

pinned_message: Optional[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: Optional[Invoice]#

Optional. Message is an invoice for a payment, information about the invoice. More about payments »

successful_payment: Optional[SuccessfulPayment]#

Optional. Message is a service message about a successful payment, information about the payment. More about payments »

connected_website: Optional[str]#

Optional. The domain name of the website on which the user has logged in. More about Telegram Login »

write_access_allowed: Optional[WriteAccessAllowed]#

Optional. Service message: the user allowed the bot added to the attachment menu to write messages

passport_data: Optional[PassportData]#

Optional. Telegram Passport data

proximity_alert_triggered: Optional[ProximityAlertTriggered]#

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

forum_topic_created: Optional[ForumTopicCreated]#

Optional. Service message: forum topic created

forum_topic_edited: Optional[ForumTopicEdited]#

Optional. Service message: forum topic edited

forum_topic_closed: Optional[ForumTopicClosed]#

Optional. Service message: forum topic closed

forum_topic_reopened: Optional[ForumTopicReopened]#

Optional. Service message: forum topic reopened

general_forum_topic_hidden: Optional[GeneralForumTopicHidden]#

Optional. Service message: the ‘General’ forum topic hidden

general_forum_topic_unhidden: Optional[GeneralForumTopicUnhidden]#

Optional. Service message: the ‘General’ forum topic unhidden

video_chat_scheduled: Optional[VideoChatScheduled]#

Optional. Service message: video chat scheduled

video_chat_started: Optional[VideoChatStarted]#

Optional. Service message: video chat started

video_chat_ended: Optional[VideoChatEnded]#

Optional. Service message: video chat ended

video_chat_participants_invited: Optional[VideoChatParticipantsInvited]#

Optional. Service message: new participants invited to a video chat

web_app_data: Optional[WebAppData]#

Optional. Service message: data sent by a Web App

reply_markup: Optional[InlineKeyboardMarkup]#

Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

property content_type: str#
property html_text: str#
property md_text: str#
reply_animation(animation: Union[InputFile, str], duration: Optional[int] = None, width: Optional[int] = None, height: Optional[int] = None, thumb: Optional[Union[InputFile, str]] = None, caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendAnimation[source]#

Shortcut for method aiogram.methods.send_animation.SendAnimation will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent aiogram.types.message.Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

Source: https://core.telegram.org/bots/api#sendanimation

Parameters:
  • animation – Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files »

  • duration – Duration of sent animation in seconds

  • width – Animation width

  • height – Animation height

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • caption – Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing

  • parse_mode – Mode for parsing entities in the animation caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • has_spoiler – Pass True if the animation needs to be covered with a spoiler animation

  • disable_notification – Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup – Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_animation.SendAnimation

answer_animation(animation: Union[InputFile, str], duration: Optional[int] = None, width: Optional[int] = None, height: Optional[int] = None, thumb: Optional[Union[InputFile, str]] = None, caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendAnimation[source]#

Shortcut for method aiogram.methods.send_animation.SendAnimation will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent aiogram.types.message.Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

Source: https://core.telegram.org/bots/api#sendanimation

Parameters:
  • animation – Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files »

  • duration – Duration of sent animation in seconds

  • width – Animation width

  • height – Animation height

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • caption – Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the animation caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • has_spoiler – Pass True if the animation needs to be covered with a spoiler animation

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_animation.SendAnimation

reply_audio(audio: Union[InputFile, str], caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, duration: Optional[int] = None, performer: Optional[str] = None, title: Optional[str] = None, thumb: Optional[Union[InputFile, str]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendAudio[source]#

Shortcut for method aiogram.methods.send_audio.SendAudio will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent aiogram.types.message.Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice messages, use the aiogram.methods.send_voice.SendVoice method instead.

Source: https://core.telegram.org/bots/api#sendaudio

Parameters:
  • audio – Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

  • caption – Audio caption, 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the audio caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • duration – Duration of the audio in seconds

  • performer – Performer

  • title – Track name

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_audio.SendAudio

answer_audio(audio: Union[InputFile, str], caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, duration: Optional[int] = None, performer: Optional[str] = None, title: Optional[str] = None, thumb: Optional[Union[InputFile, str]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendAudio[source]#

Shortcut for method aiogram.methods.send_audio.SendAudio will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent aiogram.types.message.Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice messages, use the aiogram.methods.send_voice.SendVoice method instead.

Source: https://core.telegram.org/bots/api#sendaudio

Parameters:
  • audio – Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

  • caption – Audio caption, 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the audio caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • duration – Duration of the audio in seconds

  • performer – Performer

  • title – Track name

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_audio.SendAudio

reply_contact(phone_number: str, first_name: str, last_name: Optional[str] = None, vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendContact[source]#

Shortcut for method aiogram.methods.send_contact.SendContact will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send phone contacts. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendcontact

Parameters:
  • phone_number – Contact’s phone number

  • first_name – Contact’s first name

  • last_name – Contact’s last name

  • vcard – Additional data about the contact in the form of a vCard, 0-2048 bytes

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_contact.SendContact

answer_contact(phone_number: str, first_name: str, last_name: Optional[str] = None, vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendContact[source]#

Shortcut for method aiogram.methods.send_contact.SendContact will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send phone contacts. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendcontact

Parameters:
  • phone_number – Contact’s phone number

  • first_name – Contact’s first name

  • last_name – Contact’s last name

  • vcard

    Additional data about the contact in the form of a vCard, 0-2048 bytes

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_contact.SendContact

reply_document(document: Union[InputFile, str], thumb: Optional[Union[InputFile, str]] = None, caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendDocument[source]#

Shortcut for method aiogram.methods.send_document.SendDocument will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send general files. On success, the sent aiogram.types.message.Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

Source: https://core.telegram.org/bots/api#senddocument

Parameters:
  • document – File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • caption – Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the document caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • disable_content_type_detection – Disables automatic server-side content type detection for files uploaded using multipart/form-data

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_document.SendDocument

answer_document(document: Union[InputFile, str], thumb: Optional[Union[InputFile, str]] = None, caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendDocument[source]#

Shortcut for method aiogram.methods.send_document.SendDocument will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send general files. On success, the sent aiogram.types.message.Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

Source: https://core.telegram.org/bots/api#senddocument

Parameters:
  • document – File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • caption – Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the document caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • disable_content_type_detection – Disables automatic server-side content type detection for files uploaded using multipart/form-data

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_document.SendDocument

reply_game(game_short_name: str, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) SendGame[source]#

Shortcut for method aiogram.methods.send_game.SendGame will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send a game. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendgame

Parameters:
  • game_short_name – Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    A JSON-serialized object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown. If not empty, the first button must launch the game.

Returns:

instance of method aiogram.methods.send_game.SendGame

answer_game(game_short_name: str, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) SendGame[source]#

Shortcut for method aiogram.methods.send_game.SendGame will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send a game. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendgame

Parameters:
  • game_short_name

    Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    A JSON-serialized object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown. If not empty, the first button must launch the game.

Returns:

instance of method aiogram.methods.send_game.SendGame

reply_invoice(title: str, description: str, payload: str, provider_token: str, currency: str, prices: List[LabeledPrice], max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, provider_data: Optional[str] = None, photo_url: Optional[str] = None, photo_size: Optional[int] = None, photo_width: Optional[int] = None, photo_height: Optional[int] = None, need_name: Optional[bool] = None, need_phone_number: Optional[bool] = None, need_email: Optional[bool] = None, need_shipping_address: Optional[bool] = None, send_phone_number_to_provider: Optional[bool] = None, send_email_to_provider: Optional[bool] = None, is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) SendInvoice[source]#

Shortcut for method aiogram.methods.send_invoice.SendInvoice will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send invoices. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendinvoice

Parameters:
  • title – Product name, 1-32 characters

  • description – Product description, 1-255 characters

  • payload – Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.

  • provider_token

    Payment provider token, obtained via @BotFather

  • currency – Three-letter ISO 4217 currency code, see more on currencies

  • prices – Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

  • max_tip_amount – The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0

  • suggested_tip_amounts – A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

  • start_parameter – Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter

  • provider_data – JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

  • photo_url – URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.

  • photo_size – Photo size in bytes

  • photo_width – Photo width

  • photo_height – Photo height

  • need_name – Pass True if you require the user’s full name to complete the order

  • need_phone_number – Pass True if you require the user’s phone number to complete the order

  • need_email – Pass True if you require the user’s email address to complete the order

  • need_shipping_address – Pass True if you require the user’s shipping address to complete the order

  • send_phone_number_to_provider – Pass True if the user’s phone number should be sent to provider

  • send_email_to_provider – Pass True if the user’s email address should be sent to provider

  • is_flexible – Pass True if the final price depends on the shipping method

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    A JSON-serialized object for an inline keyboard. If empty, one ‘Pay total price’ button will be shown. If not empty, the first button must be a Pay button.

Returns:

instance of method aiogram.methods.send_invoice.SendInvoice

answer_invoice(title: str, description: str, payload: str, provider_token: str, currency: str, prices: List[LabeledPrice], max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, provider_data: Optional[str] = None, photo_url: Optional[str] = None, photo_size: Optional[int] = None, photo_width: Optional[int] = None, photo_height: Optional[int] = None, need_name: Optional[bool] = None, need_phone_number: Optional[bool] = None, need_email: Optional[bool] = None, need_shipping_address: Optional[bool] = None, send_phone_number_to_provider: Optional[bool] = None, send_email_to_provider: Optional[bool] = None, is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) SendInvoice[source]#

Shortcut for method aiogram.methods.send_invoice.SendInvoice will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send invoices. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendinvoice

Parameters:
  • title – Product name, 1-32 characters

  • description – Product description, 1-255 characters

  • payload – Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.

  • provider_token

    Payment provider token, obtained via @BotFather

  • currency

    Three-letter ISO 4217 currency code, see more on currencies

  • prices – Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

  • max_tip_amount

    The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0

  • suggested_tip_amounts – A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

  • start_parameter – Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter

  • provider_data – JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

  • photo_url – URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.

  • photo_size – Photo size in bytes

  • photo_width – Photo width

  • photo_height – Photo height

  • need_name – Pass True if you require the user’s full name to complete the order

  • need_phone_number – Pass True if you require the user’s phone number to complete the order

  • need_email – Pass True if you require the user’s email address to complete the order

  • need_shipping_address – Pass True if you require the user’s shipping address to complete the order

  • send_phone_number_to_provider – Pass True if the user’s phone number should be sent to provider

  • send_email_to_provider – Pass True if the user’s email address should be sent to provider

  • is_flexible – Pass True if the final price depends on the shipping method

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    A JSON-serialized object for an inline keyboard. If empty, one ‘Pay total price’ button will be shown. If not empty, the first button must be a Pay button.

Returns:

instance of method aiogram.methods.send_invoice.SendInvoice

reply_location(latitude: float, longitude: float, horizontal_accuracy: Optional[float] = None, live_period: Optional[int] = None, heading: Optional[int] = None, proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendLocation[source]#

Shortcut for method aiogram.methods.send_location.SendLocation will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send point on the map. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendlocation

Parameters:
  • latitude – Latitude of the location

  • longitude – Longitude of the location

  • horizontal_accuracy – The radius of uncertainty for the location, measured in meters; 0-1500

  • live_period – Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.

  • heading – For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

  • proximity_alert_radius – For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_location.SendLocation

answer_location(latitude: float, longitude: float, horizontal_accuracy: Optional[float] = None, live_period: Optional[int] = None, heading: Optional[int] = None, proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendLocation[source]#

Shortcut for method aiogram.methods.send_location.SendLocation will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send point on the map. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendlocation

Parameters:
  • latitude – Latitude of the location

  • longitude – Longitude of the location

  • horizontal_accuracy – The radius of uncertainty for the location, measured in meters; 0-1500

  • live_period

    Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.

  • heading – For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

  • proximity_alert_radius – For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_location.SendLocation

reply_media_group(media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, **kwargs: Any) SendMediaGroup[source]#

Shortcut for method aiogram.methods.send_media_group.SendMediaGroup will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.

Source: https://core.telegram.org/bots/api#sendmediagroup

Parameters:
  • media – A JSON-serialized array describing messages to be sent, must include 2-10 items

  • disable_notification

    Sends messages silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent messages from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

Returns:

instance of method aiogram.methods.send_media_group.SendMediaGroup

answer_media_group(media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, **kwargs: Any) SendMediaGroup[source]#

Shortcut for method aiogram.methods.send_media_group.SendMediaGroup will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.

Source: https://core.telegram.org/bots/api#sendmediagroup

Parameters:
  • media – A JSON-serialized array describing messages to be sent, must include 2-10 items

  • disable_notification

    Sends messages silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent messages from forwarding and saving

  • reply_to_message_id – If the messages are a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

Returns:

instance of method aiogram.methods.send_media_group.SendMediaGroup

reply(text: str, parse_mode: Optional[str] = sentinel.UNSET, entities: Optional[List[MessageEntity]] = None, disable_web_page_preview: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendMessage[source]#

Shortcut for method aiogram.methods.send_message.SendMessage will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send text messages. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendmessage

Parameters:
  • text – Text of the message to be sent, 1-4096 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the message text. See formatting options for more details.

  • entities – A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode

  • disable_web_page_preview – Disables link previews for links in this message

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_message.SendMessage

answer(text: str, parse_mode: Optional[str] = sentinel.UNSET, entities: Optional[List[MessageEntity]] = None, disable_web_page_preview: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendMessage[source]#

Shortcut for method aiogram.methods.send_message.SendMessage will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send text messages. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendmessage

Parameters:
  • text – Text of the message to be sent, 1-4096 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the message text. See formatting options for more details.

  • entities – A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode

  • disable_web_page_preview – Disables link previews for links in this message

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_message.SendMessage

reply_photo(photo: Union[InputFile, str], caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendPhoto[source]#

Shortcut for method aiogram.methods.send_photo.SendPhoto will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send photos. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendphoto

Parameters:
  • photo – Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo’s width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files »

  • caption – Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the photo caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • has_spoiler – Pass True if the photo needs to be covered with a spoiler animation

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_photo.SendPhoto

answer_photo(photo: Union[InputFile, str], caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendPhoto[source]#

Shortcut for method aiogram.methods.send_photo.SendPhoto will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send photos. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendphoto

Parameters:
  • photo – Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo’s width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files »

  • caption – Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the photo caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • has_spoiler – Pass True if the photo needs to be covered with a spoiler animation

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_photo.SendPhoto

reply_poll(question: str, options: List[str], is_anonymous: Optional[bool] = None, type: Optional[str] = None, allows_multiple_answers: Optional[bool] = None, correct_option_id: Optional[int] = None, explanation: Optional[str] = None, explanation_parse_mode: Optional[str] = sentinel.UNSET, explanation_entities: Optional[List[MessageEntity]] = None, open_period: Optional[int] = None, close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendPoll[source]#

Shortcut for method aiogram.methods.send_poll.SendPoll will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send a native poll. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendpoll

Parameters:
  • question – Poll question, 1-300 characters

  • options – A JSON-serialized list of answer options, 2-10 strings 1-100 characters each

  • is_anonymousTrue, if the poll needs to be anonymous, defaults to True

  • type – Poll type, ‘quiz’ or ‘regular’, defaults to ‘regular’

  • allows_multiple_answersTrue, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False

  • correct_option_id – 0-based identifier of the correct answer option, required for polls in quiz mode

  • explanation – Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing

  • explanation_parse_mode

    Mode for parsing entities in the explanation. See formatting options for more details.

  • explanation_entities – A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode

  • open_period – Amount of time in seconds the poll will be active after creation, 5-600. Can’t be used together with close_date.

  • close_date – Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can’t be used together with open_period.

  • is_closed – Pass True if the poll needs to be immediately closed. This can be useful for poll preview.

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_poll.SendPoll

answer_poll(question: str, options: List[str], is_anonymous: Optional[bool] = None, type: Optional[str] = None, allows_multiple_answers: Optional[bool] = None, correct_option_id: Optional[int] = None, explanation: Optional[str] = None, explanation_parse_mode: Optional[str] = sentinel.UNSET, explanation_entities: Optional[List[MessageEntity]] = None, open_period: Optional[int] = None, close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendPoll[source]#

Shortcut for method aiogram.methods.send_poll.SendPoll will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send a native poll. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendpoll

Parameters:
  • question – Poll question, 1-300 characters

  • options – A JSON-serialized list of answer options, 2-10 strings 1-100 characters each

  • is_anonymousTrue, if the poll needs to be anonymous, defaults to True

  • type – Poll type, ‘quiz’ or ‘regular’, defaults to ‘regular’

  • allows_multiple_answersTrue, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False

  • correct_option_id – 0-based identifier of the correct answer option, required for polls in quiz mode

  • explanation – Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing

  • explanation_parse_mode

    Mode for parsing entities in the explanation. See formatting options for more details.

  • explanation_entities – A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode

  • open_period – Amount of time in seconds the poll will be active after creation, 5-600. Can’t be used together with close_date.

  • close_date – Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can’t be used together with open_period.

  • is_closed – Pass True if the poll needs to be immediately closed. This can be useful for poll preview.

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_poll.SendPoll

reply_dice(emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendDice[source]#

Shortcut for method aiogram.methods.send_dice.SendDice will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send an animated emoji that will display a random value. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#senddice

Parameters:
  • emoji – Emoji on which the dice throw animation is based. Currently, must be one of ‘🎲’, ‘🎯’, ‘🏀’, ‘⚽’, ‘🎳’, or ‘🎰’. Dice can have values 1-6 for ‘🎲’, ‘🎯’ and ‘🎳’, values 1-5 for ‘🏀’ and ‘⚽’, and values 1-64 for ‘🎰’. Defaults to ‘🎲’

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_dice.SendDice

answer_dice(emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendDice[source]#

Shortcut for method aiogram.methods.send_dice.SendDice will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send an animated emoji that will display a random value. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#senddice

Parameters:
  • emoji – Emoji on which the dice throw animation is based. Currently, must be one of ‘🎲’, ‘🎯’, ‘🏀’, ‘⚽’, ‘🎳’, or ‘🎰’. Dice can have values 1-6 for ‘🎲’, ‘🎯’ and ‘🎳’, values 1-5 for ‘🏀’ and ‘⚽’, and values 1-64 for ‘🎰’. Defaults to ‘🎲’

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_dice.SendDice

reply_sticker(sticker: Union[InputFile, str], disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendSticker[source]#

Shortcut for method aiogram.methods.send_sticker.SendSticker will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendsticker

Parameters:
  • sticker – Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_sticker.SendSticker

answer_sticker(sticker: Union[InputFile, str], disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendSticker[source]#

Shortcut for method aiogram.methods.send_sticker.SendSticker will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendsticker

Parameters:
  • sticker – Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_sticker.SendSticker

reply_venue(latitude: float, longitude: float, title: str, address: str, foursquare_id: Optional[str] = None, foursquare_type: Optional[str] = None, google_place_id: Optional[str] = None, google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendVenue[source]#

Shortcut for method aiogram.methods.send_venue.SendVenue will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send information about a venue. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendvenue

Parameters:
  • latitude – Latitude of the venue

  • longitude – Longitude of the venue

  • title – Name of the venue

  • address – Address of the venue

  • foursquare_id – Foursquare identifier of the venue

  • foursquare_type – Foursquare type of the venue, if known. (For example, ‘arts_entertainment/default’, ‘arts_entertainment/aquarium’ or ‘food/icecream’.)

  • google_place_id – Google Places identifier of the venue

  • google_place_type – Google Places type of the venue. (See supported types.)

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_venue.SendVenue

answer_venue(latitude: float, longitude: float, title: str, address: str, foursquare_id: Optional[str] = None, foursquare_type: Optional[str] = None, google_place_id: Optional[str] = None, google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendVenue[source]#

Shortcut for method aiogram.methods.send_venue.SendVenue will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send information about a venue. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendvenue

Parameters:
  • latitude – Latitude of the venue

  • longitude – Longitude of the venue

  • title – Name of the venue

  • address – Address of the venue

  • foursquare_id – Foursquare identifier of the venue

  • foursquare_type – Foursquare type of the venue, if known. (For example, ‘arts_entertainment/default’, ‘arts_entertainment/aquarium’ or ‘food/icecream’.)

  • google_place_id – Google Places identifier of the venue

  • google_place_type

    Google Places type of the venue. (See supported types.)

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_venue.SendVenue

reply_video(video: Union[InputFile, str], duration: Optional[int] = None, width: Optional[int] = None, height: Optional[int] = None, thumb: Optional[Union[InputFile, str]] = None, caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendVideo[source]#

Shortcut for method aiogram.methods.send_video.SendVideo will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as aiogram.types.document.Document). On success, the sent aiogram.types.message.Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

Source: https://core.telegram.org/bots/api#sendvideo

Parameters:
  • video – Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files »

  • duration – Duration of sent video in seconds

  • width – Video width

  • height – Video height

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • caption – Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the video caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • has_spoiler – Pass True if the video needs to be covered with a spoiler animation

  • supports_streaming – Pass True if the uploaded video is suitable for streaming

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_video.SendVideo

answer_video(video: Union[InputFile, str], duration: Optional[int] = None, width: Optional[int] = None, height: Optional[int] = None, thumb: Optional[Union[InputFile, str]] = None, caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendVideo[source]#

Shortcut for method aiogram.methods.send_video.SendVideo will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as aiogram.types.document.Document). On success, the sent aiogram.types.message.Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

Source: https://core.telegram.org/bots/api#sendvideo

Parameters:
  • video – Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files »

  • duration – Duration of sent video in seconds

  • width – Video width

  • height – Video height

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • caption – Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the video caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • has_spoiler – Pass True if the video needs to be covered with a spoiler animation

  • supports_streaming – Pass True if the uploaded video is suitable for streaming

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_video.SendVideo

reply_video_note(video_note: Union[InputFile, str], duration: Optional[int] = None, length: Optional[int] = None, thumb: Optional[Union[InputFile, str]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendVideoNote[source]#

Shortcut for method aiogram.methods.send_video_note.SendVideoNote will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendvideonote

Parameters:
  • video_note – Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported

  • duration – Duration of sent video in seconds

  • length – Video width and height, i.e. diameter of the video message

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_video_note.SendVideoNote

answer_video_note(video_note: Union[InputFile, str], duration: Optional[int] = None, length: Optional[int] = None, thumb: Optional[Union[InputFile, str]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendVideoNote[source]#

Shortcut for method aiogram.methods.send_video_note.SendVideoNote will automatically fill method attributes:

  • chat_id

  • message_thread_id

As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#sendvideonote

Parameters:
  • video_note – Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported

  • duration – Duration of sent video in seconds

  • length – Video width and height, i.e. diameter of the video message

  • thumb – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://<file_attach_name>’ if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_video_note.SendVideoNote

reply_voice(voice: Union[InputFile, str], caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendVoice[source]#

Shortcut for method aiogram.methods.send_voice.SendVoice will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • reply_to_message_id

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as aiogram.types.audio.Audio or aiogram.types.document.Document). On success, the sent aiogram.types.message.Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

Source: https://core.telegram.org/bots/api#sendvoice

Parameters:
  • voice – Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

  • caption – Voice message caption, 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the voice message caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • duration – Duration of the voice message in seconds

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_voice.SendVoice

answer_voice(voice: Union[InputFile, str], caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) SendVoice[source]#

Shortcut for method aiogram.methods.send_voice.SendVoice will automatically fill method attributes:

  • chat_id

  • message_thread_id

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as aiogram.types.audio.Audio or aiogram.types.document.Document). On success, the sent aiogram.types.message.Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

Source: https://core.telegram.org/bots/api#sendvoice

Parameters:
  • voice – Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

  • caption – Voice message caption, 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the voice message caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • duration – Duration of the voice message in seconds

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.send_voice.SendVoice

send_copy(chat_id: Union[str, int], disable_notification: Optional[bool] = None, reply_to_message_id: Optional[int] = None, reply_markup: Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, None] = None, allow_sending_without_reply: Optional[bool] = None, message_thread_id: Optional[int] = None) Union[SendAnimation, SendAudio, SendContact, SendDocument, SendLocation, SendMessage, SendPhoto, SendPoll, SendDice, SendSticker, SendVenue, SendVideo, SendVideoNote, SendVoice][source]#

Send copy of message.

Is similar to aiogram.client.bot.Bot.copy_message() but returning the sent message instead of aiogram.types.message_id.MessageId

Note

This method don’t use the API method named copyMessage and historically implemented before the similar method is added to API

Parameters:
  • chat_id

  • disable_notification

  • reply_to_message_id

  • reply_markup

  • allow_sending_without_reply

  • message_thread_id

Returns:

copy_to(chat_id: Union[int, str], message_thread_id: Optional[int] = None, caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, reply_to_message_id: Optional[int] = None, allow_sending_without_reply: Optional[bool] = None, reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None, **kwargs: Any) CopyMessage[source]#

Shortcut for method aiogram.methods.copy_message.CopyMessage will automatically fill method attributes:

  • from_chat_id

  • message_id

Use this method to copy messages of any kind. Service messages and invoice messages can’t be copied. A quiz aiogram.methods.poll.Poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method aiogram.methods.forward_message.ForwardMessage, but the copied message doesn’t have a link to the original message. Returns the aiogram.types.message_id.MessageId of the sent message on success.

Source: https://core.telegram.org/bots/api#copymessage

Parameters:
  • chat_id – Unique identifier for the target chat or username of the target channel (in the format @channelusername)

  • message_thread_id – Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

  • caption – New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept

  • parse_mode

    Mode for parsing entities in the new caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the sent message from forwarding and saving

  • reply_to_message_id – If the message is a reply, ID of the original message

  • allow_sending_without_reply – Pass True if the message should be sent even if the specified replied-to message is not found

  • reply_markup

    Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

instance of method aiogram.methods.copy_message.CopyMessage

edit_text(text: str, inline_message_id: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, entities: Optional[List[MessageEntity]] = None, disable_web_page_preview: Optional[bool] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) EditMessageText[source]#

Shortcut for method aiogram.methods.edit_message_text.EditMessageText will automatically fill method attributes:

  • chat_id

  • message_id

Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited aiogram.types.message.Message is returned, otherwise True is returned.

Source: https://core.telegram.org/bots/api#editmessagetext

Parameters:
  • text – New text of the message, 1-4096 characters after entities parsing

  • inline_message_id – Required if chat_id and message_id are not specified. Identifier of the inline message

  • parse_mode

    Mode for parsing entities in the message text. See formatting options for more details.

  • entities – A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode

  • disable_web_page_preview – Disables link previews for links in this message

  • reply_markup

    A JSON-serialized object for an inline keyboard.

Returns:

instance of method aiogram.methods.edit_message_text.EditMessageText

forward(chat_id: Union[int, str], message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = None, **kwargs: Any) ForwardMessage[source]#

Shortcut for method aiogram.methods.forward_message.ForwardMessage will automatically fill method attributes:

  • from_chat_id

  • message_id

Use this method to forward messages of any kind. Service messages can’t be forwarded. On success, the sent aiogram.types.message.Message is returned.

Source: https://core.telegram.org/bots/api#forwardmessage

Parameters:
  • chat_id – Unique identifier for the target chat or username of the target channel (in the format @channelusername)

  • message_thread_id – Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

  • disable_notification

    Sends the message silently. Users will receive a notification with no sound.

  • protect_content – Protects the contents of the forwarded message from forwarding and saving

Returns:

instance of method aiogram.methods.forward_message.ForwardMessage

edit_media(media: InputMedia, inline_message_id: Optional[str] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) EditMessageMedia[source]#

Shortcut for method aiogram.methods.edit_message_media.EditMessageMedia will automatically fill method attributes:

  • chat_id

  • message_id

Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can’t be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited aiogram.types.message.Message is returned, otherwise True is returned.

Source: https://core.telegram.org/bots/api#editmessagemedia

Parameters:
  • media – A JSON-serialized object for a new media content of the message

  • inline_message_id – Required if chat_id and message_id are not specified. Identifier of the inline message

  • reply_markup

    A JSON-serialized object for a new inline keyboard.

Returns:

instance of method aiogram.methods.edit_message_media.EditMessageMedia

edit_reply_markup(inline_message_id: Optional[str] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) EditMessageReplyMarkup[source]#

Shortcut for method aiogram.methods.edit_message_reply_markup.EditMessageReplyMarkup will automatically fill method attributes:

  • chat_id

  • message_id

Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited aiogram.types.message.Message is returned, otherwise True is returned.

Source: https://core.telegram.org/bots/api#editmessagereplymarkup

Parameters:
  • inline_message_id – Required if chat_id and message_id are not specified. Identifier of the inline message

  • reply_markup

    A JSON-serialized object for an inline keyboard.

Returns:

instance of method aiogram.methods.edit_message_reply_markup.EditMessageReplyMarkup

delete_reply_markup() EditMessageReplyMarkup[source]#
edit_live_location(latitude: float, longitude: float, inline_message_id: Optional[str] = None, horizontal_accuracy: Optional[float] = None, heading: Optional[int] = None, proximity_alert_radius: Optional[int] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) EditMessageLiveLocation[source]#

Shortcut for method aiogram.methods.edit_message_live_location.EditMessageLiveLocation will automatically fill method attributes:

  • chat_id

  • message_id

Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to aiogram.methods.stop_message_live_location.StopMessageLiveLocation. On success, if the edited message is not an inline message, the edited aiogram.types.message.Message is returned, otherwise True is returned.

Source: https://core.telegram.org/bots/api#editmessagelivelocation

Parameters:
  • latitude – Latitude of new location

  • longitude – Longitude of new location

  • inline_message_id – Required if chat_id and message_id are not specified. Identifier of the inline message

  • horizontal_accuracy – The radius of uncertainty for the location, measured in meters; 0-1500

  • heading – Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

  • proximity_alert_radius – The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

  • reply_markup

    A JSON-serialized object for a new inline keyboard.

Returns:

instance of method aiogram.methods.edit_message_live_location.EditMessageLiveLocation

stop_live_location(inline_message_id: Optional[str] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) StopMessageLiveLocation[source]#

Shortcut for method aiogram.methods.stop_message_live_location.StopMessageLiveLocation will automatically fill method attributes:

  • chat_id

  • message_id

Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited aiogram.types.message.Message is returned, otherwise True is returned.

Source: https://core.telegram.org/bots/api#stopmessagelivelocation

Parameters:
  • inline_message_id – Required if chat_id and message_id are not specified. Identifier of the inline message

  • reply_markup

    A JSON-serialized object for a new inline keyboard.

Returns:

instance of method aiogram.methods.stop_message_live_location.StopMessageLiveLocation

edit_caption(inline_message_id: Optional[str] = None, caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[MessageEntity]] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any) EditMessageCaption[source]#

Shortcut for method aiogram.methods.edit_message_caption.EditMessageCaption will automatically fill method attributes:

  • chat_id

  • message_id

Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited aiogram.types.message.Message is returned, otherwise True is returned.

Source: https://core.telegram.org/bots/api#editmessagecaption

Parameters:
  • inline_message_id – Required if chat_id and message_id are not specified. Identifier of the inline message

  • caption – New caption of the message, 0-1024 characters after entities parsing

  • parse_mode

    Mode for parsing entities in the message caption. See formatting options for more details.

  • caption_entities – A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

  • reply_markup

    A JSON-serialized object for an inline keyboard.

Returns:

instance of method aiogram.methods.edit_message_caption.EditMessageCaption

delete(**kwargs: Any) DeleteMessage[source]#

Shortcut for method aiogram.methods.delete_message.DeleteMessage will automatically fill method attributes:

  • chat_id

  • message_id

Use this method to delete a message, including service messages, with the following limitations:

  • A message can only be deleted if it was sent less than 48 hours ago.

  • Service messages about a supergroup, channel, or forum topic creation can’t be deleted.

  • A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.

  • Bots can delete outgoing messages in private chats, groups, and supergroups.

  • Bots can delete incoming messages in private chats.

  • Bots granted can_post_messages permissions can delete outgoing messages in channels.

  • If the bot is an administrator of a group, it can delete any message there.

  • If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.

Returns True on success.

Source: https://core.telegram.org/bots/api#deletemessage

Returns:

instance of method aiogram.methods.delete_message.DeleteMessage

pin(disable_notification: Optional[bool] = None, **kwargs: Any) PinChatMessage[source]#

Shortcut for method aiogram.methods.pin_chat_message.PinChatMessage will automatically fill method attributes:

  • chat_id

  • message_id

Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.

Source: https://core.telegram.org/bots/api#pinchatmessage

Parameters:

disable_notification – Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.

Returns:

instance of method aiogram.methods.pin_chat_message.PinChatMessage

unpin(**kwargs: Any) UnpinChatMessage[source]#

Shortcut for method aiogram.methods.unpin_chat_message.UnpinChatMessage will automatically fill method attributes:

  • chat_id

  • message_id

Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.

Source: https://core.telegram.org/bots/api#unpinchatmessage

Returns:

instance of method aiogram.methods.unpin_chat_message.UnpinChatMessage

get_url(force_private: bool = False) Optional[str][source]#

Returns message URL. Cannot be used in private (one-to-one) chats. If chat has a username, returns URL like https://t.me/username/message_id Otherwise (or if {force_private} flag is set), returns https://t.me/c/shifted_chat_id/message_id

Parameters:

force_private – if set, a private URL is returned even for a public chat

Returns:

string with full message URL