Full support of Bot API 7.3 (#1480)

* Added full support of Bot API

* Added full support of Bot API

* Fixed tests

* Added changelog

* Bump version
This commit is contained in:
Alex Root Junior 2024-05-06 23:27:54 +03:00 committed by GitHub
parent 6d655330af
commit cf2980a9c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
137 changed files with 3422 additions and 929 deletions

View file

@ -1,2 +1,2 @@
__version__ = "3.5.0"
__api_version__ = "7.2"
__version__ = "3.6.0"
__api_version__ = "7.3"

View file

@ -160,8 +160,8 @@ from ..types import (
BotName,
BotShortDescription,
BusinessConnection,
Chat,
ChatAdministratorRights,
ChatFullInfo,
ChatInviteLink,
ChatMemberAdministrator,
ChatMemberBanned,
@ -203,6 +203,7 @@ from ..types import (
InputMediaDocument,
InputMediaPhoto,
InputMediaVideo,
InputPollOption,
InputSticker,
LabeledPrice,
LinkPreviewOptions,
@ -899,7 +900,7 @@ class Bot:
: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
: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 reply keyboard or to force a reply from the user.
: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
: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
:param request_timeout: Request timeout
@ -1408,6 +1409,7 @@ class Bot:
chat_id: Optional[Union[int, str]] = None,
message_id: Optional[int] = None,
inline_message_id: Optional[str] = None,
live_period: Optional[int] = None,
horizontal_accuracy: Optional[float] = None,
heading: Optional[int] = None,
proximity_alert_radius: Optional[int] = None,
@ -1424,6 +1426,7 @@ class Bot:
:param chat_id: Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param message_id: Required if *inline_message_id* is not specified. Identifier of the message to edit
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
: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
: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.
@ -1438,6 +1441,7 @@ class Bot:
chat_id=chat_id,
message_id=message_id,
inline_message_id=inline_message_id,
live_period=live_period,
horizontal_accuracy=horizontal_accuracy,
heading=heading,
proximity_alert_radius=proximity_alert_radius,
@ -1619,15 +1623,15 @@ class Bot:
self,
chat_id: Union[int, str],
request_timeout: Optional[int] = None,
) -> Chat:
) -> ChatFullInfo:
"""
Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success.
Use this method to get up-to-date information about the chat. Returns a :class:`aiogram.types.chat_full_info.ChatFullInfo` object on success.
Source: https://core.telegram.org/bots/api#getchat
:param chat_id: Unique identifier for the target chat or username of the target supergroup or channel (in the format :code:`@channelusername`)
:param request_timeout: Request timeout
:return: Returns a :class:`aiogram.types.chat.Chat` object on success.
:return: Returns a :class:`aiogram.types.chat_full_info.ChatFullInfo` object on success.
"""
call = GetChat(
@ -2087,7 +2091,7 @@ class Bot:
:param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings
:param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat
:param can_post_stories: Pass :code:`True` if the administrator can post stories to the chat
:param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users
:param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
:param can_delete_stories: Pass :code:`True` if the administrator can delete stories posted by other users
:param can_post_messages: Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; for channels only
:param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages; for channels only
@ -2240,7 +2244,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -2312,7 +2316,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -2407,7 +2411,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -2459,7 +2463,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -2518,7 +2522,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -2570,7 +2574,7 @@ class Bot:
: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
:param reply_parameters: Description of the message to reply to
: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. Not supported for messages sent on behalf of a business account.
: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.
: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
:param request_timeout: Request timeout
@ -2727,13 +2731,13 @@ class Bot:
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
:param live_period: Period in seconds for which the location will be updated (see `Live Locations <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400.
: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.
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -2842,7 +2846,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
@ -2904,7 +2908,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -2933,9 +2937,11 @@ class Bot:
self,
chat_id: Union[int, str],
question: str,
options: List[str],
options: List[Union[InputPollOption, str]],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None,
question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
question_entities: Optional[List[MessageEntity]] = None,
is_anonymous: Optional[bool] = None,
type: Optional[str] = None,
allows_multiple_answers: Optional[bool] = None,
@ -2963,23 +2969,25 @@ class Bot:
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
:param question: Poll question, 1-300 characters
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
:param options: A JSON-serialized list of 2-10 answer options
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
: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*
: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.
:param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*
: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*
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -2992,6 +3000,8 @@ class Bot:
options=options,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id,
question_parse_mode=question_parse_mode,
question_entities=question_entities,
is_anonymous=is_anonymous,
type=type,
allows_multiple_answers=allows_multiple_answers,
@ -3041,7 +3051,7 @@ class Bot:
: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
: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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.
: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
: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
:param request_timeout: Request timeout
@ -3105,7 +3115,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -3179,7 +3189,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -3243,7 +3253,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout
@ -3288,7 +3298,7 @@ class Bot:
request_timeout: Optional[int] = None,
) -> Message:
"""
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :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.
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.
Source: https://core.telegram.org/bots/api#sendvoice
@ -3303,7 +3313,7 @@ class Bot:
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:param request_timeout: Request timeout

View file

@ -45,6 +45,7 @@ class ContentType(str, Enum):
PASSPORT_DATA = "passport_data"
PROXIMITY_ALERT_TRIGGERED = "proximity_alert_triggered"
BOOST_ADDED = "boost_added"
CHAT_BACKGROUND_SET = "chat_background_set"
FORUM_TOPIC_CREATED = "forum_topic_created"
FORUM_TOPIC_EDITED = "forum_topic_edited"
FORUM_TOPIC_CLOSED = "forum_topic_closed"

View file

@ -50,7 +50,7 @@ class CopyMessage(TelegramMethod[MessageId]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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 reply keyboard or to force a reply from the user."""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -26,6 +26,8 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
inline_message_id: Optional[str] = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
live_period: Optional[int] = None
"""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"""
horizontal_accuracy: Optional[float] = None
"""The radius of uncertainty for the location, measured in meters; 0-1500"""
heading: Optional[int] = None
@ -47,6 +49,7 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
chat_id: Optional[Union[int, str]] = None,
message_id: Optional[int] = None,
inline_message_id: Optional[str] = None,
live_period: Optional[int] = None,
horizontal_accuracy: Optional[float] = None,
heading: Optional[int] = None,
proximity_alert_radius: Optional[int] = None,
@ -63,6 +66,7 @@ class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]):
chat_id=chat_id,
message_id=message_id,
inline_message_id=inline_message_id,
live_period=live_period,
horizontal_accuracy=horizontal_accuracy,
heading=heading,
proximity_alert_radius=proximity_alert_radius,

View file

@ -2,18 +2,18 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, Union
from ..types import Chat
from ..types import ChatFullInfo
from .base import TelegramMethod
class GetChat(TelegramMethod[Chat]):
class GetChat(TelegramMethod[ChatFullInfo]):
"""
Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success.
Use this method to get up-to-date information about the chat. Returns a :class:`aiogram.types.chat_full_info.ChatFullInfo` object on success.
Source: https://core.telegram.org/bots/api#getchat
"""
__returning__ = Chat
__returning__ = ChatFullInfo
__api_method__ = "getChat"
chat_id: Union[int, str]

View file

@ -38,7 +38,7 @@ class PromoteChatMember(TelegramMethod[bool]):
can_post_stories: Optional[bool] = None
"""Pass :code:`True` if the administrator can post stories to the chat"""
can_edit_stories: Optional[bool] = None
"""Pass :code:`True` if the administrator can edit stories posted by other users"""
"""Pass :code:`True` if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive"""
can_delete_stories: Optional[bool] = None
"""Pass :code:`True` if the administrator can delete stories posted by other users"""
can_post_messages: Optional[bool] = None

View file

@ -6,7 +6,6 @@ from pydantic import Field
from ..client.default import Default
from ..types import (
UNSET_PARSE_MODE,
ForceReply,
InlineKeyboardMarkup,
InputFile,
@ -62,7 +61,7 @@ class SendAnimation(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -60,7 +60,7 @@ class SendAudio(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -49,7 +49,7 @@ class SendContact(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -43,7 +43,7 @@ class SendDice(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -6,7 +6,6 @@ from pydantic import Field
from ..client.default import Default
from ..types import (
UNSET_PARSE_MODE,
ForceReply,
InlineKeyboardMarkup,
InputFile,
@ -56,7 +55,7 @@ class SendDocument(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -34,7 +34,7 @@ class SendGame(TelegramMethod[Message]):
reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to"""
reply_markup: Optional[InlineKeyboardMarkup] = None
"""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. Not supported for messages sent on behalf of a business account."""
"""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."""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -39,7 +39,7 @@ class SendLocation(TelegramMethod[Message]):
horizontal_accuracy: Optional[float] = None
"""The radius of uncertainty for the location, measured in meters; 0-1500"""
live_period: Optional[int] = None
"""Period in seconds for which the location will be updated (see `Live Locations <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400."""
"""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."""
heading: Optional[int] = None
"""For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."""
proximity_alert_radius: Optional[int] = None
@ -53,7 +53,7 @@ class SendLocation(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -51,7 +51,7 @@ class SendMessage(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -6,7 +6,6 @@ from pydantic import Field
from ..client.default import Default
from ..types import (
UNSET_PARSE_MODE,
ForceReply,
InlineKeyboardMarkup,
InputFile,
@ -54,7 +53,7 @@ class SendPhoto(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -7,9 +7,9 @@ from pydantic import Field
from ..client.default import Default
from ..types import (
UNSET_PARSE_MODE,
ForceReply,
InlineKeyboardMarkup,
InputPollOption,
Message,
MessageEntity,
ReplyKeyboardMarkup,
@ -33,12 +33,16 @@ class SendPoll(TelegramMethod[Message]):
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
question: str
"""Poll question, 1-300 characters"""
options: List[str]
"""A JSON-serialized list of answer options, 2-10 strings 1-100 characters each"""
options: List[Union[InputPollOption, str]]
"""A JSON-serialized list of 2-10 answer options"""
business_connection_id: Optional[str] = None
"""Unique identifier of the business connection on behalf of which the message will be sent"""
message_thread_id: Optional[int] = None
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
question_parse_mode: Optional[Union[str, Default]] = Default("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"""
question_entities: Optional[List[MessageEntity]] = None
"""A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of *question_parse_mode*"""
is_anonymous: Optional[bool] = None
""":code:`True`, if the poll needs to be anonymous, defaults to :code:`True`"""
type: Optional[str] = None
@ -52,7 +56,7 @@ class SendPoll(TelegramMethod[Message]):
explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
"""Mode for parsing entities in the explanation. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
explanation_entities: Optional[List[MessageEntity]] = None
"""A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*"""
"""A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode*"""
open_period: Optional[int] = None
"""Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*."""
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
@ -68,7 +72,7 @@ class SendPoll(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)
@ -91,9 +95,11 @@ class SendPoll(TelegramMethod[Message]):
*,
chat_id: Union[int, str],
question: str,
options: List[str],
options: List[Union[InputPollOption, str]],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None,
question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
question_entities: Optional[List[MessageEntity]] = None,
is_anonymous: Optional[bool] = None,
type: Optional[str] = None,
allows_multiple_answers: Optional[bool] = None,
@ -124,6 +130,8 @@ class SendPoll(TelegramMethod[Message]):
options=options,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id,
question_parse_mode=question_parse_mode,
question_entities=question_entities,
is_anonymous=is_anonymous,
type=type,
allows_multiple_answers=allows_multiple_answers,

View file

@ -46,7 +46,7 @@ class SendSticker(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account."""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -57,7 +57,7 @@ class SendVenue(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -6,7 +6,6 @@ from pydantic import Field
from ..client.default import Default
from ..types import (
UNSET_PARSE_MODE,
ForceReply,
InlineKeyboardMarkup,
InputFile,
@ -64,7 +63,7 @@ class SendVideo(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -50,7 +50,7 @@ class SendVideoNote(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -6,7 +6,6 @@ from pydantic import Field
from ..client.default import Default
from ..types import (
UNSET_PARSE_MODE,
ForceReply,
InlineKeyboardMarkup,
InputFile,
@ -21,7 +20,7 @@ from .base import TelegramMethod
class SendVoice(TelegramMethod[Message]):
"""
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :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.
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.
Source: https://core.telegram.org/bots/api#sendvoice
"""
@ -54,7 +53,7 @@ class SendVoice(TelegramMethod[Message]):
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None
"""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. Not supported for messages sent on behalf of a business account"""
"""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"""
allow_sending_without_reply: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)

View file

@ -2,6 +2,15 @@ from typing import List, Literal, Optional, Union
from .animation import Animation
from .audio import Audio
from .background_fill import BackgroundFill
from .background_fill_freeform_gradient import BackgroundFillFreeformGradient
from .background_fill_gradient import BackgroundFillGradient
from .background_fill_solid import BackgroundFillSolid
from .background_type import BackgroundType
from .background_type_chat_theme import BackgroundTypeChatTheme
from .background_type_fill import BackgroundTypeFill
from .background_type_pattern import BackgroundTypePattern
from .background_type_wallpaper import BackgroundTypeWallpaper
from .base import UNSET_PARSE_MODE, TelegramObject
from .birthdate import Birthdate
from .bot_command import BotCommand
@ -28,6 +37,7 @@ from .callback_game import CallbackGame
from .callback_query import CallbackQuery
from .chat import Chat
from .chat_administrator_rights import ChatAdministratorRights
from .chat_background import ChatBackground
from .chat_boost import ChatBoost
from .chat_boost_added import ChatBoostAdded
from .chat_boost_removed import ChatBoostRemoved
@ -36,6 +46,7 @@ from .chat_boost_source_gift_code import ChatBoostSourceGiftCode
from .chat_boost_source_giveaway import ChatBoostSourceGiveaway
from .chat_boost_source_premium import ChatBoostSourcePremium
from .chat_boost_updated import ChatBoostUpdated
from .chat_full_info import ChatFullInfo
from .chat_invite_link import ChatInviteLink
from .chat_join_request import ChatJoinRequest
from .chat_location import ChatLocation
@ -112,6 +123,7 @@ from .input_media_document import InputMediaDocument
from .input_media_photo import InputMediaPhoto
from .input_media_video import InputMediaVideo
from .input_message_content import InputMessageContent
from .input_poll_option import InputPollOption
from .input_sticker import InputSticker
from .input_text_message_content import InputTextMessageContent
from .input_venue_message_content import InputVenueMessageContent
@ -204,6 +216,15 @@ from .write_access_allowed import WriteAccessAllowed
__all__ = (
"Animation",
"Audio",
"BackgroundFill",
"BackgroundFillFreeformGradient",
"BackgroundFillGradient",
"BackgroundFillSolid",
"BackgroundType",
"BackgroundTypeChatTheme",
"BackgroundTypeFill",
"BackgroundTypePattern",
"BackgroundTypeWallpaper",
"Birthdate",
"BotCommand",
"BotCommandScope",
@ -228,6 +249,7 @@ __all__ = (
"CallbackQuery",
"Chat",
"ChatAdministratorRights",
"ChatBackground",
"ChatBoost",
"ChatBoostAdded",
"ChatBoostRemoved",
@ -236,6 +258,7 @@ __all__ = (
"ChatBoostSourceGiveaway",
"ChatBoostSourcePremium",
"ChatBoostUpdated",
"ChatFullInfo",
"ChatInviteLink",
"ChatJoinRequest",
"ChatLocation",
@ -314,6 +337,7 @@ __all__ = (
"InputMediaPhoto",
"InputMediaVideo",
"InputMessageContent",
"InputPollOption",
"InputSticker",
"InputTextMessageContent",
"InputVenueMessageContent",

View file

@ -0,0 +1,13 @@
from .base import TelegramObject
class BackgroundFill(TelegramObject):
"""
This object describes the way a background is filled based on the selected colors. Currently, it can be one of
- :class:`aiogram.types.background_fill_solid.BackgroundFillSolid`
- :class:`aiogram.types.background_fill_gradient.BackgroundFillGradient`
- :class:`aiogram.types.background_fill_freeform_gradient.BackgroundFillFreeformGradient`
Source: https://core.telegram.org/bots/api#backgroundfill
"""

View file

@ -0,0 +1,33 @@
from typing import TYPE_CHECKING, Any, List, Literal
from .background_fill import BackgroundFill
class BackgroundFillFreeformGradient(BackgroundFill):
"""
The background is a freeform gradient that rotates after every message in the chat.
Source: https://core.telegram.org/bots/api#backgroundfillfreeformgradient
"""
type: Literal["freeform_gradient"] = "freeform_gradient"
"""Type of the background fill, always 'freeform_gradient'"""
colors: List[int]
"""A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
type: Literal["freeform_gradient"] = "freeform_gradient",
colors: List[int],
**__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__(type=type, colors=colors, **__pydantic_kwargs)

View file

@ -0,0 +1,45 @@
from typing import TYPE_CHECKING, Any, Literal
from .background_fill import BackgroundFill
class BackgroundFillGradient(BackgroundFill):
"""
The background is a gradient fill.
Source: https://core.telegram.org/bots/api#backgroundfillgradient
"""
type: Literal["gradient"] = "gradient"
"""Type of the background fill, always 'gradient'"""
top_color: int
"""Top color of the gradient in the RGB24 format"""
bottom_color: int
"""Bottom color of the gradient in the RGB24 format"""
rotation_angle: int
"""Clockwise rotation angle of the background fill in degrees; 0-359"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
type: Literal["gradient"] = "gradient",
top_color: int,
bottom_color: int,
rotation_angle: int,
**__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__(
type=type,
top_color=top_color,
bottom_color=bottom_color,
rotation_angle=rotation_angle,
**__pydantic_kwargs,
)

View file

@ -0,0 +1,33 @@
from typing import TYPE_CHECKING, Any, Literal
from .background_fill import BackgroundFill
class BackgroundFillSolid(BackgroundFill):
"""
The background is filled using the selected color.
Source: https://core.telegram.org/bots/api#backgroundfillsolid
"""
type: Literal["solid"] = "solid"
"""Type of the background fill, always 'solid'"""
color: int
"""The color of the background fill in the RGB24 format"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
type: Literal["solid"] = "solid",
color: int,
**__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__(type=type, color=color, **__pydantic_kwargs)

View file

@ -0,0 +1,14 @@
from .base import TelegramObject
class BackgroundType(TelegramObject):
"""
This object describes the type of a background. Currently, it can be one of
- :class:`aiogram.types.background_type_fill.BackgroundTypeFill`
- :class:`aiogram.types.background_type_wallpaper.BackgroundTypeWallpaper`
- :class:`aiogram.types.background_type_pattern.BackgroundTypePattern`
- :class:`aiogram.types.background_type_chat_theme.BackgroundTypeChatTheme`
Source: https://core.telegram.org/bots/api#backgroundtype
"""

View file

@ -0,0 +1,33 @@
from typing import TYPE_CHECKING, Any, Literal
from .background_type import BackgroundType
class BackgroundTypeChatTheme(BackgroundType):
"""
The background is taken directly from a built-in chat theme.
Source: https://core.telegram.org/bots/api#backgroundtypechattheme
"""
type: Literal["chat_theme"] = "chat_theme"
"""Type of the background, always 'chat_theme'"""
theme_name: str
"""Name of the chat theme, which is usually an emoji"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
type: Literal["chat_theme"] = "chat_theme",
theme_name: str,
**__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__(type=type, theme_name=theme_name, **__pydantic_kwargs)

View file

@ -0,0 +1,47 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal, Union
from .background_type import BackgroundType
if TYPE_CHECKING:
from .background_fill_freeform_gradient import BackgroundFillFreeformGradient
from .background_fill_gradient import BackgroundFillGradient
from .background_fill_solid import BackgroundFillSolid
class BackgroundTypeFill(BackgroundType):
"""
The background is automatically filled based on the selected colors.
Source: https://core.telegram.org/bots/api#backgroundtypefill
"""
type: Literal["fill"] = "fill"
"""Type of the background, always 'fill'"""
fill: Union[BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient]
"""The background fill"""
dark_theme_dimming: int
"""Dimming of the background in dark themes, as a percentage; 0-100"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
type: Literal["fill"] = "fill",
fill: Union[
BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient
],
dark_theme_dimming: int,
**__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__(
type=type, fill=fill, dark_theme_dimming=dark_theme_dimming, **__pydantic_kwargs
)

View file

@ -0,0 +1,63 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
from .background_type import BackgroundType
if TYPE_CHECKING:
from .background_fill_freeform_gradient import BackgroundFillFreeformGradient
from .background_fill_gradient import BackgroundFillGradient
from .background_fill_solid import BackgroundFillSolid
from .document import Document
class BackgroundTypePattern(BackgroundType):
"""
The background is a PNG or TGV (gzipped subset of SVG with MIME type 'application/x-tgwallpattern') pattern to be combined with the background fill chosen by the user.
Source: https://core.telegram.org/bots/api#backgroundtypepattern
"""
type: Literal["pattern"] = "pattern"
"""Type of the background, always 'pattern'"""
document: Document
"""Document with the pattern"""
fill: Union[BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient]
"""The background fill that is combined with the pattern"""
intensity: int
"""Intensity of the pattern when it is shown above the filled background; 0-100"""
is_inverted: Optional[bool] = None
"""*Optional*. :code:`True`, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only"""
is_moving: Optional[bool] = None
"""*Optional*. :code:`True`, if the background moves slightly when the device is tilted"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
type: Literal["pattern"] = "pattern",
document: Document,
fill: Union[
BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient
],
intensity: int,
is_inverted: Optional[bool] = None,
is_moving: Optional[bool] = None,
**__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__(
type=type,
document=document,
fill=fill,
intensity=intensity,
is_inverted=is_inverted,
is_moving=is_moving,
**__pydantic_kwargs,
)

View file

@ -0,0 +1,54 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal, Optional
from .background_type import BackgroundType
if TYPE_CHECKING:
from .document import Document
class BackgroundTypeWallpaper(BackgroundType):
"""
The background is a wallpaper in the JPEG format.
Source: https://core.telegram.org/bots/api#backgroundtypewallpaper
"""
type: Literal["wallpaper"] = "wallpaper"
"""Type of the background, always 'wallpaper'"""
document: Document
"""Document with the wallpaper"""
dark_theme_dimming: int
"""Dimming of the background in dark themes, as a percentage; 0-100"""
is_blurred: Optional[bool] = None
"""*Optional*. :code:`True`, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12"""
is_moving: Optional[bool] = None
"""*Optional*. :code:`True`, if the background moves slightly when the device is tilted"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
type: Literal["wallpaper"] = "wallpaper",
document: Document,
dark_theme_dimming: int,
is_blurred: Optional[bool] = None,
is_moving: Optional[bool] = None,
**__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__(
type=type,
document=document,
dark_theme_dimming=dark_theme_dimming,
is_blurred=is_blurred,
is_moving=is_moving,
**__pydantic_kwargs,
)

View file

@ -7,7 +7,7 @@ from .base import TelegramObject
class Birthdate(TelegramObject):
"""
Describes the birthdate of a user.
Source: https://core.telegram.org/bots/api#birthdate
"""

View file

@ -10,7 +10,7 @@ if TYPE_CHECKING:
class BusinessIntro(TelegramObject):
"""
Contains information about the start page settings of a Telegram Business account.
Source: https://core.telegram.org/bots/api#businessintro
"""

View file

@ -10,7 +10,7 @@ if TYPE_CHECKING:
class BusinessLocation(TelegramObject):
"""
Contains information about the location of a Telegram Business account.
Source: https://core.telegram.org/bots/api#businesslocation
"""

View file

@ -20,7 +20,7 @@ class BusinessMessagesDeleted(TelegramObject):
chat: Chat
"""Information about a chat in the business account. The bot may not have access to the chat or the corresponding user."""
message_ids: List[int]
"""A JSON-serialized list of identifiers of deleted messages in the chat of the business account"""
"""The list of identifiers of deleted messages in the chat of the business account"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!

View file

@ -10,7 +10,7 @@ if TYPE_CHECKING:
class BusinessOpeningHours(TelegramObject):
"""
Describes the opening hours of a business.
Source: https://core.telegram.org/bots/api#businessopeninghours
"""

View file

@ -7,7 +7,7 @@ from .base import TelegramObject
class BusinessOpeningHoursInterval(TelegramObject):
"""
Describes an interval of time during which a business is open.
Source: https://core.telegram.org/bots/api#businessopeninghoursinterval
"""

View file

@ -3,6 +3,8 @@ from __future__ import annotations
import datetime
from typing import TYPE_CHECKING, Any, List, Optional, Union
from pydantic import Field
from .base import TelegramObject
from .custom import DateTime
@ -60,7 +62,7 @@ class Chat(TelegramObject):
id: int
"""Unique identifier for this chat. 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."""
type: str
"""Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'"""
"""Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'"""
title: Optional[str] = None
"""*Optional*. Title, for supergroups, channels and group chats"""
username: Optional[str] = None
@ -71,76 +73,199 @@ class Chat(TelegramObject):
"""*Optional*. Last name of the other party in a private chat"""
is_forum: Optional[bool] = None
"""*Optional*. :code:`True`, if the supergroup chat is a forum (has `topics <https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups>`_ enabled)"""
photo: Optional[ChatPhoto] = None
"""*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
active_usernames: Optional[List[str]] = None
"""*Optional*. If non-empty, the list of all `active chat usernames <https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames>`_; for private chats, supergroups and channels. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
birthdate: Optional[Birthdate] = None
"""*Optional*. For private chats, the date of birth of the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
business_intro: Optional[BusinessIntro] = None
"""*Optional*. For private chats with business accounts, the intro of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
business_location: Optional[BusinessLocation] = None
"""*Optional*. For private chats with business accounts, the location of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
business_opening_hours: Optional[BusinessOpeningHours] = None
"""*Optional*. For private chats with business accounts, the opening hours of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
personal_chat: Optional[Chat] = None
"""*Optional*. For private chats, the personal channel of the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
available_reactions: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None
"""*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions <https://core.telegram.org/bots/api#reactiontypeemoji>`_ are allowed. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
accent_color_id: Optional[int] = None
"""*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors <https://core.telegram.org/bots/api#accent-colors>`_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`."""
background_custom_emoji_id: Optional[str] = None
"""*Optional*. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
profile_accent_color_id: Optional[int] = None
"""*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors <https://core.telegram.org/bots/api#profile-accent-colors>`_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
profile_background_custom_emoji_id: Optional[str] = None
"""*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
emoji_status_custom_emoji_id: Optional[str] = None
"""*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
emoji_status_expiration_date: Optional[DateTime] = None
"""*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
bio: Optional[str] = None
"""*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
has_private_forwards: Optional[bool] = None
"""*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=<user_id>` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
has_restricted_voice_and_video_messages: Optional[bool] = None
"""*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
join_to_send_messages: Optional[bool] = None
"""*Optional*. :code:`True`, if users need to join the supergroup before they can send messages. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
join_by_request: Optional[bool] = None
"""*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
description: Optional[str] = None
"""*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
invite_link: Optional[str] = None
"""*Optional*. Primary invite link, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
pinned_message: Optional[Message] = None
"""*Optional*. The most recent pinned message (by sending date). Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
permissions: Optional[ChatPermissions] = None
"""*Optional*. Default chat member permissions, for groups and supergroups. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
slow_mode_delay: Optional[int] = None
"""*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
unrestrict_boost_count: Optional[int] = None
"""*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
message_auto_delete_time: Optional[int] = None
"""*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
has_aggressive_anti_spam_enabled: Optional[bool] = None
"""*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
has_hidden_members: Optional[bool] = None
"""*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
has_protected_content: Optional[bool] = None
"""*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
has_visible_history: Optional[bool] = None
"""*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
sticker_set_name: Optional[str] = None
"""*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
can_set_sticker_set: Optional[bool] = None
"""*Optional*. :code:`True`, if the bot can change the group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
custom_emoji_sticker_set_name: Optional[str] = None
"""*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
linked_chat_id: Optional[int] = None
"""*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
location: Optional[ChatLocation] = None
"""*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
accent_color_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors <https://core.telegram.org/bots/api#accent-colors>`_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
active_usernames: Optional[List[str]] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. If non-empty, the list of all `active chat usernames <https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames>`_; for private chats, supergroups and channels. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
available_reactions: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = Field(
None, json_schema_extra={"deprecated": True}
)
"""*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions <https://core.telegram.org/bots/api#reactiontypeemoji>`_ are allowed. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
background_custom_emoji_id: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
bio: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
birthdate: Optional[Birthdate] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. For private chats, the date of birth of the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
business_intro: Optional[BusinessIntro] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. For private chats with business accounts, the intro of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
business_location: Optional[BusinessLocation] = Field(
None, json_schema_extra={"deprecated": True}
)
"""*Optional*. For private chats with business accounts, the location of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
business_opening_hours: Optional[BusinessOpeningHours] = Field(
None, json_schema_extra={"deprecated": True}
)
"""*Optional*. For private chats with business accounts, the opening hours of the business. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
can_set_sticker_set: Optional[bool] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. :code:`True`, if the bot can change the group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
custom_emoji_sticker_set_name: Optional[str] = Field(
None, json_schema_extra={"deprecated": True}
)
"""*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
description: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
emoji_status_custom_emoji_id: Optional[str] = Field(
None, json_schema_extra={"deprecated": True}
)
"""*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
emoji_status_expiration_date: Optional[DateTime] = Field(
None, json_schema_extra={"deprecated": True}
)
"""*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
has_aggressive_anti_spam_enabled: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)
"""*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
has_hidden_members: Optional[bool] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
has_private_forwards: Optional[bool] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=<user_id>` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
has_protected_content: Optional[bool] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
has_restricted_voice_and_video_messages: Optional[bool] = Field(
None, json_schema_extra={"deprecated": True}
)
"""*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
has_visible_history: Optional[bool] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
invite_link: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Primary invite link, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
join_by_request: Optional[bool] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
join_to_send_messages: Optional[bool] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. :code:`True`, if users need to join the supergroup before they can send messages. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
linked_chat_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
location: Optional[ChatLocation] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
message_auto_delete_time: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
permissions: Optional[ChatPermissions] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Default chat member permissions, for groups and supergroups. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
personal_chat: Optional[Chat] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. For private chats, the personal channel of the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
photo: Optional[ChatPhoto] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
pinned_message: Optional[Message] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. The most recent pinned message (by sending date). Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
profile_accent_color_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors <https://core.telegram.org/bots/api#profile-accent-colors>`_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
profile_background_custom_emoji_id: Optional[str] = Field(
None, json_schema_extra={"deprecated": True}
)
"""*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
slow_mode_delay: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
sticker_set_name: Optional[str] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
unrestrict_boost_count: Optional[int] = Field(None, json_schema_extra={"deprecated": True})
"""*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
.. deprecated:: API:7.3
https://core.telegram.org/bots/api-changelog#may-6-2024"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
@ -156,43 +281,43 @@ class Chat(TelegramObject):
first_name: Optional[str] = None,
last_name: Optional[str] = None,
is_forum: Optional[bool] = None,
photo: Optional[ChatPhoto] = None,
accent_color_id: Optional[int] = None,
active_usernames: Optional[List[str]] = None,
available_reactions: Optional[
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]
] = None,
background_custom_emoji_id: Optional[str] = None,
bio: Optional[str] = None,
birthdate: Optional[Birthdate] = None,
business_intro: Optional[BusinessIntro] = None,
business_location: Optional[BusinessLocation] = None,
business_opening_hours: Optional[BusinessOpeningHours] = None,
personal_chat: Optional[Chat] = None,
available_reactions: Optional[
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]
] = None,
accent_color_id: Optional[int] = None,
background_custom_emoji_id: Optional[str] = None,
profile_accent_color_id: Optional[int] = None,
profile_background_custom_emoji_id: Optional[str] = None,
emoji_status_custom_emoji_id: Optional[str] = None,
emoji_status_expiration_date: Optional[DateTime] = None,
bio: Optional[str] = None,
has_private_forwards: Optional[bool] = None,
has_restricted_voice_and_video_messages: Optional[bool] = None,
join_to_send_messages: Optional[bool] = None,
join_by_request: Optional[bool] = None,
description: Optional[str] = None,
invite_link: Optional[str] = None,
pinned_message: Optional[Message] = None,
permissions: Optional[ChatPermissions] = None,
slow_mode_delay: Optional[int] = None,
unrestrict_boost_count: Optional[int] = None,
message_auto_delete_time: Optional[int] = None,
has_aggressive_anti_spam_enabled: Optional[bool] = None,
has_hidden_members: Optional[bool] = None,
has_protected_content: Optional[bool] = None,
has_visible_history: Optional[bool] = None,
sticker_set_name: Optional[str] = None,
can_set_sticker_set: Optional[bool] = None,
custom_emoji_sticker_set_name: Optional[str] = None,
description: Optional[str] = None,
emoji_status_custom_emoji_id: Optional[str] = None,
emoji_status_expiration_date: Optional[DateTime] = None,
has_aggressive_anti_spam_enabled: Optional[bool] = None,
has_hidden_members: Optional[bool] = None,
has_private_forwards: Optional[bool] = None,
has_protected_content: Optional[bool] = None,
has_restricted_voice_and_video_messages: Optional[bool] = None,
has_visible_history: Optional[bool] = None,
invite_link: Optional[str] = None,
join_by_request: Optional[bool] = None,
join_to_send_messages: Optional[bool] = None,
linked_chat_id: Optional[int] = None,
location: Optional[ChatLocation] = None,
message_auto_delete_time: Optional[int] = None,
permissions: Optional[ChatPermissions] = None,
personal_chat: Optional[Chat] = None,
photo: Optional[ChatPhoto] = None,
pinned_message: Optional[Message] = None,
profile_accent_color_id: Optional[int] = None,
profile_background_custom_emoji_id: Optional[str] = None,
slow_mode_delay: Optional[int] = None,
sticker_set_name: Optional[str] = None,
unrestrict_boost_count: Optional[int] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
@ -207,41 +332,41 @@ class Chat(TelegramObject):
first_name=first_name,
last_name=last_name,
is_forum=is_forum,
photo=photo,
accent_color_id=accent_color_id,
active_usernames=active_usernames,
available_reactions=available_reactions,
background_custom_emoji_id=background_custom_emoji_id,
bio=bio,
birthdate=birthdate,
business_intro=business_intro,
business_location=business_location,
business_opening_hours=business_opening_hours,
personal_chat=personal_chat,
available_reactions=available_reactions,
accent_color_id=accent_color_id,
background_custom_emoji_id=background_custom_emoji_id,
profile_accent_color_id=profile_accent_color_id,
profile_background_custom_emoji_id=profile_background_custom_emoji_id,
emoji_status_custom_emoji_id=emoji_status_custom_emoji_id,
emoji_status_expiration_date=emoji_status_expiration_date,
bio=bio,
has_private_forwards=has_private_forwards,
has_restricted_voice_and_video_messages=has_restricted_voice_and_video_messages,
join_to_send_messages=join_to_send_messages,
join_by_request=join_by_request,
description=description,
invite_link=invite_link,
pinned_message=pinned_message,
permissions=permissions,
slow_mode_delay=slow_mode_delay,
unrestrict_boost_count=unrestrict_boost_count,
message_auto_delete_time=message_auto_delete_time,
has_aggressive_anti_spam_enabled=has_aggressive_anti_spam_enabled,
has_hidden_members=has_hidden_members,
has_protected_content=has_protected_content,
has_visible_history=has_visible_history,
sticker_set_name=sticker_set_name,
can_set_sticker_set=can_set_sticker_set,
custom_emoji_sticker_set_name=custom_emoji_sticker_set_name,
description=description,
emoji_status_custom_emoji_id=emoji_status_custom_emoji_id,
emoji_status_expiration_date=emoji_status_expiration_date,
has_aggressive_anti_spam_enabled=has_aggressive_anti_spam_enabled,
has_hidden_members=has_hidden_members,
has_private_forwards=has_private_forwards,
has_protected_content=has_protected_content,
has_restricted_voice_and_video_messages=has_restricted_voice_and_video_messages,
has_visible_history=has_visible_history,
invite_link=invite_link,
join_by_request=join_by_request,
join_to_send_messages=join_to_send_messages,
linked_chat_id=linked_chat_id,
location=location,
message_auto_delete_time=message_auto_delete_time,
permissions=permissions,
personal_chat=personal_chat,
photo=photo,
pinned_message=pinned_message,
profile_accent_color_id=profile_accent_color_id,
profile_background_custom_emoji_id=profile_background_custom_emoji_id,
slow_mode_delay=slow_mode_delay,
sticker_set_name=sticker_set_name,
unrestrict_boost_count=unrestrict_boost_count,
**__pydantic_kwargs,
)
@ -909,7 +1034,7 @@ class Chat(TelegramObject):
:param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings
:param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat
:param can_post_stories: Pass :code:`True` if the administrator can post stories to the chat
:param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users
:param can_edit_stories: Pass :code:`True` if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
:param can_delete_stories: Pass :code:`True` if the administrator can delete stories posted by other users
:param can_post_messages: Pass :code:`True` if the administrator can post messages in the channel, or access channel statistics; for channels only
:param can_edit_messages: Pass :code:`True` if the administrator can edit messages of other users and can pin messages; for channels only

View file

@ -34,7 +34,7 @@ class ChatAdministratorRights(TelegramObject):
can_post_stories: bool
""":code:`True`, if the administrator can post stories to the chat"""
can_edit_stories: bool
""":code:`True`, if the administrator can edit stories posted by other users"""
""":code:`True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive"""
can_delete_stories: bool
""":code:`True`, if the administrator can delete stories posted by other users"""
can_post_messages: Optional[bool] = None

View file

@ -0,0 +1,44 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Union
if TYPE_CHECKING:
from .background_type_chat_theme import BackgroundTypeChatTheme
from .background_type_fill import BackgroundTypeFill
from .background_type_pattern import BackgroundTypePattern
from .background_type_wallpaper import BackgroundTypeWallpaper
from .base import TelegramObject
class ChatBackground(TelegramObject):
"""
This object represents a chat background.
Source: https://core.telegram.org/bots/api#chatbackground
"""
type: Union[
BackgroundTypeFill, BackgroundTypeWallpaper, BackgroundTypePattern, BackgroundTypeChatTheme
]
"""Type of the background"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
type: Union[
BackgroundTypeFill,
BackgroundTypeWallpaper,
BackgroundTypePattern,
BackgroundTypeChatTheme,
],
**__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__(type=type, **__pydantic_kwargs)

View file

@ -0,0 +1,218 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, List, Optional, Union
from .chat import Chat
from .custom import DateTime
if TYPE_CHECKING:
from .birthdate import Birthdate
from .business_intro import BusinessIntro
from .business_location import BusinessLocation
from .business_opening_hours import BusinessOpeningHours
from .chat_location import ChatLocation
from .chat_permissions import ChatPermissions
from .chat_photo import ChatPhoto
from .message import Message
from .reaction_type_custom_emoji import ReactionTypeCustomEmoji
from .reaction_type_emoji import ReactionTypeEmoji
class ChatFullInfo(Chat):
"""
This object contains full information about a chat.
Source: https://core.telegram.org/bots/api#chatfullinfo
"""
id: int
"""Unique identifier for this chat. 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."""
type: str
"""Type of the chat, can be either 'private', 'group', 'supergroup' or 'channel'"""
accent_color_id: int
"""Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors <https://core.telegram.org/bots/api#accent-colors>`_ for more details."""
max_reaction_count: int
"""The maximum number of reactions that can be set on a message in the chat"""
title: Optional[str] = None
"""*Optional*. Title, for supergroups, channels and group chats"""
username: Optional[str] = None
"""*Optional*. Username, for private chats, supergroups and channels if available"""
first_name: Optional[str] = None
"""*Optional*. First name of the other party in a private chat"""
last_name: Optional[str] = None
"""*Optional*. Last name of the other party in a private chat"""
is_forum: Optional[bool] = None
"""*Optional*. :code:`True`, if the supergroup chat is a forum (has `topics <https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups>`_ enabled)"""
photo: Optional[ChatPhoto] = None
"""*Optional*. Chat photo"""
active_usernames: Optional[List[str]] = None
"""*Optional*. If non-empty, the list of all `active chat usernames <https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames>`_; for private chats, supergroups and channels"""
birthdate: Optional[Birthdate] = None
"""*Optional*. For private chats, the date of birth of the user"""
business_intro: Optional[BusinessIntro] = None
"""*Optional*. For private chats with business accounts, the intro of the business"""
business_location: Optional[BusinessLocation] = None
"""*Optional*. For private chats with business accounts, the location of the business"""
business_opening_hours: Optional[BusinessOpeningHours] = None
"""*Optional*. For private chats with business accounts, the opening hours of the business"""
personal_chat: Optional[Chat] = None
"""*Optional*. For private chats, the personal channel of the user"""
available_reactions: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None
"""*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions <https://core.telegram.org/bots/api#reactiontypeemoji>`_ are allowed."""
background_custom_emoji_id: Optional[str] = None
"""*Optional*. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background"""
profile_accent_color_id: Optional[int] = None
"""*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors <https://core.telegram.org/bots/api#profile-accent-colors>`_ for more details."""
profile_background_custom_emoji_id: Optional[str] = None
"""*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background"""
emoji_status_custom_emoji_id: Optional[str] = None
"""*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat"""
emoji_status_expiration_date: Optional[DateTime] = None
"""*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any"""
bio: Optional[str] = None
"""*Optional*. Bio of the other party in a private chat"""
has_private_forwards: Optional[bool] = None
"""*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=<user_id>` links only in chats with the user"""
has_restricted_voice_and_video_messages: Optional[bool] = None
"""*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat"""
join_to_send_messages: Optional[bool] = None
"""*Optional*. :code:`True`, if users need to join the supergroup before they can send messages"""
join_by_request: Optional[bool] = None
"""*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators"""
description: Optional[str] = None
"""*Optional*. Description, for groups, supergroups and channel chats"""
invite_link: Optional[str] = None
"""*Optional*. Primary invite link, for groups, supergroups and channel chats"""
pinned_message: Optional[Message] = None
"""*Optional*. The most recent pinned message (by sending date)"""
permissions: Optional[ChatPermissions] = None
"""*Optional*. Default chat member permissions, for groups and supergroups"""
slow_mode_delay: Optional[int] = None
"""*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds"""
unrestrict_boost_count: Optional[int] = None
"""*Optional*. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions"""
message_auto_delete_time: Optional[int] = None
"""*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds"""
has_aggressive_anti_spam_enabled: Optional[bool] = None
"""*Optional*. :code:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators."""
has_hidden_members: Optional[bool] = None
"""*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat"""
has_protected_content: Optional[bool] = None
"""*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats"""
has_visible_history: Optional[bool] = None
"""*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators"""
sticker_set_name: Optional[str] = None
"""*Optional*. For supergroups, name of the group sticker set"""
can_set_sticker_set: Optional[bool] = None
"""*Optional*. :code:`True`, if the bot can change the group sticker set"""
custom_emoji_sticker_set_name: Optional[str] = None
"""*Optional*. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group."""
linked_chat_id: Optional[int] = None
"""*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier."""
location: Optional[ChatLocation] = None
"""*Optional*. For supergroups, the location to which the supergroup is connected"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
id: int,
type: str,
accent_color_id: int,
max_reaction_count: int,
title: Optional[str] = None,
username: Optional[str] = None,
first_name: Optional[str] = None,
last_name: Optional[str] = None,
is_forum: Optional[bool] = None,
photo: Optional[ChatPhoto] = None,
active_usernames: Optional[List[str]] = None,
birthdate: Optional[Birthdate] = None,
business_intro: Optional[BusinessIntro] = None,
business_location: Optional[BusinessLocation] = None,
business_opening_hours: Optional[BusinessOpeningHours] = None,
personal_chat: Optional[Chat] = None,
available_reactions: Optional[
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]
] = None,
background_custom_emoji_id: Optional[str] = None,
profile_accent_color_id: Optional[int] = None,
profile_background_custom_emoji_id: Optional[str] = None,
emoji_status_custom_emoji_id: Optional[str] = None,
emoji_status_expiration_date: Optional[DateTime] = None,
bio: Optional[str] = None,
has_private_forwards: Optional[bool] = None,
has_restricted_voice_and_video_messages: Optional[bool] = None,
join_to_send_messages: Optional[bool] = None,
join_by_request: Optional[bool] = None,
description: Optional[str] = None,
invite_link: Optional[str] = None,
pinned_message: Optional[Message] = None,
permissions: Optional[ChatPermissions] = None,
slow_mode_delay: Optional[int] = None,
unrestrict_boost_count: Optional[int] = None,
message_auto_delete_time: Optional[int] = None,
has_aggressive_anti_spam_enabled: Optional[bool] = None,
has_hidden_members: Optional[bool] = None,
has_protected_content: Optional[bool] = None,
has_visible_history: Optional[bool] = None,
sticker_set_name: Optional[str] = None,
can_set_sticker_set: Optional[bool] = None,
custom_emoji_sticker_set_name: Optional[str] = None,
linked_chat_id: Optional[int] = None,
location: Optional[ChatLocation] = None,
**__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__(
id=id,
type=type,
accent_color_id=accent_color_id,
max_reaction_count=max_reaction_count,
title=title,
username=username,
first_name=first_name,
last_name=last_name,
is_forum=is_forum,
photo=photo,
active_usernames=active_usernames,
birthdate=birthdate,
business_intro=business_intro,
business_location=business_location,
business_opening_hours=business_opening_hours,
personal_chat=personal_chat,
available_reactions=available_reactions,
background_custom_emoji_id=background_custom_emoji_id,
profile_accent_color_id=profile_accent_color_id,
profile_background_custom_emoji_id=profile_background_custom_emoji_id,
emoji_status_custom_emoji_id=emoji_status_custom_emoji_id,
emoji_status_expiration_date=emoji_status_expiration_date,
bio=bio,
has_private_forwards=has_private_forwards,
has_restricted_voice_and_video_messages=has_restricted_voice_and_video_messages,
join_to_send_messages=join_to_send_messages,
join_by_request=join_by_request,
description=description,
invite_link=invite_link,
pinned_message=pinned_message,
permissions=permissions,
slow_mode_delay=slow_mode_delay,
unrestrict_boost_count=unrestrict_boost_count,
message_auto_delete_time=message_auto_delete_time,
has_aggressive_anti_spam_enabled=has_aggressive_anti_spam_enabled,
has_hidden_members=has_hidden_members,
has_protected_content=has_protected_content,
has_visible_history=has_visible_history,
sticker_set_name=sticker_set_name,
can_set_sticker_set=can_set_sticker_set,
custom_emoji_sticker_set_name=custom_emoji_sticker_set_name,
linked_chat_id=linked_chat_id,
location=location,
**__pydantic_kwargs,
)

View file

@ -10,6 +10,7 @@ from .base import TelegramObject
from .custom import DateTime
if TYPE_CHECKING:
from .input_poll_option import InputPollOption
from ..methods import (
ApproveChatJoinRequest,
DeclineChatJoinRequest,
@ -196,7 +197,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
@ -267,7 +268,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
@ -343,7 +344,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_animation.SendAnimation`
@ -422,7 +423,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_animation.SendAnimation`
@ -500,7 +501,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_audio.SendAudio`
@ -577,7 +578,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_audio.SendAudio`
@ -645,7 +646,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_contact.SendContact`
@ -709,7 +710,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_contact.SendContact`
@ -777,7 +778,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_document.SendDocument`
@ -847,7 +848,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_document.SendDocument`
@ -905,7 +906,7 @@ class ChatJoinRequest(TelegramObject):
: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
:param reply_parameters: Description of the message to reply to
: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. Not supported for messages sent on behalf of a business account.
: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.
: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
:return: instance of method :class:`aiogram.methods.send_game.SendGame`
@ -958,7 +959,7 @@ class ChatJoinRequest(TelegramObject):
: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
:param reply_parameters: Description of the message to reply to
: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. Not supported for messages sent on behalf of a business account.
: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.
: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
:return: instance of method :class:`aiogram.methods.send_game.SendGame`
@ -1237,13 +1238,13 @@ class ChatJoinRequest(TelegramObject):
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
:param live_period: Period in seconds for which the location will be updated (see `Live Locations <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400.
: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.
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_location.SendLocation`
@ -1307,13 +1308,13 @@ class ChatJoinRequest(TelegramObject):
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
:param live_period: Period in seconds for which the location will be updated (see `Live Locations <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400.
: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.
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_location.SendLocation`
@ -1481,7 +1482,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_photo.SendPhoto`
@ -1548,7 +1549,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_photo.SendPhoto`
@ -1579,9 +1580,11 @@ class ChatJoinRequest(TelegramObject):
def answer_poll(
self,
question: str,
options: List[str],
options: List[Union[InputPollOption, str]],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None,
question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
question_entities: Optional[List[MessageEntity]] = None,
is_anonymous: Optional[bool] = None,
type: Optional[str] = None,
allows_multiple_answers: Optional[bool] = None,
@ -1613,23 +1616,25 @@ class ChatJoinRequest(TelegramObject):
Source: https://core.telegram.org/bots/api#sendpoll
:param question: Poll question, 1-300 characters
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
:param options: A JSON-serialized list of 2-10 answer options
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
: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*
: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.
:param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*
: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*
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_poll.SendPoll`
@ -1645,6 +1650,8 @@ class ChatJoinRequest(TelegramObject):
options=options,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id,
question_parse_mode=question_parse_mode,
question_entities=question_entities,
is_anonymous=is_anonymous,
type=type,
allows_multiple_answers=allows_multiple_answers,
@ -1667,9 +1674,11 @@ class ChatJoinRequest(TelegramObject):
def answer_poll_pm(
self,
question: str,
options: List[str],
options: List[Union[InputPollOption, str]],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None,
question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
question_entities: Optional[List[MessageEntity]] = None,
is_anonymous: Optional[bool] = None,
type: Optional[str] = None,
allows_multiple_answers: Optional[bool] = None,
@ -1701,23 +1710,25 @@ class ChatJoinRequest(TelegramObject):
Source: https://core.telegram.org/bots/api#sendpoll
:param question: Poll question, 1-300 characters
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
:param options: A JSON-serialized list of 2-10 answer options
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
: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*
: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.
:param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*
: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*
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_poll.SendPoll`
@ -1733,6 +1744,8 @@ class ChatJoinRequest(TelegramObject):
options=options,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id,
question_parse_mode=question_parse_mode,
question_entities=question_entities,
is_anonymous=is_anonymous,
type=type,
allows_multiple_answers=allows_multiple_answers,
@ -1783,7 +1796,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_dice.SendDice`
@ -1838,7 +1851,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_dice.SendDice`
@ -1895,7 +1908,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.
: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
: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
:return: instance of method :class:`aiogram.methods.send_sticker.SendSticker`
@ -1953,7 +1966,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.
: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
: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
:return: instance of method :class:`aiogram.methods.send_sticker.SendSticker`
@ -2023,7 +2036,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_venue.SendVenue`
@ -2099,7 +2112,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_venue.SendVenue`
@ -2179,7 +2192,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_video.SendVideo`
@ -2261,7 +2274,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_video.SendVideo`
@ -2331,7 +2344,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote`
@ -2395,7 +2408,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote`
@ -2447,7 +2460,7 @@ class ChatJoinRequest(TelegramObject):
- :code:`chat_id`
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :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.
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.
Source: https://core.telegram.org/bots/api#sendvoice
@ -2461,7 +2474,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_voice.SendVoice`
@ -2514,7 +2527,7 @@ class ChatJoinRequest(TelegramObject):
- :code:`chat_id`
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :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.
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.
Source: https://core.telegram.org/bots/api#sendvoice
@ -2528,7 +2541,7 @@ class ChatJoinRequest(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_voice.SendVoice`

View file

@ -41,7 +41,7 @@ class ChatMemberAdministrator(ChatMember):
can_post_stories: bool
""":code:`True`, if the administrator can post stories to the chat"""
can_edit_stories: bool
""":code:`True`, if the administrator can edit stories posted by other users"""
""":code:`True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive"""
can_delete_stories: bool
""":code:`True`, if the administrator can delete stories posted by other users"""
can_post_messages: Optional[bool] = None

View file

@ -10,6 +10,7 @@ from .base import TelegramObject
from .custom import DateTime
if TYPE_CHECKING:
from .input_poll_option import InputPollOption
from ..methods import (
SendAnimation,
SendAudio,
@ -86,6 +87,8 @@ class ChatMemberUpdated(TelegramObject):
"""New information about the chat member"""
invite_link: Optional[ChatInviteLink] = None
"""*Optional*. Chat invite link, which was used by the user to join the chat; for joining by invite link events only."""
via_join_request: Optional[bool] = None
"""*Optional*. True, if the user joined the chat after sending a direct join request and being approved by an administrator"""
via_chat_folder_invite_link: Optional[bool] = None
"""*Optional*. True, if the user joined the chat via a chat folder invite link"""
@ -116,6 +119,7 @@ class ChatMemberUpdated(TelegramObject):
ChatMemberBanned,
],
invite_link: Optional[ChatInviteLink] = None,
via_join_request: Optional[bool] = None,
via_chat_folder_invite_link: Optional[bool] = None,
**__pydantic_kwargs: Any,
) -> None:
@ -130,6 +134,7 @@ class ChatMemberUpdated(TelegramObject):
old_chat_member=old_chat_member,
new_chat_member=new_chat_member,
invite_link=invite_link,
via_join_request=via_join_request,
via_chat_folder_invite_link=via_chat_folder_invite_link,
**__pydantic_kwargs,
)
@ -176,7 +181,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
@ -252,7 +257,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_animation.SendAnimation`
@ -330,7 +335,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_audio.SendAudio`
@ -398,7 +403,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_contact.SendContact`
@ -466,7 +471,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_document.SendDocument`
@ -524,7 +529,7 @@ class ChatMemberUpdated(TelegramObject):
: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
:param reply_parameters: Description of the message to reply to
: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. Not supported for messages sent on behalf of a business account.
: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.
: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
:return: instance of method :class:`aiogram.methods.send_game.SendGame`
@ -693,13 +698,13 @@ class ChatMemberUpdated(TelegramObject):
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
:param live_period: Period in seconds for which the location will be updated (see `Live Locations <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400.
: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.
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_location.SendLocation`
@ -817,7 +822,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_photo.SendPhoto`
@ -848,9 +853,11 @@ class ChatMemberUpdated(TelegramObject):
def answer_poll(
self,
question: str,
options: List[str],
options: List[Union[InputPollOption, str]],
business_connection_id: Optional[str] = None,
message_thread_id: Optional[int] = None,
question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
question_entities: Optional[List[MessageEntity]] = None,
is_anonymous: Optional[bool] = None,
type: Optional[str] = None,
allows_multiple_answers: Optional[bool] = None,
@ -882,23 +889,25 @@ class ChatMemberUpdated(TelegramObject):
Source: https://core.telegram.org/bots/api#sendpoll
:param question: Poll question, 1-300 characters
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
:param options: A JSON-serialized list of 2-10 answer options
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
: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*
: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.
:param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*
: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*
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_poll.SendPoll`
@ -914,6 +923,8 @@ class ChatMemberUpdated(TelegramObject):
options=options,
business_connection_id=business_connection_id,
message_thread_id=message_thread_id,
question_parse_mode=question_parse_mode,
question_entities=question_entities,
is_anonymous=is_anonymous,
type=type,
allows_multiple_answers=allows_multiple_answers,
@ -964,7 +975,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_dice.SendDice`
@ -1021,7 +1032,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.
: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
: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
:return: instance of method :class:`aiogram.methods.send_sticker.SendSticker`
@ -1091,7 +1102,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_venue.SendVenue`
@ -1171,7 +1182,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_video.SendVideo`
@ -1241,7 +1252,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote`
@ -1293,7 +1304,7 @@ class ChatMemberUpdated(TelegramObject):
- :code:`chat_id`
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :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.
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.
Source: https://core.telegram.org/bots/api#sendvoice
@ -1307,7 +1318,7 @@ class ChatMemberUpdated(TelegramObject):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_voice.SendVoice`

View file

@ -7,7 +7,7 @@ from .base import MutableTelegramObject
class ForceReply(MutableTelegramObject):
"""
Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode <https://core.telegram.org/bots/features#privacy-mode>`_.
Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode <https://core.telegram.org/bots/features#privacy-mode>`_. Not supported in channels and for messages sent on behalf of a Telegram Business account.
**Example:** A `poll bot <https://t.me/PollBot>`_ for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

View file

@ -23,17 +23,17 @@ class InlineKeyboardButton(MutableTelegramObject):
url: Optional[str] = None
"""*Optional*. HTTP or tg:// URL to be opened when the button is pressed. Links :code:`tg://user?id=<user_id>` can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings."""
callback_data: Optional[str] = None
"""*Optional*. Data to be sent in a `callback query <https://core.telegram.org/bots/api#callbackquery>`_ to the bot when button is pressed, 1-64 bytes"""
"""*Optional*. Data to be sent in a `callback query <https://core.telegram.org/bots/api#callbackquery>`_ to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account."""
web_app: Optional[WebAppInfo] = None
"""*Optional*. Description of the `Web App <https://core.telegram.org/bots/webapps>`_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot."""
"""*Optional*. Description of the `Web App <https://core.telegram.org/bots/webapps>`_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account."""
login_url: Optional[LoginUrl] = None
"""*Optional*. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the `Telegram Login Widget <https://core.telegram.org/widgets/login>`_."""
switch_inline_query: Optional[str] = None
"""*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted."""
"""*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account."""
switch_inline_query_current_chat: Optional[str] = None
"""*Optional*. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted."""
switch_inline_query_chosen_chat: Optional[SwitchInlineQueryChosenChat] = None
"""*Optional*. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field"""
"""*Optional*. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account."""
callback_game: Optional[CallbackGame] = None
"""*Optional*. Description of the game that will be launched when the user presses the button."""
pay: Optional[bool] = None

View file

@ -34,7 +34,7 @@ class InlineQueryResultLocation(InlineQueryResult):
horizontal_accuracy: Optional[float] = None
"""*Optional*. The radius of uncertainty for the location, measured in meters; 0-1500"""
live_period: Optional[int] = None
"""*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400."""
"""*Optional*. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely."""
heading: Optional[int] = None
"""*Optional*. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."""
proximity_alert_radius: Optional[int] = None

View file

@ -19,7 +19,7 @@ class InputLocationMessageContent(InputMessageContent):
horizontal_accuracy: Optional[float] = None
"""*Optional*. The radius of uncertainty for the location, measured in meters; 0-1500"""
live_period: Optional[int] = None
"""*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400."""
"""*Optional*. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely."""
heading: Optional[int] = None
"""*Optional*. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."""
proximity_alert_radius: Optional[int] = None

View file

@ -0,0 +1,47 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, List, Optional, Union
from .base import TelegramObject
from ..client.default import Default
if TYPE_CHECKING:
from .message_entity import MessageEntity
class InputPollOption(TelegramObject):
"""
This object contains information about one answer option in a poll to send.
Source: https://core.telegram.org/bots/api#inputpolloption
"""
text: str
"""Option text, 1-100 characters"""
text_parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
"""*Optional*. Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Currently, only custom emoji entities are allowed"""
text_entities: Optional[List[MessageEntity]] = None
"""*Optional*. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of *text_parse_mode*"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
text: str,
text_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
text_entities: Optional[List[MessageEntity]] = None,
**__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__(
text=text,
text_parse_mode=text_parse_mode,
text_entities=text_entities,
**__pydantic_kwargs,
)

View file

@ -10,7 +10,7 @@ if TYPE_CHECKING:
class KeyboardButtonRequestChat(TelegramObject):
"""
This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the сhat if appropriate `More about requesting chats » <https://core.telegram.org/bots/features#chat-and-user-selection>`_
This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. `More about requesting chats » <https://core.telegram.org/bots/features#chat-and-user-selection>`_.
Source: https://core.telegram.org/bots/api#keyboardbuttonrequestchat
"""

View file

@ -19,11 +19,11 @@ class KeyboardButtonRequestUsers(TelegramObject):
max_quantity: Optional[int] = None
"""*Optional*. The maximum number of users to be selected; 1-10. Defaults to 1."""
request_name: Optional[bool] = None
"""*Optional*. Pass :code:`True` to request the users' first and last name"""
"""*Optional*. Pass :code:`True` to request the users' first and last names"""
request_username: Optional[bool] = None
"""*Optional*. Pass :code:`True` to request the users' username"""
"""*Optional*. Pass :code:`True` to request the users' usernames"""
request_photo: Optional[bool] = None
"""*Optional*. Pass :code:`True` to request the users' photo"""
"""*Optional*. Pass :code:`True` to request the users' photos"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!

View file

@ -3,7 +3,7 @@ from __future__ import annotations
import datetime
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from pydantic import Field, computed_field
from pydantic import Field
from aiogram.utils.text_decorations import (
TextDecoration,
@ -14,6 +14,7 @@ from aiogram.utils.text_decorations import (
from ..client.default import Default
from ..enums import ContentType
from .custom import DateTime
from .input_poll_option import InputPollOption
from .maybe_inaccessible_message import MaybeInaccessibleMessage
if TYPE_CHECKING:
@ -51,6 +52,7 @@ if TYPE_CHECKING:
from .animation import Animation
from .audio import Audio
from .chat import Chat
from .chat_background import ChatBackground
from .chat_boost_added import ChatBoostAdded
from .chat_shared import ChatShared
from .contact import Contact
@ -96,7 +98,6 @@ if TYPE_CHECKING:
from .reply_keyboard_markup import ReplyKeyboardMarkup
from .reply_keyboard_remove import ReplyKeyboardRemove
from .reply_parameters import ReplyParameters
from .shared_user import SharedUser
from .sticker import Sticker
from .story import Story
from .successful_payment import SuccessfulPayment
@ -253,6 +254,8 @@ class Message(MaybeInaccessibleMessage):
"""*Optional*. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location."""
boost_added: Optional[ChatBoostAdded] = None
"""*Optional*. Service message: user boosted the chat"""
chat_background_set: Optional[ChatBackground] = None
"""*Optional*. Service message: chat background set"""
forum_topic_created: Optional[ForumTopicCreated] = None
"""*Optional*. Service message: forum topic created"""
forum_topic_edited: Optional[ForumTopicEdited] = None
@ -399,6 +402,7 @@ class Message(MaybeInaccessibleMessage):
passport_data: Optional[PassportData] = None,
proximity_alert_triggered: Optional[ProximityAlertTriggered] = None,
boost_added: Optional[ChatBoostAdded] = None,
chat_background_set: Optional[ChatBackground] = None,
forum_topic_created: Optional[ForumTopicCreated] = None,
forum_topic_edited: Optional[ForumTopicEdited] = None,
forum_topic_closed: Optional[ForumTopicClosed] = None,
@ -493,6 +497,7 @@ class Message(MaybeInaccessibleMessage):
passport_data=passport_data,
proximity_alert_triggered=proximity_alert_triggered,
boost_added=boost_added,
chat_background_set=chat_background_set,
forum_topic_created=forum_topic_created,
forum_topic_edited=forum_topic_edited,
forum_topic_closed=forum_topic_closed,
@ -625,6 +630,8 @@ class Message(MaybeInaccessibleMessage):
return ContentType.STORY
if self.write_access_allowed:
return ContentType.WRITE_ACCESS_ALLOWED
if self.chat_background_set:
return ContentType.CHAT_BACKGROUND_SET
if self.boost_added:
return ContentType.BOOST_ADDED
@ -688,7 +695,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_animation.SendAnimation`
"""
@ -768,7 +775,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_animation.SendAnimation`
@ -848,7 +855,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_audio.SendAudio`
"""
@ -926,7 +933,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_audio.SendAudio`
@ -996,7 +1003,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_contact.SendContact`
"""
@ -1061,7 +1068,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_contact.SendContact`
@ -1131,7 +1138,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_document.SendDocument`
"""
@ -1202,7 +1209,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_document.SendDocument`
@ -1262,7 +1269,7 @@ class Message(MaybeInaccessibleMessage):
: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
:param reply_parameters: Description of the message to reply to
: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. Not supported for messages sent on behalf of a business account.
: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.
: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_game.SendGame`
"""
@ -1316,7 +1323,7 @@ class Message(MaybeInaccessibleMessage):
: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
:param reply_parameters: Description of the message to reply to
: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. Not supported for messages sent on behalf of a business account.
: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.
: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
:return: instance of method :class:`aiogram.methods.send_game.SendGame`
@ -1606,13 +1613,13 @@ class Message(MaybeInaccessibleMessage):
:param latitude: Latitude of the location
:param longitude: Longitude of the location
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
:param live_period: Period in seconds for which the location will be updated (see `Live Locations <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400.
: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.
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_location.SendLocation`
"""
@ -1677,13 +1684,13 @@ class Message(MaybeInaccessibleMessage):
:param latitude: Latitude of the location
:param longitude: Longitude of the location
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
:param live_period: Period in seconds for which the location will be updated (see `Live Locations <https://telegram.org/blog/live-locations>`_, should be between 60 and 86400.
: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.
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_location.SendLocation`
@ -1859,7 +1866,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_message.SendMessage`
@ -1931,7 +1938,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
@ -2001,7 +2008,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_photo.SendPhoto`
"""
@ -2069,7 +2076,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_photo.SendPhoto`
@ -2104,7 +2111,9 @@ class Message(MaybeInaccessibleMessage):
def reply_poll(
self,
question: str,
options: List[str],
options: List[Union[InputPollOption, str]],
question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
question_entities: Optional[List[MessageEntity]] = None,
is_anonymous: Optional[bool] = None,
type: Optional[str] = None,
allows_multiple_answers: Optional[bool] = None,
@ -2138,21 +2147,23 @@ class Message(MaybeInaccessibleMessage):
Source: https://core.telegram.org/bots/api#sendpoll
:param question: Poll question, 1-300 characters
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
:param options: A JSON-serialized list of 2-10 answer options
: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*
: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.
:param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*
: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*
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_poll.SendPoll`
"""
@ -2172,6 +2183,8 @@ class Message(MaybeInaccessibleMessage):
reply_to_message_id=self.message_id,
question=question,
options=options,
question_parse_mode=question_parse_mode,
question_entities=question_entities,
is_anonymous=is_anonymous,
type=type,
allows_multiple_answers=allows_multiple_answers,
@ -2193,7 +2206,9 @@ class Message(MaybeInaccessibleMessage):
def answer_poll(
self,
question: str,
options: List[str],
options: List[Union[InputPollOption, str]],
question_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
question_entities: Optional[List[MessageEntity]] = None,
is_anonymous: Optional[bool] = None,
type: Optional[str] = None,
allows_multiple_answers: Optional[bool] = None,
@ -2227,21 +2242,23 @@ class Message(MaybeInaccessibleMessage):
Source: https://core.telegram.org/bots/api#sendpoll
:param question: Poll question, 1-300 characters
:param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
:param options: A JSON-serialized list of 2-10 answer options
: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*
: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.
:param explanation_entities: A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*
: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*
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_poll.SendPoll`
@ -2261,6 +2278,8 @@ class Message(MaybeInaccessibleMessage):
business_connection_id=self.business_connection_id,
question=question,
options=options,
question_parse_mode=question_parse_mode,
question_entities=question_entities,
is_anonymous=is_anonymous,
type=type,
allows_multiple_answers=allows_multiple_answers,
@ -2309,7 +2328,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_dice.SendDice`
"""
@ -2365,7 +2384,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_dice.SendDice`
@ -2424,7 +2443,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.
: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
: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_sticker.SendSticker`
"""
@ -2483,7 +2502,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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 reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.
: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
: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
:return: instance of method :class:`aiogram.methods.send_sticker.SendSticker`
@ -2555,7 +2574,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_venue.SendVenue`
"""
@ -2632,7 +2651,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_venue.SendVenue`
@ -2714,7 +2733,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_video.SendVideo`
"""
@ -2797,7 +2816,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_video.SendVideo`
@ -2869,7 +2888,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_video_note.SendVideoNote`
"""
@ -2934,7 +2953,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote`
@ -2990,7 +3009,7 @@ class Message(MaybeInaccessibleMessage):
- :code:`business_connection_id`
- :code:`reply_to_message_id`
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :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.
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.
Source: https://core.telegram.org/bots/api#sendvoice
@ -3002,7 +3021,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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_voice.SendVoice`
"""
@ -3058,7 +3077,7 @@ class Message(MaybeInaccessibleMessage):
- :code:`message_thread_id`
- :code:`business_connection_id`
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :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.
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.
Source: https://core.telegram.org/bots/api#sendvoice
@ -3070,7 +3089,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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. Not supported for messages sent on behalf of a business account
: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
: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
:return: instance of method :class:`aiogram.methods.send_voice.SendVoice`
@ -3269,7 +3288,15 @@ class Message(MaybeInaccessibleMessage):
if self.poll:
return SendPoll(
question=self.poll.question,
options=[option.text for option in self.poll.options],
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
],
**kwargs,
).as_(self._bot)
if self.dice: # Dice value can't be controlled
@ -3321,7 +3348,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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 reply keyboard or to force a reply from the user.
: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
: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
:return: instance of method :class:`aiogram.methods.copy_message.CopyMessage`
@ -3578,6 +3605,7 @@ class Message(MaybeInaccessibleMessage):
latitude: float,
longitude: float,
inline_message_id: Optional[str] = None,
live_period: Optional[int] = None,
horizontal_accuracy: Optional[float] = None,
heading: Optional[int] = None,
proximity_alert_radius: Optional[int] = None,
@ -3598,6 +3626,7 @@ class Message(MaybeInaccessibleMessage):
: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
: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
: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.
@ -3619,6 +3648,7 @@ class Message(MaybeInaccessibleMessage):
latitude=latitude,
longitude=longitude,
inline_message_id=inline_message_id,
live_period=live_period,
horizontal_accuracy=horizontal_accuracy,
heading=heading,
proximity_alert_radius=proximity_alert_radius,

View file

@ -33,6 +33,8 @@ class Poll(TelegramObject):
"""Poll type, currently can be 'regular' or 'quiz'"""
allows_multiple_answers: bool
""":code:`True`, if the poll allows multiple answers"""
question_entities: Optional[List[MessageEntity]] = None
"""*Optional*. Special entities that appear in the *question*. Currently, only custom emoji entities are allowed in poll questions"""
correct_option_id: Optional[int] = None
"""*Optional*. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot."""
explanation: Optional[str] = None
@ -59,6 +61,7 @@ class Poll(TelegramObject):
is_anonymous: bool,
type: str,
allows_multiple_answers: bool,
question_entities: Optional[List[MessageEntity]] = None,
correct_option_id: Optional[int] = None,
explanation: Optional[str] = None,
explanation_entities: Optional[List[MessageEntity]] = None,
@ -79,6 +82,7 @@ class Poll(TelegramObject):
is_anonymous=is_anonymous,
type=type,
allows_multiple_answers=allows_multiple_answers,
question_entities=question_entities,
correct_option_id=correct_option_id,
explanation=explanation,
explanation_entities=explanation_entities,

View file

@ -1,9 +1,12 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, List, Optional
from .base import TelegramObject
if TYPE_CHECKING:
from .message_entity import MessageEntity
class PollOption(TelegramObject):
"""
@ -16,16 +19,28 @@ class PollOption(TelegramObject):
"""Option text, 1-100 characters"""
voter_count: int
"""Number of users that voted for this option"""
text_entities: Optional[List[MessageEntity]] = None
"""*Optional*. Special entities that appear in the option *text*. Currently, only custom emoji entities are allowed in poll option texts"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__, *, text: str, voter_count: int, **__pydantic_kwargs: Any
__pydantic__self__,
*,
text: str,
voter_count: int,
text_entities: Optional[List[MessageEntity]] = None,
**__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__(text=text, voter_count=voter_count, **__pydantic_kwargs)
super().__init__(
text=text,
voter_count=voter_count,
text_entities=text_entities,
**__pydantic_kwargs,
)

View file

@ -10,7 +10,7 @@ if TYPE_CHECKING:
class ReplyKeyboardMarkup(MutableTelegramObject):
"""
This object represents a `custom keyboard <https://core.telegram.org/bots/features#keyboards>`_ with reply options (see `Introduction to bots <https://core.telegram.org/bots/features#keyboards>`_ for details and examples).
This object represents a `custom keyboard <https://core.telegram.org/bots/features#keyboards>`_ with reply options (see `Introduction to bots <https://core.telegram.org/bots/features#keyboards>`_ for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.
Source: https://core.telegram.org/bots/api#replykeyboardmarkup
"""

View file

@ -7,7 +7,7 @@ from .base import MutableTelegramObject
class ReplyKeyboardRemove(MutableTelegramObject):
"""
Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`).
Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`). Not supported in channels and for messages sent on behalf of a Telegram Business account.
Source: https://core.telegram.org/bots/api#replykeyboardremove
"""

View file

@ -10,7 +10,7 @@ if TYPE_CHECKING:
class SharedUser(TelegramObject):
"""
This object contains information about a user that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_user.KeyboardButtonRequestUser` button.
This object contains information about a user that was shared with the bot using a :class:`aiogram.types.keyboard_button_request_users.KeyboardButtonRequestUsers` button.
Source: https://core.telegram.org/bots/api#shareduser
"""