2019-11-03 22:14:41 +02:00
from __future__ import annotations
2026-01-02 02:50:46 +02:00
from typing import TYPE_CHECKING , Any
2019-11-03 22:14:41 +02:00
2024-05-06 23:27:54 +03:00
from pydantic import Field
2019-11-03 22:14:41 +02:00
2023-01-12 02:49:58 +02:00
from aiogram . utils . text_decorations import (
TextDecoration ,
html_decoration ,
markdown_decoration ,
)
2021-01-26 21:20:52 +02:00
2024-01-27 17:19:45 +02:00
from . . client . default import Default
2022-12-04 03:05:49 +02:00
from . . enums import ContentType
2023-08-27 17:09:56 +03:00
from . custom import DateTime
2023-12-31 01:40:44 +02:00
from . maybe_inaccessible_message import MaybeInaccessibleMessage
2024-07-13 04:03:49 +03:00
from . reply_parameters import ReplyParameters
2019-11-03 22:14:41 +02:00
2021-09-22 00:52:38 +03:00
if TYPE_CHECKING :
2021-01-26 21:20:52 +02:00
from . . methods import (
2021-05-11 23:04:32 +03:00
CopyMessage ,
2021-05-25 00:56:44 +03:00
DeleteMessage ,
EditMessageCaption ,
2022-10-22 00:29:29 +03:00
EditMessageLiveLocation ,
EditMessageMedia ,
2022-10-22 01:02:56 +03:00
EditMessageReplyMarkup ,
2021-05-25 00:56:44 +03:00
EditMessageText ,
2022-10-22 00:29:29 +03:00
ForwardMessage ,
PinChatMessage ,
2021-01-26 21:20:52 +02:00
SendAnimation ,
SendAudio ,
SendContact ,
SendDice ,
SendDocument ,
SendGame ,
SendInvoice ,
SendLocation ,
SendMediaGroup ,
SendMessage ,
2024-07-06 20:48:27 +03:00
SendPaidMedia ,
2021-01-26 21:20:52 +02:00
SendPhoto ,
SendPoll ,
SendSticker ,
SendVenue ,
SendVideo ,
SendVideoNote ,
SendVoice ,
2023-12-31 01:40:44 +02:00
SetMessageReaction ,
2022-10-22 00:29:29 +03:00
StopMessageLiveLocation ,
UnpinChatMessage ,
2021-01-26 21:20:52 +02:00
)
2019-11-14 22:19:33 +02:00
from . animation import Animation
2019-11-14 14:44:17 +02:00
from . audio import Audio
2019-11-14 22:19:33 +02:00
from . chat import Chat
2024-05-06 23:27:54 +03:00
from . chat_background import ChatBackground
2024-02-16 23:44:35 +02:00
from . chat_boost_added import ChatBoostAdded
2025-03-08 02:19:57 +02:00
from . chat_id_union import ChatIdUnion
2026-02-10 23:43:52 +02:00
from . chat_owner_changed import ChatOwnerChanged
from . chat_owner_left import ChatOwnerLeft
2023-02-04 19:53:32 +02:00
from . chat_shared import ChatShared
2025-07-05 03:02:44 +03:00
from . checklist import Checklist
from . checklist_tasks_added import ChecklistTasksAdded
from . checklist_tasks_done import ChecklistTasksDone
2020-01-24 01:07:22 +02:00
from . contact import Contact
2025-03-08 02:19:57 +02:00
from . date_time_union import DateTimeUnion
2020-04-11 20:15:03 +03:00
from . dice import Dice
2025-07-05 03:02:44 +03:00
from . direct_message_price_changed import DirectMessagePriceChanged
2025-08-17 19:07:58 +03:00
from . direct_messages_topic import DirectMessagesTopic
2019-11-14 22:19:33 +02:00
from . document import Document
2023-12-31 01:40:44 +02:00
from . external_reply_info import ExternalReplyInfo
2022-11-06 14:28:21 +02:00
from . forum_topic_closed import ForumTopicClosed
from . forum_topic_created import ForumTopicCreated
2022-12-30 22:44:25 +02:00
from . forum_topic_edited import ForumTopicEdited
2022-11-06 14:28:21 +02:00
from . forum_topic_reopened import ForumTopicReopened
2020-01-24 01:07:22 +02:00
from . game import Game
2022-12-30 22:44:25 +02:00
from . general_forum_topic_hidden import GeneralForumTopicHidden
from . general_forum_topic_unhidden import GeneralForumTopicUnhidden
2025-04-12 23:29:48 +03:00
from . gift_info import GiftInfo
2023-12-31 01:40:44 +02:00
from . giveaway import Giveaway
from . giveaway_completed import GiveawayCompleted
from . giveaway_created import GiveawayCreated
from . giveaway_winners import GiveawayWinners
2019-11-14 14:44:17 +02:00
from . inline_keyboard_markup import InlineKeyboardMarkup
2020-01-26 02:34:57 +02:00
from . input_file import InputFile
2025-03-08 02:19:57 +02:00
from . input_file_union import InputFileUnion
from . input_media_union import InputMediaUnion
from . input_paid_media_union import InputPaidMediaUnion
from . input_poll_option_union import InputPollOptionUnion
2021-01-26 21:20:52 +02:00
from . invoice import Invoice
2020-01-26 02:34:57 +02:00
from . labeled_price import LabeledPrice
2023-12-31 01:40:44 +02:00
from . link_preview_options import LinkPreviewOptions
2020-01-24 01:07:22 +02:00
from . location import Location
2025-03-08 02:19:57 +02:00
from . maybe_inaccessible_message_union import MaybeInaccessibleMessageUnion
from . media_union import MediaUnion
2021-05-11 23:04:32 +03:00
from . message_auto_delete_timer_changed import MessageAutoDeleteTimerChanged
2020-01-24 01:07:22 +02:00
from . message_entity import MessageEntity
2025-03-08 02:19:57 +02:00
from . message_origin_union import MessageOriginUnion
2024-07-06 20:31:49 +03:00
from . paid_media_info import PaidMediaInfo
2025-04-12 23:29:48 +03:00
from . paid_message_price_changed import PaidMessagePriceChanged
2020-01-24 01:07:22 +02:00
from . passport_data import PassportData
from . photo_size import PhotoSize
from . poll import Poll
2021-01-26 21:20:52 +02:00
from . proximity_alert_triggered import ProximityAlertTriggered
2025-03-08 02:19:57 +02:00
from . reaction_type_union import ReactionTypeUnion
2024-07-07 15:46:17 +03:00
from . refunded_payment import RefundedPayment
2020-01-26 02:34:57 +02:00
from . reply_keyboard_markup import ReplyKeyboardMarkup
2025-03-08 02:19:57 +02:00
from . reply_markup_union import ReplyMarkupUnion
2020-01-24 01:07:22 +02:00
from . sticker import Sticker
2023-08-18 20:18:05 +03:00
from . story import Story
2020-01-24 01:07:22 +02:00
from . successful_payment import SuccessfulPayment
2025-08-17 19:07:58 +03:00
from . suggested_post_approval_failed import SuggestedPostApprovalFailed
from . suggested_post_approved import SuggestedPostApproved
from . suggested_post_declined import SuggestedPostDeclined
from . suggested_post_info import SuggestedPostInfo
from . suggested_post_paid import SuggestedPostPaid
from . suggested_post_parameters import SuggestedPostParameters
from . suggested_post_refunded import SuggestedPostRefunded
2023-12-31 01:40:44 +02:00
from . text_quote import TextQuote
2025-04-12 23:29:48 +03:00
from . unique_gift_info import UniqueGiftInfo
2020-01-24 01:07:22 +02:00
from . user import User
2023-02-04 19:53:32 +02:00
from . user_shared import UserShared
2023-12-31 01:40:44 +02:00
from . users_shared import UsersShared
2020-01-24 01:07:22 +02:00
from . venue import Venue
2019-11-14 14:44:17 +02:00
from . video import Video
2022-04-19 22:03:24 +03:00
from . video_chat_ended import VideoChatEnded
from . video_chat_participants_invited import VideoChatParticipantsInvited
from . video_chat_scheduled import VideoChatScheduled
from . video_chat_started import VideoChatStarted
2020-01-24 01:07:22 +02:00
from . video_note import VideoNote
from . voice import Voice
2022-04-19 22:03:24 +03:00
from . web_app_data import WebAppData
2022-12-30 22:44:25 +02:00
from . write_access_allowed import WriteAccessAllowed
2019-11-03 22:14:41 +02:00
2023-12-31 01:40:44 +02:00
class Message ( MaybeInaccessibleMessage ) :
2019-11-03 22:14:41 +02:00
"""
This object represents a message .
Source : https : / / core . telegram . org / bots / api #message
"""
message_id : int
2024-11-02 16:13:45 +02:00
""" Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent """
2023-08-27 17:09:56 +03:00
date : DateTime
2023-12-31 01:40:44 +02:00
""" Date the message was sent in Unix time. It is always a positive number, representing a valid date. """
2019-11-03 22:14:41 +02:00
chat : Chat
2023-12-31 01:40:44 +02:00
""" Chat the message belongs to """
2026-01-02 02:50:46 +02:00
message_thread_id : int | None = None
2026-01-02 01:45:35 +02:00
""" *Optional*. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only """
2026-01-02 02:50:46 +02:00
direct_messages_topic : DirectMessagesTopic | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. Information about the direct messages chat topic that contains the message """
2026-01-02 02:50:46 +02:00
from_user : User | None = Field ( None , alias = " from " )
2024-08-16 00:44:40 +03:00
""" *Optional*. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats """
2026-01-02 02:50:46 +02:00
sender_chat : Chat | None = None
2024-08-16 00:44:40 +03:00
""" *Optional*. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel ' s discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field *from* contains a fake sender user in non-channel chats. """
2026-01-02 02:50:46 +02:00
sender_boost_count : int | None = None
2024-02-16 23:44:35 +02:00
""" *Optional*. If the sender of the message boosted the chat, the number of boosts added by the user """
2026-01-02 02:50:46 +02:00
sender_business_bot : User | None = None
2024-04-22 13:48:49 +03:00
""" *Optional*. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account. """
2026-03-03 01:19:11 +02:00
sender_tag : str | None = None
""" *Optional*. Tag or custom title of the sender of the message; for supergroups only """
2026-01-02 02:50:46 +02:00
business_connection_id : str | None = None
2024-04-22 13:48:49 +03:00
""" *Optional*. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier. """
2026-01-02 02:50:46 +02:00
forward_origin : MessageOriginUnion | None = None
2023-12-31 01:40:44 +02:00
""" *Optional*. Information about the original message for forwarded messages """
2026-01-02 02:50:46 +02:00
is_topic_message : bool | None = None
2026-01-02 01:45:35 +02:00
""" *Optional*. :code:`True`, if the message is sent to a topic in a forum supergroup or a private chat with the bot """
2026-01-02 02:50:46 +02:00
is_automatic_forward : bool | None = None
2022-06-25 18:14:29 +03:00
""" *Optional*. :code:`True`, if the message is a channel post that was automatically forwarded to the connected discussion group """
2026-01-02 02:50:46 +02:00
reply_to_message : Message | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. For replies in the same chat and message thread, the original message. Note that the :class:`aiogram.types.message.Message` object in this field will not contain further *reply_to_message* fields even if it itself is a reply. """
2026-01-02 02:50:46 +02:00
external_reply : ExternalReplyInfo | None = None
2023-12-31 01:40:44 +02:00
""" *Optional*. Information about the message that is being replied to, which may come from another chat or forum topic """
2026-01-02 02:50:46 +02:00
quote : TextQuote | None = None
2023-12-31 01:40:44 +02:00
""" *Optional*. For replies that quote part of the original message, the quoted part of the message """
2026-01-02 02:50:46 +02:00
reply_to_story : Story | None = None
2024-02-16 23:44:35 +02:00
""" *Optional*. For replies to a story, the original story """
2026-01-02 02:50:46 +02:00
reply_to_checklist_task_id : int | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. Identifier of the specific checklist task that is being replied to """
2026-01-02 02:50:46 +02:00
via_bot : User | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Bot through which the message was sent """
2026-01-02 02:50:46 +02:00
edit_date : int | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Date the message was last edited in Unix time """
2026-01-02 02:50:46 +02:00
has_protected_content : bool | None = None
2022-06-25 18:14:29 +03:00
""" *Optional*. :code:`True`, if the message can ' t be forwarded """
2026-01-02 02:50:46 +02:00
is_from_offline : bool | None = None
2025-07-05 03:02:44 +03:00
""" *Optional*. :code:`True`, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message """
2026-01-02 02:50:46 +02:00
is_paid_post : bool | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. :code:`True`, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can ' t be edited. """
2026-01-02 02:50:46 +02:00
media_group_id : str | None = None
2026-03-03 01:19:11 +02:00
""" *Optional*. The unique identifier inside this chat of a media message group this message belongs to """
2026-01-02 02:50:46 +02:00
author_signature : str | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator """
2026-01-02 02:50:46 +02:00
paid_star_count : int | None = None
2025-04-12 23:29:48 +03:00
""" *Optional*. The number of Telegram Stars that were paid by the sender of the message to send it """
2026-01-02 02:50:46 +02:00
text : str | None = None
2022-06-25 18:14:29 +03:00
""" *Optional*. For text messages, the actual UTF-8 text of the message """
2026-01-02 02:50:46 +02:00
entities : list [ MessageEntity ] | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text """
2026-01-02 02:50:46 +02:00
link_preview_options : LinkPreviewOptions | None = None
2023-12-31 01:40:44 +02:00
""" *Optional*. Options used for link preview generation for the message, if it is a text message and link preview options were changed """
2026-01-02 02:50:46 +02:00
suggested_post_info : SuggestedPostInfo | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can ' t be edited. """
2026-01-02 02:50:46 +02:00
effect_id : str | None = None
2024-05-31 20:07:11 +03:00
""" *Optional*. Unique identifier of the message effect added to the message """
2026-01-02 02:50:46 +02:00
animation : Animation | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is an animation, information about the animation. For backward compatibility, when this field is set, the *document* field will also be set """
2026-01-02 02:50:46 +02:00
audio : Audio | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is an audio file, information about the file """
2026-01-02 02:50:46 +02:00
document : Document | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a general file, information about the file """
2026-01-02 02:50:46 +02:00
paid_media : PaidMediaInfo | None = None
2024-07-06 20:31:49 +03:00
""" *Optional*. Message contains paid media; information about the paid media """
2026-01-02 02:50:46 +02:00
photo : list [ PhotoSize ] | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a photo, available sizes of the photo """
2026-01-02 02:50:46 +02:00
sticker : Sticker | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a sticker, information about the sticker """
2026-01-02 02:50:46 +02:00
story : Story | None = None
2023-08-18 20:18:05 +03:00
""" *Optional*. Message is a forwarded story """
2026-01-02 02:50:46 +02:00
video : Video | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a video, information about the video """
2026-01-02 02:50:46 +02:00
video_note : VideoNote | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a `video note <https://telegram.org/blog/video-messages-and-telescope>`_, information about the video message """
2026-01-02 02:50:46 +02:00
voice : Voice | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a voice message, information about the file """
2026-01-02 02:50:46 +02:00
caption : str | None = None
2024-07-06 20:31:49 +03:00
""" *Optional*. Caption for the animation, audio, document, paid media, photo, video or voice """
2026-01-02 02:50:46 +02:00
caption_entities : list [ MessageEntity ] | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption """
2026-01-02 02:50:46 +02:00
show_caption_above_media : bool | None = None
2025-07-05 03:02:44 +03:00
""" *Optional*. :code:`True`, if the caption must be shown above the message media """
2026-01-02 02:50:46 +02:00
has_media_spoiler : bool | None = None
2022-12-30 22:44:25 +02:00
""" *Optional*. :code:`True`, if the message media is covered by a spoiler animation """
2026-01-02 02:50:46 +02:00
checklist : Checklist | None = None
2025-07-05 03:02:44 +03:00
""" *Optional*. Message is a checklist """
2026-01-02 02:50:46 +02:00
contact : Contact | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a shared contact, information about the contact """
2026-01-02 02:50:46 +02:00
dice : Dice | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a dice with random value """
2026-01-02 02:50:46 +02:00
game : Game | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a game, information about the game. `More about games » <https://core.telegram.org/bots/api#games>`_ """
2026-01-02 02:50:46 +02:00
poll : Poll | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a native poll, information about the poll """
2026-01-02 02:50:46 +02:00
venue : Venue | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a venue, information about the venue. For backward compatibility, when this field is set, the *location* field will also be set """
2026-01-02 02:50:46 +02:00
location : Location | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a shared location, information about the location """
2026-01-02 02:50:46 +02:00
new_chat_members : list [ User ] | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) """
2026-01-02 02:50:46 +02:00
left_chat_member : User | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. A member was removed from the group, information about them (this member may be the bot itself) """
2026-02-10 23:43:52 +02:00
chat_owner_left : ChatOwnerLeft | None = None
""" *Optional*. Service message: chat owner has left """
chat_owner_changed : ChatOwnerChanged | None = None
""" *Optional*. Service message: chat owner has changed """
2026-01-02 02:50:46 +02:00
new_chat_title : str | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. A chat title was changed to this value """
2026-01-02 02:50:46 +02:00
new_chat_photo : list [ PhotoSize ] | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. A chat photo was change to this value """
2026-01-02 02:50:46 +02:00
delete_chat_photo : bool | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Service message: the chat photo was deleted """
2026-01-02 02:50:46 +02:00
group_chat_created : bool | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Service message: the group has been created """
2026-01-02 02:50:46 +02:00
supergroup_chat_created : bool | None = None
2021-01-26 21:20:52 +02:00
""" *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. """
2026-01-02 02:50:46 +02:00
channel_chat_created : bool | None = None
2021-01-26 21:20:52 +02:00
""" *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. """
2026-01-02 02:50:46 +02:00
message_auto_delete_timer_changed : MessageAutoDeleteTimerChanged | None = None
2021-05-11 23:04:32 +03:00
""" *Optional*. Service message: auto-delete timer settings changed in the chat """
2026-01-02 02:50:46 +02:00
migrate_to_chat_id : int | None = None
2021-05-11 23:04:32 +03:00
""" *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. """
2026-01-02 02:50:46 +02:00
migrate_from_chat_id : int | None = None
2021-05-11 23:04:32 +03:00
""" *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. """
2026-01-02 02:50:46 +02:00
pinned_message : MaybeInaccessibleMessageUnion | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. Specified message was pinned. Note that the :class:`aiogram.types.message.Message` object in this field will not contain further *reply_to_message* fields even if it itself is a reply. """
2026-01-02 02:50:46 +02:00
invoice : Invoice | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is an invoice for a `payment <https://core.telegram.org/bots/api#payments>`_, information about the invoice. `More about payments » <https://core.telegram.org/bots/api#payments>`_ """
2026-01-02 02:50:46 +02:00
successful_payment : SuccessfulPayment | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Message is a service message about a successful payment, information about the payment. `More about payments » <https://core.telegram.org/bots/api#payments>`_ """
2026-01-02 02:50:46 +02:00
refunded_payment : RefundedPayment | None = None
2024-07-07 15:46:17 +03:00
""" *Optional*. Message is a service message about a refunded payment, information about the payment. `More about payments » <https://core.telegram.org/bots/api#payments>`_ """
2026-01-02 02:50:46 +02:00
users_shared : UsersShared | None = None
2023-12-31 01:40:44 +02:00
""" *Optional*. Service message: users were shared with the bot """
2026-01-02 02:50:46 +02:00
chat_shared : ChatShared | None = None
2023-02-04 19:53:32 +02:00
""" *Optional*. Service message: a chat was shared with the bot """
2026-01-02 02:50:46 +02:00
gift : GiftInfo | None = None
2025-04-12 23:29:48 +03:00
""" *Optional*. Service message: a regular gift was sent or received """
2026-01-02 02:50:46 +02:00
unique_gift : UniqueGiftInfo | None = None
2025-04-12 23:29:48 +03:00
""" *Optional*. Service message: a unique gift was sent or received """
2026-01-02 02:50:46 +02:00
gift_upgrade_sent : GiftInfo | None = None
2026-01-02 01:45:35 +02:00
""" *Optional*. Service message: upgrade of a gift was purchased after the gift was sent """
2026-01-02 02:50:46 +02:00
connected_website : str | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. The domain name of the website on which the user has logged in. `More about Telegram Login » <https://core.telegram.org/widgets/login>`_ """
2026-01-02 02:50:46 +02:00
write_access_allowed : WriteAccessAllowed | None = None
2023-09-22 17:46:57 +03:00
""" *Optional*. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method `requestWriteAccess <https://core.telegram.org/bots/webapps#initializing-mini-apps>`_ """
2026-01-02 02:50:46 +02:00
passport_data : PassportData | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Telegram Passport data """
2026-01-02 02:50:46 +02:00
proximity_alert_triggered : ProximityAlertTriggered | None = None
2021-01-26 21:20:52 +02:00
""" *Optional*. Service message. A user in the chat triggered another user ' s proximity alert while sharing Live Location. """
2026-01-02 02:50:46 +02:00
boost_added : ChatBoostAdded | None = None
2024-02-16 23:44:35 +02:00
""" *Optional*. Service message: user boosted the chat """
2026-01-02 02:50:46 +02:00
chat_background_set : ChatBackground | None = None
2024-05-06 23:27:54 +03:00
""" *Optional*. Service message: chat background set """
2026-01-02 02:50:46 +02:00
checklist_tasks_done : ChecklistTasksDone | None = None
2025-07-05 03:02:44 +03:00
""" *Optional*. Service message: some tasks in a checklist were marked as done or not done """
2026-01-02 02:50:46 +02:00
checklist_tasks_added : ChecklistTasksAdded | None = None
2025-07-05 03:02:44 +03:00
""" *Optional*. Service message: tasks were added to a checklist """
2026-01-02 02:50:46 +02:00
direct_message_price_changed : DirectMessagePriceChanged | None = None
2025-07-05 03:02:44 +03:00
""" *Optional*. Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed """
2026-01-02 02:50:46 +02:00
forum_topic_created : ForumTopicCreated | None = None
2022-11-06 14:28:21 +02:00
""" *Optional*. Service message: forum topic created """
2026-01-02 02:50:46 +02:00
forum_topic_edited : ForumTopicEdited | None = None
2022-12-30 22:44:25 +02:00
""" *Optional*. Service message: forum topic edited """
2026-01-02 02:50:46 +02:00
forum_topic_closed : ForumTopicClosed | None = None
2022-11-06 14:28:21 +02:00
""" *Optional*. Service message: forum topic closed """
2026-01-02 02:50:46 +02:00
forum_topic_reopened : ForumTopicReopened | None = None
2022-11-06 14:28:21 +02:00
""" *Optional*. Service message: forum topic reopened """
2026-01-02 02:50:46 +02:00
general_forum_topic_hidden : GeneralForumTopicHidden | None = None
2022-12-30 22:44:25 +02:00
""" *Optional*. Service message: the ' General ' forum topic hidden """
2026-01-02 02:50:46 +02:00
general_forum_topic_unhidden : GeneralForumTopicUnhidden | None = None
2022-12-30 22:44:25 +02:00
""" *Optional*. Service message: the ' General ' forum topic unhidden """
2026-01-02 02:50:46 +02:00
giveaway_created : GiveawayCreated | None = None
2023-12-31 01:40:44 +02:00
""" *Optional*. Service message: a scheduled giveaway was created """
2026-01-02 02:50:46 +02:00
giveaway : Giveaway | None = None
2023-12-31 01:40:44 +02:00
""" *Optional*. The message is a scheduled giveaway message """
2026-01-02 02:50:46 +02:00
giveaway_winners : GiveawayWinners | None = None
2023-12-31 01:40:44 +02:00
""" *Optional*. A giveaway with public winners was completed """
2026-01-02 02:50:46 +02:00
giveaway_completed : GiveawayCompleted | None = None
2023-12-31 01:40:44 +02:00
""" *Optional*. Service message: a giveaway without public winners was completed """
2026-01-02 02:50:46 +02:00
paid_message_price_changed : PaidMessagePriceChanged | None = None
2025-04-12 23:29:48 +03:00
""" *Optional*. Service message: the price for paid messages has changed in the chat """
2026-01-02 02:50:46 +02:00
suggested_post_approved : SuggestedPostApproved | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. Service message: a suggested post was approved """
2026-01-02 02:50:46 +02:00
suggested_post_approval_failed : SuggestedPostApprovalFailed | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. Service message: approval of a suggested post has failed """
2026-01-02 02:50:46 +02:00
suggested_post_declined : SuggestedPostDeclined | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. Service message: a suggested post was declined """
2026-01-02 02:50:46 +02:00
suggested_post_paid : SuggestedPostPaid | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. Service message: payment for a suggested post was received """
2026-01-02 02:50:46 +02:00
suggested_post_refunded : SuggestedPostRefunded | None = None
2025-08-17 19:07:58 +03:00
""" *Optional*. Service message: payment for a suggested post was refunded """
2026-01-02 02:50:46 +02:00
video_chat_scheduled : VideoChatScheduled | None = None
2022-04-19 22:03:24 +03:00
""" *Optional*. Service message: video chat scheduled """
2026-01-02 02:50:46 +02:00
video_chat_started : VideoChatStarted | None = None
2022-04-19 22:03:24 +03:00
""" *Optional*. Service message: video chat started """
2026-01-02 02:50:46 +02:00
video_chat_ended : VideoChatEnded | None = None
2022-04-19 22:03:24 +03:00
""" *Optional*. Service message: video chat ended """
2026-01-02 02:50:46 +02:00
video_chat_participants_invited : VideoChatParticipantsInvited | None = None
2022-04-19 22:03:24 +03:00
""" *Optional*. Service message: new participants invited to a video chat """
2026-01-02 02:50:46 +02:00
web_app_data : WebAppData | None = None
2022-04-19 22:03:24 +03:00
""" *Optional*. Service message: data sent by a Web App """
2026-01-02 02:50:46 +02:00
reply_markup : InlineKeyboardMarkup | None = None
2026-03-03 01:19:11 +02:00
""" *Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons. """
2026-01-02 02:50:46 +02:00
forward_date : DateTime | None = Field ( None , json_schema_extra = { " deprecated " : True } )
2023-12-31 01:40:44 +02:00
""" *Optional*. For forwarded messages, date the original message was sent in Unix time
. . deprecated : : API : 7.0
https : / / core . telegram . org / bots / api - changelog #december-29-2023"""
2026-01-02 02:50:46 +02:00
forward_from : User | None = Field ( None , json_schema_extra = { " deprecated " : True } )
2023-12-31 01:40:44 +02:00
""" *Optional*. For forwarded messages, sender of the original message
. . deprecated : : API : 7.0
https : / / core . telegram . org / bots / api - changelog #december-29-2023"""
2026-01-02 02:50:46 +02:00
forward_from_chat : Chat | None = Field ( None , json_schema_extra = { " deprecated " : True } )
2023-12-31 01:40:44 +02:00
""" *Optional*. For messages forwarded from channels or from anonymous administrators, information about the original sender chat
. . deprecated : : API : 7.0
https : / / core . telegram . org / bots / api - changelog #december-29-2023"""
2026-01-02 02:50:46 +02:00
forward_from_message_id : int | None = Field ( None , json_schema_extra = { " deprecated " : True } )
2023-12-31 01:40:44 +02:00
""" *Optional*. For messages forwarded from channels, identifier of the original message in the channel
. . deprecated : : API : 7.0
https : / / core . telegram . org / bots / api - changelog #december-29-2023"""
2026-01-02 02:50:46 +02:00
forward_sender_name : str | None = Field ( None , json_schema_extra = { " deprecated " : True } )
2023-12-31 01:40:44 +02:00
""" *Optional*. Sender ' s name for messages forwarded from users who disallow adding a link to their account in forwarded messages
. . deprecated : : API : 7.0
https : / / core . telegram . org / bots / api - changelog #december-29-2023"""
2026-01-02 02:50:46 +02:00
forward_signature : str | None = Field ( None , json_schema_extra = { " deprecated " : True } )
2023-12-31 01:40:44 +02:00
""" *Optional*. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present
. . deprecated : : API : 7.0
https : / / core . telegram . org / bots / api - changelog #december-29-2023"""
2026-01-02 02:50:46 +02:00
user_shared : UserShared | None = Field ( None , json_schema_extra = { " deprecated " : True } )
2023-12-31 01:40:44 +02:00
""" *Optional*. Service message: a user was shared with the bot
. . deprecated : : API : 7.0
https : / / core . telegram . org / bots / api - changelog #december-29-2023"""
2019-12-11 18:03:39 +02:00
2023-08-04 00:30:27 +03:00
if TYPE_CHECKING :
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__ (
__pydantic__self__ ,
* ,
message_id : int ,
2023-08-27 17:09:56 +03:00
date : DateTime ,
2023-08-04 00:30:27 +03:00
chat : Chat ,
2026-01-02 02:50:46 +02:00
message_thread_id : int | None = None ,
direct_messages_topic : DirectMessagesTopic | None = None ,
from_user : User | None = None ,
sender_chat : Chat | None = None ,
sender_boost_count : int | None = None ,
sender_business_bot : User | None = None ,
2026-03-03 01:19:11 +02:00
sender_tag : str | None = None ,
2026-01-02 02:50:46 +02:00
business_connection_id : str | None = None ,
forward_origin : MessageOriginUnion | None = None ,
is_topic_message : bool | None = None ,
is_automatic_forward : bool | None = None ,
reply_to_message : Message | None = None ,
external_reply : ExternalReplyInfo | None = None ,
quote : TextQuote | None = None ,
reply_to_story : Story | None = None ,
reply_to_checklist_task_id : int | None = None ,
via_bot : User | None = None ,
edit_date : int | None = None ,
has_protected_content : bool | None = None ,
is_from_offline : bool | None = None ,
is_paid_post : bool | None = None ,
media_group_id : str | None = None ,
author_signature : str | None = None ,
paid_star_count : int | None = None ,
text : str | None = None ,
entities : list [ MessageEntity ] | None = None ,
link_preview_options : LinkPreviewOptions | None = None ,
suggested_post_info : SuggestedPostInfo | None = None ,
effect_id : str | None = None ,
animation : Animation | None = None ,
audio : Audio | None = None ,
document : Document | None = None ,
paid_media : PaidMediaInfo | None = None ,
photo : list [ PhotoSize ] | None = None ,
sticker : Sticker | None = None ,
story : Story | None = None ,
video : Video | None = None ,
video_note : VideoNote | None = None ,
voice : Voice | None = None ,
caption : str | None = None ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | None = None ,
has_media_spoiler : bool | None = None ,
checklist : Checklist | None = None ,
contact : Contact | None = None ,
dice : Dice | None = None ,
game : Game | None = None ,
poll : Poll | None = None ,
venue : Venue | None = None ,
location : Location | None = None ,
new_chat_members : list [ User ] | None = None ,
left_chat_member : User | None = None ,
2026-02-10 23:43:52 +02:00
chat_owner_left : ChatOwnerLeft | None = None ,
chat_owner_changed : ChatOwnerChanged | None = None ,
2026-01-02 02:50:46 +02:00
new_chat_title : str | None = None ,
new_chat_photo : list [ PhotoSize ] | None = None ,
delete_chat_photo : bool | None = None ,
group_chat_created : bool | None = None ,
supergroup_chat_created : bool | None = None ,
channel_chat_created : bool | None = None ,
message_auto_delete_timer_changed : MessageAutoDeleteTimerChanged | None = None ,
migrate_to_chat_id : int | None = None ,
migrate_from_chat_id : int | None = None ,
pinned_message : MaybeInaccessibleMessageUnion | None = None ,
invoice : Invoice | None = None ,
successful_payment : SuccessfulPayment | None = None ,
refunded_payment : RefundedPayment | None = None ,
users_shared : UsersShared | None = None ,
chat_shared : ChatShared | None = None ,
gift : GiftInfo | None = None ,
unique_gift : UniqueGiftInfo | None = None ,
gift_upgrade_sent : GiftInfo | None = None ,
connected_website : str | None = None ,
write_access_allowed : WriteAccessAllowed | None = None ,
passport_data : PassportData | None = None ,
proximity_alert_triggered : ProximityAlertTriggered | None = None ,
boost_added : ChatBoostAdded | None = None ,
chat_background_set : ChatBackground | None = None ,
checklist_tasks_done : ChecklistTasksDone | None = None ,
checklist_tasks_added : ChecklistTasksAdded | None = None ,
direct_message_price_changed : DirectMessagePriceChanged | None = None ,
forum_topic_created : ForumTopicCreated | None = None ,
forum_topic_edited : ForumTopicEdited | None = None ,
forum_topic_closed : ForumTopicClosed | None = None ,
forum_topic_reopened : ForumTopicReopened | None = None ,
general_forum_topic_hidden : GeneralForumTopicHidden | None = None ,
general_forum_topic_unhidden : GeneralForumTopicUnhidden | None = None ,
giveaway_created : GiveawayCreated | None = None ,
giveaway : Giveaway | None = None ,
giveaway_winners : GiveawayWinners | None = None ,
giveaway_completed : GiveawayCompleted | None = None ,
paid_message_price_changed : PaidMessagePriceChanged | None = None ,
suggested_post_approved : SuggestedPostApproved | None = None ,
suggested_post_approval_failed : SuggestedPostApprovalFailed | None = None ,
suggested_post_declined : SuggestedPostDeclined | None = None ,
suggested_post_paid : SuggestedPostPaid | None = None ,
suggested_post_refunded : SuggestedPostRefunded | None = None ,
video_chat_scheduled : VideoChatScheduled | None = None ,
video_chat_started : VideoChatStarted | None = None ,
video_chat_ended : VideoChatEnded | None = None ,
video_chat_participants_invited : VideoChatParticipantsInvited | None = None ,
web_app_data : WebAppData | None = None ,
reply_markup : InlineKeyboardMarkup | None = None ,
forward_date : DateTime | None = None ,
forward_from : User | None = None ,
forward_from_chat : Chat | None = None ,
forward_from_message_id : int | None = None ,
forward_sender_name : str | None = None ,
forward_signature : str | None = None ,
user_shared : UserShared | None = None ,
2023-08-04 00:30:27 +03:00
* * __pydantic_kwargs : Any ,
) - > None :
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super ( ) . __init__ (
message_id = message_id ,
date = date ,
chat = chat ,
message_thread_id = message_thread_id ,
2025-08-17 19:07:58 +03:00
direct_messages_topic = direct_messages_topic ,
2023-08-04 00:30:27 +03:00
from_user = from_user ,
sender_chat = sender_chat ,
2024-02-16 23:44:35 +02:00
sender_boost_count = sender_boost_count ,
2024-04-22 13:48:49 +03:00
sender_business_bot = sender_business_bot ,
2026-03-03 01:19:11 +02:00
sender_tag = sender_tag ,
2024-04-22 13:48:49 +03:00
business_connection_id = business_connection_id ,
2023-12-31 01:40:44 +02:00
forward_origin = forward_origin ,
2023-08-04 00:30:27 +03:00
is_topic_message = is_topic_message ,
is_automatic_forward = is_automatic_forward ,
reply_to_message = reply_to_message ,
2023-12-31 01:40:44 +02:00
external_reply = external_reply ,
quote = quote ,
2024-02-16 23:44:35 +02:00
reply_to_story = reply_to_story ,
2025-08-17 19:07:58 +03:00
reply_to_checklist_task_id = reply_to_checklist_task_id ,
2023-08-04 00:30:27 +03:00
via_bot = via_bot ,
edit_date = edit_date ,
has_protected_content = has_protected_content ,
2024-04-22 13:48:49 +03:00
is_from_offline = is_from_offline ,
2025-08-17 19:07:58 +03:00
is_paid_post = is_paid_post ,
2023-08-04 00:30:27 +03:00
media_group_id = media_group_id ,
author_signature = author_signature ,
2025-04-12 23:29:48 +03:00
paid_star_count = paid_star_count ,
2023-08-04 00:30:27 +03:00
text = text ,
entities = entities ,
2023-12-31 01:40:44 +02:00
link_preview_options = link_preview_options ,
2025-08-17 19:07:58 +03:00
suggested_post_info = suggested_post_info ,
2024-05-31 20:07:11 +03:00
effect_id = effect_id ,
2023-08-04 00:30:27 +03:00
animation = animation ,
audio = audio ,
document = document ,
2024-07-06 20:31:49 +03:00
paid_media = paid_media ,
2023-08-04 00:30:27 +03:00
photo = photo ,
sticker = sticker ,
2023-08-18 20:18:05 +03:00
story = story ,
2023-08-04 00:30:27 +03:00
video = video ,
video_note = video_note ,
voice = voice ,
caption = caption ,
caption_entities = caption_entities ,
2024-05-31 20:07:11 +03:00
show_caption_above_media = show_caption_above_media ,
2023-08-04 00:30:27 +03:00
has_media_spoiler = has_media_spoiler ,
2025-07-05 03:02:44 +03:00
checklist = checklist ,
2023-08-04 00:30:27 +03:00
contact = contact ,
dice = dice ,
game = game ,
poll = poll ,
venue = venue ,
location = location ,
new_chat_members = new_chat_members ,
left_chat_member = left_chat_member ,
2026-02-10 23:43:52 +02:00
chat_owner_left = chat_owner_left ,
chat_owner_changed = chat_owner_changed ,
2023-08-04 00:30:27 +03:00
new_chat_title = new_chat_title ,
new_chat_photo = new_chat_photo ,
delete_chat_photo = delete_chat_photo ,
group_chat_created = group_chat_created ,
supergroup_chat_created = supergroup_chat_created ,
channel_chat_created = channel_chat_created ,
message_auto_delete_timer_changed = message_auto_delete_timer_changed ,
migrate_to_chat_id = migrate_to_chat_id ,
migrate_from_chat_id = migrate_from_chat_id ,
pinned_message = pinned_message ,
invoice = invoice ,
successful_payment = successful_payment ,
2024-07-07 15:46:17 +03:00
refunded_payment = refunded_payment ,
2023-12-31 01:40:44 +02:00
users_shared = users_shared ,
2023-08-04 00:30:27 +03:00
chat_shared = chat_shared ,
2025-04-12 23:29:48 +03:00
gift = gift ,
unique_gift = unique_gift ,
2026-01-02 01:45:35 +02:00
gift_upgrade_sent = gift_upgrade_sent ,
2023-08-04 00:30:27 +03:00
connected_website = connected_website ,
write_access_allowed = write_access_allowed ,
passport_data = passport_data ,
proximity_alert_triggered = proximity_alert_triggered ,
2024-02-16 23:44:35 +02:00
boost_added = boost_added ,
2024-05-06 23:27:54 +03:00
chat_background_set = chat_background_set ,
2025-07-05 03:02:44 +03:00
checklist_tasks_done = checklist_tasks_done ,
checklist_tasks_added = checklist_tasks_added ,
direct_message_price_changed = direct_message_price_changed ,
2023-08-04 00:30:27 +03:00
forum_topic_created = forum_topic_created ,
forum_topic_edited = forum_topic_edited ,
forum_topic_closed = forum_topic_closed ,
forum_topic_reopened = forum_topic_reopened ,
general_forum_topic_hidden = general_forum_topic_hidden ,
general_forum_topic_unhidden = general_forum_topic_unhidden ,
2023-12-31 01:40:44 +02:00
giveaway_created = giveaway_created ,
giveaway = giveaway ,
giveaway_winners = giveaway_winners ,
giveaway_completed = giveaway_completed ,
2025-04-12 23:29:48 +03:00
paid_message_price_changed = paid_message_price_changed ,
2025-08-17 19:07:58 +03:00
suggested_post_approved = suggested_post_approved ,
suggested_post_approval_failed = suggested_post_approval_failed ,
suggested_post_declined = suggested_post_declined ,
suggested_post_paid = suggested_post_paid ,
suggested_post_refunded = suggested_post_refunded ,
2023-08-04 00:30:27 +03:00
video_chat_scheduled = video_chat_scheduled ,
video_chat_started = video_chat_started ,
video_chat_ended = video_chat_ended ,
video_chat_participants_invited = video_chat_participants_invited ,
web_app_data = web_app_data ,
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
forward_date = forward_date ,
forward_from = forward_from ,
forward_from_chat = forward_from_chat ,
forward_from_message_id = forward_from_message_id ,
forward_sender_name = forward_sender_name ,
forward_signature = forward_signature ,
user_shared = user_shared ,
2023-08-04 00:30:27 +03:00
* * __pydantic_kwargs ,
)
2019-12-11 18:03:39 +02:00
@property
2020-03-18 17:04:11 +03:00
def content_type ( self ) - > str :
2019-12-11 18:03:39 +02:00
if self . text :
return ContentType . TEXT
if self . audio :
return ContentType . AUDIO
if self . animation :
return ContentType . ANIMATION
if self . document :
return ContentType . DOCUMENT
if self . game :
return ContentType . GAME
if self . photo :
return ContentType . PHOTO
if self . sticker :
return ContentType . STICKER
if self . video :
return ContentType . VIDEO
if self . video_note :
return ContentType . VIDEO_NOTE
if self . voice :
return ContentType . VOICE
2025-07-05 03:02:44 +03:00
if self . checklist :
return ContentType . CHECKLIST
2019-12-11 18:03:39 +02:00
if self . contact :
return ContentType . CONTACT
if self . venue :
return ContentType . VENUE
if self . location :
return ContentType . LOCATION
if self . new_chat_members :
return ContentType . NEW_CHAT_MEMBERS
if self . left_chat_member :
return ContentType . LEFT_CHAT_MEMBER
2026-02-10 23:43:52 +02:00
if self . chat_owner_left :
return ContentType . CHAT_OWNER_LEFT
if self . chat_owner_changed :
return ContentType . CHAT_OWNER_CHANGED
2019-12-11 18:03:39 +02:00
if self . invoice :
return ContentType . INVOICE
if self . successful_payment :
return ContentType . SUCCESSFUL_PAYMENT
2023-12-31 01:40:44 +02:00
if self . users_shared :
return ContentType . USERS_SHARED
2019-12-11 18:03:39 +02:00
if self . connected_website :
return ContentType . CONNECTED_WEBSITE
if self . migrate_from_chat_id :
return ContentType . MIGRATE_FROM_CHAT_ID
if self . migrate_to_chat_id :
return ContentType . MIGRATE_TO_CHAT_ID
if self . pinned_message :
return ContentType . PINNED_MESSAGE
if self . new_chat_title :
return ContentType . NEW_CHAT_TITLE
if self . new_chat_photo :
return ContentType . NEW_CHAT_PHOTO
if self . delete_chat_photo :
return ContentType . DELETE_CHAT_PHOTO
if self . group_chat_created :
return ContentType . GROUP_CHAT_CREATED
2022-05-13 23:52:13 +03:00
if self . supergroup_chat_created :
return ContentType . SUPERGROUP_CHAT_CREATED
if self . channel_chat_created :
return ContentType . CHANNEL_CHAT_CREATED
2024-07-06 20:31:49 +03:00
if self . paid_media :
return ContentType . PAID_MEDIA
2019-12-11 18:03:39 +02:00
if self . passport_data :
return ContentType . PASSPORT_DATA
2022-05-13 23:52:13 +03:00
if self . proximity_alert_triggered :
return ContentType . PROXIMITY_ALERT_TRIGGERED
2019-12-11 18:03:39 +02:00
if self . poll :
return ContentType . POLL
2020-04-12 20:27:32 +03:00
if self . dice :
return ContentType . DICE
2021-05-11 23:04:32 +03:00
if self . message_auto_delete_timer_changed :
return ContentType . MESSAGE_AUTO_DELETE_TIMER_CHANGED
2022-11-06 14:28:21 +02:00
if self . forum_topic_created :
return ContentType . FORUM_TOPIC_CREATED
2023-04-16 22:41:49 +03:00
if self . forum_topic_edited :
return ContentType . FORUM_TOPIC_EDITED
2022-11-06 14:28:21 +02:00
if self . forum_topic_closed :
return ContentType . FORUM_TOPIC_CLOSED
if self . forum_topic_reopened :
return ContentType . FORUM_TOPIC_REOPENED
2023-12-31 01:40:44 +02:00
if self . general_forum_topic_hidden :
return ContentType . GENERAL_FORUM_TOPIC_HIDDEN
if self . general_forum_topic_unhidden :
return ContentType . GENERAL_FORUM_TOPIC_UNHIDDEN
if self . giveaway_created :
return ContentType . GIVEAWAY_CREATED
if self . giveaway :
return ContentType . GIVEAWAY
if self . giveaway_completed :
return ContentType . GIVEAWAY_COMPLETED
if self . giveaway_winners :
return ContentType . GIVEAWAY_WINNERS
2022-04-19 22:03:24 +03:00
if self . video_chat_scheduled :
return ContentType . VIDEO_CHAT_SCHEDULED
if self . video_chat_started :
return ContentType . VIDEO_CHAT_STARTED
if self . video_chat_ended :
return ContentType . VIDEO_CHAT_ENDED
if self . video_chat_participants_invited :
return ContentType . VIDEO_CHAT_PARTICIPANTS_INVITED
if self . web_app_data :
return ContentType . WEB_APP_DATA
2023-08-13 18:05:04 +03:00
if self . user_shared :
return ContentType . USER_SHARED
if self . chat_shared :
return ContentType . CHAT_SHARED
2023-08-18 20:18:05 +03:00
if self . story :
return ContentType . STORY
2023-12-31 01:40:44 +02:00
if self . write_access_allowed :
return ContentType . WRITE_ACCESS_ALLOWED
2024-05-06 23:27:54 +03:00
if self . chat_background_set :
return ContentType . CHAT_BACKGROUND_SET
2024-02-16 23:44:35 +02:00
if self . boost_added :
return ContentType . BOOST_ADDED
2025-07-05 03:02:44 +03:00
if self . checklist_tasks_done :
return ContentType . CHECKLIST_TASKS_DONE
if self . checklist_tasks_added :
return ContentType . CHECKLIST_TASKS_ADDED
if self . direct_message_price_changed :
return ContentType . DIRECT_MESSAGE_PRICE_CHANGED
2024-07-07 15:46:17 +03:00
if self . refunded_payment :
return ContentType . REFUNDED_PAYMENT
2025-04-12 23:29:48 +03:00
if self . gift :
return ContentType . GIFT
if self . unique_gift :
return ContentType . UNIQUE_GIFT
2026-01-02 01:45:35 +02:00
if self . gift_upgrade_sent :
return ContentType . GIFT_UPGRADE_SENT
2025-04-12 23:29:48 +03:00
if self . paid_message_price_changed :
return ContentType . PAID_MESSAGE_PRICE_CHANGED
2025-08-17 19:07:58 +03:00
if self . suggested_post_approved :
return ContentType . SUGGESTED_POST_APPROVED
if self . suggested_post_approval_failed :
return ContentType . SUGGESTED_POST_APPROVAL_FAILED
if self . suggested_post_declined :
return ContentType . SUGGESTED_POST_DECLINED
if self . suggested_post_paid :
return ContentType . SUGGESTED_POST_PAID
if self . suggested_post_refunded :
return ContentType . SUGGESTED_POST_REFUNDED
2019-12-11 18:03:39 +02:00
return ContentType . UNKNOWN
2021-09-23 23:45:22 +03:00
def _unparse_entities ( self , text_decoration : TextDecoration ) - > str :
2022-04-16 19:07:32 +03:00
text = self . text or self . caption or " "
entities = self . entities or self . caption_entities or [ ]
2021-09-23 23:45:22 +03:00
return text_decoration . unparse ( text = text , entities = entities )
@property
def html_text ( self ) - > str :
return self . _unparse_entities ( html_decoration )
@property
def md_text ( self ) - > str :
return self . _unparse_entities ( markdown_decoration )
2024-07-13 04:03:49 +03:00
def as_reply_parameters (
self ,
2026-01-02 02:50:46 +02:00
allow_sending_without_reply : bool | Default | None = Default (
2024-07-13 04:03:49 +03:00
" allow_sending_without_reply "
) ,
2026-01-02 02:50:46 +02:00
quote : str | None = None ,
quote_parse_mode : str | Default | None = Default ( " parse_mode " ) ,
quote_entities : list [ MessageEntity ] | None = None ,
quote_position : int | None = None ,
2024-07-13 04:03:49 +03:00
) - > ReplyParameters :
return ReplyParameters (
message_id = self . message_id ,
chat_id = self . chat . id ,
allow_sending_without_reply = allow_sending_without_reply ,
quote = quote ,
quote_parse_mode = quote_parse_mode ,
quote_entities = quote_entities ,
quote_position = quote_position ,
)
2020-01-26 02:34:57 +02:00
def reply_animation (
self ,
2025-03-08 02:19:57 +02:00
animation : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
duration : int | None = None ,
width : int | None = None ,
height : int | None = None ,
thumbnail : InputFile | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | Default | None = Default ( " show_caption_above_media " ) ,
has_spoiler : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendAnimation :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_animation . SendAnimation `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send animation files ( GIF or H .264 / MPEG - 4 AVC video without sound ) . On success , the sent : class : ` 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
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param duration : Duration of sent animation in seconds
: param width : Animation width
: param height : Animation height
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2022-12-04 03:05:49 +02:00
: param caption : Animation caption ( may also be used when resending animation by * file_id * ) , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the animation caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
2024-05-31 20:07:11 +03:00
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media
2022-12-30 22:44:25 +02:00
: param has_spoiler : Pass : code : ` True ` if the animation needs to be covered with a spoiler animation
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_animation . SendAnimation `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendAnimation
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendAnimation (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
animation = animation ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
duration = duration ,
width = width ,
height = height ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2024-05-31 20:07:11 +03:00
show_caption_above_media = show_caption_above_media ,
2022-12-30 22:44:25 +02:00
has_spoiler = has_spoiler ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_animation (
self ,
2025-03-08 02:19:57 +02:00
animation : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
duration : int | None = None ,
width : int | None = None ,
height : int | None = None ,
thumbnail : InputFile | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | Default | None = Default ( " show_caption_above_media " ) ,
has_spoiler : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendAnimation :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_animation . SendAnimation `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send animation files ( GIF or H .264 / MPEG - 4 AVC video without sound ) . On success , the sent : class : ` 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
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param duration : Duration of sent animation in seconds
: param width : Animation width
: param height : Animation height
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2022-12-04 03:05:49 +02:00
: param caption : Animation caption ( may also be used when resending animation by * file_id * ) , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the animation caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
2024-05-31 20:07:11 +03:00
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media
2022-12-30 22:44:25 +02:00
: param has_spoiler : Pass : code : ` True ` if the animation needs to be covered with a spoiler animation
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_animation . SendAnimation `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendAnimation
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendAnimation (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
animation = animation ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
duration = duration ,
width = width ,
height = height ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2024-05-31 20:07:11 +03:00
show_caption_above_media = show_caption_above_media ,
2022-12-30 22:44:25 +02:00
has_spoiler = has_spoiler ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_audio (
self ,
2025-03-08 02:19:57 +02:00
audio : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
duration : int | None = None ,
performer : str | None = None ,
title : str | None = None ,
thumbnail : InputFile | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendAudio :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_audio . SendAudio `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
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 : class : ` 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 : class : ` aiogram . methods . send_voice . SendVoice ` method instead .
Source : https : / / core . telegram . org / bots / api #sendaudio
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param caption : Audio caption , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the audio caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
: param duration : Duration of the audio in seconds
: param performer : Performer
: param title : Track name
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_audio . SendAudio `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendAudio
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendAudio (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
audio = audio ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2020-01-26 02:34:57 +02:00
duration = duration ,
performer = performer ,
title = title ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_audio (
self ,
2025-03-08 02:19:57 +02:00
audio : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
duration : int | None = None ,
performer : str | None = None ,
title : str | None = None ,
thumbnail : InputFile | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendAudio :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_audio . SendAudio `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
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 : class : ` 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 : class : ` aiogram . methods . send_voice . SendVoice ` method instead .
Source : https : / / core . telegram . org / bots / api #sendaudio
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param caption : Audio caption , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the audio caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
: param duration : Duration of the audio in seconds
: param performer : Performer
: param title : Track name
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_audio . SendAudio `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendAudio
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendAudio (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
audio = audio ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2020-01-26 02:34:57 +02:00
duration = duration ,
performer = performer ,
title = title ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_contact (
self ,
phone_number : str ,
first_name : str ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
last_name : str | None = None ,
vcard : str | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendContact :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_contact . SendContact `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send phone contacts . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendcontact
: param phone_number : Contact ' s phone number
: param first_name : Contact ' s first name
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param last_name : Contact ' s last name
: param vcard : Additional data about the contact in the form of a ` vCard < https : / / en . wikipedia . org / wiki / VCard > ` _ , 0 - 2048 bytes
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_contact . SendContact `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendContact
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendContact (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
phone_number = phone_number ,
first_name = first_name ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
last_name = last_name ,
vcard = vcard ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_contact (
self ,
phone_number : str ,
first_name : str ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
last_name : str | None = None ,
vcard : str | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendContact :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_contact . SendContact `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send phone contacts . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendcontact
: param phone_number : Contact ' s phone number
: param first_name : Contact ' s first name
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param last_name : Contact ' s last name
: param vcard : Additional data about the contact in the form of a ` vCard < https : / / en . wikipedia . org / wiki / VCard > ` _ , 0 - 2048 bytes
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_contact . SendContact `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendContact
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendContact (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
phone_number = phone_number ,
first_name = first_name ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
last_name = last_name ,
vcard = vcard ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_document (
self ,
2025-03-08 02:19:57 +02:00
document : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
thumbnail : InputFile | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
disable_content_type_detection : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendDocument :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_document . SendDocument `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send general files . On success , the sent : class : ` 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
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2022-12-04 03:05:49 +02:00
: param caption : Document caption ( may also be used when resending documents by * file_id * ) , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the document caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
: param disable_content_type_detection : Disables automatic server - side content type detection for files uploaded using multipart / form - data
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_document . SendDocument `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendDocument
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendDocument (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
document = document ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
disable_content_type_detection = disable_content_type_detection ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_document (
self ,
2025-03-08 02:19:57 +02:00
document : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
thumbnail : InputFile | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
disable_content_type_detection : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendDocument :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_document . SendDocument `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send general files . On success , the sent : class : ` 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
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2022-12-04 03:05:49 +02:00
: param caption : Document caption ( may also be used when resending documents by * file_id * ) , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the document caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
: param disable_content_type_detection : Disables automatic server - side content type detection for files uploaded using multipart / form - data
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_document . SendDocument `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendDocument
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendDocument (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
document = document ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
disable_content_type_detection = disable_content_type_detection ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_game (
self ,
game_short_name : str ,
2026-01-02 02:50:46 +02:00
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
reply_markup : InlineKeyboardMarkup | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendGame :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_game . SendGame `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send a game . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendgame
: param game_short_name : Short name of the game , serves as the unique identifier for the game . Set up your games via ` @BotFather < https : / / t . me / botfather > ` _ .
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2024-05-06 23:27:54 +03:00
: param reply_markup : A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_game . SendGame `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendGame
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendGame (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
game_short_name = game_short_name ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_game (
self ,
game_short_name : str ,
2026-01-02 02:50:46 +02:00
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : InlineKeyboardMarkup | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendGame :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_game . SendGame `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send a game . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendgame
: param game_short_name : Short name of the game , serves as the unique identifier for the game . Set up your games via ` @BotFather < https : / / t . me / botfather > ` _ .
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_game . SendGame `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendGame
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendGame (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
game_short_name = game_short_name ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_invoice (
self ,
title : str ,
description : str ,
payload : str ,
currency : str ,
2024-11-02 16:13:45 +02:00
prices : list [ LabeledPrice ] ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
provider_token : str | None = None ,
max_tip_amount : int | None = None ,
suggested_tip_amounts : list [ int ] | None = None ,
start_parameter : str | None = None ,
provider_data : str | None = None ,
photo_url : str | None = None ,
photo_size : int | None = None ,
photo_width : int | None = None ,
photo_height : int | None = None ,
need_name : bool | None = None ,
need_phone_number : bool | None = None ,
need_email : bool | None = None ,
need_shipping_address : bool | None = None ,
send_phone_number_to_provider : bool | None = None ,
send_email_to_provider : bool | None = None ,
is_flexible : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : InlineKeyboardMarkup | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendInvoice :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_invoice . SendInvoice `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send invoices . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendinvoice
2020-01-26 02:34:57 +02:00
2022-10-30 13:28:52 +01:00
: param title : Product name , 1 - 32 characters
: param description : Product description , 1 - 255 characters
2024-09-08 04:01:18 +03:00
: param payload : Bot - defined invoice payload , 1 - 128 bytes . This will not be displayed to the user , use it for your internal processes .
2024-05-31 20:07:11 +03:00
: param currency : Three - letter ISO 4217 currency code , see ` more on currencies < https : / / core . telegram . org / bots / payments #supported-currencies>`_. Pass 'XTR' for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param prices : Price breakdown , a JSON - serialized list of components ( e . g . product price , tax , discount , delivery cost , delivery tax , bonus , etc . ) . Must contain exactly one item for payments in ` Telegram Stars < https : / / t . me / BotNews / 90 > ` _ .
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2024-05-31 20:07:11 +03:00
: param provider_token : Payment provider token , obtained via ` @BotFather < https : / / t . me / botfather > ` _ . Pass an empty string for payments in ` Telegram Stars < https : / / t . me / BotNews / 90 > ` _ .
: param 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 : code : ` US $ 1.45 ` pass : code : ` max_tip_amount = 145 ` . See the * exp * parameter in ` currencies . json < https : / / core . telegram . org / bots / payments / currencies . json > ` _ , it shows the number of digits past the decimal point for each currency ( 2 for the majority of currencies ) . Defaults to 0. Not supported for payments in ` Telegram Stars < https : / / t . me / BotNews / 90 > ` _ .
2022-10-30 13:28:52 +01:00
: param 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 * .
: param 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
: param 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 .
: param 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 .
: param photo_size : Photo size in bytes
: param photo_width : Photo width
: param photo_height : Photo height
2024-05-31 20:07:11 +03:00
: param need_name : Pass : code : ` True ` if you require the user ' s full name to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param need_phone_number : Pass : code : ` True ` if you require the user ' s phone number to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param need_email : Pass : code : ` True ` if you require the user ' s email address to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param need_shipping_address : Pass : code : ` True ` if you require the user ' s shipping address to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param send_phone_number_to_provider : Pass : code : ` True ` if the user ' s phone number should be sent to the provider. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param send_email_to_provider : Pass : code : ` True ` if the user ' s email address should be sent to the provider. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param is_flexible : Pass : code : ` True ` if the final price depends on the shipping method . Ignored for payments in ` Telegram Stars < https : / / t . me / BotNews / 90 > ` _ .
2022-10-30 13:28:52 +01:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2022-12-04 03:05:49 +02:00
: param reply_markup : A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button.
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_invoice . SendInvoice `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendInvoice
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendInvoice (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
title = title ,
description = description ,
payload = payload ,
currency = currency ,
prices = prices ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2024-05-31 20:07:11 +03:00
provider_token = provider_token ,
2022-10-30 13:28:52 +01:00
max_tip_amount = max_tip_amount ,
suggested_tip_amounts = suggested_tip_amounts ,
start_parameter = start_parameter ,
2020-01-26 02:34:57 +02:00
provider_data = provider_data ,
photo_url = photo_url ,
photo_size = photo_size ,
photo_width = photo_width ,
photo_height = photo_height ,
need_name = need_name ,
need_phone_number = need_phone_number ,
need_email = need_email ,
need_shipping_address = need_shipping_address ,
send_phone_number_to_provider = send_phone_number_to_provider ,
send_email_to_provider = send_email_to_provider ,
is_flexible = is_flexible ,
disable_notification = disable_notification ,
2022-10-30 13:28:52 +01:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_invoice (
self ,
title : str ,
description : str ,
payload : str ,
currency : str ,
2024-11-02 16:13:45 +02:00
prices : list [ LabeledPrice ] ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
provider_token : str | None = None ,
max_tip_amount : int | None = None ,
suggested_tip_amounts : list [ int ] | None = None ,
start_parameter : str | None = None ,
provider_data : str | None = None ,
photo_url : str | None = None ,
photo_size : int | None = None ,
photo_width : int | None = None ,
photo_height : int | None = None ,
need_name : bool | None = None ,
need_phone_number : bool | None = None ,
need_email : bool | None = None ,
need_shipping_address : bool | None = None ,
send_phone_number_to_provider : bool | None = None ,
send_email_to_provider : bool | None = None ,
is_flexible : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : InlineKeyboardMarkup | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendInvoice :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_invoice . SendInvoice `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send invoices . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendinvoice
2020-01-26 02:34:57 +02:00
2022-10-30 13:28:52 +01:00
: param title : Product name , 1 - 32 characters
: param description : Product description , 1 - 255 characters
2024-09-08 04:01:18 +03:00
: param payload : Bot - defined invoice payload , 1 - 128 bytes . This will not be displayed to the user , use it for your internal processes .
2024-05-31 20:07:11 +03:00
: param currency : Three - letter ISO 4217 currency code , see ` more on currencies < https : / / core . telegram . org / bots / payments #supported-currencies>`_. Pass 'XTR' for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param prices : Price breakdown , a JSON - serialized list of components ( e . g . product price , tax , discount , delivery cost , delivery tax , bonus , etc . ) . Must contain exactly one item for payments in ` Telegram Stars < https : / / t . me / BotNews / 90 > ` _ .
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2024-05-31 20:07:11 +03:00
: param provider_token : Payment provider token , obtained via ` @BotFather < https : / / t . me / botfather > ` _ . Pass an empty string for payments in ` Telegram Stars < https : / / t . me / BotNews / 90 > ` _ .
: param 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 : code : ` US $ 1.45 ` pass : code : ` max_tip_amount = 145 ` . See the * exp * parameter in ` currencies . json < https : / / core . telegram . org / bots / payments / currencies . json > ` _ , it shows the number of digits past the decimal point for each currency ( 2 for the majority of currencies ) . Defaults to 0. Not supported for payments in ` Telegram Stars < https : / / t . me / BotNews / 90 > ` _ .
2022-10-30 13:28:52 +01:00
: param 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 * .
: param 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
: param 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 .
: param 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 .
: param photo_size : Photo size in bytes
: param photo_width : Photo width
: param photo_height : Photo height
2024-05-31 20:07:11 +03:00
: param need_name : Pass : code : ` True ` if you require the user ' s full name to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param need_phone_number : Pass : code : ` True ` if you require the user ' s phone number to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param need_email : Pass : code : ` True ` if you require the user ' s email address to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param need_shipping_address : Pass : code : ` True ` if you require the user ' s shipping address to complete the order. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param send_phone_number_to_provider : Pass : code : ` True ` if the user ' s phone number should be sent to the provider. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param send_email_to_provider : Pass : code : ` True ` if the user ' s email address should be sent to the provider. Ignored for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
: param is_flexible : Pass : code : ` True ` if the final price depends on the shipping method . Ignored for payments in ` Telegram Stars < https : / / t . me / BotNews / 90 > ` _ .
2022-10-30 13:28:52 +01:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2022-12-04 03:05:49 +02:00
: param reply_markup : A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button.
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_invoice . SendInvoice `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendInvoice
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendInvoice (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
title = title ,
description = description ,
payload = payload ,
currency = currency ,
prices = prices ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2024-05-31 20:07:11 +03:00
provider_token = provider_token ,
2022-10-30 13:28:52 +01:00
max_tip_amount = max_tip_amount ,
suggested_tip_amounts = suggested_tip_amounts ,
start_parameter = start_parameter ,
2020-01-26 02:34:57 +02:00
provider_data = provider_data ,
photo_url = photo_url ,
photo_size = photo_size ,
photo_width = photo_width ,
photo_height = photo_height ,
need_name = need_name ,
need_phone_number = need_phone_number ,
need_email = need_email ,
need_shipping_address = need_shipping_address ,
send_phone_number_to_provider = send_phone_number_to_provider ,
send_email_to_provider = send_email_to_provider ,
is_flexible = is_flexible ,
disable_notification = disable_notification ,
2022-10-30 13:28:52 +01:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_location (
self ,
latitude : float ,
longitude : float ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
horizontal_accuracy : float | None = None ,
live_period : int | None = None ,
heading : int | None = None ,
proximity_alert_radius : int | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendLocation :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_location . SendLocation `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send point on the map . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendlocation
: param latitude : Latitude of the location
: param longitude : Longitude of the location
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param horizontal_accuracy : The radius of uncertainty for the location , measured in meters ; 0 - 1500
2024-05-06 23:27:54 +03:00
: param live_period : Period in seconds during which the location will be updated ( see ` Live Locations < https : / / telegram . org / blog / live - locations > ` _ , should be between 60 and 86400 , or 0x7FFFFFFF for live locations that can be edited indefinitely .
2022-12-04 03:05:49 +02:00
: param heading : For live locations , a direction in which the user is moving , in degrees . Must be between 1 and 360 if specified .
: param 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 .
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_location . SendLocation `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendLocation
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendLocation (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
latitude = latitude ,
longitude = longitude ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2022-12-04 03:05:49 +02:00
horizontal_accuracy = horizontal_accuracy ,
2020-01-26 02:34:57 +02:00
live_period = live_period ,
2022-12-04 03:05:49 +02:00
heading = heading ,
proximity_alert_radius = proximity_alert_radius ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_location (
self ,
latitude : float ,
longitude : float ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
horizontal_accuracy : float | None = None ,
live_period : int | None = None ,
heading : int | None = None ,
proximity_alert_radius : int | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendLocation :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_location . SendLocation `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send point on the map . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendlocation
: param latitude : Latitude of the location
: param longitude : Longitude of the location
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param horizontal_accuracy : The radius of uncertainty for the location , measured in meters ; 0 - 1500
2024-05-06 23:27:54 +03:00
: param live_period : Period in seconds during which the location will be updated ( see ` Live Locations < https : / / telegram . org / blog / live - locations > ` _ , should be between 60 and 86400 , or 0x7FFFFFFF for live locations that can be edited indefinitely .
2022-12-04 03:05:49 +02:00
: param heading : For live locations , a direction in which the user is moving , in degrees . Must be between 1 and 360 if specified .
: param 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 .
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_location . SendLocation `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendLocation
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendLocation (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
latitude = latitude ,
longitude = longitude ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2022-12-04 03:05:49 +02:00
horizontal_accuracy = horizontal_accuracy ,
2020-01-26 02:34:57 +02:00
live_period = live_period ,
2022-12-04 03:05:49 +02:00
heading = heading ,
proximity_alert_radius = proximity_alert_radius ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_media_group (
self ,
2025-03-08 02:19:57 +02:00
media : list [ MediaUnion ] ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendMediaGroup :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_media_group . SendMediaGroup `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
2025-08-17 19:07:58 +03:00
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 : class : ` aiogram . types . message . Message ` objects that were sent is returned .
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #sendmediagroup
: param media : A JSON - serialized array describing messages to be sent , must include 2 - 10 items
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the messages will be sent ; required if the messages are sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends messages ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent messages from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2022-12-04 03:05:49 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: return : instance of method : class : ` aiogram . methods . send_media_group . SendMediaGroup `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendMediaGroup
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendMediaGroup (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
media = media ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2021-08-17 00:07:38 +03:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_media_group (
self ,
2025-03-08 02:19:57 +02:00
media : list [ MediaUnion ] ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
reply_parameters : ReplyParameters | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendMediaGroup :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_media_group . SendMediaGroup `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
2025-08-17 19:07:58 +03:00
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 : class : ` aiogram . types . message . Message ` objects that were sent is returned .
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #sendmediagroup
: param media : A JSON - serialized array describing messages to be sent , must include 2 - 10 items
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the messages will be sent ; required if the messages are sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends messages ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent messages from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2022-12-04 03:05:49 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2023-12-31 01:40:44 +02:00
: param reply_to_message_id : If the messages are a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_media_group . SendMediaGroup `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendMediaGroup
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendMediaGroup (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
media = media ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2022-12-04 03:05:49 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2023-12-31 01:40:44 +02:00
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply (
self ,
text : str ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
entities : list [ MessageEntity ] | None = None ,
link_preview_options : LinkPreviewOptions | Default | None = Default ( " link_preview " ) ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
disable_web_page_preview : bool | Default | None = Default ( " link_preview_is_disabled " ) ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendMessage :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_message . SendMessage `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send text messages . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendmessage
: param text : Text of the message to be sent , 1 - 4096 characters after entities parsing
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param parse_mode : Mode for parsing entities in the message text . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param entities : A JSON - serialized list of special entities that appear in message text , which can be specified instead of * parse_mode *
2023-12-31 01:40:44 +02:00
: param link_preview_options : Link preview generation options for the message
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param disable_web_page_preview : Disables link previews for links in this message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_message . SendMessage `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendMessage
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendMessage (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
text = text ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
entities = entities ,
2023-12-31 01:40:44 +02:00
link_preview_options = link_preview_options ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
disable_web_page_preview = disable_web_page_preview ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer (
self ,
text : str ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
entities : list [ MessageEntity ] | None = None ,
link_preview_options : LinkPreviewOptions | Default | None = Default ( " link_preview " ) ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
disable_web_page_preview : bool | Default | None = Default ( " link_preview_is_disabled " ) ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendMessage :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_message . SendMessage `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send text messages . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendmessage
: param text : Text of the message to be sent , 1 - 4096 characters after entities parsing
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param parse_mode : Mode for parsing entities in the message text . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param entities : A JSON - serialized list of special entities that appear in message text , which can be specified instead of * parse_mode *
2023-12-31 01:40:44 +02:00
: param link_preview_options : Link preview generation options for the message
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param disable_web_page_preview : Disables link previews for links in this message
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_message . SendMessage `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendMessage
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendMessage (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
text = text ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
entities = entities ,
2023-12-31 01:40:44 +02:00
link_preview_options = link_preview_options ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
disable_web_page_preview = disable_web_page_preview ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_photo (
self ,
2025-03-08 02:19:57 +02:00
photo : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | Default | None = Default ( " show_caption_above_media " ) ,
has_spoiler : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendPhoto :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_photo . SendPhoto `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send photos . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendphoto
: param 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. :ref:`More information on Sending Files » <sending-files>`
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param caption : Photo caption ( may also be used when resending photos by * file_id * ) , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the photo caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
2024-05-31 20:07:11 +03:00
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media
2022-12-30 22:44:25 +02:00
: param has_spoiler : Pass : code : ` True ` if the photo needs to be covered with a spoiler animation
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_photo . SendPhoto `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendPhoto
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendPhoto (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
photo = photo ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2024-05-31 20:07:11 +03:00
show_caption_above_media = show_caption_above_media ,
2022-12-30 22:44:25 +02:00
has_spoiler = has_spoiler ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_photo (
self ,
2025-03-08 02:19:57 +02:00
photo : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | Default | None = Default ( " show_caption_above_media " ) ,
has_spoiler : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendPhoto :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_photo . SendPhoto `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send photos . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendphoto
: param 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. :ref:`More information on Sending Files » <sending-files>`
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param caption : Photo caption ( may also be used when resending photos by * file_id * ) , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the photo caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
2024-05-31 20:07:11 +03:00
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media
2022-12-30 22:44:25 +02:00
: param has_spoiler : Pass : code : ` True ` if the photo needs to be covered with a spoiler animation
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_photo . SendPhoto `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendPhoto
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendPhoto (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
photo = photo ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2024-05-31 20:07:11 +03:00
show_caption_above_media = show_caption_above_media ,
2022-12-30 22:44:25 +02:00
has_spoiler = has_spoiler ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_poll (
self ,
question : str ,
2025-03-08 02:19:57 +02:00
options : list [ InputPollOptionUnion ] ,
2026-01-02 02:50:46 +02:00
question_parse_mode : str | Default | None = Default ( " parse_mode " ) ,
question_entities : list [ MessageEntity ] | None = None ,
is_anonymous : bool | None = None ,
type : str | None = None ,
allows_multiple_answers : bool | None = None ,
correct_option_id : int | None = None ,
explanation : str | None = None ,
explanation_parse_mode : str | Default | None = Default ( " parse_mode " ) ,
explanation_entities : list [ MessageEntity ] | None = None ,
open_period : int | None = None ,
close_date : DateTimeUnion | None = None ,
is_closed : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendPoll :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_poll . SendPoll `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send a native poll . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendpoll
: param question : Poll question , 1 - 300 characters
2025-07-05 03:02:44 +03:00
: param options : A JSON - serialized list of 2 - 12 answer options
2024-05-06 23:27:54 +03:00
: param question_parse_mode : Mode for parsing entities in the question . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details. Currently, only custom emoji entities are allowed
: param question_entities : A JSON - serialized list of special entities that appear in the poll question . It can be specified instead of * question_parse_mode *
2022-12-04 03:05:49 +02:00
: param is_anonymous : : code : ` True ` , if the poll needs to be anonymous , defaults to : code : ` True `
: param type : Poll type , ' quiz ' or ' regular ' , defaults to ' regular '
: param allows_multiple_answers : : code : ` True ` , if the poll allows multiple answers , ignored for polls in quiz mode , defaults to : code : ` False `
: param correct_option_id : 0 - based identifier of the correct answer option , required for polls in quiz mode
: param 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
: param explanation_parse_mode : Mode for parsing entities in the explanation . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
2024-05-06 23:27:54 +03:00
: param explanation_entities : A JSON - serialized list of special entities that appear in the poll explanation . It can be specified instead of * explanation_parse_mode *
2022-12-04 03:05:49 +02:00
: param open_period : Amount of time in seconds the poll will be active after creation , 5 - 600. Can ' t be used together with *close_date*.
: param 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*.
: param is_closed : Pass : code : ` True ` if the poll needs to be immediately closed . This can be useful for poll preview .
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_poll . SendPoll `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendPoll
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendPoll (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
question = question ,
options = options ,
2024-05-06 23:27:54 +03:00
question_parse_mode = question_parse_mode ,
question_entities = question_entities ,
2020-01-26 02:34:57 +02:00
is_anonymous = is_anonymous ,
type = type ,
allows_multiple_answers = allows_multiple_answers ,
correct_option_id = correct_option_id ,
2020-05-02 23:01:32 +03:00
explanation = explanation ,
explanation_parse_mode = explanation_parse_mode ,
2022-12-04 03:05:49 +02:00
explanation_entities = explanation_entities ,
2020-05-02 23:01:32 +03:00
open_period = open_period ,
close_date = close_date ,
2020-01-26 02:34:57 +02:00
is_closed = is_closed ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_poll (
self ,
question : str ,
2025-03-08 02:19:57 +02:00
options : list [ InputPollOptionUnion ] ,
2026-01-02 02:50:46 +02:00
question_parse_mode : str | Default | None = Default ( " parse_mode " ) ,
question_entities : list [ MessageEntity ] | None = None ,
is_anonymous : bool | None = None ,
type : str | None = None ,
allows_multiple_answers : bool | None = None ,
correct_option_id : int | None = None ,
explanation : str | None = None ,
explanation_parse_mode : str | Default | None = Default ( " parse_mode " ) ,
explanation_entities : list [ MessageEntity ] | None = None ,
open_period : int | None = None ,
close_date : DateTimeUnion | None = None ,
is_closed : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendPoll :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_poll . SendPoll `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send a native poll . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendpoll
: param question : Poll question , 1 - 300 characters
2025-07-05 03:02:44 +03:00
: param options : A JSON - serialized list of 2 - 12 answer options
2024-05-06 23:27:54 +03:00
: param question_parse_mode : Mode for parsing entities in the question . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details. Currently, only custom emoji entities are allowed
: param question_entities : A JSON - serialized list of special entities that appear in the poll question . It can be specified instead of * question_parse_mode *
2022-12-04 03:05:49 +02:00
: param is_anonymous : : code : ` True ` , if the poll needs to be anonymous , defaults to : code : ` True `
: param type : Poll type , ' quiz ' or ' regular ' , defaults to ' regular '
: param allows_multiple_answers : : code : ` True ` , if the poll allows multiple answers , ignored for polls in quiz mode , defaults to : code : ` False `
: param correct_option_id : 0 - based identifier of the correct answer option , required for polls in quiz mode
: param 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
: param explanation_parse_mode : Mode for parsing entities in the explanation . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
2024-05-06 23:27:54 +03:00
: param explanation_entities : A JSON - serialized list of special entities that appear in the poll explanation . It can be specified instead of * explanation_parse_mode *
2022-12-04 03:05:49 +02:00
: param open_period : Amount of time in seconds the poll will be active after creation , 5 - 600. Can ' t be used together with *close_date*.
: param 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*.
: param is_closed : Pass : code : ` True ` if the poll needs to be immediately closed . This can be useful for poll preview .
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_poll . SendPoll `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendPoll
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendPoll (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
question = question ,
options = options ,
2024-05-06 23:27:54 +03:00
question_parse_mode = question_parse_mode ,
question_entities = question_entities ,
2020-01-26 02:34:57 +02:00
is_anonymous = is_anonymous ,
type = type ,
allows_multiple_answers = allows_multiple_answers ,
correct_option_id = correct_option_id ,
2020-05-02 23:01:32 +03:00
explanation = explanation ,
explanation_parse_mode = explanation_parse_mode ,
2022-12-04 03:05:49 +02:00
explanation_entities = explanation_entities ,
2020-05-02 23:01:32 +03:00
open_period = open_period ,
close_date = close_date ,
2020-01-26 02:34:57 +02:00
is_closed = is_closed ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-04-11 23:06:41 +03:00
def reply_dice (
self ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
emoji : str | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-04-11 23:06:41 +03:00
) - > SendDice :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_dice . SendDice `
will automatically fill method attributes :
2020-04-11 23:06:41 +03:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send an animated emoji that will display a random value . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #senddice
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param 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 ' 🎲 '
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_dice . SendDice `
2020-04-11 23:06:41 +03:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendDice
2020-04-11 23:06:41 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-04-11 23:06:41 +03:00
return SendDice (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-05-02 23:01:32 +03:00
emoji = emoji ,
2020-04-11 23:06:41 +03:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-04-11 23:06:41 +03:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-04-11 23:06:41 +03:00
def answer_dice (
self ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
emoji : str | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-04-11 23:06:41 +03:00
) - > SendDice :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_dice . SendDice `
will automatically fill method attributes :
2020-04-11 23:06:41 +03:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send an animated emoji that will display a random value . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #senddice
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param 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 ' 🎲 '
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_dice . SendDice `
2020-04-11 23:06:41 +03:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendDice
2020-04-11 23:06:41 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-04-11 23:06:41 +03:00
return SendDice (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-05-02 23:01:32 +03:00
emoji = emoji ,
2020-04-11 23:06:41 +03:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-04-11 23:06:41 +03:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_sticker (
self ,
2025-03-08 02:19:57 +02:00
sticker : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
emoji : str | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendSticker :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_sticker . SendSticker `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send static . WEBP , ` animated < https : / / telegram . org / blog / animated - stickers > ` _ . TGS , or ` video < https : / / telegram . org / blog / video - stickers - better - reactions > ` _ . WEBM stickers . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendsticker
2024-04-22 13:48:49 +03:00
: param 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 sticker from the Internet , or upload a new . WEBP , . TGS , or . WEBM sticker using multipart / form - data . : ref : ` More information on Sending Files » < sending - files > ` . Video and animated stickers can ' t be sent via an HTTP URL.
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2023-03-11 02:17:47 +02:00
: param emoji : Emoji associated with the sticker ; only for just uploaded stickers
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_sticker . SendSticker `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendSticker
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendSticker (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
sticker = sticker ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2023-03-11 02:17:47 +02:00
emoji = emoji ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_sticker (
self ,
2025-03-08 02:19:57 +02:00
sticker : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
emoji : str | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendSticker :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_sticker . SendSticker `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send static . WEBP , ` animated < https : / / telegram . org / blog / animated - stickers > ` _ . TGS , or ` video < https : / / telegram . org / blog / video - stickers - better - reactions > ` _ . WEBM stickers . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendsticker
2024-04-22 13:48:49 +03:00
: param 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 sticker from the Internet , or upload a new . WEBP , . TGS , or . WEBM sticker using multipart / form - data . : ref : ` More information on Sending Files » < sending - files > ` . Video and animated stickers can ' t be sent via an HTTP URL.
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2023-03-11 02:17:47 +02:00
: param emoji : Emoji associated with the sticker ; only for just uploaded stickers
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_sticker . SendSticker `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendSticker
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendSticker (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
sticker = sticker ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2023-03-11 02:17:47 +02:00
emoji = emoji ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_venue (
self ,
latitude : float ,
longitude : float ,
title : str ,
address : str ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
foursquare_id : str | None = None ,
foursquare_type : str | None = None ,
google_place_id : str | None = None ,
google_place_type : str | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendVenue :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_venue . SendVenue `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send information about a venue . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendvenue
: param latitude : Latitude of the venue
: param longitude : Longitude of the venue
: param title : Name of the venue
: param address : Address of the venue
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param foursquare_id : Foursquare identifier of the venue
: param foursquare_type : Foursquare type of the venue , if known . ( For example , ' arts_entertainment/default ' , ' arts_entertainment/aquarium ' or ' food/icecream ' . )
: param google_place_id : Google Places identifier of the venue
: param google_place_type : Google Places type of the venue . ( See ` supported types < https : / / developers . google . com / places / web - service / supported_types > ` _ . )
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_venue . SendVenue `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendVenue
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendVenue (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
latitude = latitude ,
longitude = longitude ,
title = title ,
address = address ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
foursquare_id = foursquare_id ,
foursquare_type = foursquare_type ,
2022-12-04 03:05:49 +02:00
google_place_id = google_place_id ,
google_place_type = google_place_type ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_venue (
self ,
latitude : float ,
longitude : float ,
title : str ,
address : str ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
foursquare_id : str | None = None ,
foursquare_type : str | None = None ,
google_place_id : str | None = None ,
google_place_type : str | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendVenue :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_venue . SendVenue `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send information about a venue . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendvenue
: param latitude : Latitude of the venue
: param longitude : Longitude of the venue
: param title : Name of the venue
: param address : Address of the venue
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param foursquare_id : Foursquare identifier of the venue
: param foursquare_type : Foursquare type of the venue , if known . ( For example , ' arts_entertainment/default ' , ' arts_entertainment/aquarium ' or ' food/icecream ' . )
: param google_place_id : Google Places identifier of the venue
: param google_place_type : Google Places type of the venue . ( See ` supported types < https : / / developers . google . com / places / web - service / supported_types > ` _ . )
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_venue . SendVenue `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendVenue
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendVenue (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
latitude = latitude ,
longitude = longitude ,
title = title ,
address = address ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
foursquare_id = foursquare_id ,
foursquare_type = foursquare_type ,
2022-12-04 03:05:49 +02:00
google_place_id = google_place_id ,
google_place_type = google_place_type ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_video (
self ,
2025-03-08 02:19:57 +02:00
video : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
duration : int | None = None ,
width : int | None = None ,
height : int | None = None ,
thumbnail : InputFile | None = None ,
cover : InputFileUnion | None = None ,
start_timestamp : DateTimeUnion | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | Default | None = Default ( " show_caption_above_media " ) ,
has_spoiler : bool | None = None ,
supports_streaming : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendVideo :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_video . SendVideo `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
Use this method to send video files , Telegram clients support MPEG4 videos ( other formats may be sent as : class : ` aiogram . types . document . Document ` ) . On success , the sent : class : ` 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
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param duration : Duration of sent video in seconds
: param width : Video width
: param height : Video height
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2025-02-16 22:37:18 +02:00
: param cover : Cover for the video in the message . Pass a file_id to send a file that exists on the Telegram servers ( recommended ) , pass an HTTP URL for Telegram to get a file from the Internet , or pass ' attach://<file_attach_name> ' to upload a new one using multipart / form - data under < file_attach_name > name . : ref : ` More information on Sending Files » < sending - files > `
: param start_timestamp : Start timestamp for the video in the message
2022-12-04 03:05:49 +02:00
: param caption : Video caption ( may also be used when resending videos by * file_id * ) , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the video caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
2024-05-31 20:07:11 +03:00
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media
2022-12-30 22:44:25 +02:00
: param has_spoiler : Pass : code : ` True ` if the video needs to be covered with a spoiler animation
2022-12-04 03:05:49 +02:00
: param supports_streaming : Pass : code : ` True ` if the uploaded video is suitable for streaming
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_video . SendVideo `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendVideo
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendVideo (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
video = video ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
duration = duration ,
width = width ,
height = height ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2025-02-16 22:37:18 +02:00
cover = cover ,
start_timestamp = start_timestamp ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2024-05-31 20:07:11 +03:00
show_caption_above_media = show_caption_above_media ,
2022-12-30 22:44:25 +02:00
has_spoiler = has_spoiler ,
2020-01-26 02:34:57 +02:00
supports_streaming = supports_streaming ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_video (
self ,
2025-03-08 02:19:57 +02:00
video : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
duration : int | None = None ,
width : int | None = None ,
height : int | None = None ,
thumbnail : InputFile | None = None ,
cover : InputFileUnion | None = None ,
start_timestamp : DateTimeUnion | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | Default | None = Default ( " show_caption_above_media " ) ,
has_spoiler : bool | None = None ,
supports_streaming : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendVideo :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_video . SendVideo `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
Use this method to send video files , Telegram clients support MPEG4 videos ( other formats may be sent as : class : ` aiogram . types . document . Document ` ) . On success , the sent : class : ` 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
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param duration : Duration of sent video in seconds
: param width : Video width
: param height : Video height
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2025-02-16 22:37:18 +02:00
: param cover : Cover for the video in the message . Pass a file_id to send a file that exists on the Telegram servers ( recommended ) , pass an HTTP URL for Telegram to get a file from the Internet , or pass ' attach://<file_attach_name> ' to upload a new one using multipart / form - data under < file_attach_name > name . : ref : ` More information on Sending Files » < sending - files > `
: param start_timestamp : Start timestamp for the video in the message
2022-12-04 03:05:49 +02:00
: param caption : Video caption ( may also be used when resending videos by * file_id * ) , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the video caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
2024-05-31 20:07:11 +03:00
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media
2022-12-30 22:44:25 +02:00
: param has_spoiler : Pass : code : ` True ` if the video needs to be covered with a spoiler animation
2022-12-04 03:05:49 +02:00
: param supports_streaming : Pass : code : ` True ` if the uploaded video is suitable for streaming
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_video . SendVideo `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendVideo
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendVideo (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
video = video ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
duration = duration ,
width = width ,
height = height ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2025-02-16 22:37:18 +02:00
cover = cover ,
start_timestamp = start_timestamp ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2024-05-31 20:07:11 +03:00
show_caption_above_media = show_caption_above_media ,
2022-12-30 22:44:25 +02:00
has_spoiler = has_spoiler ,
2020-01-26 02:34:57 +02:00
supports_streaming = supports_streaming ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_video_note (
self ,
2025-03-08 02:19:57 +02:00
video_note : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
duration : int | None = None ,
length : int | None = None ,
thumbnail : InputFile | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendVideoNote :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_video_note . SendVideoNote `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
As of ` v .4 .0 < https : / / telegram . org / blog / video - messages - and - telescope > ` _ , Telegram clients support rounded square MPEG4 videos of up to 1 minute long . Use this method to send video messages . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendvideonote
: param 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 . : ref : ` More information on Sending Files » < sending - files > ` . Sending video notes by a URL is currently unsupported
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param duration : Duration of sent video in seconds
: param length : Video width and height , i . e . diameter of the video message
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_video_note . SendVideoNote `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendVideoNote
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendVideoNote (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
video_note = video_note ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
duration = duration ,
length = length ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_video_note (
self ,
2025-03-08 02:19:57 +02:00
video_note : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
duration : int | None = None ,
length : int | None = None ,
thumbnail : InputFile | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendVideoNote :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_video_note . SendVideoNote `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
As of ` v .4 .0 < https : / / telegram . org / blog / video - messages - and - telescope > ` _ , Telegram clients support rounded square MPEG4 videos of up to 1 minute long . Use this method to send video messages . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
Source : https : / / core . telegram . org / bots / api #sendvideonote
: param 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 . : ref : ` More information on Sending Files » < sending - files > ` . Sending video notes by a URL is currently unsupported
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param duration : Duration of sent video in seconds
: param length : Video width and height , i . e . diameter of the video message
2023-03-11 02:17:47 +02:00
: param thumbnail : 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 > . : ref : ` More information on Sending Files » < sending - files > `
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_video_note . SendVideoNote `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendVideoNote
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendVideoNote (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
video_note = video_note ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
duration = duration ,
length = length ,
2023-03-11 02:17:47 +02:00
thumbnail = thumbnail ,
2020-01-26 02:34:57 +02:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def reply_voice (
self ,
2025-03-08 02:19:57 +02:00
voice : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
duration : int | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendVoice :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_voice . SendVoice `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2024-07-13 04:03:49 +03:00
- : code : ` reply_parameters `
2022-12-04 03:05:49 +02:00
2024-05-06 23:27:54 +03:00
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 , or in . MP3 format , or in . M4A format ( other formats may be sent as : class : ` aiogram . types . audio . Audio ` or : class : ` aiogram . types . document . Document ` ) . On success , the sent : class : ` 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 .
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #sendvoice
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param caption : Voice message caption , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the voice message caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
: param duration : Duration of the voice message in seconds
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_voice . SendVoice `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendVoice
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendVoice (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2024-07-13 04:03:49 +03:00
reply_parameters = self . as_reply_parameters ( ) ,
2020-01-26 02:34:57 +02:00
voice = voice ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2020-01-26 02:34:57 +02:00
duration = duration ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
def answer_voice (
self ,
2025-03-08 02:19:57 +02:00
voice : InputFileUnion ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
duration : int | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2020-01-26 02:34:57 +02:00
) - > SendVoice :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . send_voice . SendVoice `
will automatically fill method attributes :
2020-01-26 02:34:57 +02:00
2022-12-04 03:05:49 +02:00
- : code : ` chat_id `
- : code : ` message_thread_id `
2024-04-22 13:48:49 +03:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
2024-05-06 23:27:54 +03:00
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 , or in . MP3 format , or in . M4A format ( other formats may be sent as : class : ` aiogram . types . audio . Audio ` or : class : ` aiogram . types . document . Document ` ) . On success , the sent : class : ` 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 .
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #sendvoice
: param 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 . : ref : ` More information on Sending Files » < sending - files > `
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2022-12-04 03:05:49 +02:00
: param caption : Voice message caption , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the voice message caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
: param duration : Duration of the voice message in seconds
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2024-05-31 20:07:11 +03:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; for private chats only
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . send_voice . SendVoice `
2020-01-26 02:34:57 +02:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendVoice
2020-01-26 02:34:57 +02:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2020-01-26 02:34:57 +02:00
return SendVoice (
chat_id = self . chat . id ,
2022-12-04 03:05:49 +02:00
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
2024-04-22 13:48:49 +03:00
business_connection_id = self . business_connection_id ,
2020-01-26 02:34:57 +02:00
voice = voice ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2020-01-26 02:34:57 +02:00
caption = caption ,
parse_mode = parse_mode ,
2022-12-04 03:05:49 +02:00
caption_entities = caption_entities ,
2020-01-26 02:34:57 +02:00
duration = duration ,
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2024-05-31 20:07:11 +03:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2020-01-26 02:34:57 +02:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2020-01-26 02:34:57 +02:00
2023-01-12 02:49:58 +02:00
def send_copy ( # noqa: C901
2021-05-11 23:04:32 +03:00
self : Message ,
2026-01-02 02:50:46 +02:00
chat_id : ChatIdUnion ,
disable_notification : bool | None = None ,
reply_to_message_id : int | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : InlineKeyboardMarkup | ReplyKeyboardMarkup | None = None ,
allow_sending_without_reply : bool | None = None ,
message_thread_id : int | None = None ,
business_connection_id : str | None = None ,
parse_mode : str | None = None ,
message_effect_id : str | None = None ,
) - > (
ForwardMessage
| SendAnimation
| SendAudio
| SendContact
| SendDocument
| SendLocation
| SendMessage
| SendPhoto
| SendPoll
| SendDice
| SendSticker
| SendVenue
| SendVideo
| SendVideoNote
| SendVoice
) :
2021-05-11 23:04:32 +03:00
"""
2023-08-04 00:30:27 +03:00
Send copy of a message .
2021-05-11 23:04:32 +03:00
Is similar to : meth : ` aiogram . client . bot . Bot . copy_message `
but returning the sent message instead of : class : ` aiogram . types . message_id . MessageId `
. . note : :
2023-08-04 00:30:27 +03:00
This method doesn ' t use the API method named `copyMessage` and
2021-05-11 23:04:32 +03:00
historically implemented before the similar method is added to API
: param chat_id :
: param disable_notification :
: param reply_to_message_id :
2024-02-03 18:25:14 +01:00
: param reply_parameters :
2021-05-11 23:04:32 +03:00
: param reply_markup :
2022-11-08 08:06:57 +10:00
: param allow_sending_without_reply :
2022-11-06 14:28:21 +02:00
: param message_thread_id :
2024-05-31 20:07:11 +03:00
: param business_connection_id :
2023-10-08 18:56:30 +03:00
: param parse_mode :
2024-05-31 20:07:11 +03:00
: param message_effect_id :
2021-05-11 23:04:32 +03:00
: return :
"""
from . . methods import (
2023-08-28 22:32:11 +03:00
ForwardMessage ,
2021-05-11 23:04:32 +03:00
SendAnimation ,
SendAudio ,
SendContact ,
SendDice ,
SendDocument ,
SendLocation ,
SendMessage ,
SendPhoto ,
SendPoll ,
SendSticker ,
SendVenue ,
SendVideo ,
SendVideoNote ,
SendVoice ,
)
2026-01-02 02:50:46 +02:00
kwargs : dict [ str , Any ] = {
2021-05-11 23:04:32 +03:00
" chat_id " : chat_id ,
" reply_markup " : reply_markup or self . reply_markup ,
" disable_notification " : disable_notification ,
" reply_to_message_id " : reply_to_message_id ,
2024-02-03 18:25:14 +01:00
" reply_parameters " : reply_parameters ,
2022-11-06 14:28:21 +02:00
" message_thread_id " : message_thread_id ,
2024-04-22 13:48:49 +03:00
" business_connection_id " : business_connection_id ,
2022-11-06 14:28:21 +02:00
" allow_sending_without_reply " : allow_sending_without_reply ,
2023-10-08 18:56:30 +03:00
# when sending a copy, we don't need any parse mode
# because all entities are already prepared
" parse_mode " : parse_mode ,
2024-05-31 20:07:11 +03:00
" message_effect_id " : message_effect_id or self . effect_id ,
2021-05-11 23:04:32 +03:00
}
if self . text :
2023-08-26 23:24:51 +03:00
return SendMessage (
text = self . text ,
entities = self . entities ,
* * kwargs ,
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . audio :
2021-05-11 23:04:32 +03:00
return SendAudio (
audio = self . audio . file_id ,
2023-08-04 00:30:27 +03:00
caption = self . caption ,
2021-05-11 23:04:32 +03:00
title = self . audio . title ,
performer = self . audio . performer ,
duration = self . audio . duration ,
2023-08-04 00:30:27 +03:00
caption_entities = self . caption_entities ,
2021-05-11 23:04:32 +03:00
* * kwargs ,
2023-07-29 22:59:43 +03:00
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . animation :
2021-05-11 23:04:32 +03:00
return SendAnimation (
2023-08-04 00:30:27 +03:00
animation = self . animation . file_id ,
caption = self . caption ,
caption_entities = self . caption_entities ,
* * kwargs ,
2023-07-29 22:59:43 +03:00
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . document :
2021-05-11 23:04:32 +03:00
return SendDocument (
2023-08-04 00:30:27 +03:00
document = self . document . file_id ,
caption = self . caption ,
caption_entities = self . caption_entities ,
* * kwargs ,
2023-07-29 22:59:43 +03:00
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . photo :
2021-05-11 23:04:32 +03:00
return SendPhoto (
2023-08-04 00:30:27 +03:00
photo = self . photo [ - 1 ] . file_id ,
caption = self . caption ,
caption_entities = self . caption_entities ,
* * kwargs ,
2023-07-29 22:59:43 +03:00
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . sticker :
2023-08-26 23:24:51 +03:00
return SendSticker (
sticker = self . sticker . file_id ,
* * kwargs ,
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . video :
2021-05-11 23:04:32 +03:00
return SendVideo (
2023-08-04 00:30:27 +03:00
video = self . video . file_id ,
caption = self . caption ,
caption_entities = self . caption_entities ,
* * kwargs ,
2023-07-29 22:59:43 +03:00
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . video_note :
2023-08-26 23:24:51 +03:00
return SendVideoNote (
video_note = self . video_note . file_id ,
* * kwargs ,
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . voice :
2023-08-26 23:24:51 +03:00
return SendVoice (
voice = self . voice . file_id ,
* * kwargs ,
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . contact :
2021-05-11 23:04:32 +03:00
return SendContact (
phone_number = self . contact . phone_number ,
first_name = self . contact . first_name ,
last_name = self . contact . last_name ,
vcard = self . contact . vcard ,
* * kwargs ,
2023-07-29 22:59:43 +03:00
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . venue :
2021-05-11 23:04:32 +03:00
return SendVenue (
latitude = self . venue . location . latitude ,
longitude = self . venue . location . longitude ,
title = self . venue . title ,
address = self . venue . address ,
foursquare_id = self . venue . foursquare_id ,
foursquare_type = self . venue . foursquare_type ,
* * kwargs ,
2023-07-29 22:59:43 +03:00
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . location :
2021-05-11 23:04:32 +03:00
return SendLocation (
2023-08-26 23:24:51 +03:00
latitude = self . location . latitude ,
longitude = self . location . longitude ,
* * kwargs ,
2023-07-29 22:59:43 +03:00
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . poll :
2024-07-06 20:31:49 +03:00
from . input_poll_option import InputPollOption
2021-05-11 23:04:32 +03:00
return SendPoll (
question = self . poll . question ,
2024-05-06 23:27:54 +03:00
options = [
InputPollOption (
text = option . text ,
voter_count = option . voter_count ,
text_entities = option . text_entities ,
text_parse_mode = None ,
)
for option in self . poll . options
] ,
2021-05-11 23:04:32 +03:00
* * kwargs ,
2023-07-29 22:59:43 +03:00
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
if self . dice : # Dice value can't be controlled
2023-08-26 23:24:51 +03:00
return SendDice (
* * kwargs ,
) . as_ ( self . _bot )
2023-08-28 22:32:11 +03:00
if self . story :
return ForwardMessage (
from_chat_id = self . chat . id ,
message_id = self . message_id ,
* * kwargs ,
) . as_ ( self . _bot )
2023-01-12 02:49:58 +02:00
raise TypeError ( " This type of message can ' t be copied. " )
2021-05-11 23:04:32 +03:00
def copy_to (
self ,
2025-03-08 02:19:57 +02:00
chat_id : ChatIdUnion ,
2026-01-02 02:50:46 +02:00
message_thread_id : int | None = None ,
direct_messages_topic_id : int | None = None ,
video_start_timestamp : DateTimeUnion | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | Default | None = Default ( " show_caption_above_media " ) ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
allow_paid_broadcast : bool | None = None ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
allow_sending_without_reply : bool | None = None ,
reply_to_message_id : int | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2021-05-11 23:04:32 +03:00
) - > CopyMessage :
"""
2022-12-04 03:05:49 +02:00
Shortcut for method : class : ` aiogram . methods . copy_message . CopyMessage `
will automatically fill method attributes :
2021-05-11 23:04:32 +03:00
2022-12-04 03:05:49 +02:00
- : code : ` from_chat_id `
- : code : ` message_id `
2024-07-06 20:31:49 +03:00
Use this method to copy messages of any kind . Service messages , paid media messages , giveaway messages , giveaway winners messages , and invoice messages can ' t be copied. A quiz :class:`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 :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn ' t have a link to the original message . Returns the : class : ` aiogram . types . message_id . MessageId ` of the sent message on success .
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #copymessage
: param chat_id : Unique identifier for the target chat or username of the target channel ( in the format : code : ` @channelusername ` )
2026-01-02 01:45:35 +02:00
: param message_thread_id : Unique identifier for the target message thread ( topic ) of a forum ; for forum supergroups and private chats of bots with forum topic mode enabled only
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2025-02-16 22:37:18 +02:00
: param video_start_timestamp : New start timestamp for the copied video in the message
2022-12-04 03:05:49 +02:00
: param caption : New caption for media , 0 - 1024 characters after entities parsing . If not specified , the original caption is kept
: param parse_mode : Mode for parsing entities in the new caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the new caption , which can be specified instead of * parse_mode *
2024-05-31 20:07:11 +03:00
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media . Ignored if a new caption isn ' t specified.
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2026-01-02 01:45:35 +02:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; only available when copying to private chats
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2023-12-31 01:40:44 +02:00
: param reply_parameters : Description of the message to reply to
2024-05-06 23:27:54 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
2023-12-31 01:40:44 +02:00
: param allow_sending_without_reply : Pass : code : ` True ` if the message should be sent even if the specified replied - to message is not found
: param reply_to_message_id : If the message is a reply , ID of the original message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . copy_message . CopyMessage `
2021-05-11 23:04:32 +03:00
"""
2022-12-04 03:05:49 +02:00
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import CopyMessage
2021-05-11 23:04:32 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2021-05-11 23:04:32 +03:00
return CopyMessage (
from_chat_id = self . chat . id ,
message_id = self . message_id ,
2022-12-04 03:05:49 +02:00
chat_id = chat_id ,
message_thread_id = message_thread_id ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2025-02-16 22:37:18 +02:00
video_start_timestamp = video_start_timestamp ,
2021-05-11 23:04:32 +03:00
caption = caption ,
parse_mode = parse_mode ,
caption_entities = caption_entities ,
2024-05-31 20:07:11 +03:00
show_caption_above_media = show_caption_above_media ,
2021-05-11 23:04:32 +03:00
disable_notification = disable_notification ,
2022-12-04 03:05:49 +02:00
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2026-01-02 01:45:35 +02:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2023-12-31 01:40:44 +02:00
reply_parameters = reply_parameters ,
2021-05-11 23:04:32 +03:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
allow_sending_without_reply = allow_sending_without_reply ,
reply_to_message_id = reply_to_message_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2021-05-11 23:04:32 +03:00
2021-05-25 00:56:44 +03:00
def edit_text (
self ,
text : str ,
2026-01-02 02:50:46 +02:00
inline_message_id : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
entities : list [ MessageEntity ] | None = None ,
link_preview_options : LinkPreviewOptions | Default | None = Default ( " link_preview " ) ,
reply_markup : InlineKeyboardMarkup | None = None ,
disable_web_page_preview : bool | Default | None = Default ( " link_preview_is_disabled " ) ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2021-05-25 00:56:44 +03:00
) - > EditMessageText :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . edit_message_text . EditMessageText `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
2024-06-19 00:54:22 +03:00
Use this method to edit text and ` game < https : / / core . telegram . org / bots / api #games>`_ messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #editmessagetext
: param text : New text of the message , 1 - 4096 characters after entities parsing
: param inline_message_id : Required if * chat_id * and * message_id * are not specified . Identifier of the inline message
: param parse_mode : Mode for parsing entities in the message text . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param entities : A JSON - serialized list of special entities that appear in message text , which can be specified instead of * parse_mode *
2023-12-31 01:40:44 +02:00
: param link_preview_options : Link preview generation options for the message
2022-12-04 03:05:49 +02:00
: param reply_markup : A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_.
2023-12-31 01:40:44 +02:00
: param disable_web_page_preview : Disables link previews for links in this message
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . edit_message_text . EditMessageText `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import EditMessageText
2021-05-25 00:56:44 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2021-05-25 00:56:44 +03:00
return EditMessageText (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2021-05-25 00:56:44 +03:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2021-05-25 00:56:44 +03:00
text = text ,
2022-12-04 03:05:49 +02:00
inline_message_id = inline_message_id ,
2021-05-25 00:56:44 +03:00
parse_mode = parse_mode ,
entities = entities ,
2023-12-31 01:40:44 +02:00
link_preview_options = link_preview_options ,
2021-05-25 00:56:44 +03:00
reply_markup = reply_markup ,
2023-12-31 01:40:44 +02:00
disable_web_page_preview = disable_web_page_preview ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2021-05-25 00:56:44 +03:00
2022-10-22 00:29:29 +03:00
def forward (
self ,
2025-03-08 02:19:57 +02:00
chat_id : ChatIdUnion ,
2026-01-02 02:50:46 +02:00
message_thread_id : int | None = None ,
direct_messages_topic_id : int | None = None ,
video_start_timestamp : DateTimeUnion | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | Default | None = Default ( " protect_content " ) ,
message_effect_id : str | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2022-10-22 00:29:29 +03:00
) - > ForwardMessage :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . forward_message . ForwardMessage `
will automatically fill method attributes :
- : code : ` from_chat_id `
- : code : ` message_id `
2023-12-31 01:40:44 +02:00
Use this method to forward messages of any kind . Service messages and messages with protected content can ' t be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned.
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #forwardmessage
: param chat_id : Unique identifier for the target chat or username of the target channel ( in the format : code : ` @channelusername ` )
2026-01-02 01:45:35 +02:00
: param message_thread_id : Unique identifier for the target message thread ( topic ) of a forum ; for forum supergroups and private chats of bots with forum topic mode enabled only
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be forwarded ; required if the message is forwarded to a direct messages chat
2025-02-16 22:37:18 +02:00
: param video_start_timestamp : New start timestamp for the forwarded video in the message
2022-12-04 03:05:49 +02:00
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the forwarded message from forwarding and saving
2026-01-02 01:45:35 +02:00
: param message_effect_id : Unique identifier of the message effect to be added to the message ; only available when forwarding to private chats
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only
2022-12-04 03:05:49 +02:00
: return : instance of method : class : ` aiogram . methods . forward_message . ForwardMessage `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import ForwardMessage
2022-10-22 00:29:29 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2022-10-22 00:29:29 +03:00
return ForwardMessage (
from_chat_id = self . chat . id ,
message_id = self . message_id ,
2022-12-04 03:05:49 +02:00
chat_id = chat_id ,
message_thread_id = message_thread_id ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2025-02-16 22:37:18 +02:00
video_start_timestamp = video_start_timestamp ,
2022-10-22 00:29:29 +03:00
disable_notification = disable_notification ,
protect_content = protect_content ,
2026-01-02 01:45:35 +02:00
message_effect_id = message_effect_id ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2022-10-22 00:29:29 +03:00
def edit_media (
self ,
2025-03-08 02:19:57 +02:00
media : InputMediaUnion ,
2026-01-02 02:50:46 +02:00
inline_message_id : str | None = None ,
reply_markup : InlineKeyboardMarkup | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2022-10-22 00:29:29 +03:00
) - > EditMessageMedia :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . edit_message_media . EditMessageMedia `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
2024-11-02 16:13:45 +02:00
Use this method to edit animation , audio , document , photo , or video messages , or to add media to text 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 :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #editmessagemedia
: param media : A JSON - serialized object for a new media content of the message
: param inline_message_id : Required if * chat_id * and * message_id * are not specified . Identifier of the inline message
: param reply_markup : A JSON - serialized object for a new ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_.
: return : instance of method : class : ` aiogram . methods . edit_message_media . EditMessageMedia `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import EditMessageMedia
2022-10-22 00:29:29 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2022-10-22 00:29:29 +03:00
return EditMessageMedia (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2022-10-22 00:29:29 +03:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2022-12-04 03:05:49 +02:00
media = media ,
inline_message_id = inline_message_id ,
2022-10-22 00:29:29 +03:00
reply_markup = reply_markup ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2022-10-22 00:29:29 +03:00
2021-08-17 00:11:47 +03:00
def edit_reply_markup (
self ,
2026-01-02 02:50:46 +02:00
inline_message_id : str | None = None ,
reply_markup : InlineKeyboardMarkup | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2021-08-17 00:11:47 +03:00
) - > EditMessageReplyMarkup :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . edit_message_reply_markup . EditMessageReplyMarkup `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
2024-06-19 00:54:22 +03:00
Use this method to edit only the reply markup of messages . On success , if the edited message is not an inline message , the edited : class : ` aiogram . types . message . Message ` is returned , otherwise : code : ` True ` is returned . Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within * * 48 hours * * from the time they were sent .
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #editmessagereplymarkup
: param inline_message_id : Required if * chat_id * and * message_id * are not specified . Identifier of the inline message
: param reply_markup : A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_.
: return : instance of method : class : ` aiogram . methods . edit_message_reply_markup . EditMessageReplyMarkup `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import EditMessageReplyMarkup
2021-08-17 00:11:47 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2021-08-17 00:11:47 +03:00
return EditMessageReplyMarkup (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2021-08-17 00:11:47 +03:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2022-12-04 03:05:49 +02:00
inline_message_id = inline_message_id ,
2021-08-17 00:11:47 +03:00
reply_markup = reply_markup ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2021-08-17 00:11:47 +03:00
2023-08-02 23:28:50 +03:00
def delete_reply_markup (
self ,
2026-01-02 02:50:46 +02:00
inline_message_id : str | None = None ,
2023-08-02 23:28:50 +03:00
* * kwargs : Any ,
) - > EditMessageReplyMarkup :
"""
Shortcut for method : class : ` aiogram . methods . edit_message_reply_markup . EditMessageReplyMarkup `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2023-08-02 23:28:50 +03:00
- : code : ` reply_markup `
2024-06-19 00:54:22 +03:00
Use this method to edit only the reply markup of messages . On success , if the edited message is not an inline message , the edited : class : ` aiogram . types . message . Message ` is returned , otherwise : code : ` True ` is returned . Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within * * 48 hours * * from the time they were sent .
2023-08-02 23:28:50 +03:00
Source : https : / / core . telegram . org / bots / api #editmessagereplymarkup
: param inline_message_id : Required if * chat_id * and * message_id * are not specified . Identifier of the inline message
: return : instance of method : class : ` aiogram . methods . edit_message_reply_markup . EditMessageReplyMarkup `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import EditMessageReplyMarkup
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2023-08-02 23:28:50 +03:00
return EditMessageReplyMarkup (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2023-08-02 23:28:50 +03:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2023-08-02 23:28:50 +03:00
reply_markup = None ,
inline_message_id = inline_message_id ,
* * kwargs ,
) . as_ ( self . _bot )
2021-08-17 00:11:47 +03:00
2022-10-22 00:29:29 +03:00
def edit_live_location (
self ,
latitude : float ,
longitude : float ,
2026-01-02 02:50:46 +02:00
inline_message_id : str | None = None ,
live_period : int | None = None ,
horizontal_accuracy : float | None = None ,
heading : int | None = None ,
proximity_alert_radius : int | None = None ,
reply_markup : InlineKeyboardMarkup | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2022-10-22 00:29:29 +03:00
) - > EditMessageLiveLocation :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . edit_message_live_location . EditMessageLiveLocation `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
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 : class : ` aiogram . methods . stop_message_live_location . StopMessageLiveLocation ` . On success , if the edited message is not an inline message , the edited : class : ` aiogram . types . message . Message ` is returned , otherwise : code : ` True ` is returned .
Source : https : / / core . telegram . org / bots / api #editmessagelivelocation
: param latitude : Latitude of new location
: param longitude : Longitude of new location
: param inline_message_id : Required if * chat_id * and * message_id * are not specified . Identifier of the inline message
2024-05-06 23:27:54 +03:00
: param live_period : New period in seconds during which the location can be updated , starting from the message send date . If 0x7FFFFFFF is specified , then the location can be updated forever . Otherwise , the new value must not exceed the current * live_period * by more than a day , and the live location expiration date must remain within the next 90 days . If not specified , then * live_period * remains unchanged
2022-12-04 03:05:49 +02:00
: param horizontal_accuracy : The radius of uncertainty for the location , measured in meters ; 0 - 1500
: param heading : Direction in which the user is moving , in degrees . Must be between 1 and 360 if specified .
: param proximity_alert_radius : The maximum distance for proximity alerts about approaching another chat member , in meters . Must be between 1 and 100000 if specified .
: param reply_markup : A JSON - serialized object for a new ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_.
: return : instance of method : class : ` aiogram . methods . edit_message_live_location . EditMessageLiveLocation `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import EditMessageLiveLocation
2022-10-22 00:29:29 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2022-10-22 00:29:29 +03:00
return EditMessageLiveLocation (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2022-10-22 00:29:29 +03:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2022-12-04 03:05:49 +02:00
latitude = latitude ,
longitude = longitude ,
inline_message_id = inline_message_id ,
2024-05-06 23:27:54 +03:00
live_period = live_period ,
2022-10-22 00:29:29 +03:00
horizontal_accuracy = horizontal_accuracy ,
heading = heading ,
proximity_alert_radius = proximity_alert_radius ,
reply_markup = reply_markup ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2022-10-22 00:29:29 +03:00
def stop_live_location (
self ,
2026-01-02 02:50:46 +02:00
inline_message_id : str | None = None ,
reply_markup : InlineKeyboardMarkup | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2022-10-22 00:29:29 +03:00
) - > StopMessageLiveLocation :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . stop_message_live_location . StopMessageLiveLocation `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
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 : class : ` aiogram . types . message . Message ` is returned , otherwise : code : ` True ` is returned .
Source : https : / / core . telegram . org / bots / api #stopmessagelivelocation
: param inline_message_id : Required if * chat_id * and * message_id * are not specified . Identifier of the inline message
: param reply_markup : A JSON - serialized object for a new ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_.
: return : instance of method : class : ` aiogram . methods . stop_message_live_location . StopMessageLiveLocation `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import StopMessageLiveLocation
2022-10-22 00:29:29 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2022-10-22 00:29:29 +03:00
return StopMessageLiveLocation (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2022-10-22 00:29:29 +03:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2022-12-04 03:05:49 +02:00
inline_message_id = inline_message_id ,
2022-10-22 00:29:29 +03:00
reply_markup = reply_markup ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2022-10-22 00:29:29 +03:00
2021-05-25 00:56:44 +03:00
def edit_caption (
self ,
2026-01-02 02:50:46 +02:00
inline_message_id : str | None = None ,
caption : str | None = None ,
parse_mode : str | Default | None = Default ( " parse_mode " ) ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | Default | None = Default ( " show_caption_above_media " ) ,
reply_markup : InlineKeyboardMarkup | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2021-05-25 00:56:44 +03:00
) - > EditMessageCaption :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . edit_message_caption . EditMessageCaption `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
2024-06-19 00:54:22 +03:00
Use this method to edit captions of messages . On success , if the edited message is not an inline message , the edited : class : ` aiogram . types . message . Message ` is returned , otherwise : code : ` True ` is returned . Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within * * 48 hours * * from the time they were sent .
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #editmessagecaption
: param inline_message_id : Required if * chat_id * and * message_id * are not specified . Identifier of the inline message
: param caption : New caption of the message , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the message caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
2024-05-31 20:07:11 +03:00
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media . Supported only for animation , photo and video messages .
2022-12-04 03:05:49 +02:00
: param reply_markup : A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_.
: return : instance of method : class : ` aiogram . methods . edit_message_caption . EditMessageCaption `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import EditMessageCaption
2021-05-25 00:56:44 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2021-05-25 00:56:44 +03:00
return EditMessageCaption (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2021-05-25 00:56:44 +03:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2022-12-04 03:05:49 +02:00
inline_message_id = inline_message_id ,
2021-05-25 00:56:44 +03:00
caption = caption ,
parse_mode = parse_mode ,
caption_entities = caption_entities ,
2024-05-31 20:07:11 +03:00
show_caption_above_media = show_caption_above_media ,
2021-05-25 00:56:44 +03:00
reply_markup = reply_markup ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2021-05-25 00:56:44 +03:00
2022-11-06 14:28:21 +02:00
def delete (
self ,
* * kwargs : Any ,
) - > DeleteMessage :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . delete_message . DeleteMessage `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
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 .
2025-08-17 19:07:58 +03:00
- If the bot has * can_delete_messages * administrator right in a supergroup or a channel , it can delete any message there .
- If the bot has * can_manage_direct_messages * administrator right in a channel , it can delete any message in the corresponding direct messages chat .
2022-12-04 03:05:49 +02:00
Returns : code : ` True ` on success .
Source : https : / / core . telegram . org / bots / api #deletemessage
: return : instance of method : class : ` aiogram . methods . delete_message . DeleteMessage `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import DeleteMessage
2021-05-25 00:56:44 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2022-11-06 14:28:21 +02:00
return DeleteMessage (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2022-11-06 14:28:21 +02:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2021-05-25 00:56:44 +03:00
2022-10-22 00:29:29 +03:00
def pin (
self ,
2026-01-02 02:50:46 +02:00
disable_notification : bool | None = None ,
2022-11-06 14:28:21 +02:00
* * kwargs : Any ,
2022-10-22 00:29:29 +03:00
) - > PinChatMessage :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . pin_chat_message . PinChatMessage `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
2025-08-17 19:07:58 +03:00
Use this method to add a message to the list of pinned messages in a chat . In private chats and channel direct messages chats , all non - service messages can be pinned . Conversely , the bot must be an administrator with the ' can_pin_messages ' right or the ' can_edit_messages ' right to pin messages in groups and channels respectively . Returns : code : ` True ` on success .
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #pinchatmessage
: param disable_notification : Pass : code : ` 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 .
: return : instance of method : class : ` aiogram . methods . pin_chat_message . PinChatMessage `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import PinChatMessage
2022-10-22 00:29:29 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2022-10-22 00:29:29 +03:00
return PinChatMessage (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2022-10-22 00:29:29 +03:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2022-10-22 00:29:29 +03:00
disable_notification = disable_notification ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2022-10-22 00:29:29 +03:00
2022-11-06 14:28:21 +02:00
def unpin (
self ,
* * kwargs : Any ,
) - > UnpinChatMessage :
2022-12-04 03:05:49 +02:00
"""
Shortcut for method : class : ` aiogram . methods . unpin_chat_message . UnpinChatMessage `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2022-12-04 03:05:49 +02:00
2025-08-17 19:07:58 +03:00
Use this method to remove a message from the list of pinned messages in a chat . In private chats and channel direct messages chats , all messages can be unpinned . Conversely , the bot must be an administrator with the ' can_pin_messages ' right or the ' can_edit_messages ' right to unpin messages in groups and channels respectively . Returns : code : ` True ` on success .
2022-12-04 03:05:49 +02:00
Source : https : / / core . telegram . org / bots / api #unpinchatmessage
: return : instance of method : class : ` aiogram . methods . unpin_chat_message . UnpinChatMessage `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import UnpinChatMessage
2022-10-22 00:29:29 +03:00
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-08-04 00:30:27 +03:00
2022-10-22 00:29:29 +03:00
return UnpinChatMessage (
2023-08-04 00:30:27 +03:00
chat_id = self . chat . id ,
2022-10-22 00:29:29 +03:00
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2022-11-06 14:28:21 +02:00
* * kwargs ,
2023-07-11 23:17:26 +03:00
) . as_ ( self . _bot )
2022-10-22 00:29:29 +03:00
2026-01-02 02:50:46 +02:00
def get_url ( self , force_private : bool = False , include_thread_id : bool = False ) - > str | None :
2021-06-05 13:37:01 +03:00
"""
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
: param force_private : if set , a private URL is returned even for a public chat
2024-08-14 04:11:58 +05:00
: param include_thread_id : if set , adds chat thread id to URL and returns like https : / / t . me / username / thread_id / message_id
2021-06-05 13:37:01 +03:00
: return : string with full message URL
"""
2026-01-04 21:34:08 +02:00
if self . chat . type in { " private " , " group " } :
2021-06-05 13:37:01 +03:00
return None
2023-01-12 02:49:58 +02:00
chat_value = (
f " c/ { self . chat . shifted_id } "
if not self . chat . username or force_private
else self . chat . username
)
2021-06-05 13:37:01 +03:00
2024-08-14 04:11:58 +05:00
message_id_value = (
f " { self . message_thread_id } / { self . message_id } "
if include_thread_id and self . message_thread_id and self . is_topic_message
else f " { self . message_id } "
)
return f " https://t.me/ { chat_value } / { message_id_value } "
2023-12-31 01:40:44 +02:00
def react (
self ,
2026-01-02 02:50:46 +02:00
reaction : list [ ReactionTypeUnion ] | None = None ,
is_big : bool | None = None ,
2023-12-31 01:40:44 +02:00
* * kwargs : Any ,
) - > SetMessageReaction :
"""
Shortcut for method : class : ` aiogram . methods . set_message_reaction . SetMessageReaction `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_id `
2024-11-02 16:55:15 +02:00
- : code : ` business_connection_id `
2023-12-31 01:40:44 +02:00
2025-02-16 22:37:18 +02:00
Use this method to change the chosen reactions on a message . Service messages of some types can ' t be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can ' t use paid reactions . Returns : code : ` True ` on success .
2023-12-31 01:40:44 +02:00
Source : https : / / core . telegram . org / bots / api #setmessagereaction
2024-08-16 00:44:40 +03:00
: param reaction : A JSON - serialized list of reaction types to set on the message . Currently , as non - premium users , bots can set up to one reaction per message . A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators . Paid reactions can ' t be used by bots.
2023-12-31 01:40:44 +02:00
: param is_big : Pass : code : ` True ` to set the reaction with a big animation
: return : instance of method : class : ` aiogram . methods . set_message_reaction . SetMessageReaction `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SetMessageReaction
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2023-12-31 01:40:44 +02:00
return SetMessageReaction (
chat_id = self . chat . id ,
message_id = self . message_id ,
2024-11-02 16:55:15 +02:00
business_connection_id = self . business_connection_id ,
2023-12-31 01:40:44 +02:00
reaction = reaction ,
is_big = is_big ,
* * kwargs ,
) . as_ ( self . _bot )
2024-07-06 20:31:49 +03:00
def answer_paid_media (
self ,
star_count : int ,
2025-03-08 02:19:57 +02:00
media : list [ InputPaidMediaUnion ] ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
payload : str | None = None ,
caption : str | None = None ,
parse_mode : str | None = None ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | None = None ,
allow_paid_broadcast : bool | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_parameters : ReplyParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
2024-07-06 20:31:49 +03:00
* * kwargs : Any ,
) - > SendPaidMedia :
"""
Shortcut for method : class : ` aiogram . methods . send_paid_media . SendPaidMedia `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_thread_id `
- : code : ` business_connection_id `
2024-08-16 00:44:40 +03:00
Use this method to send paid media . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
2024-07-06 20:31:49 +03:00
Source : https : / / core . telegram . org / bots / api #sendpaidmedia
2026-01-02 01:45:35 +02:00
: param star_count : The number of Telegram Stars that must be paid to buy access to the media ; 1 - 25000
2024-07-06 20:31:49 +03:00
: param media : A JSON - serialized array describing the media to be sent ; up to 10 items
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2024-09-08 04:01:18 +03:00
: param payload : Bot - defined paid media payload , 0 - 128 bytes . This will not be displayed to the user , use it for your internal processes .
2024-07-06 20:31:49 +03:00
: param caption : Media caption , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the media caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-07-06 20:31:49 +03:00
: param reply_parameters : Description of the message to reply to
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
: return : instance of method : class : ` aiogram . methods . send_paid_media . SendPaidMedia `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendPaidMedia
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2024-07-06 20:31:49 +03:00
return SendPaidMedia (
chat_id = self . chat . id ,
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
business_connection_id = self . business_connection_id ,
star_count = star_count ,
media = media ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2024-09-08 04:01:18 +03:00
payload = payload ,
2024-07-06 20:31:49 +03:00
caption = caption ,
parse_mode = parse_mode ,
caption_entities = caption_entities ,
show_caption_above_media = show_caption_above_media ,
disable_notification = disable_notification ,
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2024-07-06 20:31:49 +03:00
reply_parameters = reply_parameters ,
reply_markup = reply_markup ,
* * kwargs ,
) . as_ ( self . _bot )
2024-07-13 04:03:49 +03:00
def reply_paid_media (
self ,
star_count : int ,
2025-03-08 02:19:57 +02:00
media : list [ InputPaidMediaUnion ] ,
2026-01-02 02:50:46 +02:00
direct_messages_topic_id : int | None = None ,
payload : str | None = None ,
caption : str | None = None ,
parse_mode : str | None = None ,
caption_entities : list [ MessageEntity ] | None = None ,
show_caption_above_media : bool | None = None ,
disable_notification : bool | None = None ,
protect_content : bool | None = None ,
allow_paid_broadcast : bool | None = None ,
suggested_post_parameters : SuggestedPostParameters | None = None ,
reply_markup : ReplyMarkupUnion | None = None ,
2024-07-13 04:03:49 +03:00
* * kwargs : Any ,
) - > SendPaidMedia :
"""
Shortcut for method : class : ` aiogram . methods . send_paid_media . SendPaidMedia `
will automatically fill method attributes :
- : code : ` chat_id `
- : code : ` message_thread_id `
- : code : ` business_connection_id `
- : code : ` reply_parameters `
2024-08-16 00:44:40 +03:00
Use this method to send paid media . On success , the sent : class : ` aiogram . types . message . Message ` is returned .
2024-07-13 04:03:49 +03:00
Source : https : / / core . telegram . org / bots / api #sendpaidmedia
2026-01-02 01:45:35 +02:00
: param star_count : The number of Telegram Stars that must be paid to buy access to the media ; 1 - 25000
2024-07-13 04:03:49 +03:00
: param media : A JSON - serialized array describing the media to be sent ; up to 10 items
2025-08-17 19:07:58 +03:00
: param direct_messages_topic_id : Identifier of the direct messages topic to which the message will be sent ; required if the message is sent to a direct messages chat
2024-09-08 04:01:18 +03:00
: param payload : Bot - defined paid media payload , 0 - 128 bytes . This will not be displayed to the user , use it for your internal processes .
2024-07-13 04:03:49 +03:00
: param caption : Media caption , 0 - 1024 characters after entities parsing
: param parse_mode : Mode for parsing entities in the media caption . See ` formatting options < https : / / core . telegram . org / bots / api #formatting-options>`_ for more details.
: param caption_entities : A JSON - serialized list of special entities that appear in the caption , which can be specified instead of * parse_mode *
: param show_caption_above_media : Pass : code : ` True ` , if the caption must be shown above the message media
: param disable_notification : Sends the message ` silently < https : / / telegram . org / blog / channels - 2 - 0 #silent-messages>`_. Users will receive a notification with no sound.
: param protect_content : Protects the contents of the sent message from forwarding and saving
2024-11-02 16:13:45 +02:00
: param allow_paid_broadcast : Pass : code : ` True ` to allow up to 1000 messages per second , ignoring ` broadcasting limits < https : / / core . telegram . org / bots / faq #how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
2025-08-17 19:07:58 +03:00
: param suggested_post_parameters : A JSON - serialized object containing the parameters of the suggested post to send ; for direct messages chats only . If the message is sent as a reply to another suggested post , then that suggested post is automatically declined .
2024-07-13 04:03:49 +03:00
: param reply_markup : Additional interface options . A JSON - serialized object for an ` inline keyboard < https : / / core . telegram . org / bots / features #inline-keyboards>`_, `custom reply keyboard <https://core.telegram.org/bots/features#keyboards>`_, instructions to remove a reply keyboard or to force a reply from the user
: return : instance of method : class : ` aiogram . methods . send_paid_media . SendPaidMedia `
"""
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
from aiogram . methods import SendPaidMedia
2026-01-04 21:34:08 +02:00
assert self . chat is not None , (
" This method can be used only if chat is present in the message. "
)
2024-07-13 04:03:49 +03:00
return SendPaidMedia (
chat_id = self . chat . id ,
message_thread_id = self . message_thread_id if self . is_topic_message else None ,
business_connection_id = self . business_connection_id ,
reply_parameters = self . as_reply_parameters ( ) ,
star_count = star_count ,
media = media ,
2025-08-17 19:07:58 +03:00
direct_messages_topic_id = direct_messages_topic_id ,
2024-09-08 04:01:18 +03:00
payload = payload ,
2024-07-13 04:03:49 +03:00
caption = caption ,
parse_mode = parse_mode ,
caption_entities = caption_entities ,
show_caption_above_media = show_caption_above_media ,
disable_notification = disable_notification ,
protect_content = protect_content ,
2024-11-02 16:13:45 +02:00
allow_paid_broadcast = allow_paid_broadcast ,
2025-08-17 19:07:58 +03:00
suggested_post_parameters = suggested_post_parameters ,
2024-07-13 04:03:49 +03:00
reply_markup = reply_markup ,
* * kwargs ,
) . as_ ( self . _bot )