mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added full support for the Bot API 9.6
This commit is contained in:
parent
00c1130938
commit
da14db0963
99 changed files with 2906 additions and 328 deletions
|
|
@ -1,2 +1,2 @@
|
|||
__version__ = "3.26.0"
|
||||
__api_version__ = "9.5"
|
||||
__version__ = "3.27.0"
|
||||
__api_version__ = "9.6"
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ from ..methods import (
|
|||
GetFile,
|
||||
GetForumTopicIconStickers,
|
||||
GetGameHighScores,
|
||||
GetManagedBotToken,
|
||||
GetMe,
|
||||
GetMyCommands,
|
||||
GetMyDefaultAdministratorRights,
|
||||
|
|
@ -110,11 +111,13 @@ from ..methods import (
|
|||
RemoveUserVerification,
|
||||
ReopenForumTopic,
|
||||
ReopenGeneralForumTopic,
|
||||
ReplaceManagedBotToken,
|
||||
ReplaceStickerInSet,
|
||||
RepostStory,
|
||||
RestrictChatMember,
|
||||
RevokeChatInviteLink,
|
||||
SavePreparedInlineMessage,
|
||||
SavePreparedKeyboardButton,
|
||||
SendAnimation,
|
||||
SendAudio,
|
||||
SendChatAction,
|
||||
|
|
@ -216,6 +219,7 @@ from ..types import (
|
|||
InputProfilePhotoUnion,
|
||||
InputSticker,
|
||||
InputStoryContentUnion,
|
||||
KeyboardButton,
|
||||
LabeledPrice,
|
||||
LinkPreviewOptions,
|
||||
MaskPosition,
|
||||
|
|
@ -228,6 +232,7 @@ from ..types import (
|
|||
PassportElementErrorUnion,
|
||||
Poll,
|
||||
PreparedInlineMessage,
|
||||
PreparedKeyboardButton,
|
||||
ReactionTypeUnion,
|
||||
ReplyMarkupUnion,
|
||||
ReplyParameters,
|
||||
|
|
@ -3008,13 +3013,20 @@ class Bot:
|
|||
is_anonymous: bool | None = None,
|
||||
type: str | None = None,
|
||||
allows_multiple_answers: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
allows_revoting: bool | None = None,
|
||||
shuffle_options: bool | None = None,
|
||||
allow_adding_options: bool | None = None,
|
||||
hide_results_until_closes: bool | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode"),
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTimeUnion | None = None,
|
||||
is_closed: bool | None = None,
|
||||
description: str | None = None,
|
||||
description_parse_mode: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
disable_notification: bool | None = None,
|
||||
protect_content: bool | Default | None = Default("protect_content"),
|
||||
allow_paid_broadcast: bool | None = None,
|
||||
|
|
@ -3022,6 +3034,7 @@ class Bot:
|
|||
reply_parameters: ReplyParameters | None = None,
|
||||
reply_markup: ReplyMarkupUnion | None = None,
|
||||
allow_sending_without_reply: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
reply_to_message_id: int | None = None,
|
||||
request_timeout: int | None = None,
|
||||
) -> Message:
|
||||
|
|
@ -3039,14 +3052,21 @@ class Bot:
|
|||
: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 allows_multiple_answers: Pass :code:`True`, if the poll allows multiple answers, defaults to :code:`False`
|
||||
:param allows_revoting: Pass :code:`True`, if the poll allows to change chosen answer options, defaults to :code:`False` for quizzes and to :code:`True` for regular polls
|
||||
:param shuffle_options: Pass :code:`True`, if the poll options must be shown in random order
|
||||
:param allow_adding_options: Pass :code:`True`, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
|
||||
:param hide_results_until_closes: Pass :code:`True`, if poll results must be shown only after the poll closes
|
||||
:param correct_option_ids: A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, 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. 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 open_period: Amount of time in seconds the poll will be active after creation, 5-2628000. 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 2628000 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 description: Description of the poll to be sent, 0-1024 characters after entities parsing
|
||||
:param description_parse_mode: Mode for parsing entities in the poll description. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param description_entities: A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of *description_parse_mode*
|
||||
: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 allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
||||
|
|
@ -3054,6 +3074,7 @@ class Bot:
|
|||
: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
|
||||
: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 correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode
|
||||
:param reply_to_message_id: If the message is a reply, ID of the original message
|
||||
:param request_timeout: Request timeout
|
||||
:return: On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
|
@ -3070,13 +3091,20 @@ class Bot:
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
correct_option_id=correct_option_id,
|
||||
allows_revoting=allows_revoting,
|
||||
shuffle_options=shuffle_options,
|
||||
allow_adding_options=allow_adding_options,
|
||||
hide_results_until_closes=hide_results_until_closes,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_parse_mode=explanation_parse_mode,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
is_closed=is_closed,
|
||||
description=description,
|
||||
description_parse_mode=description_parse_mode,
|
||||
description_entities=description_entities,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
allow_paid_broadcast=allow_paid_broadcast,
|
||||
|
|
@ -3084,6 +3112,7 @@ class Bot:
|
|||
reply_parameters=reply_parameters,
|
||||
reply_markup=reply_markup,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
correct_option_id=correct_option_id,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
|
@ -4904,8 +4933,8 @@ class Bot:
|
|||
:param chat_id: Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift.
|
||||
:param pay_for_upgrade: Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
|
||||
:param text: Text that will be shown along with the gift; 0-128 characters
|
||||
:param text_parse_mode: Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
|
||||
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
|
||||
:param text_parse_mode: Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', 'custom_emoji', and 'date_time' are ignored.
|
||||
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', 'custom_emoji', and 'date_time' are ignored.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
|
@ -5232,8 +5261,8 @@ class Bot:
|
|||
:param month_count: Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
|
||||
:param star_count: Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
|
||||
:param text: Text that will be shown along with the service message about the subscription; 0-128 characters
|
||||
:param text_parse_mode: Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
|
||||
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.
|
||||
:param text_parse_mode: Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', 'custom_emoji', and 'date_time' are ignored.
|
||||
:param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', 'custom_emoji', and 'date_time' are ignored.
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
"""
|
||||
|
|
@ -5938,3 +5967,66 @@ class Bot:
|
|||
tag=tag,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def get_managed_bot_token(
|
||||
self,
|
||||
user_id: int,
|
||||
request_timeout: int | None = None,
|
||||
) -> str:
|
||||
"""
|
||||
Use this method to get the token of a managed bot. Returns the token as *String* on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getmanagedbottoken
|
||||
|
||||
:param user_id: User identifier of the managed bot whose token will be returned
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns the token as *String* on success.
|
||||
"""
|
||||
|
||||
call = GetManagedBotToken(
|
||||
user_id=user_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def replace_managed_bot_token(
|
||||
self,
|
||||
user_id: int,
|
||||
request_timeout: int | None = None,
|
||||
) -> str:
|
||||
"""
|
||||
Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as *String* on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#replacemanagedbottoken
|
||||
|
||||
:param user_id: User identifier of the managed bot whose token will be replaced
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns the new token as *String* on success.
|
||||
"""
|
||||
|
||||
call = ReplaceManagedBotToken(
|
||||
user_id=user_id,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def save_prepared_keyboard_button(
|
||||
self,
|
||||
user_id: int,
|
||||
button: KeyboardButton,
|
||||
request_timeout: int | None = None,
|
||||
) -> PreparedKeyboardButton:
|
||||
"""
|
||||
Stores a keyboard button that can be used by a user within a Mini App. Returns a :class:`aiogram.types.prepared_keyboard_button.PreparedKeyboardButton` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#savepreparedkeyboardbutton
|
||||
|
||||
:param user_id: Unique identifier of the target user that can use the button
|
||||
:param button: A JSON-serialized object describing the button to be saved. The button must be of the type *request_users*, *request_chat*, or *request_managed_bot*
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns a :class:`aiogram.types.prepared_keyboard_button.PreparedKeyboardButton` object.
|
||||
"""
|
||||
|
||||
call = SavePreparedKeyboardButton(
|
||||
user_id=user_id,
|
||||
button=button,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
|
|
|||
|
|
@ -67,7 +67,10 @@ class ContentType(str, Enum):
|
|||
GIVEAWAY = "giveaway"
|
||||
GIVEAWAY_WINNERS = "giveaway_winners"
|
||||
GIVEAWAY_COMPLETED = "giveaway_completed"
|
||||
MANAGED_BOT_CREATED = "managed_bot_created"
|
||||
PAID_MESSAGE_PRICE_CHANGED = "paid_message_price_changed"
|
||||
POLL_OPTION_ADDED = "poll_option_added"
|
||||
POLL_OPTION_DELETED = "poll_option_deleted"
|
||||
SUGGESTED_POST_APPROVED = "suggested_post_approved"
|
||||
SUGGESTED_POST_APPROVAL_FAILED = "suggested_post_approval_failed"
|
||||
SUGGESTED_POST_DECLINED = "suggested_post_declined"
|
||||
|
|
|
|||
|
|
@ -31,3 +31,4 @@ class UpdateType(str, Enum):
|
|||
CHAT_JOIN_REQUEST = "chat_join_request"
|
||||
CHAT_BOOST = "chat_boost"
|
||||
REMOVED_CHAT_BOOST = "removed_chat_boost"
|
||||
MANAGED_BOT = "managed_bot"
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ from .get_custom_emoji_stickers import GetCustomEmojiStickers
|
|||
from .get_file import GetFile
|
||||
from .get_forum_topic_icon_stickers import GetForumTopicIconStickers
|
||||
from .get_game_high_scores import GetGameHighScores
|
||||
from .get_managed_bot_token import GetManagedBotToken
|
||||
from .get_me import GetMe
|
||||
from .get_my_commands import GetMyCommands
|
||||
from .get_my_default_administrator_rights import GetMyDefaultAdministratorRights
|
||||
|
|
@ -92,11 +93,13 @@ from .remove_my_profile_photo import RemoveMyProfilePhoto
|
|||
from .remove_user_verification import RemoveUserVerification
|
||||
from .reopen_forum_topic import ReopenForumTopic
|
||||
from .reopen_general_forum_topic import ReopenGeneralForumTopic
|
||||
from .replace_managed_bot_token import ReplaceManagedBotToken
|
||||
from .replace_sticker_in_set import ReplaceStickerInSet
|
||||
from .repost_story import RepostStory
|
||||
from .restrict_chat_member import RestrictChatMember
|
||||
from .revoke_chat_invite_link import RevokeChatInviteLink
|
||||
from .save_prepared_inline_message import SavePreparedInlineMessage
|
||||
from .save_prepared_keyboard_button import SavePreparedKeyboardButton
|
||||
from .send_animation import SendAnimation
|
||||
from .send_audio import SendAudio
|
||||
from .send_chat_action import SendChatAction
|
||||
|
|
@ -230,6 +233,7 @@ __all__ = (
|
|||
"GetFile",
|
||||
"GetForumTopicIconStickers",
|
||||
"GetGameHighScores",
|
||||
"GetManagedBotToken",
|
||||
"GetMe",
|
||||
"GetMyCommands",
|
||||
"GetMyDefaultAdministratorRights",
|
||||
|
|
@ -260,6 +264,7 @@ __all__ = (
|
|||
"RemoveUserVerification",
|
||||
"ReopenForumTopic",
|
||||
"ReopenGeneralForumTopic",
|
||||
"ReplaceManagedBotToken",
|
||||
"ReplaceStickerInSet",
|
||||
"RepostStory",
|
||||
"Request",
|
||||
|
|
@ -267,6 +272,7 @@ __all__ = (
|
|||
"RestrictChatMember",
|
||||
"RevokeChatInviteLink",
|
||||
"SavePreparedInlineMessage",
|
||||
"SavePreparedKeyboardButton",
|
||||
"SendAnimation",
|
||||
"SendAudio",
|
||||
"SendChatAction",
|
||||
|
|
|
|||
28
aiogram/methods/get_managed_bot_token.py
Normal file
28
aiogram/methods/get_managed_bot_token.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
class GetManagedBotToken(TelegramMethod[str]):
|
||||
"""
|
||||
Use this method to get the token of a managed bot. Returns the token as *String* on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getmanagedbottoken
|
||||
"""
|
||||
|
||||
__returning__ = str
|
||||
__api_method__ = "getManagedBotToken"
|
||||
|
||||
user_id: int
|
||||
"""User identifier of the managed bot whose token will be returned"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(__pydantic__self__, *, user_id: 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__(user_id=user_id, **__pydantic_kwargs)
|
||||
|
|
@ -25,9 +25,9 @@ class GiftPremiumSubscription(TelegramMethod[bool]):
|
|||
text: str | None = None
|
||||
"""Text that will be shown along with the service message about the subscription; 0-128 characters"""
|
||||
text_parse_mode: str | None = None
|
||||
"""Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
|
||||
"""Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', 'custom_emoji', and 'date_time' are ignored."""
|
||||
text_entities: list[MessageEntity] | None = None
|
||||
"""A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
|
||||
"""A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', 'custom_emoji', and 'date_time' are ignored."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
|
|||
28
aiogram/methods/replace_managed_bot_token.py
Normal file
28
aiogram/methods/replace_managed_bot_token.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
class ReplaceManagedBotToken(TelegramMethod[str]):
|
||||
"""
|
||||
Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as *String* on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#replacemanagedbottoken
|
||||
"""
|
||||
|
||||
__returning__ = str
|
||||
__api_method__ = "replaceManagedBotToken"
|
||||
|
||||
user_id: int
|
||||
"""User identifier of the managed bot whose token will be replaced"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(__pydantic__self__, *, user_id: 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__(user_id=user_id, **__pydantic_kwargs)
|
||||
33
aiogram/methods/save_prepared_keyboard_button.py
Normal file
33
aiogram/methods/save_prepared_keyboard_button.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from ..types import KeyboardButton, PreparedKeyboardButton
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
class SavePreparedKeyboardButton(TelegramMethod[PreparedKeyboardButton]):
|
||||
"""
|
||||
Stores a keyboard button that can be used by a user within a Mini App. Returns a :class:`aiogram.types.prepared_keyboard_button.PreparedKeyboardButton` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#savepreparedkeyboardbutton
|
||||
"""
|
||||
|
||||
__returning__ = PreparedKeyboardButton
|
||||
__api_method__ = "savePreparedKeyboardButton"
|
||||
|
||||
user_id: int
|
||||
"""Unique identifier of the target user that can use the button"""
|
||||
button: KeyboardButton
|
||||
"""A JSON-serialized object describing the button to be saved. The button must be of the type *request_users*, *request_chat*, or *request_managed_bot*"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, user_id: int, button: KeyboardButton, **__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__(user_id=user_id, button=button, **__pydantic_kwargs)
|
||||
|
|
@ -28,9 +28,9 @@ class SendGift(TelegramMethod[bool]):
|
|||
text: str | None = None
|
||||
"""Text that will be shown along with the gift; 0-128 characters"""
|
||||
text_parse_mode: str | None = None
|
||||
"""Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
|
||||
"""Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', 'custom_emoji', and 'date_time' are ignored."""
|
||||
text_entities: list[MessageEntity] | None = None
|
||||
"""A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored."""
|
||||
"""A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', 'custom_emoji', and 'date_time' are ignored."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
|
|||
|
|
@ -46,9 +46,17 @@ class SendPoll(TelegramMethod[Message]):
|
|||
type: str | None = None
|
||||
"""Poll type, 'quiz' or 'regular', defaults to 'regular'"""
|
||||
allows_multiple_answers: bool | None = None
|
||||
""":code:`True`, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False`"""
|
||||
correct_option_id: int | None = None
|
||||
"""0-based identifier of the correct answer option, required for polls in quiz mode"""
|
||||
"""Pass :code:`True`, if the poll allows multiple answers, defaults to :code:`False`"""
|
||||
allows_revoting: bool | None = None
|
||||
"""Pass :code:`True`, if the poll allows to change chosen answer options, defaults to :code:`False` for quizzes and to :code:`True` for regular polls"""
|
||||
shuffle_options: bool | None = None
|
||||
"""Pass :code:`True`, if the poll options must be shown in random order"""
|
||||
allow_adding_options: bool | None = None
|
||||
"""Pass :code:`True`, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes"""
|
||||
hide_results_until_closes: bool | None = None
|
||||
"""Pass :code:`True`, if poll results must be shown only after the poll closes"""
|
||||
correct_option_ids: list[int] | None = None
|
||||
"""A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode"""
|
||||
explanation: str | None = None
|
||||
"""Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing"""
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode")
|
||||
|
|
@ -56,11 +64,17 @@ class SendPoll(TelegramMethod[Message]):
|
|||
explanation_entities: list[MessageEntity] | None = None
|
||||
"""A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of *explanation_parse_mode*"""
|
||||
open_period: int | None = None
|
||||
"""Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*."""
|
||||
"""Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with *close_date*."""
|
||||
close_date: DateTimeUnion | None = None
|
||||
"""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*."""
|
||||
"""Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with *open_period*."""
|
||||
is_closed: bool | None = None
|
||||
"""Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview."""
|
||||
description: str | None = None
|
||||
"""Description of the poll to be sent, 0-1024 characters after entities parsing"""
|
||||
description_parse_mode: str | None = None
|
||||
"""Mode for parsing entities in the poll description. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
description_entities: list[MessageEntity] | None = None
|
||||
"""A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of *description_parse_mode*"""
|
||||
disable_notification: bool | None = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: bool | Default | None = Default("protect_content")
|
||||
|
|
@ -78,6 +92,11 @@ class SendPoll(TelegramMethod[Message]):
|
|||
|
||||
.. deprecated:: API:7.0
|
||||
https://core.telegram.org/bots/api-changelog#december-29-2023"""
|
||||
correct_option_id: int | None = Field(None, json_schema_extra={"deprecated": True})
|
||||
"""0-based identifier of the correct answer option, required for polls in quiz mode
|
||||
|
||||
.. deprecated:: API:9.6
|
||||
https://core.telegram.org/bots/api-changelog#april-3-2026"""
|
||||
reply_to_message_id: int | None = Field(None, json_schema_extra={"deprecated": True})
|
||||
"""If the message is a reply, ID of the original message
|
||||
|
||||
|
|
@ -101,13 +120,20 @@ class SendPoll(TelegramMethod[Message]):
|
|||
is_anonymous: bool | None = None,
|
||||
type: str | None = None,
|
||||
allows_multiple_answers: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
allows_revoting: bool | None = None,
|
||||
shuffle_options: bool | None = None,
|
||||
allow_adding_options: bool | None = None,
|
||||
hide_results_until_closes: bool | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode"),
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTimeUnion | None = None,
|
||||
is_closed: bool | None = None,
|
||||
description: str | None = None,
|
||||
description_parse_mode: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
disable_notification: bool | None = None,
|
||||
protect_content: bool | Default | None = Default("protect_content"),
|
||||
allow_paid_broadcast: bool | None = None,
|
||||
|
|
@ -115,6 +141,7 @@ class SendPoll(TelegramMethod[Message]):
|
|||
reply_parameters: ReplyParameters | None = None,
|
||||
reply_markup: ReplyMarkupUnion | None = None,
|
||||
allow_sending_without_reply: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
reply_to_message_id: int | None = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
|
|
@ -133,13 +160,20 @@ class SendPoll(TelegramMethod[Message]):
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
correct_option_id=correct_option_id,
|
||||
allows_revoting=allows_revoting,
|
||||
shuffle_options=shuffle_options,
|
||||
allow_adding_options=allow_adding_options,
|
||||
hide_results_until_closes=hide_results_until_closes,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_parse_mode=explanation_parse_mode,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
is_closed=is_closed,
|
||||
description=description,
|
||||
description_parse_mode=description_parse_mode,
|
||||
description_entities=description_entities,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
allow_paid_broadcast=allow_paid_broadcast,
|
||||
|
|
@ -147,6 +181,7 @@ class SendPoll(TelegramMethod[Message]):
|
|||
reply_parameters=reply_parameters,
|
||||
reply_markup=reply_markup,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
correct_option_id=correct_option_id,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -495,6 +495,7 @@ __all__ = (
|
|||
"KeyboardButton",
|
||||
"KeyboardButtonPollType",
|
||||
"KeyboardButtonRequestChat",
|
||||
"KeyboardButtonRequestManagedBot",
|
||||
"KeyboardButtonRequestUser",
|
||||
"KeyboardButtonRequestUsers",
|
||||
"LabeledPrice",
|
||||
|
|
@ -502,6 +503,8 @@ __all__ = (
|
|||
"Location",
|
||||
"LocationAddress",
|
||||
"LoginUrl",
|
||||
"ManagedBotCreated",
|
||||
"ManagedBotUpdated",
|
||||
"MaskPosition",
|
||||
"MaybeInaccessibleMessage",
|
||||
"MaybeInaccessibleMessageUnion",
|
||||
|
|
@ -554,8 +557,11 @@ __all__ = (
|
|||
"Poll",
|
||||
"PollAnswer",
|
||||
"PollOption",
|
||||
"PollOptionAdded",
|
||||
"PollOptionDeleted",
|
||||
"PreCheckoutQuery",
|
||||
"PreparedInlineMessage",
|
||||
"PreparedKeyboardButton",
|
||||
"ProximityAlertTriggered",
|
||||
"ReactionCount",
|
||||
"ReactionType",
|
||||
|
|
@ -652,6 +658,12 @@ __all__ = (
|
|||
from ..client.default import Default as _Default
|
||||
from .chat_owner_changed import ChatOwnerChanged
|
||||
from .chat_owner_left import ChatOwnerLeft
|
||||
from .keyboard_button_request_managed_bot import KeyboardButtonRequestManagedBot
|
||||
from .managed_bot_created import ManagedBotCreated
|
||||
from .managed_bot_updated import ManagedBotUpdated
|
||||
from .poll_option_added import PollOptionAdded
|
||||
from .poll_option_deleted import PollOptionDeleted
|
||||
from .prepared_keyboard_button import PreparedKeyboardButton
|
||||
from .user_profile_audios import UserProfileAudios
|
||||
from .video_quality import VideoQuality
|
||||
|
||||
|
|
|
|||
|
|
@ -1783,13 +1783,20 @@ class ChatJoinRequest(TelegramObject):
|
|||
is_anonymous: bool | None = None,
|
||||
type: str | None = None,
|
||||
allows_multiple_answers: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
allows_revoting: bool | None = None,
|
||||
shuffle_options: bool | None = None,
|
||||
allow_adding_options: bool | None = None,
|
||||
hide_results_until_closes: bool | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode"),
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTimeUnion | None = None,
|
||||
is_closed: bool | None = None,
|
||||
description: str | None = None,
|
||||
description_parse_mode: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
disable_notification: bool | None = None,
|
||||
protect_content: bool | Default | None = Default("protect_content"),
|
||||
allow_paid_broadcast: bool | None = None,
|
||||
|
|
@ -1797,6 +1804,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
reply_parameters: ReplyParameters | None = None,
|
||||
reply_markup: ReplyMarkupUnion | None = None,
|
||||
allow_sending_without_reply: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
reply_to_message_id: int | None = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPoll:
|
||||
|
|
@ -1818,14 +1826,21 @@ class ChatJoinRequest(TelegramObject):
|
|||
: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 allows_multiple_answers: Pass :code:`True`, if the poll allows multiple answers, defaults to :code:`False`
|
||||
:param allows_revoting: Pass :code:`True`, if the poll allows to change chosen answer options, defaults to :code:`False` for quizzes and to :code:`True` for regular polls
|
||||
:param shuffle_options: Pass :code:`True`, if the poll options must be shown in random order
|
||||
:param allow_adding_options: Pass :code:`True`, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
|
||||
:param hide_results_until_closes: Pass :code:`True`, if poll results must be shown only after the poll closes
|
||||
:param correct_option_ids: A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, 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. 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 open_period: Amount of time in seconds the poll will be active after creation, 5-2628000. 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 2628000 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 description: Description of the poll to be sent, 0-1024 characters after entities parsing
|
||||
:param description_parse_mode: Mode for parsing entities in the poll description. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param description_entities: A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of *description_parse_mode*
|
||||
: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 allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
||||
|
|
@ -1833,6 +1848,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
: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
|
||||
: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 correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode
|
||||
: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`
|
||||
"""
|
||||
|
|
@ -1852,13 +1868,20 @@ class ChatJoinRequest(TelegramObject):
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
correct_option_id=correct_option_id,
|
||||
allows_revoting=allows_revoting,
|
||||
shuffle_options=shuffle_options,
|
||||
allow_adding_options=allow_adding_options,
|
||||
hide_results_until_closes=hide_results_until_closes,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_parse_mode=explanation_parse_mode,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
is_closed=is_closed,
|
||||
description=description,
|
||||
description_parse_mode=description_parse_mode,
|
||||
description_entities=description_entities,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
allow_paid_broadcast=allow_paid_broadcast,
|
||||
|
|
@ -1866,6 +1889,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
reply_parameters=reply_parameters,
|
||||
reply_markup=reply_markup,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
correct_option_id=correct_option_id,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
|
@ -1881,13 +1905,20 @@ class ChatJoinRequest(TelegramObject):
|
|||
is_anonymous: bool | None = None,
|
||||
type: str | None = None,
|
||||
allows_multiple_answers: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
allows_revoting: bool | None = None,
|
||||
shuffle_options: bool | None = None,
|
||||
allow_adding_options: bool | None = None,
|
||||
hide_results_until_closes: bool | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode"),
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTimeUnion | None = None,
|
||||
is_closed: bool | None = None,
|
||||
description: str | None = None,
|
||||
description_parse_mode: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
disable_notification: bool | None = None,
|
||||
protect_content: bool | Default | None = Default("protect_content"),
|
||||
allow_paid_broadcast: bool | None = None,
|
||||
|
|
@ -1895,6 +1926,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
reply_parameters: ReplyParameters | None = None,
|
||||
reply_markup: ReplyMarkupUnion | None = None,
|
||||
allow_sending_without_reply: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
reply_to_message_id: int | None = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPoll:
|
||||
|
|
@ -1916,14 +1948,21 @@ class ChatJoinRequest(TelegramObject):
|
|||
: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 allows_multiple_answers: Pass :code:`True`, if the poll allows multiple answers, defaults to :code:`False`
|
||||
:param allows_revoting: Pass :code:`True`, if the poll allows to change chosen answer options, defaults to :code:`False` for quizzes and to :code:`True` for regular polls
|
||||
:param shuffle_options: Pass :code:`True`, if the poll options must be shown in random order
|
||||
:param allow_adding_options: Pass :code:`True`, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
|
||||
:param hide_results_until_closes: Pass :code:`True`, if poll results must be shown only after the poll closes
|
||||
:param correct_option_ids: A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, 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. 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 open_period: Amount of time in seconds the poll will be active after creation, 5-2628000. 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 2628000 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 description: Description of the poll to be sent, 0-1024 characters after entities parsing
|
||||
:param description_parse_mode: Mode for parsing entities in the poll description. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param description_entities: A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of *description_parse_mode*
|
||||
: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 allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
||||
|
|
@ -1931,6 +1970,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
: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
|
||||
: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 correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode
|
||||
: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`
|
||||
"""
|
||||
|
|
@ -1950,13 +1990,20 @@ class ChatJoinRequest(TelegramObject):
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
correct_option_id=correct_option_id,
|
||||
allows_revoting=allows_revoting,
|
||||
shuffle_options=shuffle_options,
|
||||
allow_adding_options=allow_adding_options,
|
||||
hide_results_until_closes=hide_results_until_closes,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_parse_mode=explanation_parse_mode,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
is_closed=is_closed,
|
||||
description=description,
|
||||
description_parse_mode=description_parse_mode,
|
||||
description_entities=description_entities,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
allow_paid_broadcast=allow_paid_broadcast,
|
||||
|
|
@ -1964,6 +2011,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
reply_parameters=reply_parameters,
|
||||
reply_markup=reply_markup,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
correct_option_id=correct_option_id,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
|
|
|||
|
|
@ -924,13 +924,20 @@ class ChatMemberUpdated(TelegramObject):
|
|||
is_anonymous: bool | None = None,
|
||||
type: str | None = None,
|
||||
allows_multiple_answers: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
allows_revoting: bool | None = None,
|
||||
shuffle_options: bool | None = None,
|
||||
allow_adding_options: bool | None = None,
|
||||
hide_results_until_closes: bool | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode"),
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTimeUnion | None = None,
|
||||
is_closed: bool | None = None,
|
||||
description: str | None = None,
|
||||
description_parse_mode: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
disable_notification: bool | None = None,
|
||||
protect_content: bool | Default | None = Default("protect_content"),
|
||||
allow_paid_broadcast: bool | None = None,
|
||||
|
|
@ -938,6 +945,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
reply_parameters: ReplyParameters | None = None,
|
||||
reply_markup: ReplyMarkupUnion | None = None,
|
||||
allow_sending_without_reply: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
reply_to_message_id: int | None = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPoll:
|
||||
|
|
@ -959,14 +967,21 @@ class ChatMemberUpdated(TelegramObject):
|
|||
: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 allows_multiple_answers: Pass :code:`True`, if the poll allows multiple answers, defaults to :code:`False`
|
||||
:param allows_revoting: Pass :code:`True`, if the poll allows to change chosen answer options, defaults to :code:`False` for quizzes and to :code:`True` for regular polls
|
||||
:param shuffle_options: Pass :code:`True`, if the poll options must be shown in random order
|
||||
:param allow_adding_options: Pass :code:`True`, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
|
||||
:param hide_results_until_closes: Pass :code:`True`, if poll results must be shown only after the poll closes
|
||||
:param correct_option_ids: A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, 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. 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 open_period: Amount of time in seconds the poll will be active after creation, 5-2628000. 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 2628000 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 description: Description of the poll to be sent, 0-1024 characters after entities parsing
|
||||
:param description_parse_mode: Mode for parsing entities in the poll description. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param description_entities: A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of *description_parse_mode*
|
||||
: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 allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
||||
|
|
@ -974,6 +989,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
: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
|
||||
: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 correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode
|
||||
: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`
|
||||
"""
|
||||
|
|
@ -993,13 +1009,20 @@ class ChatMemberUpdated(TelegramObject):
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
correct_option_id=correct_option_id,
|
||||
allows_revoting=allows_revoting,
|
||||
shuffle_options=shuffle_options,
|
||||
allow_adding_options=allow_adding_options,
|
||||
hide_results_until_closes=hide_results_until_closes,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_parse_mode=explanation_parse_mode,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
is_closed=is_closed,
|
||||
description=description,
|
||||
description_parse_mode=description_parse_mode,
|
||||
description_entities=description_entities,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
allow_paid_broadcast=allow_paid_broadcast,
|
||||
|
|
@ -1007,6 +1030,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
reply_parameters=reply_parameters,
|
||||
reply_markup=reply_markup,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
correct_option_id=correct_option_id,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
|
|
|||
|
|
@ -1746,13 +1746,20 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
|
|||
is_anonymous: bool | None = None,
|
||||
type: str | None = None,
|
||||
allows_multiple_answers: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
allows_revoting: bool | None = None,
|
||||
shuffle_options: bool | None = None,
|
||||
allow_adding_options: bool | None = None,
|
||||
hide_results_until_closes: bool | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode"),
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTimeUnion | None = None,
|
||||
is_closed: bool | None = None,
|
||||
description: str | None = None,
|
||||
description_parse_mode: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
disable_notification: bool | None = None,
|
||||
protect_content: bool | Default | None = Default("protect_content"),
|
||||
allow_paid_broadcast: bool | None = None,
|
||||
|
|
@ -1760,6 +1767,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
|
|||
reply_parameters: ReplyParameters | None = None,
|
||||
reply_markup: ReplyMarkupUnion | None = None,
|
||||
allow_sending_without_reply: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
reply_to_message_id: int | None = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPoll:
|
||||
|
|
@ -1781,14 +1789,21 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
|
|||
: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 allows_multiple_answers: Pass :code:`True`, if the poll allows multiple answers, defaults to :code:`False`
|
||||
:param allows_revoting: Pass :code:`True`, if the poll allows to change chosen answer options, defaults to :code:`False` for quizzes and to :code:`True` for regular polls
|
||||
:param shuffle_options: Pass :code:`True`, if the poll options must be shown in random order
|
||||
:param allow_adding_options: Pass :code:`True`, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
|
||||
:param hide_results_until_closes: Pass :code:`True`, if poll results must be shown only after the poll closes
|
||||
:param correct_option_ids: A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, 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. 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 open_period: Amount of time in seconds the poll will be active after creation, 5-2628000. 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 2628000 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 description: Description of the poll to be sent, 0-1024 characters after entities parsing
|
||||
:param description_parse_mode: Mode for parsing entities in the poll description. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param description_entities: A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of *description_parse_mode*
|
||||
: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 allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
||||
|
|
@ -1796,6 +1811,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
|
|||
: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
|
||||
: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 correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode
|
||||
: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`
|
||||
"""
|
||||
|
|
@ -1819,13 +1835,20 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
correct_option_id=correct_option_id,
|
||||
allows_revoting=allows_revoting,
|
||||
shuffle_options=shuffle_options,
|
||||
allow_adding_options=allow_adding_options,
|
||||
hide_results_until_closes=hide_results_until_closes,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_parse_mode=explanation_parse_mode,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
is_closed=is_closed,
|
||||
description=description,
|
||||
description_parse_mode=description_parse_mode,
|
||||
description_entities=description_entities,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
allow_paid_broadcast=allow_paid_broadcast,
|
||||
|
|
@ -1833,6 +1856,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
|
|||
reply_parameters=reply_parameters,
|
||||
reply_markup=reply_markup,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
correct_option_id=correct_option_id,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
|
@ -1848,19 +1872,27 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
|
|||
is_anonymous: bool | None = None,
|
||||
type: str | None = None,
|
||||
allows_multiple_answers: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
allows_revoting: bool | None = None,
|
||||
shuffle_options: bool | None = None,
|
||||
allow_adding_options: bool | None = None,
|
||||
hide_results_until_closes: bool | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode"),
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTimeUnion | None = None,
|
||||
is_closed: bool | None = None,
|
||||
description: str | None = None,
|
||||
description_parse_mode: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
disable_notification: bool | None = None,
|
||||
protect_content: bool | Default | None = Default("protect_content"),
|
||||
allow_paid_broadcast: bool | None = None,
|
||||
message_effect_id: str | None = None,
|
||||
reply_markup: ReplyMarkupUnion | None = None,
|
||||
allow_sending_without_reply: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPoll:
|
||||
"""
|
||||
|
|
@ -1882,20 +1914,28 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
|
|||
: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 allows_multiple_answers: Pass :code:`True`, if the poll allows multiple answers, defaults to :code:`False`
|
||||
:param allows_revoting: Pass :code:`True`, if the poll allows to change chosen answer options, defaults to :code:`False` for quizzes and to :code:`True` for regular polls
|
||||
:param shuffle_options: Pass :code:`True`, if the poll options must be shown in random order
|
||||
:param allow_adding_options: Pass :code:`True`, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
|
||||
:param hide_results_until_closes: Pass :code:`True`, if poll results must be shown only after the poll closes
|
||||
:param correct_option_ids: A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, 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. 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 open_period: Amount of time in seconds the poll will be active after creation, 5-2628000. 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 2628000 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 description: Description of the poll to be sent, 0-1024 characters after entities parsing
|
||||
:param description_parse_mode: Mode for parsing entities in the poll description. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param description_entities: A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of *description_parse_mode*
|
||||
: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 allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
||||
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
|
||||
: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 correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode
|
||||
:return: instance of method :class:`aiogram.methods.send_poll.SendPoll`
|
||||
"""
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -1919,19 +1959,27 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
correct_option_id=correct_option_id,
|
||||
allows_revoting=allows_revoting,
|
||||
shuffle_options=shuffle_options,
|
||||
allow_adding_options=allow_adding_options,
|
||||
hide_results_until_closes=hide_results_until_closes,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_parse_mode=explanation_parse_mode,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
is_closed=is_closed,
|
||||
description=description,
|
||||
description_parse_mode=description_parse_mode,
|
||||
description_entities=description_entities,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
allow_paid_broadcast=allow_paid_broadcast,
|
||||
message_effect_id=message_effect_id,
|
||||
reply_markup=reply_markup,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
correct_option_id=correct_option_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class InputChecklist(TelegramObject):
|
|||
parse_mode: str | None = None
|
||||
"""*Optional*. Mode for parsing entities in the title. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
title_entities: list[MessageEntity] | None = None
|
||||
"""*Optional*. List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities are allowed."""
|
||||
"""*Optional*. List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, *custom_emoji*, and *date_time* entities are allowed."""
|
||||
others_can_add_tasks: bool | None = None
|
||||
"""*Optional*. Pass :code:`True` if other users can add tasks to the checklist"""
|
||||
others_can_mark_tasks_as_done: bool | None = None
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class InputChecklistTask(TelegramObject):
|
|||
parse_mode: str | None = None
|
||||
"""*Optional*. Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
text_entities: list[MessageEntity] | None = None
|
||||
"""*Optional*. List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities are allowed."""
|
||||
"""*Optional*. List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, *custom_emoji*, and *date_time* entities are allowed."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from .base import MutableTelegramObject
|
|||
if TYPE_CHECKING:
|
||||
from .keyboard_button_poll_type import KeyboardButtonPollType
|
||||
from .keyboard_button_request_chat import KeyboardButtonRequestChat
|
||||
from .keyboard_button_request_managed_bot import KeyboardButtonRequestManagedBot
|
||||
from .keyboard_button_request_user import KeyboardButtonRequestUser
|
||||
from .keyboard_button_request_users import KeyboardButtonRequestUsers
|
||||
from .web_app_info import WebAppInfo
|
||||
|
|
@ -31,6 +32,8 @@ class KeyboardButton(MutableTelegramObject):
|
|||
"""*Optional*. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only."""
|
||||
request_chat: KeyboardButtonRequestChat | None = None
|
||||
"""*Optional*. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a 'chat_shared' service message. Available in private chats only."""
|
||||
request_managed_bot: KeyboardButtonRequestManagedBot | None = None
|
||||
"""*Optional*. If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the `@BotFather <https://t.me/BotFather>`_ Mini App. Available in private chats only."""
|
||||
request_contact: bool | None = None
|
||||
"""*Optional*. If :code:`True`, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only."""
|
||||
request_location: bool | None = None
|
||||
|
|
@ -59,6 +62,7 @@ class KeyboardButton(MutableTelegramObject):
|
|||
style: str | None = None,
|
||||
request_users: KeyboardButtonRequestUsers | None = None,
|
||||
request_chat: KeyboardButtonRequestChat | None = None,
|
||||
request_managed_bot: KeyboardButtonRequestManagedBot | None = None,
|
||||
request_contact: bool | None = None,
|
||||
request_location: bool | None = None,
|
||||
request_poll: KeyboardButtonPollType | None = None,
|
||||
|
|
@ -76,6 +80,7 @@ class KeyboardButton(MutableTelegramObject):
|
|||
style=style,
|
||||
request_users=request_users,
|
||||
request_chat=request_chat,
|
||||
request_managed_bot=request_managed_bot,
|
||||
request_contact=request_contact,
|
||||
request_location=request_location,
|
||||
request_poll=request_poll,
|
||||
|
|
|
|||
41
aiogram/types/keyboard_button_request_managed_bot.py
Normal file
41
aiogram/types/keyboard_button_request_managed_bot.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
class KeyboardButtonRequestManagedBot(TelegramObject):
|
||||
"""
|
||||
This object defines the parameters for the creation of a managed bot. Information about the created bot will be shared with the bot using the update *managed_bot* and a :class:`aiogram.types.message.Message` with the field *managed_bot_created*.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#keyboardbuttonrequestmanagedbot
|
||||
"""
|
||||
|
||||
request_id: int
|
||||
"""Signed 32-bit identifier of the request. Must be unique within the message"""
|
||||
suggested_name: str | None = None
|
||||
"""*Optional*. Suggested name for the bot"""
|
||||
suggested_username: str | None = None
|
||||
"""*Optional*. Suggested username for the bot"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
request_id: int,
|
||||
suggested_name: str | None = None,
|
||||
suggested_username: str | None = 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__(
|
||||
request_id=request_id,
|
||||
suggested_name=suggested_name,
|
||||
suggested_username=suggested_username,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
32
aiogram/types/managed_bot_created.py
Normal file
32
aiogram/types/managed_bot_created.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .user import User
|
||||
|
||||
|
||||
class ManagedBotCreated(TelegramObject):
|
||||
"""
|
||||
This object contains information about the bot that was created to be managed by the current bot.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#managedbotcreated
|
||||
"""
|
||||
|
||||
bot_user: User = Field(..., alias="bot")
|
||||
"""Information about the bot. The bot's token can be fetched using the method :class:`aiogram.methods.get_managed_bot_token.GetManagedBotToken`."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(__pydantic__self__, *, bot_user: User, **__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__(bot_user=bot_user, **__pydantic_kwargs)
|
||||
36
aiogram/types/managed_bot_updated.py
Normal file
36
aiogram/types/managed_bot_updated.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .user import User
|
||||
|
||||
|
||||
class ManagedBotUpdated(TelegramObject):
|
||||
"""
|
||||
This object contains information about the creation or token update of a bot that is managed by the current bot.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#managedbotupdated
|
||||
"""
|
||||
|
||||
user: User
|
||||
"""User that created the bot"""
|
||||
bot_user: User = Field(..., alias="bot")
|
||||
"""Information about the bot. Token of the bot can be fetched using the method :class:`aiogram.methods.get_managed_bot_token.GetManagedBotToken`."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, user: User, bot_user: User, **__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__(user=user, bot_user=bot_user, **__pydantic_kwargs)
|
||||
|
|
@ -90,6 +90,7 @@ if TYPE_CHECKING:
|
|||
from .labeled_price import LabeledPrice
|
||||
from .link_preview_options import LinkPreviewOptions
|
||||
from .location import Location
|
||||
from .managed_bot_created import ManagedBotCreated
|
||||
from .maybe_inaccessible_message_union import MaybeInaccessibleMessageUnion
|
||||
from .media_union import MediaUnion
|
||||
from .message_auto_delete_timer_changed import MessageAutoDeleteTimerChanged
|
||||
|
|
@ -100,6 +101,8 @@ if TYPE_CHECKING:
|
|||
from .passport_data import PassportData
|
||||
from .photo_size import PhotoSize
|
||||
from .poll import Poll
|
||||
from .poll_option_added import PollOptionAdded
|
||||
from .poll_option_deleted import PollOptionDeleted
|
||||
from .proximity_alert_triggered import ProximityAlertTriggered
|
||||
from .reaction_type_union import ReactionTypeUnion
|
||||
from .refunded_payment import RefundedPayment
|
||||
|
|
@ -177,6 +180,8 @@ class Message(MaybeInaccessibleMessage):
|
|||
"""*Optional*. For replies to a story, the original story"""
|
||||
reply_to_checklist_task_id: int | None = None
|
||||
"""*Optional*. Identifier of the specific checklist task that is being replied to"""
|
||||
reply_to_poll_option_id: str | None = None
|
||||
"""*Optional*. Persistent identifier of the specific poll option that is being replied to"""
|
||||
via_bot: User | None = None
|
||||
"""*Optional*. Bot through which the message was sent"""
|
||||
edit_date: int | None = None
|
||||
|
|
@ -327,8 +332,14 @@ class Message(MaybeInaccessibleMessage):
|
|||
"""*Optional*. A giveaway with public winners was completed"""
|
||||
giveaway_completed: GiveawayCompleted | None = None
|
||||
"""*Optional*. Service message: a giveaway without public winners was completed"""
|
||||
managed_bot_created: ManagedBotCreated | None = None
|
||||
"""*Optional*. Service message: user created a bot that will be managed by the current bot"""
|
||||
paid_message_price_changed: PaidMessagePriceChanged | None = None
|
||||
"""*Optional*. Service message: the price for paid messages has changed in the chat"""
|
||||
poll_option_added: PollOptionAdded | None = None
|
||||
"""*Optional*. Service message: answer option was added to a poll"""
|
||||
poll_option_deleted: PollOptionDeleted | None = None
|
||||
"""*Optional*. Service message: answer option was deleted from a poll"""
|
||||
suggested_post_approved: SuggestedPostApproved | None = None
|
||||
"""*Optional*. Service message: a suggested post was approved"""
|
||||
suggested_post_approval_failed: SuggestedPostApprovalFailed | None = None
|
||||
|
|
@ -413,6 +424,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
quote: TextQuote | None = None,
|
||||
reply_to_story: Story | None = None,
|
||||
reply_to_checklist_task_id: int | None = None,
|
||||
reply_to_poll_option_id: str | None = None,
|
||||
via_bot: User | None = None,
|
||||
edit_date: int | None = None,
|
||||
has_protected_content: bool | None = None,
|
||||
|
|
@ -488,7 +500,10 @@ class Message(MaybeInaccessibleMessage):
|
|||
giveaway: Giveaway | None = None,
|
||||
giveaway_winners: GiveawayWinners | None = None,
|
||||
giveaway_completed: GiveawayCompleted | None = None,
|
||||
managed_bot_created: ManagedBotCreated | None = None,
|
||||
paid_message_price_changed: PaidMessagePriceChanged | None = None,
|
||||
poll_option_added: PollOptionAdded | None = None,
|
||||
poll_option_deleted: PollOptionDeleted | None = None,
|
||||
suggested_post_approved: SuggestedPostApproved | None = None,
|
||||
suggested_post_approval_failed: SuggestedPostApprovalFailed | None = None,
|
||||
suggested_post_declined: SuggestedPostDeclined | None = None,
|
||||
|
|
@ -533,6 +548,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
quote=quote,
|
||||
reply_to_story=reply_to_story,
|
||||
reply_to_checklist_task_id=reply_to_checklist_task_id,
|
||||
reply_to_poll_option_id=reply_to_poll_option_id,
|
||||
via_bot=via_bot,
|
||||
edit_date=edit_date,
|
||||
has_protected_content=has_protected_content,
|
||||
|
|
@ -608,7 +624,10 @@ class Message(MaybeInaccessibleMessage):
|
|||
giveaway=giveaway,
|
||||
giveaway_winners=giveaway_winners,
|
||||
giveaway_completed=giveaway_completed,
|
||||
managed_bot_created=managed_bot_created,
|
||||
paid_message_price_changed=paid_message_price_changed,
|
||||
poll_option_added=poll_option_added,
|
||||
poll_option_deleted=poll_option_deleted,
|
||||
suggested_post_approved=suggested_post_approved,
|
||||
suggested_post_approval_failed=suggested_post_approval_failed,
|
||||
suggested_post_declined=suggested_post_declined,
|
||||
|
|
@ -774,6 +793,12 @@ class Message(MaybeInaccessibleMessage):
|
|||
return ContentType.SUGGESTED_POST_PAID
|
||||
if self.suggested_post_refunded:
|
||||
return ContentType.SUGGESTED_POST_REFUNDED
|
||||
if self.managed_bot_created:
|
||||
return ContentType.MANAGED_BOT_CREATED
|
||||
if self.poll_option_added:
|
||||
return ContentType.POLL_OPTION_ADDED
|
||||
if self.poll_option_deleted:
|
||||
return ContentType.POLL_OPTION_DELETED
|
||||
return ContentType.UNKNOWN
|
||||
|
||||
def _unparse_entities(self, text_decoration: TextDecoration) -> str:
|
||||
|
|
@ -2444,19 +2469,27 @@ class Message(MaybeInaccessibleMessage):
|
|||
is_anonymous: bool | None = None,
|
||||
type: str | None = None,
|
||||
allows_multiple_answers: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
allows_revoting: bool | None = None,
|
||||
shuffle_options: bool | None = None,
|
||||
allow_adding_options: bool | None = None,
|
||||
hide_results_until_closes: bool | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode"),
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTimeUnion | None = None,
|
||||
is_closed: bool | None = None,
|
||||
description: str | None = None,
|
||||
description_parse_mode: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
disable_notification: bool | None = None,
|
||||
protect_content: bool | Default | None = Default("protect_content"),
|
||||
allow_paid_broadcast: bool | None = None,
|
||||
message_effect_id: str | None = None,
|
||||
reply_markup: ReplyMarkupUnion | None = None,
|
||||
allow_sending_without_reply: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPoll:
|
||||
"""
|
||||
|
|
@ -2478,20 +2511,28 @@ class Message(MaybeInaccessibleMessage):
|
|||
: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 allows_multiple_answers: Pass :code:`True`, if the poll allows multiple answers, defaults to :code:`False`
|
||||
:param allows_revoting: Pass :code:`True`, if the poll allows to change chosen answer options, defaults to :code:`False` for quizzes and to :code:`True` for regular polls
|
||||
:param shuffle_options: Pass :code:`True`, if the poll options must be shown in random order
|
||||
:param allow_adding_options: Pass :code:`True`, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
|
||||
:param hide_results_until_closes: Pass :code:`True`, if poll results must be shown only after the poll closes
|
||||
:param correct_option_ids: A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, 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. 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 open_period: Amount of time in seconds the poll will be active after creation, 5-2628000. 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 2628000 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 description: Description of the poll to be sent, 0-1024 characters after entities parsing
|
||||
:param description_parse_mode: Mode for parsing entities in the poll description. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param description_entities: A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of *description_parse_mode*
|
||||
: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 allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
||||
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
|
||||
: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 correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode
|
||||
:return: instance of method :class:`aiogram.methods.send_poll.SendPoll`
|
||||
"""
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -2515,19 +2556,27 @@ class Message(MaybeInaccessibleMessage):
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
correct_option_id=correct_option_id,
|
||||
allows_revoting=allows_revoting,
|
||||
shuffle_options=shuffle_options,
|
||||
allow_adding_options=allow_adding_options,
|
||||
hide_results_until_closes=hide_results_until_closes,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_parse_mode=explanation_parse_mode,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
is_closed=is_closed,
|
||||
description=description,
|
||||
description_parse_mode=description_parse_mode,
|
||||
description_entities=description_entities,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
allow_paid_broadcast=allow_paid_broadcast,
|
||||
message_effect_id=message_effect_id,
|
||||
reply_markup=reply_markup,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
correct_option_id=correct_option_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
||||
|
|
@ -2540,13 +2589,20 @@ class Message(MaybeInaccessibleMessage):
|
|||
is_anonymous: bool | None = None,
|
||||
type: str | None = None,
|
||||
allows_multiple_answers: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
allows_revoting: bool | None = None,
|
||||
shuffle_options: bool | None = None,
|
||||
allow_adding_options: bool | None = None,
|
||||
hide_results_until_closes: bool | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_parse_mode: str | Default | None = Default("parse_mode"),
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTimeUnion | None = None,
|
||||
is_closed: bool | None = None,
|
||||
description: str | None = None,
|
||||
description_parse_mode: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
disable_notification: bool | None = None,
|
||||
protect_content: bool | Default | None = Default("protect_content"),
|
||||
allow_paid_broadcast: bool | None = None,
|
||||
|
|
@ -2554,6 +2610,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
reply_parameters: ReplyParameters | None = None,
|
||||
reply_markup: ReplyMarkupUnion | None = None,
|
||||
allow_sending_without_reply: bool | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
reply_to_message_id: int | None = None,
|
||||
**kwargs: Any,
|
||||
) -> SendPoll:
|
||||
|
|
@ -2575,14 +2632,21 @@ class Message(MaybeInaccessibleMessage):
|
|||
: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 allows_multiple_answers: Pass :code:`True`, if the poll allows multiple answers, defaults to :code:`False`
|
||||
:param allows_revoting: Pass :code:`True`, if the poll allows to change chosen answer options, defaults to :code:`False` for quizzes and to :code:`True` for regular polls
|
||||
:param shuffle_options: Pass :code:`True`, if the poll options must be shown in random order
|
||||
:param allow_adding_options: Pass :code:`True`, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes
|
||||
:param hide_results_until_closes: Pass :code:`True`, if poll results must be shown only after the poll closes
|
||||
:param correct_option_ids: A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, 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. 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 open_period: Amount of time in seconds the poll will be active after creation, 5-2628000. 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 2628000 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 description: Description of the poll to be sent, 0-1024 characters after entities parsing
|
||||
:param description_parse_mode: Mode for parsing entities in the poll description. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||
:param description_entities: A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of *description_parse_mode*
|
||||
: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 allow_paid_broadcast: Pass :code:`True` to allow up to 1000 messages per second, ignoring `broadcasting limits <https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once>`_ for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
|
||||
|
|
@ -2590,6 +2654,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
: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
|
||||
: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 correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode
|
||||
: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`
|
||||
"""
|
||||
|
|
@ -2613,13 +2678,20 @@ class Message(MaybeInaccessibleMessage):
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
correct_option_id=correct_option_id,
|
||||
allows_revoting=allows_revoting,
|
||||
shuffle_options=shuffle_options,
|
||||
allow_adding_options=allow_adding_options,
|
||||
hide_results_until_closes=hide_results_until_closes,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_parse_mode=explanation_parse_mode,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
is_closed=is_closed,
|
||||
description=description,
|
||||
description_parse_mode=description_parse_mode,
|
||||
description_entities=description_entities,
|
||||
disable_notification=disable_notification,
|
||||
protect_content=protect_content,
|
||||
allow_paid_broadcast=allow_paid_broadcast,
|
||||
|
|
@ -2627,6 +2699,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
reply_parameters=reply_parameters,
|
||||
reply_markup=reply_markup,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
correct_option_id=correct_option_id,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from .base import TelegramObject
|
||||
from .custom import DateTime
|
||||
|
||||
|
|
@ -33,10 +35,12 @@ class Poll(TelegramObject):
|
|||
"""Poll type, currently can be 'regular' or 'quiz'"""
|
||||
allows_multiple_answers: bool
|
||||
""":code:`True`, if the poll allows multiple answers"""
|
||||
allows_revoting: bool
|
||||
""":code:`True`, if the poll allows to change the chosen answer options"""
|
||||
question_entities: list[MessageEntity] | None = None
|
||||
"""*Optional*. Special entities that appear in the *question*. Currently, only custom emoji entities are allowed in poll questions"""
|
||||
correct_option_id: int | None = 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."""
|
||||
correct_option_ids: list[int] | None = None
|
||||
"""*Optional*. Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot."""
|
||||
explanation: str | None = None
|
||||
"""*Optional*. 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"""
|
||||
explanation_entities: list[MessageEntity] | None = None
|
||||
|
|
@ -45,6 +49,15 @@ class Poll(TelegramObject):
|
|||
"""*Optional*. Amount of time in seconds the poll will be active after creation"""
|
||||
close_date: DateTime | None = None
|
||||
"""*Optional*. Point in time (Unix timestamp) when the poll will be automatically closed"""
|
||||
description: str | None = None
|
||||
"""*Optional*. Description of the poll; for polls inside the :class:`aiogram.types.message.Message` object only"""
|
||||
description_entities: list[MessageEntity] | None = None
|
||||
"""*Optional*. Special entities like usernames, URLs, bot commands, etc. that appear in the description"""
|
||||
correct_option_id: int | None = Field(None, json_schema_extra={"deprecated": True})
|
||||
"""*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.
|
||||
|
||||
.. deprecated:: API:9.6
|
||||
https://core.telegram.org/bots/api-changelog#april-3-2026"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -61,12 +74,16 @@ class Poll(TelegramObject):
|
|||
is_anonymous: bool,
|
||||
type: str,
|
||||
allows_multiple_answers: bool,
|
||||
allows_revoting: bool,
|
||||
question_entities: list[MessageEntity] | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
correct_option_ids: list[int] | None = None,
|
||||
explanation: str | None = None,
|
||||
explanation_entities: list[MessageEntity] | None = None,
|
||||
open_period: int | None = None,
|
||||
close_date: DateTime | None = None,
|
||||
description: str | None = None,
|
||||
description_entities: list[MessageEntity] | None = None,
|
||||
correct_option_id: int | None = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -82,11 +99,15 @@ class Poll(TelegramObject):
|
|||
is_anonymous=is_anonymous,
|
||||
type=type,
|
||||
allows_multiple_answers=allows_multiple_answers,
|
||||
allows_revoting=allows_revoting,
|
||||
question_entities=question_entities,
|
||||
correct_option_id=correct_option_id,
|
||||
correct_option_ids=correct_option_ids,
|
||||
explanation=explanation,
|
||||
explanation_entities=explanation_entities,
|
||||
open_period=open_period,
|
||||
close_date=close_date,
|
||||
description=description,
|
||||
description_entities=description_entities,
|
||||
correct_option_id=correct_option_id,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class PollAnswer(TelegramObject):
|
|||
"""Unique poll identifier"""
|
||||
option_ids: list[int]
|
||||
"""0-based identifiers of chosen answer options. May be empty if the vote was retracted."""
|
||||
option_persistent_ids: list[str]
|
||||
"""Persistent identifiers of the chosen answer options. May be empty if the vote was retracted."""
|
||||
voter_chat: Chat | None = None
|
||||
"""*Optional*. The chat that changed the answer to the poll, if the voter is anonymous"""
|
||||
user: User | None = None
|
||||
|
|
@ -34,6 +36,7 @@ class PollAnswer(TelegramObject):
|
|||
*,
|
||||
poll_id: str,
|
||||
option_ids: list[int],
|
||||
option_persistent_ids: list[str],
|
||||
voter_chat: Chat | None = None,
|
||||
user: User | None = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
|
|
@ -45,6 +48,7 @@ class PollAnswer(TelegramObject):
|
|||
super().__init__(
|
||||
poll_id=poll_id,
|
||||
option_ids=option_ids,
|
||||
option_persistent_ids=option_persistent_ids,
|
||||
voter_chat=voter_chat,
|
||||
user=user,
|
||||
**__pydantic_kwargs,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ from typing import TYPE_CHECKING, Any
|
|||
from .base import TelegramObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .chat import Chat
|
||||
from .message_entity import MessageEntity
|
||||
from .user import User
|
||||
|
||||
|
||||
class PollOption(TelegramObject):
|
||||
|
|
@ -15,12 +17,20 @@ class PollOption(TelegramObject):
|
|||
Source: https://core.telegram.org/bots/api#polloption
|
||||
"""
|
||||
|
||||
persistent_id: str
|
||||
"""Unique identifier of the option, persistent on option addition and deletion"""
|
||||
text: str
|
||||
"""Option text, 1-100 characters"""
|
||||
voter_count: int
|
||||
"""Number of users that voted for this option"""
|
||||
"""Number of users who voted for this option; may be 0 if unknown"""
|
||||
text_entities: list[MessageEntity] | None = None
|
||||
"""*Optional*. Special entities that appear in the option *text*. Currently, only custom emoji entities are allowed in poll option texts"""
|
||||
added_by_user: User | None = None
|
||||
"""*Optional*. User who added the option; omitted if the option wasn't added by a user after poll creation"""
|
||||
added_by_chat: Chat | None = None
|
||||
"""*Optional*. Chat that added the option; omitted if the option wasn't added by a chat after poll creation"""
|
||||
addition_date: int | None = None
|
||||
"""*Optional*. Point in time (Unix timestamp) when the option was added; omitted if the option existed in the original poll"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -29,9 +39,13 @@ class PollOption(TelegramObject):
|
|||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
persistent_id: str,
|
||||
text: str,
|
||||
voter_count: int,
|
||||
text_entities: list[MessageEntity] | None = None,
|
||||
added_by_user: User | None = None,
|
||||
added_by_chat: Chat | None = None,
|
||||
addition_date: int | None = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -39,8 +53,12 @@ class PollOption(TelegramObject):
|
|||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
persistent_id=persistent_id,
|
||||
text=text,
|
||||
voter_count=voter_count,
|
||||
text_entities=text_entities,
|
||||
added_by_user=added_by_user,
|
||||
added_by_chat=added_by_chat,
|
||||
addition_date=addition_date,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
51
aiogram/types/poll_option_added.py
Normal file
51
aiogram/types/poll_option_added.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .maybe_inaccessible_message_union import MaybeInaccessibleMessageUnion
|
||||
from .message_entity import MessageEntity
|
||||
|
||||
|
||||
class PollOptionAdded(TelegramObject):
|
||||
"""
|
||||
Describes a service message about an option added to a poll.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#polloptionadded
|
||||
"""
|
||||
|
||||
option_persistent_id: str
|
||||
"""Unique identifier of the added option"""
|
||||
option_text: str
|
||||
"""Option text"""
|
||||
poll_message: MaybeInaccessibleMessageUnion | None = None
|
||||
"""*Optional*. Message containing the poll to which the option was added, if known. Note that the :class:`aiogram.types.message.Message` object in this field will not contain the *reply_to_message* field even if it itself is a reply."""
|
||||
option_text_entities: list[MessageEntity] | None = None
|
||||
"""*Optional*. Special entities that appear in the *option_text*"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
option_persistent_id: str,
|
||||
option_text: str,
|
||||
poll_message: MaybeInaccessibleMessageUnion | None = None,
|
||||
option_text_entities: list[MessageEntity] | None = 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__(
|
||||
option_persistent_id=option_persistent_id,
|
||||
option_text=option_text,
|
||||
poll_message=poll_message,
|
||||
option_text_entities=option_text_entities,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
51
aiogram/types/poll_option_deleted.py
Normal file
51
aiogram/types/poll_option_deleted.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .maybe_inaccessible_message_union import MaybeInaccessibleMessageUnion
|
||||
from .message_entity import MessageEntity
|
||||
|
||||
|
||||
class PollOptionDeleted(TelegramObject):
|
||||
"""
|
||||
Describes a service message about an option deleted from a poll.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#polloptiondeleted
|
||||
"""
|
||||
|
||||
option_persistent_id: str
|
||||
"""Unique identifier of the deleted option"""
|
||||
option_text: str
|
||||
"""Option text"""
|
||||
poll_message: MaybeInaccessibleMessageUnion | None = None
|
||||
"""*Optional*. Message containing the poll from which the option was deleted, if known. Note that the :class:`aiogram.types.message.Message` object in this field will not contain the *reply_to_message* field even if it itself is a reply."""
|
||||
option_text_entities: list[MessageEntity] | None = None
|
||||
"""*Optional*. Special entities that appear in the *option_text*"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
option_persistent_id: str,
|
||||
option_text: str,
|
||||
poll_message: MaybeInaccessibleMessageUnion | None = None,
|
||||
option_text_entities: list[MessageEntity] | None = 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__(
|
||||
option_persistent_id=option_persistent_id,
|
||||
option_text=option_text,
|
||||
poll_message=poll_message,
|
||||
option_text_entities=option_text_entities,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
25
aiogram/types/prepared_keyboard_button.py
Normal file
25
aiogram/types/prepared_keyboard_button.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
class PreparedKeyboardButton(TelegramObject):
|
||||
"""
|
||||
Describes a keyboard button to be used by a user of a Mini App.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#preparedkeyboardbutton
|
||||
"""
|
||||
|
||||
id: str
|
||||
"""Unique identifier of the keyboard button"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(__pydantic__self__, *, id: 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__(id=id, **__pydantic_kwargs)
|
||||
|
|
@ -24,7 +24,7 @@ class ReplyParameters(TelegramObject):
|
|||
allow_sending_without_reply: bool | Default | None = Default("allow_sending_without_reply")
|
||||
"""*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found. Always :code:`False` for replies in another chat or forum topic. Always :code:`True` for messages sent on behalf of a business account."""
|
||||
quote: str | None = None
|
||||
"""*Optional*. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities. The message will fail to send if the quote isn't found in the original message."""
|
||||
"""*Optional*. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, *custom_emoji*, and *date_time* entities. The message will fail to send if the quote isn't found in the original message."""
|
||||
quote_parse_mode: str | Default | None = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the quote. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
quote_entities: list[MessageEntity] | None = None
|
||||
|
|
@ -33,6 +33,8 @@ class ReplyParameters(TelegramObject):
|
|||
"""*Optional*. Position of the quote in the original message in UTF-16 code units"""
|
||||
checklist_task_id: int | None = None
|
||||
"""*Optional*. Identifier of the specific checklist task to be replied to"""
|
||||
poll_option_id: str | None = None
|
||||
"""*Optional*. Persistent identifier of the specific poll option to be replied to"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -51,6 +53,7 @@ class ReplyParameters(TelegramObject):
|
|||
quote_entities: list[MessageEntity] | None = None,
|
||||
quote_position: int | None = None,
|
||||
checklist_task_id: int | None = None,
|
||||
poll_option_id: str | None = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -66,5 +69,6 @@ class ReplyParameters(TelegramObject):
|
|||
quote_entities=quote_entities,
|
||||
quote_position=quote_position,
|
||||
checklist_task_id=checklist_task_id,
|
||||
poll_option_id=poll_option_id,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class TextQuote(TelegramObject):
|
|||
position: int
|
||||
"""Approximate quote position in the original message in UTF-16 code units as specified by the sender"""
|
||||
entities: list[MessageEntity] | None = None
|
||||
"""*Optional*. Special entities that appear in the quote. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities are kept in quotes."""
|
||||
"""*Optional*. Special entities that appear in the quote. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, *custom_emoji*, and *date_time* entities are kept in quotes."""
|
||||
is_manual: bool | None = None
|
||||
"""*Optional*. :code:`True`, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server."""
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ if TYPE_CHECKING:
|
|||
from .chat_member_updated import ChatMemberUpdated
|
||||
from .chosen_inline_result import ChosenInlineResult
|
||||
from .inline_query import InlineQuery
|
||||
from .managed_bot_updated import ManagedBotUpdated
|
||||
from .message import Message
|
||||
from .message_reaction_count_updated import MessageReactionCountUpdated
|
||||
from .message_reaction_updated import MessageReactionUpdated
|
||||
|
|
@ -82,6 +83,8 @@ class Update(TelegramObject):
|
|||
"""*Optional*. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates."""
|
||||
removed_chat_boost: ChatBoostRemoved | None = None
|
||||
"""*Optional*. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates."""
|
||||
managed_bot: ManagedBotUpdated | None = None
|
||||
"""*Optional*. A new bot was created to be managed by the bot or token of a bot was changed"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -114,6 +117,7 @@ class Update(TelegramObject):
|
|||
chat_join_request: ChatJoinRequest | None = None,
|
||||
chat_boost: ChatBoostUpdated | None = None,
|
||||
removed_chat_boost: ChatBoostRemoved | None = None,
|
||||
managed_bot: ManagedBotUpdated | None = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -145,6 +149,7 @@ class Update(TelegramObject):
|
|||
chat_join_request=chat_join_request,
|
||||
chat_boost=chat_boost,
|
||||
removed_chat_boost=removed_chat_boost,
|
||||
managed_bot=managed_bot,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ class User(TelegramObject):
|
|||
"""*Optional*. :code:`True`, if the bot has forum topic mode enabled in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`."""
|
||||
allows_users_to_create_topics: bool | None = None
|
||||
"""*Optional*. :code:`True`, if the bot allows users to create and delete topics in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`."""
|
||||
can_manage_bots: bool | None = None
|
||||
"""*Optional*. :code:`True`, if other bots can be created to be controlled by the bot. Returned only in :class:`aiogram.methods.get_me.GetMe`."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -70,6 +72,7 @@ class User(TelegramObject):
|
|||
has_main_web_app: bool | None = None,
|
||||
has_topics_enabled: bool | None = None,
|
||||
allows_users_to_create_topics: bool | None = None,
|
||||
can_manage_bots: bool | None = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -92,6 +95,7 @@ class User(TelegramObject):
|
|||
has_main_web_app=has_main_web_app,
|
||||
has_topics_enabled=has_topics_enabled,
|
||||
allows_users_to_create_topics=allows_users_to_create_topics,
|
||||
can_manage_bots=can_manage_bots,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue