From 6795b3de05e85fc7284628821e5c05872b8f7938 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sun, 31 Dec 2023 01:40:44 +0200 Subject: [PATCH] Added support for Bot API 7.0 (#1387) * Added support for Bot API 7.0 * Fixed available tests * Fixed text decorations * Bot API 7.0 tests for ForwardMessages * Bot API 7.0 tests for CopyMessages * Bot API 7.0 tests for DeleteMessages * Bot API 7.0 tests for GetUserChatBoosts * Bot API 7.0 tests for SetMessageReaction * Fixed custom_emoji attribute name * Fixed tests * Test parsing CallbackQuery message (inaccessible and accessible) * Added changes description * Bot API 7.0 tests for dispatcher handle update message_reaction * Bot API 7.0 tests for dispatcher handle update message_reaction_count * Bot API 7.0 tests for dispatcher handle update chat_boost * Bot API 7.0 tests for dispatcher handle update removed_chat_boost * fix tests: update ReactionTypeCustomEmoji custom_emoji -> custom_emoji_id * micro fix Markdown V2 blockquote * add tests for Markdown tools * fix markdown test apply single entity * add tests coverage for Message.react * check that all messages and content types are covered for Message.content_type * sort imports in tests (run `make reformat lint`) * update Giveaway objects Unix time field to DateTime type * Update Message.content_type property * upgrade tests for message content_types and sent_copy * Update Giveaway type generation config * Update GiveawayWinners and PassportFile types generation configs --------- Co-authored-by: Suren Khorenyan --- .apiversion | 2 +- .butcher/enums/ChatBoostSourceType.yml | 12 + .butcher/enums/ContentType.yml | 4 + .butcher/enums/MessageOriginType.yml | 13 + .butcher/enums/ReactionTypeType.yml | 11 + .butcher/methods/copyMessage/entity.json | 48 +- .butcher/methods/copyMessages/entity.json | 73 + .butcher/methods/deleteMessages/entity.json | 33 + .butcher/methods/editMessageText/entity.json | 22 +- .butcher/methods/forwardMessage/entity.json | 6 +- .butcher/methods/forwardMessages/entity.json | 65 + .butcher/methods/getChat/entity.json | 6 +- .butcher/methods/getUpdates/entity.json | 6 +- .../methods/getUserChatBoosts/entity.json | 33 + .butcher/methods/sendAnimation/entity.json | 42 +- .butcher/methods/sendAudio/entity.json | 42 +- .butcher/methods/sendContact/entity.json | 42 +- .butcher/methods/sendDice/entity.json | 42 +- .butcher/methods/sendDocument/entity.json | 42 +- .butcher/methods/sendGame/entity.json | 42 +- .butcher/methods/sendInvoice/entity.json | 42 +- .butcher/methods/sendLocation/entity.json | 42 +- .butcher/methods/sendMediaGroup/entity.json | 28 +- .butcher/methods/sendMessage/entity.json | 64 +- .butcher/methods/sendPhoto/entity.json | 42 +- .butcher/methods/sendPoll/entity.json | 42 +- .butcher/methods/sendSticker/entity.json | 42 +- .butcher/methods/sendVenue/entity.json | 42 +- .butcher/methods/sendVideo/entity.json | 42 +- .butcher/methods/sendVideoNote/entity.json | 42 +- .butcher/methods/sendVoice/entity.json | 42 +- .../methods/setMessageReaction/entity.json | 49 + .butcher/methods/setWebhook/entity.json | 6 +- .butcher/schema/schema.json | 2279 +++++++++++++---- .butcher/types/CallbackQuery/entity.json | 8 +- .butcher/types/Chat/entity.json | 60 +- .butcher/types/ChatBoost/entity.json | 49 + .butcher/types/ChatBoost/replace.yml | 9 + .butcher/types/ChatBoostRemoved/entity.json | 49 + .butcher/types/ChatBoostRemoved/replace.yml | 5 + .butcher/types/ChatBoostSource/entity.json | 16 + .butcher/types/ChatBoostSource/subtypes.yml | 1 + .../types/ChatBoostSourceGiftCode/entity.json | 33 + .../types/ChatBoostSourceGiveaway/entity.json | 49 + .../types/ChatBoostSourcePremium/entity.json | 33 + .butcher/types/ChatBoostUpdated/entity.json | 33 + .../types/ChatMemberRestricted/entity.json | 6 +- .butcher/types/ChatPermissions/entity.json | 6 +- .butcher/types/ExternalReplyInfo/entity.json | 201 ++ .butcher/types/Giveaway/entity.json | 81 + .butcher/types/Giveaway/replace.yml | 5 + .butcher/types/GiveawayCompleted/entity.json | 41 + .butcher/types/GiveawayCreated/entity.json | 16 + .butcher/types/GiveawayWinners/entity.json | 105 + .butcher/types/GiveawayWinners/replace.yml | 5 + .../types/InaccessibleMessage/entity.json | 41 + .../types/InaccessibleMessage/replace.yml | 7 + .../types/InputTextMessageContent/entity.json | 14 +- .butcher/types/KeyboardButton/entity.json | 28 +- .../KeyboardButtonRequestUser/entity.json | 7 +- .../KeyboardButtonRequestUsers/entity.json | 49 + .butcher/types/LinkPreviewOptions/entity.json | 57 + .../MaybeInaccessibleMessage/entity.json | 16 + .../MaybeInaccessibleMessage/subtypes.yml | 1 + .butcher/types/Message/aliases.yml | 5 + .butcher/types/Message/entity.json | 226 +- .butcher/types/MessageEntity/entity.json | 6 +- .butcher/types/MessageOrigin/entity.json | 16 + .butcher/types/MessageOrigin/subtypes.yml | 1 + .../types/MessageOriginChannel/entity.json | 57 + .../types/MessageOriginChannel/replace.yml | 5 + .butcher/types/MessageOriginChat/entity.json | 49 + .butcher/types/MessageOriginChat/replace.yml | 5 + .../types/MessageOriginHiddenUser/entity.json | 41 + .../types/MessageOriginHiddenUser/replace.yml | 5 + .butcher/types/MessageOriginUser/entity.json | 41 + .butcher/types/MessageOriginUser/replace.yml | 5 + .../MessageReactionCountUpdated/entity.json | 49 + .../MessageReactionCountUpdated/replace.yml | 5 + .../types/MessageReactionUpdated/entity.json | 73 + .../types/MessageReactionUpdated/replace.yml | 5 + .butcher/types/PassportFile/replace.yml | 5 + .butcher/types/ReactionCount/entity.json | 33 + .butcher/types/ReactionType/entity.json | 16 + .butcher/types/ReactionType/subtypes.yml | 1 + .../types/ReactionTypeCustomEmoji/entity.json | 33 + .butcher/types/ReactionTypeEmoji/entity.json | 33 + .butcher/types/ReplyParameters/entity.json | 73 + .butcher/types/ReplyParameters/replace.yml | 3 + .butcher/types/ShippingAddress/entity.json | 4 +- .butcher/types/TextQuote/entity.json | 49 + .butcher/types/Update/entity.json | 32 + .butcher/types/UserChatBoosts/entity.json | 25 + .butcher/types/UserShared/entity.json | 7 +- .butcher/types/UsersShared/entity.json | 33 + CHANGES/1387.feature.rst | 11 + Makefile | 13 - README.rst | 2 +- aiogram/__meta__.py | 4 +- aiogram/client/bot.py | 451 +++- .../dispatcher/middlewares/user_context.py | 13 +- aiogram/dispatcher/router.py | 12 + aiogram/enums/__init__.py | 6 + aiogram/enums/chat_boost_source_type.py | 13 + aiogram/enums/content_type.py | 7 +- aiogram/enums/message_entity_type.py | 1 + aiogram/enums/message_origin_type.py | 14 + aiogram/enums/reaction_type_type.py | 12 + aiogram/enums/update_type.py | 4 + aiogram/handlers/callback_query.py | 4 +- aiogram/methods/__init__.py | 10 + aiogram/methods/copy_message.py | 33 +- aiogram/methods/copy_messages.py | 61 + aiogram/methods/delete_messages.py | 36 + aiogram/methods/edit_message_text.py | 27 +- aiogram/methods/forward_message.py | 2 +- aiogram/methods/forward_messages.py | 57 + aiogram/methods/get_chat.py | 2 +- aiogram/methods/get_updates.py | 2 +- aiogram/methods/get_user_chat_boosts.py | 33 + aiogram/methods/send_animation.py | 31 +- aiogram/methods/send_audio.py | 31 +- aiogram/methods/send_contact.py | 31 +- aiogram/methods/send_dice.py | 31 +- aiogram/methods/send_document.py | 31 +- aiogram/methods/send_game.py | 32 +- aiogram/methods/send_invoice.py | 32 +- aiogram/methods/send_location.py | 31 +- aiogram/methods/send_media_group.py | 27 +- aiogram/methods/send_message.py | 49 +- aiogram/methods/send_photo.py | 31 +- aiogram/methods/send_poll.py | 31 +- aiogram/methods/send_sticker.py | 31 +- aiogram/methods/send_venue.py | 31 +- aiogram/methods/send_video.py | 31 +- aiogram/methods/send_video_note.py | 31 +- aiogram/methods/send_voice.py | 31 +- aiogram/methods/set_message_reaction.py | 49 + aiogram/methods/set_webhook.py | 2 +- aiogram/types/__init__.py | 62 + aiogram/types/callback_query.py | 9 +- aiogram/types/chat.py | 32 +- aiogram/types/chat_boost.py | 55 + aiogram/types/chat_boost_removed.py | 56 + aiogram/types/chat_boost_source.py | 13 + aiogram/types/chat_boost_source_gift_code.py | 39 + aiogram/types/chat_boost_source_giveaway.py | 51 + aiogram/types/chat_boost_source_premium.py | 39 + aiogram/types/chat_boost_updated.py | 35 + aiogram/types/chat_join_request.py | 518 ++-- aiogram/types/chat_member_restricted.py | 2 +- aiogram/types/chat_member_updated.py | 260 +- aiogram/types/chat_permissions.py | 2 +- aiogram/types/external_reply_info.py | 153 ++ aiogram/types/giveaway.py | 67 + aiogram/types/giveaway_completed.py | 46 + aiogram/types/giveaway_created.py | 9 + aiogram/types/giveaway_winners.py | 80 + aiogram/types/inaccessible_message.py | 41 + aiogram/types/input_text_message_content.py | 16 +- aiogram/types/keyboard_button.py | 24 +- aiogram/types/keyboard_button_request_user.py | 3 + .../types/keyboard_button_request_users.py | 45 + aiogram/types/link_preview_options.py | 49 + aiogram/types/maybe_inaccessible_message.py | 12 + aiogram/types/message.py | 653 +++-- aiogram/types/message_entity.py | 2 +- aiogram/types/message_origin.py | 14 + aiogram/types/message_origin_channel.py | 56 + aiogram/types/message_origin_chat.py | 52 + aiogram/types/message_origin_hidden_user.py | 40 + aiogram/types/message_origin_user.py | 43 + .../types/message_reaction_count_updated.py | 52 + aiogram/types/message_reaction_updated.py | 66 + aiogram/types/passport_file.py | 5 +- aiogram/types/reaction_count.py | 39 + aiogram/types/reaction_type.py | 12 + aiogram/types/reaction_type_custom_emoji.py | 34 + aiogram/types/reaction_type_emoji.py | 34 + aiogram/types/reply_parameters.py | 62 + aiogram/types/shipping_address.py | 2 +- aiogram/types/text_quote.py | 50 + aiogram/types/update.py | 28 + aiogram/types/user_chat_boosts.py | 32 + aiogram/types/user_shared.py | 3 + aiogram/types/users_shared.py | 29 + aiogram/utils/formatting.py | 13 + aiogram/utils/markdown.py | 24 + aiogram/utils/text_decorations.py | 12 + docs/api/enums/chat_boost_source_type.rst | 9 + docs/api/enums/index.rst | 3 + docs/api/enums/message_origin_type.rst | 9 + docs/api/enums/reaction_type_type.rst | 9 + docs/api/methods/copy_messages.rst | 45 + docs/api/methods/delete_messages.rst | 45 + docs/api/methods/forward_messages.rst | 45 + docs/api/methods/get_user_chat_boosts.rst | 38 + docs/api/methods/index.rst | 5 + docs/api/methods/set_message_reaction.rst | 51 + docs/api/types/chat_boost.rst | 10 + docs/api/types/chat_boost_added.rst | 10 + docs/api/types/chat_boost_removed.rst | 10 + docs/api/types/chat_boost_source.rst | 10 + .../api/types/chat_boost_source_gift_code.rst | 10 + docs/api/types/chat_boost_source_giveaway.rst | 10 + docs/api/types/chat_boost_source_premium.rst | 10 + docs/api/types/chat_boost_updated.rst | 10 + docs/api/types/external_reply_info.rst | 10 + docs/api/types/giveaway.rst | 10 + docs/api/types/giveaway_completed.rst | 10 + docs/api/types/giveaway_created.rst | 10 + docs/api/types/giveaway_winners.rst | 10 + docs/api/types/inaccessible_message.rst | 10 + docs/api/types/index.rst | 31 + .../types/keyboard_button_request_users.rst | 10 + docs/api/types/link_preview_options.rst | 10 + docs/api/types/maybe_inaccessible_message.rst | 10 + docs/api/types/message_origin.rst | 10 + docs/api/types/message_origin_channel.rst | 10 + docs/api/types/message_origin_chat.rst | 10 + docs/api/types/message_origin_hidden_user.rst | 10 + docs/api/types/message_origin_user.rst | 10 + .../types/message_reaction_count_updated.rst | 10 + docs/api/types/message_reaction_updated.rst | 10 + docs/api/types/reaction_count.rst | 10 + docs/api/types/reaction_type.rst | 10 + docs/api/types/reaction_type_custom_emoji.rst | 10 + docs/api/types/reaction_type_emoji.rst | 10 + docs/api/types/reply_parameters.rst | 10 + docs/api/types/text_quote.rst | 10 + docs/api/types/user_chat_boosts.rst | 10 + docs/api/types/users_shared.rst | 10 + .../test_methods/test_copy_messages.py | 29 + .../test_methods/test_delete_messages.py | 19 + .../test_methods/test_forward_message.py | 1 + .../test_methods/test_forward_messages.py | 29 + .../test_methods/test_get_user_chat_boosts.py | 52 + .../test_methods/test_set_message_reaction.py | 25 + .../test_types/test_callback_query.py | 33 +- tests/test_api/test_types/test_message.py | 349 ++- tests/test_dispatcher/test_dispatcher.py | 78 + tests/test_utils/test_formatting.py | 2 +- tests/test_utils/test_markdown.py | 18 + tests/test_utils/test_text_decorations.py | 10 + 244 files changed, 9401 insertions(+), 1715 deletions(-) create mode 100644 .butcher/enums/ChatBoostSourceType.yml create mode 100644 .butcher/enums/MessageOriginType.yml create mode 100644 .butcher/enums/ReactionTypeType.yml create mode 100644 .butcher/methods/copyMessages/entity.json create mode 100644 .butcher/methods/deleteMessages/entity.json create mode 100644 .butcher/methods/forwardMessages/entity.json create mode 100644 .butcher/methods/getUserChatBoosts/entity.json create mode 100644 .butcher/methods/setMessageReaction/entity.json create mode 100644 .butcher/types/ChatBoost/entity.json create mode 100644 .butcher/types/ChatBoost/replace.yml create mode 100644 .butcher/types/ChatBoostRemoved/entity.json create mode 100644 .butcher/types/ChatBoostRemoved/replace.yml create mode 100644 .butcher/types/ChatBoostSource/entity.json create mode 100644 .butcher/types/ChatBoostSource/subtypes.yml create mode 100644 .butcher/types/ChatBoostSourceGiftCode/entity.json create mode 100644 .butcher/types/ChatBoostSourceGiveaway/entity.json create mode 100644 .butcher/types/ChatBoostSourcePremium/entity.json create mode 100644 .butcher/types/ChatBoostUpdated/entity.json create mode 100644 .butcher/types/ExternalReplyInfo/entity.json create mode 100644 .butcher/types/Giveaway/entity.json create mode 100644 .butcher/types/Giveaway/replace.yml create mode 100644 .butcher/types/GiveawayCompleted/entity.json create mode 100644 .butcher/types/GiveawayCreated/entity.json create mode 100644 .butcher/types/GiveawayWinners/entity.json create mode 100644 .butcher/types/GiveawayWinners/replace.yml create mode 100644 .butcher/types/InaccessibleMessage/entity.json create mode 100644 .butcher/types/InaccessibleMessage/replace.yml create mode 100644 .butcher/types/KeyboardButtonRequestUsers/entity.json create mode 100644 .butcher/types/LinkPreviewOptions/entity.json create mode 100644 .butcher/types/MaybeInaccessibleMessage/entity.json create mode 100644 .butcher/types/MaybeInaccessibleMessage/subtypes.yml create mode 100644 .butcher/types/MessageOrigin/entity.json create mode 100644 .butcher/types/MessageOrigin/subtypes.yml create mode 100644 .butcher/types/MessageOriginChannel/entity.json create mode 100644 .butcher/types/MessageOriginChannel/replace.yml create mode 100644 .butcher/types/MessageOriginChat/entity.json create mode 100644 .butcher/types/MessageOriginChat/replace.yml create mode 100644 .butcher/types/MessageOriginHiddenUser/entity.json create mode 100644 .butcher/types/MessageOriginHiddenUser/replace.yml create mode 100644 .butcher/types/MessageOriginUser/entity.json create mode 100644 .butcher/types/MessageOriginUser/replace.yml create mode 100644 .butcher/types/MessageReactionCountUpdated/entity.json create mode 100644 .butcher/types/MessageReactionCountUpdated/replace.yml create mode 100644 .butcher/types/MessageReactionUpdated/entity.json create mode 100644 .butcher/types/MessageReactionUpdated/replace.yml create mode 100644 .butcher/types/PassportFile/replace.yml create mode 100644 .butcher/types/ReactionCount/entity.json create mode 100644 .butcher/types/ReactionType/entity.json create mode 100644 .butcher/types/ReactionType/subtypes.yml create mode 100644 .butcher/types/ReactionTypeCustomEmoji/entity.json create mode 100644 .butcher/types/ReactionTypeEmoji/entity.json create mode 100644 .butcher/types/ReplyParameters/entity.json create mode 100644 .butcher/types/ReplyParameters/replace.yml create mode 100644 .butcher/types/TextQuote/entity.json create mode 100644 .butcher/types/UserChatBoosts/entity.json create mode 100644 .butcher/types/UsersShared/entity.json create mode 100644 CHANGES/1387.feature.rst create mode 100644 aiogram/enums/chat_boost_source_type.py create mode 100644 aiogram/enums/message_origin_type.py create mode 100644 aiogram/enums/reaction_type_type.py create mode 100644 aiogram/methods/copy_messages.py create mode 100644 aiogram/methods/delete_messages.py create mode 100644 aiogram/methods/forward_messages.py create mode 100644 aiogram/methods/get_user_chat_boosts.py create mode 100644 aiogram/methods/set_message_reaction.py create mode 100644 aiogram/types/chat_boost.py create mode 100644 aiogram/types/chat_boost_removed.py create mode 100644 aiogram/types/chat_boost_source.py create mode 100644 aiogram/types/chat_boost_source_gift_code.py create mode 100644 aiogram/types/chat_boost_source_giveaway.py create mode 100644 aiogram/types/chat_boost_source_premium.py create mode 100644 aiogram/types/chat_boost_updated.py create mode 100644 aiogram/types/external_reply_info.py create mode 100644 aiogram/types/giveaway.py create mode 100644 aiogram/types/giveaway_completed.py create mode 100644 aiogram/types/giveaway_created.py create mode 100644 aiogram/types/giveaway_winners.py create mode 100644 aiogram/types/inaccessible_message.py create mode 100644 aiogram/types/keyboard_button_request_users.py create mode 100644 aiogram/types/link_preview_options.py create mode 100644 aiogram/types/maybe_inaccessible_message.py create mode 100644 aiogram/types/message_origin.py create mode 100644 aiogram/types/message_origin_channel.py create mode 100644 aiogram/types/message_origin_chat.py create mode 100644 aiogram/types/message_origin_hidden_user.py create mode 100644 aiogram/types/message_origin_user.py create mode 100644 aiogram/types/message_reaction_count_updated.py create mode 100644 aiogram/types/message_reaction_updated.py create mode 100644 aiogram/types/reaction_count.py create mode 100644 aiogram/types/reaction_type.py create mode 100644 aiogram/types/reaction_type_custom_emoji.py create mode 100644 aiogram/types/reaction_type_emoji.py create mode 100644 aiogram/types/reply_parameters.py create mode 100644 aiogram/types/text_quote.py create mode 100644 aiogram/types/user_chat_boosts.py create mode 100644 aiogram/types/users_shared.py create mode 100644 docs/api/enums/chat_boost_source_type.rst create mode 100644 docs/api/enums/message_origin_type.rst create mode 100644 docs/api/enums/reaction_type_type.rst create mode 100644 docs/api/methods/copy_messages.rst create mode 100644 docs/api/methods/delete_messages.rst create mode 100644 docs/api/methods/forward_messages.rst create mode 100644 docs/api/methods/get_user_chat_boosts.rst create mode 100644 docs/api/methods/set_message_reaction.rst create mode 100644 docs/api/types/chat_boost.rst create mode 100644 docs/api/types/chat_boost_added.rst create mode 100644 docs/api/types/chat_boost_removed.rst create mode 100644 docs/api/types/chat_boost_source.rst create mode 100644 docs/api/types/chat_boost_source_gift_code.rst create mode 100644 docs/api/types/chat_boost_source_giveaway.rst create mode 100644 docs/api/types/chat_boost_source_premium.rst create mode 100644 docs/api/types/chat_boost_updated.rst create mode 100644 docs/api/types/external_reply_info.rst create mode 100644 docs/api/types/giveaway.rst create mode 100644 docs/api/types/giveaway_completed.rst create mode 100644 docs/api/types/giveaway_created.rst create mode 100644 docs/api/types/giveaway_winners.rst create mode 100644 docs/api/types/inaccessible_message.rst create mode 100644 docs/api/types/keyboard_button_request_users.rst create mode 100644 docs/api/types/link_preview_options.rst create mode 100644 docs/api/types/maybe_inaccessible_message.rst create mode 100644 docs/api/types/message_origin.rst create mode 100644 docs/api/types/message_origin_channel.rst create mode 100644 docs/api/types/message_origin_chat.rst create mode 100644 docs/api/types/message_origin_hidden_user.rst create mode 100644 docs/api/types/message_origin_user.rst create mode 100644 docs/api/types/message_reaction_count_updated.rst create mode 100644 docs/api/types/message_reaction_updated.rst create mode 100644 docs/api/types/reaction_count.rst create mode 100644 docs/api/types/reaction_type.rst create mode 100644 docs/api/types/reaction_type_custom_emoji.rst create mode 100644 docs/api/types/reaction_type_emoji.rst create mode 100644 docs/api/types/reply_parameters.rst create mode 100644 docs/api/types/text_quote.rst create mode 100644 docs/api/types/user_chat_boosts.rst create mode 100644 docs/api/types/users_shared.rst create mode 100644 tests/test_api/test_methods/test_copy_messages.py create mode 100644 tests/test_api/test_methods/test_delete_messages.py create mode 100644 tests/test_api/test_methods/test_forward_messages.py create mode 100644 tests/test_api/test_methods/test_get_user_chat_boosts.py create mode 100644 tests/test_api/test_methods/test_set_message_reaction.py diff --git a/.apiversion b/.apiversion index 12e41412..4fedf1d2 100644 --- a/.apiversion +++ b/.apiversion @@ -1 +1 @@ -6.9 +7.0 diff --git a/.butcher/enums/ChatBoostSourceType.yml b/.butcher/enums/ChatBoostSourceType.yml new file mode 100644 index 00000000..ce28625c --- /dev/null +++ b/.butcher/enums/ChatBoostSourceType.yml @@ -0,0 +1,12 @@ +name: ChatBoostSourceType +description: | + This object represents a type of chat boost source. + + Source: https://core.telegram.org/bots/api#chatboostsource +multi_parse: + attribute: source + regexp: "'([a-z_]+)'" + entities: + - ChatBoostSourcePremium + - ChatBoostSourceGiftCode + - ChatBoostSourceGiveaway diff --git a/.butcher/enums/ContentType.yml b/.butcher/enums/ContentType.yml index 654c89ac..66cba87e 100644 --- a/.butcher/enums/ContentType.yml +++ b/.butcher/enums/ContentType.yml @@ -31,3 +31,7 @@ extract: - caption - caption_entities - reply_to_message + - quote + - forward_origin + - external_reply + - link_preview_options diff --git a/.butcher/enums/MessageOriginType.yml b/.butcher/enums/MessageOriginType.yml new file mode 100644 index 00000000..09b32c59 --- /dev/null +++ b/.butcher/enums/MessageOriginType.yml @@ -0,0 +1,13 @@ +name: MessageOriginType +description: | + This object represents origin of a message. + + Source: https://core.telegram.org/bots/api#messageorigin +multi_parse: + attribute: type + regexp: "'([a-z_]+)'" + entities: + - MessageOriginUser + - MessageOriginHiddenUser + - MessageOriginChat + - MessageOriginChannel diff --git a/.butcher/enums/ReactionTypeType.yml b/.butcher/enums/ReactionTypeType.yml new file mode 100644 index 00000000..10e97c8d --- /dev/null +++ b/.butcher/enums/ReactionTypeType.yml @@ -0,0 +1,11 @@ +name: ReactionTypeType +description: | + This object represents reaction type. + + Source: https://core.telegram.org/bots/api#reactiontype +multi_parse: + attribute: type + regexp: "'([a-z_]+)'" + entities: + - ReactionTypeEmoji + - ReactionTypeCustomEmoji diff --git a/.butcher/methods/copyMessage/entity.json b/.butcher/methods/copyMessage/entity.json index 5dc4f776..83697db9 100644 --- a/.butcher/methods/copyMessage/entity.json +++ b/.butcher/methods/copyMessage/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "copymessage", "name": "copyMessage", - "description": "Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.", - "html_description": "

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

", - "rst_description": "Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success.", + "description": "Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.", + "html_description": "

Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

", + "rst_description": "Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success.", "annotations": [ { "type": "Integer or String", @@ -84,20 +84,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -106,6 +98,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/copyMessages/entity.json b/.butcher/methods/copyMessages/entity.json new file mode 100644 index 00000000..e443a4ba --- /dev/null +++ b/.butcher/methods/copyMessages/entity.json @@ -0,0 +1,73 @@ +{ + "meta": {}, + "group": { + "title": "Available methods", + "anchor": "available-methods" + }, + "object": { + "anchor": "copymessages", + "name": "copyMessages", + "description": "Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.", + "html_description": "

Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.

", + "rst_description": "Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_messages.ForwardMessages`, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": false, + "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only", + "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only", + "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n", + "name": "message_thread_id" + }, + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)", + "html_description": "Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)", + "rst_description": "Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)\n", + "name": "from_chat_id" + }, + { + "type": "Array of Integer", + "required": true, + "description": "Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.", + "html_description": "Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.", + "rst_description": "Identifiers of 1-100 messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order.\n", + "name": "message_ids" + }, + { + "type": "Boolean", + "required": false, + "description": "Sends the messages silently. Users will receive a notification with no sound.", + "html_description": "Sends the messages silently. Users will receive a notification with no sound.", + "rst_description": "Sends the messages `silently `_. Users will receive a notification with no sound.\n", + "name": "disable_notification" + }, + { + "type": "Boolean", + "required": false, + "description": "Protects the contents of the sent messages from forwarding and saving", + "html_description": "Protects the contents of the sent messages from forwarding and saving", + "rst_description": "Protects the contents of the sent messages from forwarding and saving\n", + "name": "protect_content" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to copy the messages without their captions", + "html_description": "Pass True to copy the messages without their captions", + "rst_description": "Pass :code:`True` to copy the messages without their captions\n", + "name": "remove_caption" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/deleteMessages/entity.json b/.butcher/methods/deleteMessages/entity.json new file mode 100644 index 00000000..b88ea494 --- /dev/null +++ b/.butcher/methods/deleteMessages/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "deletemessages", + "name": "deleteMessages", + "description": "Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.", + "html_description": "

Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.

", + "rst_description": "Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Array of Integer", + "required": true, + "description": "Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted", + "html_description": "Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted", + "rst_description": "Identifiers of 1-100 messages to delete. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted\n", + "name": "message_ids" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/editMessageText/entity.json b/.butcher/methods/editMessageText/entity.json index 981fde92..129b6204 100644 --- a/.butcher/methods/editMessageText/entity.json +++ b/.butcher/methods/editMessageText/entity.json @@ -60,12 +60,12 @@ "name": "entities" }, { - "type": "Boolean", + "type": "LinkPreviewOptions", "required": false, - "description": "Disables link previews for links in this message", - "html_description": "Disables link previews for links in this message", - "rst_description": "Disables link previews for links in this message\n", - "name": "disable_web_page_preview" + "description": "Link preview generation options for the message", + "html_description": "Link preview generation options for the message", + "rst_description": "Link preview generation options for the message\n", + "name": "link_preview_options" }, { "type": "InlineKeyboardMarkup", @@ -74,6 +74,18 @@ "html_description": "A JSON-serialized object for an inline keyboard.", "rst_description": "A JSON-serialized object for an `inline keyboard `_.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Disables link previews for links in this message", + "html_description": "Disables link previews for links in this message", + "rst_description": "Disables link previews for links in this message\n", + "name": "disable_web_page_preview", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/forwardMessage/entity.json b/.butcher/methods/forwardMessage/entity.json index d3e6a0f1..2af7b0b4 100644 --- a/.butcher/methods/forwardMessage/entity.json +++ b/.butcher/methods/forwardMessage/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "forwardmessage", "name": "forwardMessage", - "description": "Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.", - "html_description": "

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

", - "rst_description": "Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned.", + "description": "Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.", + "html_description": "

Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.

", + "rst_description": "Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ { "type": "Integer or String", diff --git a/.butcher/methods/forwardMessages/entity.json b/.butcher/methods/forwardMessages/entity.json new file mode 100644 index 00000000..e7879395 --- /dev/null +++ b/.butcher/methods/forwardMessages/entity.json @@ -0,0 +1,65 @@ +{ + "meta": {}, + "group": { + "title": "Available methods", + "anchor": "available-methods" + }, + "object": { + "anchor": "forwardmessages", + "name": "forwardMessages", + "description": "Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.", + "html_description": "

Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.

", + "rst_description": "Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": false, + "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only", + "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only", + "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n", + "name": "message_thread_id" + }, + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)", + "html_description": "Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)", + "rst_description": "Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)\n", + "name": "from_chat_id" + }, + { + "type": "Array of Integer", + "required": true, + "description": "Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.", + "html_description": "Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.", + "rst_description": "Identifiers of 1-100 messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order.\n", + "name": "message_ids" + }, + { + "type": "Boolean", + "required": false, + "description": "Sends the messages silently. Users will receive a notification with no sound.", + "html_description": "Sends the messages silently. Users will receive a notification with no sound.", + "rst_description": "Sends the messages `silently `_. Users will receive a notification with no sound.\n", + "name": "disable_notification" + }, + { + "type": "Boolean", + "required": false, + "description": "Protects the contents of the forwarded messages from forwarding and saving", + "html_description": "Protects the contents of the forwarded messages from forwarding and saving", + "rst_description": "Protects the contents of the forwarded messages from forwarding and saving\n", + "name": "protect_content" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/getChat/entity.json b/.butcher/methods/getChat/entity.json index d1ab1088..53f3a5b9 100644 --- a/.butcher/methods/getChat/entity.json +++ b/.butcher/methods/getChat/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "getchat", "name": "getChat", - "description": "Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.", - "html_description": "

Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.

", - "rst_description": "Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a :class:`aiogram.types.chat.Chat` object on success.", + "description": "Use this method to get up to date information about the chat. Returns a Chat object on success.", + "html_description": "

Use this method to get up to date information about the chat. Returns a Chat object on success.

", + "rst_description": "Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success.", "annotations": [ { "type": "Integer or String", diff --git a/.butcher/methods/getUpdates/entity.json b/.butcher/methods/getUpdates/entity.json index 775ad6dd..0c2f1299 100644 --- a/.butcher/methods/getUpdates/entity.json +++ b/.butcher/methods/getUpdates/entity.json @@ -38,9 +38,9 @@ { "type": "Array of String", "required": false, - "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", - "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\n
\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", - "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n", + "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", + "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
\n
\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", + "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n", "name": "allowed_updates" } ], diff --git a/.butcher/methods/getUserChatBoosts/entity.json b/.butcher/methods/getUserChatBoosts/entity.json new file mode 100644 index 00000000..2242f983 --- /dev/null +++ b/.butcher/methods/getUserChatBoosts/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available methods", + "anchor": "available-methods" + }, + "object": { + "anchor": "getuserchatboosts", + "name": "getUserChatBoosts", + "description": "Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.", + "html_description": "

Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.

", + "rst_description": "Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a :class:`aiogram.types.user_chat_boosts.UserChatBoosts` object.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the chat or username of the channel (in the format @channelusername)", + "html_description": "Unique identifier for the chat or username of the channel (in the format @channelusername)", + "rst_description": "Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the target user", + "html_description": "Unique identifier of the target user", + "rst_description": "Unique identifier of the target user\n", + "name": "user_id" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/sendAnimation/entity.json b/.butcher/methods/sendAnimation/entity.json index a7cd738d..f3e82be9 100644 --- a/.butcher/methods/sendAnimation/entity.json +++ b/.butcher/methods/sendAnimation/entity.json @@ -116,20 +116,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -138,6 +130,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendAudio/entity.json b/.butcher/methods/sendAudio/entity.json index f16c9a7b..94f4b1ff 100644 --- a/.butcher/methods/sendAudio/entity.json +++ b/.butcher/methods/sendAudio/entity.json @@ -108,20 +108,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -130,6 +122,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendContact/entity.json b/.butcher/methods/sendContact/entity.json index 27c7e87a..e72b59da 100644 --- a/.butcher/methods/sendContact/entity.json +++ b/.butcher/methods/sendContact/entity.json @@ -76,20 +76,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -98,6 +90,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendDice/entity.json b/.butcher/methods/sendDice/entity.json index 60354dd0..f6d09e5d 100644 --- a/.butcher/methods/sendDice/entity.json +++ b/.butcher/methods/sendDice/entity.json @@ -52,20 +52,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -74,6 +66,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendDocument/entity.json b/.butcher/methods/sendDocument/entity.json index fc629ca0..4868bcd6 100644 --- a/.butcher/methods/sendDocument/entity.json +++ b/.butcher/methods/sendDocument/entity.json @@ -92,20 +92,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -114,6 +106,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendGame/entity.json b/.butcher/methods/sendGame/entity.json index 31dc2e6d..2532a480 100644 --- a/.butcher/methods/sendGame/entity.json +++ b/.butcher/methods/sendGame/entity.json @@ -52,20 +52,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup", @@ -74,6 +66,30 @@ "html_description": "A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.", "rst_description": "A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendInvoice/entity.json b/.butcher/methods/sendInvoice/entity.json index 76c76e87..d51a042c 100644 --- a/.butcher/methods/sendInvoice/entity.json +++ b/.butcher/methods/sendInvoice/entity.json @@ -212,20 +212,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup", @@ -234,6 +226,30 @@ "html_description": "A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.", "rst_description": "A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendLocation/entity.json b/.butcher/methods/sendLocation/entity.json index 49bf7650..1fc1ebc6 100644 --- a/.butcher/methods/sendLocation/entity.json +++ b/.butcher/methods/sendLocation/entity.json @@ -92,20 +92,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -114,6 +106,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendMediaGroup/entity.json b/.butcher/methods/sendMediaGroup/entity.json index d520e89f..6f9c4490 100644 --- a/.butcher/methods/sendMediaGroup/entity.json +++ b/.butcher/methods/sendMediaGroup/entity.json @@ -52,12 +52,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the messages are a reply, ID of the original message", - "html_description": "If the messages are a reply, ID of the original message", - "rst_description": "If the messages are a reply, ID of the original message\n", - "name": "reply_to_message_id" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "Boolean", @@ -65,7 +65,23 @@ "description": "Pass True if the message should be sent even if the specified replied-to message is not found", "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the messages are a reply, ID of the original message", + "html_description": "If the messages are a reply, ID of the original message", + "rst_description": "If the messages are a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendMessage/entity.json b/.butcher/methods/sendMessage/entity.json index 80017658..8550f779 100644 --- a/.butcher/methods/sendMessage/entity.json +++ b/.butcher/methods/sendMessage/entity.json @@ -52,12 +52,12 @@ "name": "entities" }, { - "type": "Boolean", + "type": "LinkPreviewOptions", "required": false, - "description": "Disables link previews for links in this message", - "html_description": "Disables link previews for links in this message", - "rst_description": "Disables link previews for links in this message\n", - "name": "disable_web_page_preview" + "description": "Link preview generation options for the message", + "html_description": "Link preview generation options for the message", + "rst_description": "Link preview generation options for the message\n", + "name": "link_preview_options" }, { "type": "Boolean", @@ -76,20 +76,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -98,6 +90,42 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Boolean", + "required": false, + "description": "Disables link previews for links in this message", + "html_description": "Disables link previews for links in this message", + "rst_description": "Disables link previews for links in this message\n", + "name": "disable_web_page_preview", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendPhoto/entity.json b/.butcher/methods/sendPhoto/entity.json index 0b6edb18..fa65104b 100644 --- a/.butcher/methods/sendPhoto/entity.json +++ b/.butcher/methods/sendPhoto/entity.json @@ -84,20 +84,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -106,6 +98,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendPoll/entity.json b/.butcher/methods/sendPoll/entity.json index 8edfb619..bf1daa6d 100644 --- a/.butcher/methods/sendPoll/entity.json +++ b/.butcher/methods/sendPoll/entity.json @@ -140,20 +140,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -162,6 +154,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendSticker/entity.json b/.butcher/methods/sendSticker/entity.json index 4fa2e22e..9b67cb82 100644 --- a/.butcher/methods/sendSticker/entity.json +++ b/.butcher/methods/sendSticker/entity.json @@ -60,20 +60,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -82,6 +74,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendVenue/entity.json b/.butcher/methods/sendVenue/entity.json index ab6e0613..f17dcff7 100644 --- a/.butcher/methods/sendVenue/entity.json +++ b/.butcher/methods/sendVenue/entity.json @@ -108,20 +108,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -130,6 +122,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendVideo/entity.json b/.butcher/methods/sendVideo/entity.json index fed387f8..1d117484 100644 --- a/.butcher/methods/sendVideo/entity.json +++ b/.butcher/methods/sendVideo/entity.json @@ -124,20 +124,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -146,6 +138,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendVideoNote/entity.json b/.butcher/methods/sendVideoNote/entity.json index 01eb3645..2727d1b7 100644 --- a/.butcher/methods/sendVideoNote/entity.json +++ b/.butcher/methods/sendVideoNote/entity.json @@ -76,20 +76,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -98,6 +90,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/sendVoice/entity.json b/.butcher/methods/sendVoice/entity.json index a7af4bab..b5a4da98 100644 --- a/.butcher/methods/sendVoice/entity.json +++ b/.butcher/methods/sendVoice/entity.json @@ -84,20 +84,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -106,6 +98,30 @@ "html_description": "Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.", "rst_description": "Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.\n", "name": "reply_markup" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", + "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", + "name": "allow_sending_without_reply", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "required": false, + "description": "If the message is a reply, ID of the original message", + "html_description": "If the message is a reply, ID of the original message", + "rst_description": "If the message is a reply, ID of the original message\n", + "name": "reply_to_message_id", + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "methods" diff --git a/.butcher/methods/setMessageReaction/entity.json b/.butcher/methods/setMessageReaction/entity.json new file mode 100644 index 00000000..11b934bd --- /dev/null +++ b/.butcher/methods/setMessageReaction/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available methods", + "anchor": "available-methods" + }, + "object": { + "anchor": "setmessagereaction", + "name": "setMessageReaction", + "description": "Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success.", + "html_description": "

Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success.

", + "rst_description": "Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": true, + "description": "Identifier of the target message", + "html_description": "Identifier of the target message", + "rst_description": "Identifier of the target message\n", + "name": "message_id" + }, + { + "type": "Array of ReactionType", + "required": false, + "description": "New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.", + "html_description": "New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.", + "rst_description": "New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.\n", + "name": "reaction" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to set the reaction with a big animation", + "html_description": "Pass True to set the reaction with a big animation", + "rst_description": "Pass :code:`True` to set the reaction with a big animation\n", + "name": "is_big" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/setWebhook/entity.json b/.butcher/methods/setWebhook/entity.json index 593186b6..7233fec6 100644 --- a/.butcher/methods/setWebhook/entity.json +++ b/.butcher/methods/setWebhook/entity.json @@ -46,9 +46,9 @@ { "type": "Array of String", "required": false, - "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", - "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", - "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.\n", + "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", + "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", + "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.\n", "name": "allowed_updates" }, { diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index 27e87e97..9b9b33b8 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -1,7 +1,7 @@ { "api": { - "version": "6.9", - "release_date": "2023-09-22" + "version": "7.0", + "release_date": "2023-12-29" }, "items": [ { @@ -55,6 +55,22 @@ "name": "edited_channel_post", "required": false }, + { + "type": "MessageReactionUpdated", + "description": "A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify \"message_reaction\" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.", + "html_description": "Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify \"message_reaction\" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.", + "rst_description": "*Optional*. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify :code:`\"message_reaction\"` in the list of *allowed_updates* to receive these updates. The update isn't received for reactions set by bots.\n", + "name": "message_reaction", + "required": false + }, + { + "type": "MessageReactionCountUpdated", + "description": "Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify \"message_reaction_count\" in the list of allowed_updates to receive these updates.", + "html_description": "Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify \"message_reaction_count\" in the list of allowed_updates to receive these updates.", + "rst_description": "*Optional*. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify :code:`\"message_reaction_count\"` in the list of *allowed_updates* to receive these updates.\n", + "name": "message_reaction_count", + "required": false + }, { "type": "InlineQuery", "description": "New incoming inline query", @@ -134,6 +150,22 @@ "rst_description": "*Optional*. A request to join the chat has been sent. The bot must have the *can_invite_users* administrator right in the chat to receive these updates.\n", "name": "chat_join_request", "required": false + }, + { + "type": "ChatBoostUpdated", + "description": "A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.", + "html_description": "Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.", + "rst_description": "*Optional*. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.\n", + "name": "chat_boost", + "required": false + }, + { + "type": "ChatBoostRemoved", + "description": "A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.", + "html_description": "Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.", + "rst_description": "*Optional*. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.\n", + "name": "removed_chat_boost", + "required": false } ], "category": "types" @@ -172,9 +204,9 @@ { "type": "Array of String", "required": false, - "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", - "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\n
\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", - "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n", + "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", + "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
\n
\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.", + "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.\n\n\n\nPlease note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.\n", "name": "allowed_updates" } ], @@ -222,9 +254,9 @@ { "type": "Array of String", "required": false, - "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", - "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", - "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.\n", + "description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", + "html_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify [\"message\", \"edited_channel_post\", \"callback_query\"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.", + "rst_description": "A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`[\"message\", \"edited_channel_post\", \"callback_query\"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.\n\nPlease note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.\n", "name": "allowed_updates" }, { @@ -539,19 +571,59 @@ "name": "active_usernames", "required": false }, + { + "type": "Array of ReactionType", + "description": "List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.", + "html_description": "Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.", + "rst_description": "*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions `_ are allowed. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "available_reactions", + "required": false + }, + { + "type": "Integer", + "description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", + "html_description": "Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", + "rst_description": "*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "accent_color_id", + "required": false + }, { "type": "String", - "description": "Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.", - "html_description": "Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.", - "rst_description": "*Optional*. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.", + "html_description": "Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.", + "rst_description": "*Optional*. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "background_custom_emoji_id", + "required": false + }, + { + "type": "Integer", + "description": "Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", + "html_description": "Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", + "rst_description": "*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "profile_accent_color_id", + "required": false + }, + { + "type": "String", + "description": "Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", + "html_description": "Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", + "rst_description": "*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "profile_background_custom_emoji_id", + "required": false + }, + { + "type": "String", + "description": "Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", + "html_description": "Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", + "rst_description": "*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "emoji_status_custom_emoji_id", "required": false }, { "type": "Integer", - "description": "Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.", - "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.", - "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", + "html_description": "Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", + "rst_description": "*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "emoji_status_expiration_date", "required": false }, @@ -667,6 +739,14 @@ "name": "has_protected_content", "required": false }, + { + "type": "True", + "description": "True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", + "html_description": "Optional. True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "has_visible_history", + "required": false + }, { "type": "String", "description": "For supergroups, name of group sticker set. Returned only in getChat.", @@ -743,66 +823,26 @@ }, { "type": "Integer", - "description": "Date the message was sent in Unix time", - "html_description": "Date the message was sent in Unix time", - "rst_description": "Date the message was sent in Unix time\n", + "description": "Date the message was sent in Unix time. It is always a positive number, representing a valid date.", + "html_description": "Date the message was sent in Unix time. It is always a positive number, representing a valid date.", + "rst_description": "Date the message was sent in Unix time. It is always a positive number, representing a valid date.\n", "name": "date", "required": true }, { "type": "Chat", - "description": "Conversation the message belongs to", - "html_description": "Conversation the message belongs to", - "rst_description": "Conversation the message belongs to\n", + "description": "Chat the message belongs to", + "html_description": "Chat the message belongs to", + "rst_description": "Chat the message belongs to\n", "name": "chat", "required": true }, { - "type": "User", - "description": "For forwarded messages, sender of the original message", - "html_description": "Optional. For forwarded messages, sender of the original message", - "rst_description": "*Optional*. For forwarded messages, sender of the original message\n", - "name": "forward_from", - "required": false - }, - { - "type": "Chat", - "description": "For messages forwarded from channels or from anonymous administrators, information about the original sender chat", - "html_description": "Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat", - "rst_description": "*Optional*. For messages forwarded from channels or from anonymous administrators, information about the original sender chat\n", - "name": "forward_from_chat", - "required": false - }, - { - "type": "Integer", - "description": "For messages forwarded from channels, identifier of the original message in the channel", - "html_description": "Optional. For messages forwarded from channels, identifier of the original message in the channel", - "rst_description": "*Optional*. For messages forwarded from channels, identifier of the original message in the channel\n", - "name": "forward_from_message_id", - "required": false - }, - { - "type": "String", - "description": "For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present", - "html_description": "Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present", - "rst_description": "*Optional*. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present\n", - "name": "forward_signature", - "required": false - }, - { - "type": "String", - "description": "Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages", - "html_description": "Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages", - "rst_description": "*Optional*. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages\n", - "name": "forward_sender_name", - "required": false - }, - { - "type": "Integer", - "description": "For forwarded messages, date the original message was sent in Unix time", - "html_description": "Optional. For forwarded messages, date the original message was sent in Unix time", - "rst_description": "*Optional*. For forwarded messages, date the original message was sent in Unix time\n", - "name": "forward_date", + "type": "MessageOrigin", + "description": "Information about the original message for forwarded messages", + "html_description": "Optional. Information about the original message for forwarded messages", + "rst_description": "*Optional*. Information about the original message for forwarded messages\n", + "name": "forward_origin", "required": false }, { @@ -823,12 +863,28 @@ }, { "type": "Message", - "description": "For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", - "html_description": "Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", - "rst_description": "*Optional*. For replies, the original message. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.\n", + "description": "For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", + "html_description": "Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", + "rst_description": "*Optional*. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.\n", "name": "reply_to_message", "required": false }, + { + "type": "ExternalReplyInfo", + "description": "Information about the message that is being replied to, which may come from another chat or forum topic", + "html_description": "Optional. Information about the message that is being replied to, which may come from another chat or forum topic", + "rst_description": "*Optional*. Information about the message that is being replied to, which may come from another chat or forum topic\n", + "name": "external_reply", + "required": false + }, + { + "type": "TextQuote", + "description": "For replies that quote part of the original message, the quoted part of the message", + "html_description": "Optional. For replies that quote part of the original message, the quoted part of the message", + "rst_description": "*Optional*. For replies that quote part of the original message, the quoted part of the message\n", + "name": "quote", + "required": false + }, { "type": "User", "description": "Bot through which the message was sent", @@ -885,6 +941,14 @@ "name": "entities", "required": false }, + { + "type": "LinkPreviewOptions", + "description": "Options used for link preview generation for the message, if it is a text message and link preview options were changed", + "html_description": "Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed", + "rst_description": "*Optional*. Options used for link preview generation for the message, if it is a text message and link preview options were changed\n", + "name": "link_preview_options", + "required": false + }, { "type": "Animation", "description": "Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set", @@ -1118,10 +1182,10 @@ "required": false }, { - "type": "Message", - "description": "Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.", - "html_description": "Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.", - "rst_description": "*Optional*. Specified message was pinned. Note that the Message object in this field will not contain further *reply_to_message* fields even if it is itself a reply.\n", + "type": "MaybeInaccessibleMessage", + "description": "Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", + "html_description": "Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", + "rst_description": "*Optional*. Specified message was pinned. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.\n", "name": "pinned_message", "required": false }, @@ -1142,11 +1206,11 @@ "required": false }, { - "type": "UserShared", - "description": "Service message: a user was shared with the bot", - "html_description": "Optional. Service message: a user was shared with the bot", - "rst_description": "*Optional*. Service message: a user was shared with the bot\n", - "name": "user_shared", + "type": "UsersShared", + "description": "Service message: users were shared with the bot", + "html_description": "Optional. Service message: users were shared with the bot", + "rst_description": "*Optional*. Service message: users were shared with the bot\n", + "name": "users_shared", "required": false }, { @@ -1237,6 +1301,38 @@ "name": "general_forum_topic_unhidden", "required": false }, + { + "type": "GiveawayCreated", + "description": "Service message: a scheduled giveaway was created", + "html_description": "Optional. Service message: a scheduled giveaway was created", + "rst_description": "*Optional*. Service message: a scheduled giveaway was created\n", + "name": "giveaway_created", + "required": false + }, + { + "type": "Giveaway", + "description": "The message is a scheduled giveaway message", + "html_description": "Optional. The message is a scheduled giveaway message", + "rst_description": "*Optional*. The message is a scheduled giveaway message\n", + "name": "giveaway", + "required": false + }, + { + "type": "GiveawayWinners", + "description": "A giveaway with public winners was completed", + "html_description": "Optional. A giveaway with public winners was completed", + "rst_description": "*Optional*. A giveaway with public winners was completed\n", + "name": "giveaway_winners", + "required": false + }, + { + "type": "GiveawayCompleted", + "description": "Service message: a giveaway without public winners was completed", + "html_description": "Optional. Service message: a giveaway without public winners was completed", + "rst_description": "*Optional*. Service message: a giveaway without public winners was completed\n", + "name": "giveaway_completed", + "required": false + }, { "type": "VideoChatScheduled", "description": "Service message: video chat scheduled", @@ -1306,6 +1402,49 @@ ], "category": "types" }, + { + "anchor": "inaccessiblemessage", + "name": "InaccessibleMessage", + "description": "This object describes a message that was deleted or is otherwise inaccessible to the bot.", + "html_description": "

This object describes a message that was deleted or is otherwise inaccessible to the bot.

", + "rst_description": "This object describes a message that was deleted or is otherwise inaccessible to the bot.", + "annotations": [ + { + "type": "Chat", + "description": "Chat the message belonged to", + "html_description": "Chat the message belonged to", + "rst_description": "Chat the message belonged to\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Unique message identifier inside the chat", + "html_description": "Unique message identifier inside the chat", + "rst_description": "Unique message identifier inside the chat\n", + "name": "message_id", + "required": true + }, + { + "type": "Integer", + "description": "Always 0. The field can be used to differentiate regular and inaccessible messages.", + "html_description": "Always 0. The field can be used to differentiate regular and inaccessible messages.", + "rst_description": "Always 0. The field can be used to differentiate regular and inaccessible messages.\n", + "name": "date", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "maybeinaccessiblemessage", + "name": "MaybeInaccessibleMessage", + "description": "This object describes a message that can be inaccessible to the bot. It can be one of\n - Message\n - InaccessibleMessage", + "html_description": "

This object describes a message that can be inaccessible to the bot. It can be one of

", + "rst_description": "This object describes a message that can be inaccessible to the bot. It can be one of\n\n - :class:`aiogram.types.message.Message`\n - :class:`aiogram.types.inaccessible_message.InaccessibleMessage`", + "annotations": [], + "category": "types" + }, { "anchor": "messageentity", "name": "MessageEntity", @@ -1315,9 +1454,9 @@ "annotations": [ { "type": "String", - "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)", - "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)", - "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n", + "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)", + "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)", + "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n", "name": "type", "required": true }, @@ -1372,6 +1511,477 @@ ], "category": "types" }, + { + "anchor": "textquote", + "name": "TextQuote", + "description": "This object contains information about the quoted part of a message that is replied to by the given message.", + "html_description": "

This object contains information about the quoted part of a message that is replied to by the given message.

", + "rst_description": "This object contains information about the quoted part of a message that is replied to by the given message.", + "annotations": [ + { + "type": "String", + "description": "Text of the quoted part of a message that is replied to by the given message", + "html_description": "Text of the quoted part of a message that is replied to by the given message", + "rst_description": "Text of the quoted part of a message that is replied to by the given message\n", + "name": "text", + "required": true + }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.", + "html_description": "Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.", + "rst_description": "*Optional*. Special entities that appear in the quote. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities are kept in quotes.\n", + "name": "entities", + "required": false + }, + { + "type": "Integer", + "description": "Approximate quote position in the original message in UTF-16 code units as specified by the sender", + "html_description": "Approximate quote position in the original message in UTF-16 code units as specified by the sender", + "rst_description": "Approximate quote position in the original message in UTF-16 code units as specified by the sender\n", + "name": "position", + "required": true + }, + { + "type": "True", + "description": "True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.", + "html_description": "Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.", + "rst_description": "*Optional*. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.\n", + "name": "is_manual", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "externalreplyinfo", + "name": "ExternalReplyInfo", + "description": "This object contains information about a message that is being replied to, which may come from another chat or forum topic.", + "html_description": "

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

", + "rst_description": "This object contains information about a message that is being replied to, which may come from another chat or forum topic.", + "annotations": [ + { + "type": "MessageOrigin", + "description": "Origin of the message replied to by the given message", + "html_description": "Origin of the message replied to by the given message", + "rst_description": "Origin of the message replied to by the given message\n", + "name": "origin", + "required": true + }, + { + "type": "Chat", + "description": "Chat the original message belongs to. Available only if the chat is a supergroup or a channel.", + "html_description": "Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.", + "rst_description": "*Optional*. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.\n", + "name": "chat", + "required": false + }, + { + "type": "Integer", + "description": "Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.", + "html_description": "Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.", + "rst_description": "*Optional*. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.\n", + "name": "message_id", + "required": false + }, + { + "type": "LinkPreviewOptions", + "description": "Options used for link preview generation for the original message, if it is a text message", + "html_description": "Optional. Options used for link preview generation for the original message, if it is a text message", + "rst_description": "*Optional*. Options used for link preview generation for the original message, if it is a text message\n", + "name": "link_preview_options", + "required": false + }, + { + "type": "Animation", + "description": "Message is an animation, information about the animation", + "html_description": "Optional. Message is an animation, information about the animation", + "rst_description": "*Optional*. Message is an animation, information about the animation\n", + "name": "animation", + "required": false + }, + { + "type": "Audio", + "description": "Message is an audio file, information about the file", + "html_description": "Optional. Message is an audio file, information about the file", + "rst_description": "*Optional*. Message is an audio file, information about the file\n", + "name": "audio", + "required": false + }, + { + "type": "Document", + "description": "Message is a general file, information about the file", + "html_description": "Optional. Message is a general file, information about the file", + "rst_description": "*Optional*. Message is a general file, information about the file\n", + "name": "document", + "required": false + }, + { + "type": "Array of PhotoSize", + "description": "Message is a photo, available sizes of the photo", + "html_description": "Optional. Message is a photo, available sizes of the photo", + "rst_description": "*Optional*. Message is a photo, available sizes of the photo\n", + "name": "photo", + "required": false + }, + { + "type": "Sticker", + "description": "Message is a sticker, information about the sticker", + "html_description": "Optional. Message is a sticker, information about the sticker", + "rst_description": "*Optional*. Message is a sticker, information about the sticker\n", + "name": "sticker", + "required": false + }, + { + "type": "Story", + "description": "Message is a forwarded story", + "html_description": "Optional. Message is a forwarded story", + "rst_description": "*Optional*. Message is a forwarded story\n", + "name": "story", + "required": false + }, + { + "type": "Video", + "description": "Message is a video, information about the video", + "html_description": "Optional. Message is a video, information about the video", + "rst_description": "*Optional*. Message is a video, information about the video\n", + "name": "video", + "required": false + }, + { + "type": "VideoNote", + "description": "Message is a video note, information about the video message", + "html_description": "Optional. Message is a video note, information about the video message", + "rst_description": "*Optional*. Message is a `video note `_, information about the video message\n", + "name": "video_note", + "required": false + }, + { + "type": "Voice", + "description": "Message is a voice message, information about the file", + "html_description": "Optional. Message is a voice message, information about the file", + "rst_description": "*Optional*. Message is a voice message, information about the file\n", + "name": "voice", + "required": false + }, + { + "type": "True", + "description": "True, if the message media is covered by a spoiler animation", + "html_description": "Optional. True, if the message media is covered by a spoiler animation", + "rst_description": "*Optional*. :code:`True`, if the message media is covered by a spoiler animation\n", + "name": "has_media_spoiler", + "required": false + }, + { + "type": "Contact", + "description": "Message is a shared contact, information about the contact", + "html_description": "Optional. Message is a shared contact, information about the contact", + "rst_description": "*Optional*. Message is a shared contact, information about the contact\n", + "name": "contact", + "required": false + }, + { + "type": "Dice", + "description": "Message is a dice with random value", + "html_description": "Optional. Message is a dice with random value", + "rst_description": "*Optional*. Message is a dice with random value\n", + "name": "dice", + "required": false + }, + { + "type": "Game", + "description": "Message is a game, information about the game.", + "html_description": "Optional. Message is a game, information about the game. More about games »", + "rst_description": "*Optional*. Message is a game, information about the game. `More about games » `_\n", + "name": "game", + "required": false + }, + { + "type": "Giveaway", + "description": "Message is a scheduled giveaway, information about the giveaway", + "html_description": "Optional. Message is a scheduled giveaway, information about the giveaway", + "rst_description": "*Optional*. Message is a scheduled giveaway, information about the giveaway\n", + "name": "giveaway", + "required": false + }, + { + "type": "GiveawayWinners", + "description": "A giveaway with public winners was completed", + "html_description": "Optional. A giveaway with public winners was completed", + "rst_description": "*Optional*. A giveaway with public winners was completed\n", + "name": "giveaway_winners", + "required": false + }, + { + "type": "Invoice", + "description": "Message is an invoice for a payment, information about the invoice.", + "html_description": "Optional. Message is an invoice for a payment, information about the invoice. More about payments »", + "rst_description": "*Optional*. Message is an invoice for a `payment `_, information about the invoice. `More about payments » `_\n", + "name": "invoice", + "required": false + }, + { + "type": "Location", + "description": "Message is a shared location, information about the location", + "html_description": "Optional. Message is a shared location, information about the location", + "rst_description": "*Optional*. Message is a shared location, information about the location\n", + "name": "location", + "required": false + }, + { + "type": "Poll", + "description": "Message is a native poll, information about the poll", + "html_description": "Optional. Message is a native poll, information about the poll", + "rst_description": "*Optional*. Message is a native poll, information about the poll\n", + "name": "poll", + "required": false + }, + { + "type": "Venue", + "description": "Message is a venue, information about the venue", + "html_description": "Optional. Message is a venue, information about the venue", + "rst_description": "*Optional*. Message is a venue, information about the venue\n", + "name": "venue", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "replyparameters", + "name": "ReplyParameters", + "description": "Describes reply parameters for the message that is being sent.", + "html_description": "

Describes reply parameters for the message that is being sent.

", + "rst_description": "Describes reply parameters for the message that is being sent.", + "annotations": [ + { + "type": "Integer", + "description": "Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified", + "html_description": "Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified", + "rst_description": "Identifier of the message that will be replied to in the current chat, or in the chat *chat_id* if it is specified\n", + "name": "message_id", + "required": true + }, + { + "type": "Integer or String", + "description": "If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)", + "html_description": "Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)", + "rst_description": "*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)\n", + "name": "chat_id", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.", + "html_description": "Optional. Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.", + "rst_description": "*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.\n", + "name": "allow_sending_without_reply", + "required": false + }, + { + "type": "String", + "description": "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.", + "html_description": "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.", + "rst_description": "*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.\n", + "name": "quote", + "required": false + }, + { + "type": "String", + "description": "Mode for parsing entities in the quote. See formatting options for more details.", + "html_description": "Optional. Mode for parsing entities in the quote. See formatting options for more details.", + "rst_description": "*Optional*. Mode for parsing entities in the quote. See `formatting options `_ for more details.\n", + "name": "quote_parse_mode", + "required": false + }, + { + "type": "Array of MessageEntity", + "description": "A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.", + "html_description": "Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.", + "rst_description": "*Optional*. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of *quote_parse_mode*.\n", + "name": "quote_entities", + "required": false + }, + { + "type": "Integer", + "description": "Position of the quote in the original message in UTF-16 code units", + "html_description": "Optional. Position of the quote in the original message in UTF-16 code units", + "rst_description": "*Optional*. Position of the quote in the original message in UTF-16 code units\n", + "name": "quote_position", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "messageorigin", + "name": "MessageOrigin", + "description": "This object describes the origin of a message. It can be one of\n - MessageOriginUser\n - MessageOriginHiddenUser\n - MessageOriginChat\n - MessageOriginChannel", + "html_description": "

This object describes the origin of a message. It can be one of

", + "rst_description": "This object describes the origin of a message. It can be one of\n\n - :class:`aiogram.types.message_origin_user.MessageOriginUser`\n - :class:`aiogram.types.message_origin_hidden_user.MessageOriginHiddenUser`\n - :class:`aiogram.types.message_origin_chat.MessageOriginChat`\n - :class:`aiogram.types.message_origin_channel.MessageOriginChannel`", + "annotations": [], + "category": "types" + }, + { + "anchor": "messageoriginuser", + "name": "MessageOriginUser", + "description": "The message was originally sent by a known user.", + "html_description": "

The message was originally sent by a known user.

", + "rst_description": "The message was originally sent by a known user.", + "annotations": [ + { + "type": "String", + "description": "Type of the message origin, always 'user'", + "html_description": "Type of the message origin, always “user”", + "rst_description": "Type of the message origin, always 'user'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Date the message was sent originally in Unix time", + "html_description": "Date the message was sent originally in Unix time", + "rst_description": "Date the message was sent originally in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "User", + "description": "User that sent the message originally", + "html_description": "User that sent the message originally", + "rst_description": "User that sent the message originally\n", + "name": "sender_user", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "messageoriginhiddenuser", + "name": "MessageOriginHiddenUser", + "description": "The message was originally sent by an unknown user.", + "html_description": "

The message was originally sent by an unknown user.

", + "rst_description": "The message was originally sent by an unknown user.", + "annotations": [ + { + "type": "String", + "description": "Type of the message origin, always 'hidden_user'", + "html_description": "Type of the message origin, always “hidden_user”", + "rst_description": "Type of the message origin, always 'hidden_user'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Date the message was sent originally in Unix time", + "html_description": "Date the message was sent originally in Unix time", + "rst_description": "Date the message was sent originally in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "String", + "description": "Name of the user that sent the message originally", + "html_description": "Name of the user that sent the message originally", + "rst_description": "Name of the user that sent the message originally\n", + "name": "sender_user_name", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "messageoriginchat", + "name": "MessageOriginChat", + "description": "The message was originally sent on behalf of a chat to a group chat.", + "html_description": "

The message was originally sent on behalf of a chat to a group chat.

", + "rst_description": "The message was originally sent on behalf of a chat to a group chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the message origin, always 'chat'", + "html_description": "Type of the message origin, always “chat”", + "rst_description": "Type of the message origin, always 'chat'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Date the message was sent originally in Unix time", + "html_description": "Date the message was sent originally in Unix time", + "rst_description": "Date the message was sent originally in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Chat", + "description": "Chat that sent the message originally", + "html_description": "Chat that sent the message originally", + "rst_description": "Chat that sent the message originally\n", + "name": "sender_chat", + "required": true + }, + { + "type": "String", + "description": "For messages originally sent by an anonymous chat administrator, original message author signature", + "html_description": "Optional. For messages originally sent by an anonymous chat administrator, original message author signature", + "rst_description": "*Optional*. For messages originally sent by an anonymous chat administrator, original message author signature\n", + "name": "author_signature", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "messageoriginchannel", + "name": "MessageOriginChannel", + "description": "The message was originally sent to a channel chat.", + "html_description": "

The message was originally sent to a channel chat.

", + "rst_description": "The message was originally sent to a channel chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the message origin, always 'channel'", + "html_description": "Type of the message origin, always “channel”", + "rst_description": "Type of the message origin, always 'channel'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Date the message was sent originally in Unix time", + "html_description": "Date the message was sent originally in Unix time", + "rst_description": "Date the message was sent originally in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Chat", + "description": "Channel chat to which the message was originally sent", + "html_description": "Channel chat to which the message was originally sent", + "rst_description": "Channel chat to which the message was originally sent\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Unique message identifier inside the chat", + "html_description": "Unique message identifier inside the chat", + "rst_description": "Unique message identifier inside the chat\n", + "name": "message_id", + "required": true + }, + { + "type": "String", + "description": "Signature of the original post author", + "html_description": "Optional. Signature of the original post author", + "rst_description": "*Optional*. Signature of the original post author\n", + "name": "author_signature", + "required": false + } + ], + "category": "types" + }, { "anchor": "photosize", "name": "PhotoSize", @@ -2400,11 +3010,11 @@ "category": "types" }, { - "anchor": "usershared", - "name": "UserShared", - "description": "This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.", - "html_description": "

This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.

", - "rst_description": "This object contains information about the user whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_user.KeyboardButtonRequestUser` button.", + "anchor": "usersshared", + "name": "UsersShared", + "description": "This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.", + "html_description": "

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

", + "rst_description": "This object contains information about the users whose identifiers were shared with the bot using a :class:`aiogram.types.keyboard_button_request_users.KeyboardButtonRequestUsers` button.", "annotations": [ { "type": "Integer", @@ -2415,11 +3025,11 @@ "required": true }, { - "type": "Integer", - "description": "Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.", - "html_description": "Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.", - "rst_description": "Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.\n", - "name": "user_id", + "type": "Array of Integer", + "description": "Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.", + "html_description": "Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.", + "rst_description": "Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.\n", + "name": "user_ids", "required": true } ], @@ -2548,6 +3158,271 @@ ], "category": "types" }, + { + "anchor": "giveawaycreated", + "name": "GiveawayCreated", + "description": "This object represents a service message about the creation of a scheduled giveaway. Currently holds no information.", + "html_description": "

This object represents a service message about the creation of a scheduled giveaway. Currently holds no information.

", + "rst_description": "This object represents a service message about the creation of a scheduled giveaway. Currently holds no information.", + "annotations": [], + "category": "types" + }, + { + "anchor": "giveaway", + "name": "Giveaway", + "description": "This object represents a message about a scheduled giveaway.", + "html_description": "

This object represents a message about a scheduled giveaway.

", + "rst_description": "This object represents a message about a scheduled giveaway.", + "annotations": [ + { + "type": "Array of Chat", + "description": "The list of chats which the user must join to participate in the giveaway", + "html_description": "The list of chats which the user must join to participate in the giveaway", + "rst_description": "The list of chats which the user must join to participate in the giveaway\n", + "name": "chats", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when winners of the giveaway will be selected", + "html_description": "Point in time (Unix timestamp) when winners of the giveaway will be selected", + "rst_description": "Point in time (Unix timestamp) when winners of the giveaway will be selected\n", + "name": "winners_selection_date", + "required": true + }, + { + "type": "Integer", + "description": "The number of users which are supposed to be selected as winners of the giveaway", + "html_description": "The number of users which are supposed to be selected as winners of the giveaway", + "rst_description": "The number of users which are supposed to be selected as winners of the giveaway\n", + "name": "winner_count", + "required": true + }, + { + "type": "True", + "description": "True, if only users who join the chats after the giveaway started should be eligible to win", + "html_description": "Optional. True, if only users who join the chats after the giveaway started should be eligible to win", + "rst_description": "*Optional*. :code:`True`, if only users who join the chats after the giveaway started should be eligible to win\n", + "name": "only_new_members", + "required": false + }, + { + "type": "True", + "description": "True, if the list of giveaway winners will be visible to everyone", + "html_description": "Optional. True, if the list of giveaway winners will be visible to everyone", + "rst_description": "*Optional*. :code:`True`, if the list of giveaway winners will be visible to everyone\n", + "name": "has_public_winners", + "required": false + }, + { + "type": "String", + "description": "Description of additional giveaway prize", + "html_description": "Optional. Description of additional giveaway prize", + "rst_description": "*Optional*. Description of additional giveaway prize\n", + "name": "prize_description", + "required": false + }, + { + "type": "Array of String", + "description": "A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.", + "html_description": "Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.", + "rst_description": "*Optional*. A list of two-letter `ISO 3166-1 alpha-2 `_ country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.\n", + "name": "country_codes", + "required": false + }, + { + "type": "Integer", + "description": "The number of months the Telegram Premium subscription won from the giveaway will be active for", + "html_description": "Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for", + "rst_description": "*Optional*. The number of months the Telegram Premium subscription won from the giveaway will be active for\n", + "name": "premium_subscription_month_count", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "giveawaywinners", + "name": "GiveawayWinners", + "description": "This object represents a message about the completion of a giveaway with public winners.", + "html_description": "

This object represents a message about the completion of a giveaway with public winners.

", + "rst_description": "This object represents a message about the completion of a giveaway with public winners.", + "annotations": [ + { + "type": "Chat", + "description": "The chat that created the giveaway", + "html_description": "The chat that created the giveaway", + "rst_description": "The chat that created the giveaway\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Identifier of the messsage with the giveaway in the chat", + "html_description": "Identifier of the messsage with the giveaway in the chat", + "rst_description": "Identifier of the messsage with the giveaway in the chat\n", + "name": "giveaway_message_id", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when winners of the giveaway were selected", + "html_description": "Point in time (Unix timestamp) when winners of the giveaway were selected", + "rst_description": "Point in time (Unix timestamp) when winners of the giveaway were selected\n", + "name": "winners_selection_date", + "required": true + }, + { + "type": "Integer", + "description": "Total number of winners in the giveaway", + "html_description": "Total number of winners in the giveaway", + "rst_description": "Total number of winners in the giveaway\n", + "name": "winner_count", + "required": true + }, + { + "type": "Array of User", + "description": "List of up to 100 winners of the giveaway", + "html_description": "List of up to 100 winners of the giveaway", + "rst_description": "List of up to 100 winners of the giveaway\n", + "name": "winners", + "required": true + }, + { + "type": "Integer", + "description": "The number of other chats the user had to join in order to be eligible for the giveaway", + "html_description": "Optional. The number of other chats the user had to join in order to be eligible for the giveaway", + "rst_description": "*Optional*. The number of other chats the user had to join in order to be eligible for the giveaway\n", + "name": "additional_chat_count", + "required": false + }, + { + "type": "Integer", + "description": "The number of months the Telegram Premium subscription won from the giveaway will be active for", + "html_description": "Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for", + "rst_description": "*Optional*. The number of months the Telegram Premium subscription won from the giveaway will be active for\n", + "name": "premium_subscription_month_count", + "required": false + }, + { + "type": "Integer", + "description": "Number of undistributed prizes", + "html_description": "Optional. Number of undistributed prizes", + "rst_description": "*Optional*. Number of undistributed prizes\n", + "name": "unclaimed_prize_count", + "required": false + }, + { + "type": "True", + "description": "True, if only users who had joined the chats after the giveaway started were eligible to win", + "html_description": "Optional. True, if only users who had joined the chats after the giveaway started were eligible to win", + "rst_description": "*Optional*. :code:`True`, if only users who had joined the chats after the giveaway started were eligible to win\n", + "name": "only_new_members", + "required": false + }, + { + "type": "True", + "description": "True, if the giveaway was canceled because the payment for it was refunded", + "html_description": "Optional. True, if the giveaway was canceled because the payment for it was refunded", + "rst_description": "*Optional*. :code:`True`, if the giveaway was canceled because the payment for it was refunded\n", + "name": "was_refunded", + "required": false + }, + { + "type": "String", + "description": "Description of additional giveaway prize", + "html_description": "Optional. Description of additional giveaway prize", + "rst_description": "*Optional*. Description of additional giveaway prize\n", + "name": "prize_description", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "giveawaycompleted", + "name": "GiveawayCompleted", + "description": "This object represents a service message about the completion of a giveaway without public winners.", + "html_description": "

This object represents a service message about the completion of a giveaway without public winners.

", + "rst_description": "This object represents a service message about the completion of a giveaway without public winners.", + "annotations": [ + { + "type": "Integer", + "description": "Number of winners in the giveaway", + "html_description": "Number of winners in the giveaway", + "rst_description": "Number of winners in the giveaway\n", + "name": "winner_count", + "required": true + }, + { + "type": "Integer", + "description": "Number of undistributed prizes", + "html_description": "Optional. Number of undistributed prizes", + "rst_description": "*Optional*. Number of undistributed prizes\n", + "name": "unclaimed_prize_count", + "required": false + }, + { + "type": "Message", + "description": "Message with the giveaway that was completed, if it wasn't deleted", + "html_description": "Optional. Message with the giveaway that was completed, if it wasn't deleted", + "rst_description": "*Optional*. Message with the giveaway that was completed, if it wasn't deleted\n", + "name": "giveaway_message", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "linkpreviewoptions", + "name": "LinkPreviewOptions", + "description": "Describes the options used for link preview generation.", + "html_description": "

Describes the options used for link preview generation.

", + "rst_description": "Describes the options used for link preview generation.", + "annotations": [ + { + "type": "Boolean", + "description": "True, if the link preview is disabled", + "html_description": "Optional. True, if the link preview is disabled", + "rst_description": "*Optional*. :code:`True`, if the link preview is disabled\n", + "name": "is_disabled", + "required": false + }, + { + "type": "String", + "description": "URL to use for the link preview. If empty, then the first URL found in the message text will be used", + "html_description": "Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used", + "rst_description": "*Optional*. URL to use for the link preview. If empty, then the first URL found in the message text will be used\n", + "name": "url", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview", + "html_description": "Optional. True, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview", + "rst_description": "*Optional*. :code:`True`, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview\n", + "name": "prefer_small_media", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview", + "html_description": "Optional. True, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview", + "rst_description": "*Optional*. :code:`True`, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview\n", + "name": "prefer_large_media", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text", + "html_description": "Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text", + "rst_description": "*Optional*. :code:`True`, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text\n", + "name": "show_above_text", + "required": false + } + ], + "category": "types" + }, { "anchor": "userprofilephotos", "name": "UserProfilePhotos", @@ -2695,9 +3570,9 @@ { "anchor": "keyboardbutton", "name": "KeyboardButton", - "description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.\nNote: request_user and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", - "html_description": "

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.
\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.
\nNote: request_user and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", - "rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_user*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.\n\n**Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.\n\n**Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*.\n\n**Note:** *request_user* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", + "description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", + "html_description": "

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.
\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.
\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", + "rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_users*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.\n\n**Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.\n\n**Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*.\n\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", "annotations": [ { "type": "String", @@ -2708,11 +3583,11 @@ "required": true }, { - "type": "KeyboardButtonRequestUser", - "description": "If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only.", - "html_description": "Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only.", - "rst_description": "*Optional.* If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only.\n", - "name": "request_user", + "type": "KeyboardButtonRequestUsers", + "description": "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.", + "html_description": "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.", + "rst_description": "*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.\n", + "name": "request_users", "required": false }, { @@ -2759,35 +3634,43 @@ "category": "types" }, { - "anchor": "keyboardbuttonrequestuser", - "name": "KeyboardButtonRequestUser", - "description": "This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.", - "html_description": "

This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. More about requesting users »

", - "rst_description": "This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_", + "anchor": "keyboardbuttonrequestusers", + "name": "KeyboardButtonRequestUsers", + "description": "This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed.", + "html_description": "

This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »

", + "rst_description": "This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_", "annotations": [ { "type": "Integer", - "description": "Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message", - "html_description": "Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message", - "rst_description": "Signed 32-bit identifier of the request, which will be received back in the :class:`aiogram.types.user_shared.UserShared` object. Must be unique within the message\n", + "description": "Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message", + "html_description": "Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message", + "rst_description": "Signed 32-bit identifier of the request that will be received back in the :class:`aiogram.types.users_shared.UsersShared` object. Must be unique within the message\n", "name": "request_id", "required": true }, { "type": "Boolean", - "description": "Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.", - "html_description": "Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.", - "rst_description": "*Optional*. Pass :code:`True` to request a bot, pass :code:`False` to request a regular user. If not specified, no additional restrictions are applied.\n", + "description": "Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.", + "html_description": "Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.", + "rst_description": "*Optional*. Pass :code:`True` to request bots, pass :code:`False` to request regular users. If not specified, no additional restrictions are applied.\n", "name": "user_is_bot", "required": false }, { "type": "Boolean", - "description": "Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.", - "html_description": "Optional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.", - "rst_description": "*Optional*. Pass :code:`True` to request a premium user, pass :code:`False` to request a non-premium user. If not specified, no additional restrictions are applied.\n", + "description": "Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied.", + "html_description": "Optional. Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied.", + "rst_description": "*Optional*. Pass :code:`True` to request premium users, pass :code:`False` to request non-premium users. If not specified, no additional restrictions are applied.\n", "name": "user_is_premium", "required": false + }, + { + "type": "Integer", + "description": "The maximum number of users to be selected; 1-10. Defaults to 1.", + "html_description": "Optional. The maximum number of users to be selected; 1-10. Defaults to 1.", + "rst_description": "*Optional*. The maximum number of users to be selected; 1-10. Defaults to 1.\n", + "name": "max_quantity", + "required": false } ], "category": "types" @@ -3134,10 +4017,10 @@ "required": true }, { - "type": "Message", - "description": "Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old", - "html_description": "Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old", - "rst_description": "*Optional*. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old\n", + "type": "MaybeInaccessibleMessage", + "description": "Message sent by the bot with the callback button that originated the query", + "html_description": "Optional. Message sent by the bot with the callback button that originated the query", + "rst_description": "*Optional*. Message sent by the bot with the callback button that originated the query\n", "name": "message", "required": false }, @@ -3464,6 +4347,72 @@ ], "category": "types" }, + { + "anchor": "chatmemberupdated", + "name": "ChatMemberUpdated", + "description": "This object represents changes in the status of a chat member.", + "html_description": "

This object represents changes in the status of a chat member.

", + "rst_description": "This object represents changes in the status of a chat member.", + "annotations": [ + { + "type": "Chat", + "description": "Chat the user belongs to", + "html_description": "Chat the user belongs to", + "rst_description": "Chat the user belongs to\n", + "name": "chat", + "required": true + }, + { + "type": "User", + "description": "Performer of the action, which resulted in the change", + "html_description": "Performer of the action, which resulted in the change", + "rst_description": "Performer of the action, which resulted in the change\n", + "name": "from", + "required": true + }, + { + "type": "Integer", + "description": "Date the change was done in Unix time", + "html_description": "Date the change was done in Unix time", + "rst_description": "Date the change was done in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "ChatMember", + "description": "Previous information about the chat member", + "html_description": "Previous information about the chat member", + "rst_description": "Previous information about the chat member\n", + "name": "old_chat_member", + "required": true + }, + { + "type": "ChatMember", + "description": "New information about the chat member", + "html_description": "New information about the chat member", + "rst_description": "New information about the chat member\n", + "name": "new_chat_member", + "required": true + }, + { + "type": "ChatInviteLink", + "description": "Chat invite link, which was used by the user to join the chat; for joining by invite link events only.", + "html_description": "Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.", + "rst_description": "*Optional*. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.\n", + "name": "invite_link", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the user joined the chat via a chat folder invite link", + "html_description": "Optional. True, if the user joined the chat via a chat folder invite link", + "rst_description": "*Optional*. True, if the user joined the chat via a chat folder invite link\n", + "name": "via_chat_folder_invite_link", + "required": false + } + ], + "category": "types" + }, { "anchor": "chatmember", "name": "ChatMember", @@ -3736,9 +4685,9 @@ }, { "type": "Boolean", - "description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues", - "html_description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues", - "rst_description": ":code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues\n", + "description": "True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues", + "html_description": "True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues", + "rst_description": ":code:`True`, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues\n", "name": "can_send_messages", "required": true }, @@ -3917,72 +4866,6 @@ ], "category": "types" }, - { - "anchor": "chatmemberupdated", - "name": "ChatMemberUpdated", - "description": "This object represents changes in the status of a chat member.", - "html_description": "

This object represents changes in the status of a chat member.

", - "rst_description": "This object represents changes in the status of a chat member.", - "annotations": [ - { - "type": "Chat", - "description": "Chat the user belongs to", - "html_description": "Chat the user belongs to", - "rst_description": "Chat the user belongs to\n", - "name": "chat", - "required": true - }, - { - "type": "User", - "description": "Performer of the action, which resulted in the change", - "html_description": "Performer of the action, which resulted in the change", - "rst_description": "Performer of the action, which resulted in the change\n", - "name": "from", - "required": true - }, - { - "type": "Integer", - "description": "Date the change was done in Unix time", - "html_description": "Date the change was done in Unix time", - "rst_description": "Date the change was done in Unix time\n", - "name": "date", - "required": true - }, - { - "type": "ChatMember", - "description": "Previous information about the chat member", - "html_description": "Previous information about the chat member", - "rst_description": "Previous information about the chat member\n", - "name": "old_chat_member", - "required": true - }, - { - "type": "ChatMember", - "description": "New information about the chat member", - "html_description": "New information about the chat member", - "rst_description": "New information about the chat member\n", - "name": "new_chat_member", - "required": true - }, - { - "type": "ChatInviteLink", - "description": "Chat invite link, which was used by the user to join the chat; for joining by invite link events only.", - "html_description": "Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.", - "rst_description": "*Optional*. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.\n", - "name": "invite_link", - "required": false - }, - { - "type": "Boolean", - "description": "True, if the user joined the chat via a chat folder invite link", - "html_description": "Optional. True, if the user joined the chat via a chat folder invite link", - "rst_description": "*Optional*. True, if the user joined the chat via a chat folder invite link\n", - "name": "via_chat_folder_invite_link", - "required": false - } - ], - "category": "types" - }, { "anchor": "chatjoinrequest", "name": "ChatJoinRequest", @@ -4050,9 +4933,9 @@ "annotations": [ { "type": "Boolean", - "description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues", - "html_description": "Optional. True, if the user is allowed to send text messages, contacts, invoices, locations and venues", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues\n", + "description": "True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues", + "html_description": "Optional. True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues\n", "name": "can_send_messages", "required": false }, @@ -4189,6 +5072,201 @@ ], "category": "types" }, + { + "anchor": "reactiontype", + "name": "ReactionType", + "description": "This object describes the type of a reaction. Currently, it can be one of\n - ReactionTypeEmoji\n - ReactionTypeCustomEmoji", + "html_description": "

This object describes the type of a reaction. Currently, it can be one of

", + "rst_description": "This object describes the type of a reaction. Currently, it can be one of\n\n - :class:`aiogram.types.reaction_type_emoji.ReactionTypeEmoji`\n - :class:`aiogram.types.reaction_type_custom_emoji.ReactionTypeCustomEmoji`", + "annotations": [], + "category": "types" + }, + { + "anchor": "reactiontypeemoji", + "name": "ReactionTypeEmoji", + "description": "The reaction is based on an emoji.", + "html_description": "

The reaction is based on an emoji.

", + "rst_description": "The reaction is based on an emoji.", + "annotations": [ + { + "type": "String", + "description": "Type of the reaction, always 'emoji'", + "html_description": "Type of the reaction, always “emoji”", + "rst_description": "Type of the reaction, always 'emoji'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Reaction emoji. Currently, it can be one of \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"", + "html_description": "Reaction emoji. Currently, it can be one of \"\"👍\"/\", \"\"👎\"/\", \"\"❤\"/\", \"\"🔥\"/\", \"\"🥰\"/\", \"\"👏\"/\", \"\"😁\"/\", \"\"🤔\"/\", \"\"🤯\"/\", \"\"😱\"/\", \"\"🤬\"/\", \"\"😢\"/\", \"\"🎉\"/\", \"\"🤩\"/\", \"\"🤮\"/\", \"\"💩\"/\", \"\"🙏\"/\", \"\"👌\"/\", \"\"🕊\"/\", \"\"🤡\"/\", \"\"🥱\"/\", \"\"🥴\"/\", \"\"😍\"/\", \"\"🐳\"/\", \"\"❤‍🔥\"/\", \"\"🌚\"/\", \"\"🌭\"/\", \"\"💯\"/\", \"\"🤣\"/\", \"\"⚡\"/\", \"\"🍌\"/\", \"\"🏆\"/\", \"\"💔\"/\", \"\"🤨\"/\", \"\"😐\"/\", \"\"🍓\"/\", \"\"🍾\"/\", \"\"💋\"/\", \"\"🖕\"/\", \"\"😈\"/\", \"\"😴\"/\", \"\"😭\"/\", \"\"🤓\"/\", \"\"👻\"/\", \"\"👨‍💻\"/\", \"\"👀\"/\", \"\"🎃\"/\", \"\"🙈\"/\", \"\"😇\"/\", \"\"😨\"/\", \"\"🤝\"/\", \"\"✍\"/\", \"\"🤗\"/\", \"\"🫡\"/\", \"\"🎅\"/\", \"\"🎄\"/\", \"\"☃\"/\", \"\"💅\"/\", \"\"🤪\"/\", \"\"🗿\"/\", \"\"🆒\"/\", \"\"💘\"/\", \"\"🙉\"/\", \"\"🦄\"/\", \"\"😘\"/\", \"\"💊\"/\", \"\"🙊\"/\", \"\"😎\"/\", \"\"👾\"/\", \"\"🤷‍♂\"/\", \"\"🤷\"/\", \"\"🤷‍♀\"/\", \"\"😡\"/\"", + "rst_description": "Reaction emoji. Currently, it can be one of \"👍\", \"👎\", \"❤\", \"🔥\", \"🥰\", \"👏\", \"😁\", \"🤔\", \"🤯\", \"😱\", \"🤬\", \"😢\", \"🎉\", \"🤩\", \"🤮\", \"💩\", \"🙏\", \"👌\", \"🕊\", \"🤡\", \"🥱\", \"🥴\", \"😍\", \"🐳\", \"❤‍🔥\", \"🌚\", \"🌭\", \"💯\", \"🤣\", \"⚡\", \"🍌\", \"🏆\", \"💔\", \"🤨\", \"😐\", \"🍓\", \"🍾\", \"💋\", \"🖕\", \"😈\", \"😴\", \"😭\", \"🤓\", \"👻\", \"👨‍💻\", \"👀\", \"🎃\", \"🙈\", \"😇\", \"😨\", \"🤝\", \"✍\", \"🤗\", \"🫡\", \"🎅\", \"🎄\", \"☃\", \"💅\", \"🤪\", \"🗿\", \"🆒\", \"💘\", \"🙉\", \"🦄\", \"😘\", \"💊\", \"🙊\", \"😎\", \"👾\", \"🤷‍♂\", \"🤷\", \"🤷‍♀\", \"😡\"\n", + "name": "emoji", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "reactiontypecustomemoji", + "name": "ReactionTypeCustomEmoji", + "description": "The reaction is based on a custom emoji.", + "html_description": "

The reaction is based on a custom emoji.

", + "rst_description": "The reaction is based on a custom emoji.", + "annotations": [ + { + "type": "String", + "description": "Type of the reaction, always 'custom_emoji'", + "html_description": "Type of the reaction, always “custom_emoji”", + "rst_description": "Type of the reaction, always 'custom_emoji'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Custom emoji identifier", + "html_description": "Custom emoji identifier", + "rst_description": "Custom emoji identifier\n", + "name": "custom_emoji_id", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "reactioncount", + "name": "ReactionCount", + "description": "Represents a reaction added to a message along with the number of times it was added.", + "html_description": "

Represents a reaction added to a message along with the number of times it was added.

", + "rst_description": "Represents a reaction added to a message along with the number of times it was added.", + "annotations": [ + { + "type": "ReactionType", + "description": "Type of the reaction", + "html_description": "Type of the reaction", + "rst_description": "Type of the reaction\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Number of times the reaction was added", + "html_description": "Number of times the reaction was added", + "rst_description": "Number of times the reaction was added\n", + "name": "total_count", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "messagereactionupdated", + "name": "MessageReactionUpdated", + "description": "This object represents a change of a reaction on a message performed by a user.", + "html_description": "

This object represents a change of a reaction on a message performed by a user.

", + "rst_description": "This object represents a change of a reaction on a message performed by a user.", + "annotations": [ + { + "type": "Chat", + "description": "The chat containing the message the user reacted to", + "html_description": "The chat containing the message the user reacted to", + "rst_description": "The chat containing the message the user reacted to\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Unique identifier of the message inside the chat", + "html_description": "Unique identifier of the message inside the chat", + "rst_description": "Unique identifier of the message inside the chat\n", + "name": "message_id", + "required": true + }, + { + "type": "User", + "description": "The user that changed the reaction, if the user isn't anonymous", + "html_description": "Optional. The user that changed the reaction, if the user isn't anonymous", + "rst_description": "*Optional*. The user that changed the reaction, if the user isn't anonymous\n", + "name": "user", + "required": false + }, + { + "type": "Chat", + "description": "The chat on behalf of which the reaction was changed, if the user is anonymous", + "html_description": "Optional. The chat on behalf of which the reaction was changed, if the user is anonymous", + "rst_description": "*Optional*. The chat on behalf of which the reaction was changed, if the user is anonymous\n", + "name": "actor_chat", + "required": false + }, + { + "type": "Integer", + "description": "Date of the change in Unix time", + "html_description": "Date of the change in Unix time", + "rst_description": "Date of the change in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Array of ReactionType", + "description": "Previous list of reaction types that were set by the user", + "html_description": "Previous list of reaction types that were set by the user", + "rst_description": "Previous list of reaction types that were set by the user\n", + "name": "old_reaction", + "required": true + }, + { + "type": "Array of ReactionType", + "description": "New list of reaction types that have been set by the user", + "html_description": "New list of reaction types that have been set by the user", + "rst_description": "New list of reaction types that have been set by the user\n", + "name": "new_reaction", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "messagereactioncountupdated", + "name": "MessageReactionCountUpdated", + "description": "This object represents reaction changes on a message with anonymous reactions.", + "html_description": "

This object represents reaction changes on a message with anonymous reactions.

", + "rst_description": "This object represents reaction changes on a message with anonymous reactions.", + "annotations": [ + { + "type": "Chat", + "description": "The chat containing the message", + "html_description": "The chat containing the message", + "rst_description": "The chat containing the message\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Unique message identifier inside the chat", + "html_description": "Unique message identifier inside the chat", + "rst_description": "Unique message identifier inside the chat\n", + "name": "message_id", + "required": true + }, + { + "type": "Integer", + "description": "Date of the change in Unix time", + "html_description": "Date of the change in Unix time", + "rst_description": "Date of the change in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Array of ReactionCount", + "description": "List of reactions that are present on the message", + "html_description": "List of reactions that are present on the message", + "rst_description": "List of reactions that are present on the message\n", + "name": "reactions", + "required": true + } + ], + "category": "types" + }, { "anchor": "forumtopic", "name": "ForumTopic", @@ -4557,6 +5635,237 @@ ], "category": "types" }, + { + "anchor": "chatboostsource", + "name": "ChatBoostSource", + "description": "This object describes the source of a chat boost. It can be one of\n - ChatBoostSourcePremium\n - ChatBoostSourceGiftCode\n - ChatBoostSourceGiveaway", + "html_description": "

This object describes the source of a chat boost. It can be one of

", + "rst_description": "This object describes the source of a chat boost. It can be one of\n\n - :class:`aiogram.types.chat_boost_source_premium.ChatBoostSourcePremium`\n - :class:`aiogram.types.chat_boost_source_gift_code.ChatBoostSourceGiftCode`\n - :class:`aiogram.types.chat_boost_source_giveaway.ChatBoostSourceGiveaway`", + "annotations": [], + "category": "types" + }, + { + "anchor": "chatboostsourcepremium", + "name": "ChatBoostSourcePremium", + "description": "The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.", + "html_description": "

The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.

", + "rst_description": "The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.", + "annotations": [ + { + "type": "String", + "description": "Source of the boost, always 'premium'", + "html_description": "Source of the boost, always “premium”", + "rst_description": "Source of the boost, always 'premium'\n", + "name": "source", + "required": true + }, + { + "type": "User", + "description": "User that boosted the chat", + "html_description": "User that boosted the chat", + "rst_description": "User that boosted the chat\n", + "name": "user", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "chatboostsourcegiftcode", + "name": "ChatBoostSourceGiftCode", + "description": "The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.", + "html_description": "

The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.

", + "rst_description": "The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.", + "annotations": [ + { + "type": "String", + "description": "Source of the boost, always 'gift_code'", + "html_description": "Source of the boost, always “gift_code”", + "rst_description": "Source of the boost, always 'gift_code'\n", + "name": "source", + "required": true + }, + { + "type": "User", + "description": "User for which the gift code was created", + "html_description": "User for which the gift code was created", + "rst_description": "User for which the gift code was created\n", + "name": "user", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "chatboostsourcegiveaway", + "name": "ChatBoostSourceGiveaway", + "description": "The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.", + "html_description": "

The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.

", + "rst_description": "The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.", + "annotations": [ + { + "type": "String", + "description": "Source of the boost, always 'giveaway'", + "html_description": "Source of the boost, always “giveaway”", + "rst_description": "Source of the boost, always 'giveaway'\n", + "name": "source", + "required": true + }, + { + "type": "Integer", + "description": "Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet.", + "html_description": "Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet.", + "rst_description": "Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet.\n", + "name": "giveaway_message_id", + "required": true + }, + { + "type": "User", + "description": "User that won the prize in the giveaway if any", + "html_description": "Optional. User that won the prize in the giveaway if any", + "rst_description": "*Optional*. User that won the prize in the giveaway if any\n", + "name": "user", + "required": false + }, + { + "type": "True", + "description": "True, if the giveaway was completed, but there was no user to win the prize", + "html_description": "Optional. True, if the giveaway was completed, but there was no user to win the prize", + "rst_description": "*Optional*. True, if the giveaway was completed, but there was no user to win the prize\n", + "name": "is_unclaimed", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "chatboost", + "name": "ChatBoost", + "description": "This object contains information about a chat boost.", + "html_description": "

This object contains information about a chat boost.

", + "rst_description": "This object contains information about a chat boost.", + "annotations": [ + { + "type": "String", + "description": "Unique identifier of the boost", + "html_description": "Unique identifier of the boost", + "rst_description": "Unique identifier of the boost\n", + "name": "boost_id", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when the chat was boosted", + "html_description": "Point in time (Unix timestamp) when the chat was boosted", + "rst_description": "Point in time (Unix timestamp) when the chat was boosted\n", + "name": "add_date", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged", + "html_description": "Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged", + "rst_description": "Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged\n", + "name": "expiration_date", + "required": true + }, + { + "type": "ChatBoostSource", + "description": "Source of the added boost", + "html_description": "Source of the added boost", + "rst_description": "Source of the added boost\n", + "name": "source", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "chatboostupdated", + "name": "ChatBoostUpdated", + "description": "This object represents a boost added to a chat or changed.", + "html_description": "

This object represents a boost added to a chat or changed.

", + "rst_description": "This object represents a boost added to a chat or changed.", + "annotations": [ + { + "type": "Chat", + "description": "Chat which was boosted", + "html_description": "Chat which was boosted", + "rst_description": "Chat which was boosted\n", + "name": "chat", + "required": true + }, + { + "type": "ChatBoost", + "description": "Infomation about the chat boost", + "html_description": "Infomation about the chat boost", + "rst_description": "Infomation about the chat boost\n", + "name": "boost", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "chatboostremoved", + "name": "ChatBoostRemoved", + "description": "This object represents a boost removed from a chat.", + "html_description": "

This object represents a boost removed from a chat.

", + "rst_description": "This object represents a boost removed from a chat.", + "annotations": [ + { + "type": "Chat", + "description": "Chat which was boosted", + "html_description": "Chat which was boosted", + "rst_description": "Chat which was boosted\n", + "name": "chat", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the boost", + "html_description": "Unique identifier of the boost", + "rst_description": "Unique identifier of the boost\n", + "name": "boost_id", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when the boost was removed", + "html_description": "Point in time (Unix timestamp) when the boost was removed", + "rst_description": "Point in time (Unix timestamp) when the boost was removed\n", + "name": "remove_date", + "required": true + }, + { + "type": "ChatBoostSource", + "description": "Source of the removed boost", + "html_description": "Source of the removed boost", + "rst_description": "Source of the removed boost\n", + "name": "source", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "userchatboosts", + "name": "UserChatBoosts", + "description": "This object represents a list of boosts added to a chat by a user.", + "html_description": "

This object represents a list of boosts added to a chat by a user.

", + "rst_description": "This object represents a list of boosts added to a chat by a user.", + "annotations": [ + { + "type": "Array of ChatBoost", + "description": "The list of boosts added to the chat by the user", + "html_description": "The list of boosts added to the chat by the user", + "rst_description": "The list of boosts added to the chat by the user\n", + "name": "boosts", + "required": true + } + ], + "category": "types" + }, { "anchor": "responseparameters", "name": "ResponseParameters", @@ -5077,12 +6386,12 @@ "name": "entities" }, { - "type": "Boolean", + "type": "LinkPreviewOptions", "required": false, - "description": "Disables link previews for links in this message", - "html_description": "Disables link previews for links in this message", - "rst_description": "Disables link previews for links in this message\n", - "name": "disable_web_page_preview" + "description": "Link preview generation options for the message", + "html_description": "Link preview generation options for the message", + "rst_description": "Link preview generation options for the message\n", + "name": "link_preview_options" }, { "type": "Boolean", @@ -5101,20 +6410,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -5130,9 +6431,9 @@ { "anchor": "forwardmessage", "name": "forwardMessage", - "description": "Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.", - "html_description": "

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

", - "rst_description": "Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned.", + "description": "Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.", + "html_description": "

Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.

", + "rst_description": "Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned.", "annotations": [ { "type": "Integer or String", @@ -5185,12 +6486,70 @@ ], "category": "methods" }, + { + "anchor": "forwardmessages", + "name": "forwardMessages", + "description": "Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.", + "html_description": "

Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.

", + "rst_description": "Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": false, + "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only", + "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only", + "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n", + "name": "message_thread_id" + }, + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)", + "html_description": "Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)", + "rst_description": "Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)\n", + "name": "from_chat_id" + }, + { + "type": "Array of Integer", + "required": true, + "description": "Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.", + "html_description": "Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.", + "rst_description": "Identifiers of 1-100 messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order.\n", + "name": "message_ids" + }, + { + "type": "Boolean", + "required": false, + "description": "Sends the messages silently. Users will receive a notification with no sound.", + "html_description": "Sends the messages silently. Users will receive a notification with no sound.", + "rst_description": "Sends the messages `silently `_. Users will receive a notification with no sound.\n", + "name": "disable_notification" + }, + { + "type": "Boolean", + "required": false, + "description": "Protects the contents of the forwarded messages from forwarding and saving", + "html_description": "Protects the contents of the forwarded messages from forwarding and saving", + "rst_description": "Protects the contents of the forwarded messages from forwarding and saving\n", + "name": "protect_content" + } + ], + "category": "methods" + }, { "anchor": "copymessage", "name": "copyMessage", - "description": "Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.", - "html_description": "

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

", - "rst_description": "Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success.", + "description": "Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.", + "html_description": "

Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

", + "rst_description": "Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success.", "annotations": [ { "type": "Integer or String", @@ -5265,20 +6624,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -5291,6 +6642,72 @@ ], "category": "methods" }, + { + "anchor": "copymessages", + "name": "copyMessages", + "description": "Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.", + "html_description": "

Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.

", + "rst_description": "Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_messages.ForwardMessages`, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": false, + "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only", + "html_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only", + "rst_description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only\n", + "name": "message_thread_id" + }, + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)", + "html_description": "Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)", + "rst_description": "Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)\n", + "name": "from_chat_id" + }, + { + "type": "Array of Integer", + "required": true, + "description": "Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.", + "html_description": "Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.", + "rst_description": "Identifiers of 1-100 messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order.\n", + "name": "message_ids" + }, + { + "type": "Boolean", + "required": false, + "description": "Sends the messages silently. Users will receive a notification with no sound.", + "html_description": "Sends the messages silently. Users will receive a notification with no sound.", + "rst_description": "Sends the messages `silently `_. Users will receive a notification with no sound.\n", + "name": "disable_notification" + }, + { + "type": "Boolean", + "required": false, + "description": "Protects the contents of the sent messages from forwarding and saving", + "html_description": "Protects the contents of the sent messages from forwarding and saving", + "rst_description": "Protects the contents of the sent messages from forwarding and saving\n", + "name": "protect_content" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to copy the messages without their captions", + "html_description": "Pass True to copy the messages without their captions", + "rst_description": "Pass :code:`True` to copy the messages without their captions\n", + "name": "remove_caption" + } + ], + "category": "methods" + }, { "anchor": "sendphoto", "name": "sendPhoto", @@ -5371,20 +6788,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -5501,20 +6910,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -5615,20 +7016,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -5761,20 +7154,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -5899,20 +7284,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -6005,20 +7382,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -6103,20 +7472,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -6177,20 +7538,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the messages are a reply, ID of the original message", - "html_description": "If the messages are a reply, ID of the original message", - "rst_description": "If the messages are a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" } ], "category": "methods" @@ -6283,20 +7636,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -6413,20 +7758,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -6511,20 +7848,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -6673,20 +8002,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -6747,20 +8068,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -6807,6 +8120,48 @@ ], "category": "methods" }, + { + "anchor": "setmessagereaction", + "name": "setMessageReaction", + "description": "Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success.", + "html_description": "

Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success.

", + "rst_description": "Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": true, + "description": "Identifier of the target message", + "html_description": "Identifier of the target message", + "rst_description": "Identifier of the target message\n", + "name": "message_id" + }, + { + "type": "Array of ReactionType", + "required": false, + "description": "New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.", + "html_description": "New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.", + "rst_description": "New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.\n", + "name": "reaction" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to set the reaction with a big animation", + "html_description": "Pass True to set the reaction with a big animation", + "rst_description": "Pass :code:`True` to set the reaction with a big animation\n", + "name": "is_big" + } + ], + "category": "methods" + }, { "anchor": "getuserprofilephotos", "name": "getUserProfilePhotos", @@ -7650,9 +9005,9 @@ { "anchor": "getchat", "name": "getChat", - "description": "Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.", - "html_description": "

Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.

", - "rst_description": "Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a :class:`aiogram.types.chat.Chat` object on success.", + "description": "Use this method to get up to date information about the chat. Returns a Chat object on success.", + "html_description": "

Use this method to get up to date information about the chat. Returns a Chat object on success.

", + "rst_description": "Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success.", "annotations": [ { "type": "Integer or String", @@ -8134,6 +9489,32 @@ ], "category": "methods" }, + { + "anchor": "getuserchatboosts", + "name": "getUserChatBoosts", + "description": "Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.", + "html_description": "

Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.

", + "rst_description": "Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a :class:`aiogram.types.user_chat_boosts.UserChatBoosts` object.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the chat or username of the channel (in the format @channelusername)", + "html_description": "Unique identifier for the chat or username of the channel (in the format @channelusername)", + "rst_description": "Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the target user", + "html_description": "Unique identifier of the target user", + "rst_description": "Unique identifier of the target user\n", + "name": "user_id" + } + ], + "category": "methods" + }, { "anchor": "setmycommands", "name": "setMyCommands", @@ -8503,12 +9884,12 @@ "name": "entities" }, { - "type": "Boolean", + "type": "LinkPreviewOptions", "required": false, - "description": "Disables link previews for links in this message", - "html_description": "Disables link previews for links in this message", - "rst_description": "Disables link previews for links in this message\n", - "name": "disable_web_page_preview" + "description": "Link preview generation options for the message", + "html_description": "Link preview generation options for the message", + "rst_description": "Link preview generation options for the message\n", + "name": "link_preview_options" }, { "type": "InlineKeyboardMarkup", @@ -8862,6 +10243,32 @@ } ], "category": "methods" + }, + { + "anchor": "deletemessages", + "name": "deleteMessages", + "description": "Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.", + "html_description": "

Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.

", + "rst_description": "Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "html_description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)", + "rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n", + "name": "chat_id" + }, + { + "type": "Array of Integer", + "required": true, + "description": "Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted", + "html_description": "Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted", + "rst_description": "Identifiers of 1-100 messages to delete. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted\n", + "name": "message_ids" + } + ], + "category": "methods" } ], "description": "The following methods allow you to change an existing message in the message history instead of sending a new one with a result of an action. This is most useful for messages with inline keyboards using callback queries, but can also help reduce clutter in conversations with regular chat bots.\nPlease note, that it is currently only possible to edit messages without reply_markup or with inline keyboards." @@ -9206,20 +10613,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply", @@ -11763,11 +13162,11 @@ "required": false }, { - "type": "Boolean", - "description": "Disables link previews for links in the sent message", - "html_description": "Optional. Disables link previews for links in the sent message", - "rst_description": "*Optional*. Disables link previews for links in the sent message\n", - "name": "disable_web_page_preview", + "type": "LinkPreviewOptions", + "description": "Link preview generation options for the message", + "html_description": "Optional. Link preview generation options for the message", + "rst_description": "*Optional*. Link preview generation options for the message\n", + "name": "link_preview_options", "required": false } ], @@ -12426,20 +13825,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup", @@ -12784,8 +14175,8 @@ { "type": "String", "description": "Two-letter ISO 3166-1 alpha-2 country code", - "html_description": "Two-letter ISO 3166-1 alpha-2 country code", - "rst_description": "Two-letter ISO 3166-1 alpha-2 country code\n", + "html_description": "Two-letter ISO 3166-1 alpha-2 country code", + "rst_description": "Two-letter `ISO 3166-1 alpha-2 `_ country code\n", "name": "country_code", "required": true }, @@ -13757,20 +15148,12 @@ "name": "protect_content" }, { - "type": "Integer", + "type": "ReplyParameters", "required": false, - "description": "If the message is a reply, ID of the original message", - "html_description": "If the message is a reply, ID of the original message", - "rst_description": "If the message is a reply, ID of the original message\n", - "name": "reply_to_message_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "html_description": "Pass True if the message should be sent even if the specified replied-to message is not found", - "rst_description": "Pass :code:`True` if the message should be sent even if the specified replied-to message is not found\n", - "name": "allow_sending_without_reply" + "description": "Description of the message to reply to", + "html_description": "Description of the message to reply to", + "rst_description": "Description of the message to reply to\n", + "name": "reply_parameters" }, { "type": "InlineKeyboardMarkup", diff --git a/.butcher/types/CallbackQuery/entity.json b/.butcher/types/CallbackQuery/entity.json index e0b35038..24ff2072 100644 --- a/.butcher/types/CallbackQuery/entity.json +++ b/.butcher/types/CallbackQuery/entity.json @@ -28,10 +28,10 @@ "required": true }, { - "type": "Message", - "description": "Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old", - "html_description": "Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old", - "rst_description": "*Optional*. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old\n", + "type": "MaybeInaccessibleMessage", + "description": "Message sent by the bot with the callback button that originated the query", + "html_description": "Optional. Message sent by the bot with the callback button that originated the query", + "rst_description": "*Optional*. Message sent by the bot with the callback button that originated the query\n", "name": "message", "required": false }, diff --git a/.butcher/types/Chat/entity.json b/.butcher/types/Chat/entity.json index 0a65849d..188816ef 100644 --- a/.butcher/types/Chat/entity.json +++ b/.butcher/types/Chat/entity.json @@ -83,19 +83,59 @@ "name": "active_usernames", "required": false }, + { + "type": "Array of ReactionType", + "description": "List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.", + "html_description": "Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.", + "rst_description": "*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions `_ are allowed. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "available_reactions", + "required": false + }, + { + "type": "Integer", + "description": "Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", + "html_description": "Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.", + "rst_description": "*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "accent_color_id", + "required": false + }, { "type": "String", - "description": "Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.", - "html_description": "Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.", - "rst_description": "*Optional*. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.", + "html_description": "Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.", + "rst_description": "*Optional*. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "background_custom_emoji_id", + "required": false + }, + { + "type": "Integer", + "description": "Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", + "html_description": "Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.", + "rst_description": "*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "profile_accent_color_id", + "required": false + }, + { + "type": "String", + "description": "Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", + "html_description": "Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.", + "rst_description": "*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "profile_background_custom_emoji_id", + "required": false + }, + { + "type": "String", + "description": "Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", + "html_description": "Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.", + "rst_description": "*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "emoji_status_custom_emoji_id", "required": false }, { "type": "Integer", - "description": "Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.", - "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.", - "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "description": "Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", + "html_description": "Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.", + "rst_description": "*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "emoji_status_expiration_date", "required": false }, @@ -211,6 +251,14 @@ "name": "has_protected_content", "required": false }, + { + "type": "True", + "description": "True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", + "html_description": "Optional. True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.", + "rst_description": "*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "has_visible_history", + "required": false + }, { "type": "String", "description": "For supergroups, name of group sticker set. Returned only in getChat.", diff --git a/.butcher/types/ChatBoost/entity.json b/.butcher/types/ChatBoost/entity.json new file mode 100644 index 00000000..e0663217 --- /dev/null +++ b/.butcher/types/ChatBoost/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatboost", + "name": "ChatBoost", + "description": "This object contains information about a chat boost.", + "html_description": "

This object contains information about a chat boost.

", + "rst_description": "This object contains information about a chat boost.", + "annotations": [ + { + "type": "String", + "description": "Unique identifier of the boost", + "html_description": "Unique identifier of the boost", + "rst_description": "Unique identifier of the boost\n", + "name": "boost_id", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when the chat was boosted", + "html_description": "Point in time (Unix timestamp) when the chat was boosted", + "rst_description": "Point in time (Unix timestamp) when the chat was boosted\n", + "name": "add_date", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged", + "html_description": "Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged", + "rst_description": "Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged\n", + "name": "expiration_date", + "required": true + }, + { + "type": "ChatBoostSource", + "description": "Source of the added boost", + "html_description": "Source of the added boost", + "rst_description": "Source of the added boost\n", + "name": "source", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ChatBoost/replace.yml b/.butcher/types/ChatBoost/replace.yml new file mode 100644 index 00000000..5ab36451 --- /dev/null +++ b/.butcher/types/ChatBoost/replace.yml @@ -0,0 +1,9 @@ +annotations: + add_date: + parsed_type: + type: std + name: DateTime + expiration_date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/ChatBoostRemoved/entity.json b/.butcher/types/ChatBoostRemoved/entity.json new file mode 100644 index 00000000..72bac88d --- /dev/null +++ b/.butcher/types/ChatBoostRemoved/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatboostremoved", + "name": "ChatBoostRemoved", + "description": "This object represents a boost removed from a chat.", + "html_description": "

This object represents a boost removed from a chat.

", + "rst_description": "This object represents a boost removed from a chat.", + "annotations": [ + { + "type": "Chat", + "description": "Chat which was boosted", + "html_description": "Chat which was boosted", + "rst_description": "Chat which was boosted\n", + "name": "chat", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the boost", + "html_description": "Unique identifier of the boost", + "rst_description": "Unique identifier of the boost\n", + "name": "boost_id", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when the boost was removed", + "html_description": "Point in time (Unix timestamp) when the boost was removed", + "rst_description": "Point in time (Unix timestamp) when the boost was removed\n", + "name": "remove_date", + "required": true + }, + { + "type": "ChatBoostSource", + "description": "Source of the removed boost", + "html_description": "Source of the removed boost", + "rst_description": "Source of the removed boost\n", + "name": "source", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ChatBoostRemoved/replace.yml b/.butcher/types/ChatBoostRemoved/replace.yml new file mode 100644 index 00000000..cfba455f --- /dev/null +++ b/.butcher/types/ChatBoostRemoved/replace.yml @@ -0,0 +1,5 @@ +annotations: + remove_date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/ChatBoostSource/entity.json b/.butcher/types/ChatBoostSource/entity.json new file mode 100644 index 00000000..3a73894f --- /dev/null +++ b/.butcher/types/ChatBoostSource/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatboostsource", + "name": "ChatBoostSource", + "description": "This object describes the source of a chat boost. It can be one of\n - ChatBoostSourcePremium\n - ChatBoostSourceGiftCode\n - ChatBoostSourceGiveaway", + "html_description": "

This object describes the source of a chat boost. It can be one of

", + "rst_description": "This object describes the source of a chat boost. It can be one of\n\n - :class:`aiogram.types.chat_boost_source_premium.ChatBoostSourcePremium`\n - :class:`aiogram.types.chat_boost_source_gift_code.ChatBoostSourceGiftCode`\n - :class:`aiogram.types.chat_boost_source_giveaway.ChatBoostSourceGiveaway`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/ChatBoostSource/subtypes.yml b/.butcher/types/ChatBoostSource/subtypes.yml new file mode 100644 index 00000000..fd3f58ea --- /dev/null +++ b/.butcher/types/ChatBoostSource/subtypes.yml @@ -0,0 +1 @@ +discriminator: "source" diff --git a/.butcher/types/ChatBoostSourceGiftCode/entity.json b/.butcher/types/ChatBoostSourceGiftCode/entity.json new file mode 100644 index 00000000..3e6c0166 --- /dev/null +++ b/.butcher/types/ChatBoostSourceGiftCode/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatboostsourcegiftcode", + "name": "ChatBoostSourceGiftCode", + "description": "The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.", + "html_description": "

The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.

", + "rst_description": "The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.", + "annotations": [ + { + "type": "String", + "description": "Source of the boost, always 'gift_code'", + "html_description": "Source of the boost, always “gift_code”", + "rst_description": "Source of the boost, always 'gift_code'\n", + "name": "source", + "required": true + }, + { + "type": "User", + "description": "User for which the gift code was created", + "html_description": "User for which the gift code was created", + "rst_description": "User for which the gift code was created\n", + "name": "user", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ChatBoostSourceGiveaway/entity.json b/.butcher/types/ChatBoostSourceGiveaway/entity.json new file mode 100644 index 00000000..f01133f3 --- /dev/null +++ b/.butcher/types/ChatBoostSourceGiveaway/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatboostsourcegiveaway", + "name": "ChatBoostSourceGiveaway", + "description": "The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.", + "html_description": "

The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.

", + "rst_description": "The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.", + "annotations": [ + { + "type": "String", + "description": "Source of the boost, always 'giveaway'", + "html_description": "Source of the boost, always “giveaway”", + "rst_description": "Source of the boost, always 'giveaway'\n", + "name": "source", + "required": true + }, + { + "type": "Integer", + "description": "Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet.", + "html_description": "Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet.", + "rst_description": "Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet.\n", + "name": "giveaway_message_id", + "required": true + }, + { + "type": "User", + "description": "User that won the prize in the giveaway if any", + "html_description": "Optional. User that won the prize in the giveaway if any", + "rst_description": "*Optional*. User that won the prize in the giveaway if any\n", + "name": "user", + "required": false + }, + { + "type": "True", + "description": "True, if the giveaway was completed, but there was no user to win the prize", + "html_description": "Optional. True, if the giveaway was completed, but there was no user to win the prize", + "rst_description": "*Optional*. True, if the giveaway was completed, but there was no user to win the prize\n", + "name": "is_unclaimed", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ChatBoostSourcePremium/entity.json b/.butcher/types/ChatBoostSourcePremium/entity.json new file mode 100644 index 00000000..d78c8ed2 --- /dev/null +++ b/.butcher/types/ChatBoostSourcePremium/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatboostsourcepremium", + "name": "ChatBoostSourcePremium", + "description": "The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.", + "html_description": "

The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.

", + "rst_description": "The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.", + "annotations": [ + { + "type": "String", + "description": "Source of the boost, always 'premium'", + "html_description": "Source of the boost, always “premium”", + "rst_description": "Source of the boost, always 'premium'\n", + "name": "source", + "required": true + }, + { + "type": "User", + "description": "User that boosted the chat", + "html_description": "User that boosted the chat", + "rst_description": "User that boosted the chat\n", + "name": "user", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ChatBoostUpdated/entity.json b/.butcher/types/ChatBoostUpdated/entity.json new file mode 100644 index 00000000..6ef9c19f --- /dev/null +++ b/.butcher/types/ChatBoostUpdated/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatboostupdated", + "name": "ChatBoostUpdated", + "description": "This object represents a boost added to a chat or changed.", + "html_description": "

This object represents a boost added to a chat or changed.

", + "rst_description": "This object represents a boost added to a chat or changed.", + "annotations": [ + { + "type": "Chat", + "description": "Chat which was boosted", + "html_description": "Chat which was boosted", + "rst_description": "Chat which was boosted\n", + "name": "chat", + "required": true + }, + { + "type": "ChatBoost", + "description": "Infomation about the chat boost", + "html_description": "Infomation about the chat boost", + "rst_description": "Infomation about the chat boost\n", + "name": "boost", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ChatMemberRestricted/entity.json b/.butcher/types/ChatMemberRestricted/entity.json index 1c46132d..e822ae41 100644 --- a/.butcher/types/ChatMemberRestricted/entity.json +++ b/.butcher/types/ChatMemberRestricted/entity.json @@ -37,9 +37,9 @@ }, { "type": "Boolean", - "description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues", - "html_description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues", - "rst_description": ":code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues\n", + "description": "True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues", + "html_description": "True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues", + "rst_description": ":code:`True`, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues\n", "name": "can_send_messages", "required": true }, diff --git a/.butcher/types/ChatPermissions/entity.json b/.butcher/types/ChatPermissions/entity.json index 5a206394..b3209460 100644 --- a/.butcher/types/ChatPermissions/entity.json +++ b/.butcher/types/ChatPermissions/entity.json @@ -13,9 +13,9 @@ "annotations": [ { "type": "Boolean", - "description": "True, if the user is allowed to send text messages, contacts, invoices, locations and venues", - "html_description": "Optional. True, if the user is allowed to send text messages, contacts, invoices, locations and venues", - "rst_description": "*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues\n", + "description": "True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues", + "html_description": "Optional. True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues", + "rst_description": "*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues\n", "name": "can_send_messages", "required": false }, diff --git a/.butcher/types/ExternalReplyInfo/entity.json b/.butcher/types/ExternalReplyInfo/entity.json new file mode 100644 index 00000000..975e126c --- /dev/null +++ b/.butcher/types/ExternalReplyInfo/entity.json @@ -0,0 +1,201 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "externalreplyinfo", + "name": "ExternalReplyInfo", + "description": "This object contains information about a message that is being replied to, which may come from another chat or forum topic.", + "html_description": "

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

", + "rst_description": "This object contains information about a message that is being replied to, which may come from another chat or forum topic.", + "annotations": [ + { + "type": "MessageOrigin", + "description": "Origin of the message replied to by the given message", + "html_description": "Origin of the message replied to by the given message", + "rst_description": "Origin of the message replied to by the given message\n", + "name": "origin", + "required": true + }, + { + "type": "Chat", + "description": "Chat the original message belongs to. Available only if the chat is a supergroup or a channel.", + "html_description": "Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.", + "rst_description": "*Optional*. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.\n", + "name": "chat", + "required": false + }, + { + "type": "Integer", + "description": "Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.", + "html_description": "Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.", + "rst_description": "*Optional*. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.\n", + "name": "message_id", + "required": false + }, + { + "type": "LinkPreviewOptions", + "description": "Options used for link preview generation for the original message, if it is a text message", + "html_description": "Optional. Options used for link preview generation for the original message, if it is a text message", + "rst_description": "*Optional*. Options used for link preview generation for the original message, if it is a text message\n", + "name": "link_preview_options", + "required": false + }, + { + "type": "Animation", + "description": "Message is an animation, information about the animation", + "html_description": "Optional. Message is an animation, information about the animation", + "rst_description": "*Optional*. Message is an animation, information about the animation\n", + "name": "animation", + "required": false + }, + { + "type": "Audio", + "description": "Message is an audio file, information about the file", + "html_description": "Optional. Message is an audio file, information about the file", + "rst_description": "*Optional*. Message is an audio file, information about the file\n", + "name": "audio", + "required": false + }, + { + "type": "Document", + "description": "Message is a general file, information about the file", + "html_description": "Optional. Message is a general file, information about the file", + "rst_description": "*Optional*. Message is a general file, information about the file\n", + "name": "document", + "required": false + }, + { + "type": "Array of PhotoSize", + "description": "Message is a photo, available sizes of the photo", + "html_description": "Optional. Message is a photo, available sizes of the photo", + "rst_description": "*Optional*. Message is a photo, available sizes of the photo\n", + "name": "photo", + "required": false + }, + { + "type": "Sticker", + "description": "Message is a sticker, information about the sticker", + "html_description": "Optional. Message is a sticker, information about the sticker", + "rst_description": "*Optional*. Message is a sticker, information about the sticker\n", + "name": "sticker", + "required": false + }, + { + "type": "Story", + "description": "Message is a forwarded story", + "html_description": "Optional. Message is a forwarded story", + "rst_description": "*Optional*. Message is a forwarded story\n", + "name": "story", + "required": false + }, + { + "type": "Video", + "description": "Message is a video, information about the video", + "html_description": "Optional. Message is a video, information about the video", + "rst_description": "*Optional*. Message is a video, information about the video\n", + "name": "video", + "required": false + }, + { + "type": "VideoNote", + "description": "Message is a video note, information about the video message", + "html_description": "Optional. Message is a video note, information about the video message", + "rst_description": "*Optional*. Message is a `video note `_, information about the video message\n", + "name": "video_note", + "required": false + }, + { + "type": "Voice", + "description": "Message is a voice message, information about the file", + "html_description": "Optional. Message is a voice message, information about the file", + "rst_description": "*Optional*. Message is a voice message, information about the file\n", + "name": "voice", + "required": false + }, + { + "type": "True", + "description": "True, if the message media is covered by a spoiler animation", + "html_description": "Optional. True, if the message media is covered by a spoiler animation", + "rst_description": "*Optional*. :code:`True`, if the message media is covered by a spoiler animation\n", + "name": "has_media_spoiler", + "required": false + }, + { + "type": "Contact", + "description": "Message is a shared contact, information about the contact", + "html_description": "Optional. Message is a shared contact, information about the contact", + "rst_description": "*Optional*. Message is a shared contact, information about the contact\n", + "name": "contact", + "required": false + }, + { + "type": "Dice", + "description": "Message is a dice with random value", + "html_description": "Optional. Message is a dice with random value", + "rst_description": "*Optional*. Message is a dice with random value\n", + "name": "dice", + "required": false + }, + { + "type": "Game", + "description": "Message is a game, information about the game.", + "html_description": "Optional. Message is a game, information about the game. More about games »", + "rst_description": "*Optional*. Message is a game, information about the game. `More about games » `_\n", + "name": "game", + "required": false + }, + { + "type": "Giveaway", + "description": "Message is a scheduled giveaway, information about the giveaway", + "html_description": "Optional. Message is a scheduled giveaway, information about the giveaway", + "rst_description": "*Optional*. Message is a scheduled giveaway, information about the giveaway\n", + "name": "giveaway", + "required": false + }, + { + "type": "GiveawayWinners", + "description": "A giveaway with public winners was completed", + "html_description": "Optional. A giveaway with public winners was completed", + "rst_description": "*Optional*. A giveaway with public winners was completed\n", + "name": "giveaway_winners", + "required": false + }, + { + "type": "Invoice", + "description": "Message is an invoice for a payment, information about the invoice.", + "html_description": "Optional. Message is an invoice for a payment, information about the invoice. More about payments »", + "rst_description": "*Optional*. Message is an invoice for a `payment `_, information about the invoice. `More about payments » `_\n", + "name": "invoice", + "required": false + }, + { + "type": "Location", + "description": "Message is a shared location, information about the location", + "html_description": "Optional. Message is a shared location, information about the location", + "rst_description": "*Optional*. Message is a shared location, information about the location\n", + "name": "location", + "required": false + }, + { + "type": "Poll", + "description": "Message is a native poll, information about the poll", + "html_description": "Optional. Message is a native poll, information about the poll", + "rst_description": "*Optional*. Message is a native poll, information about the poll\n", + "name": "poll", + "required": false + }, + { + "type": "Venue", + "description": "Message is a venue, information about the venue", + "html_description": "Optional. Message is a venue, information about the venue", + "rst_description": "*Optional*. Message is a venue, information about the venue\n", + "name": "venue", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/Giveaway/entity.json b/.butcher/types/Giveaway/entity.json new file mode 100644 index 00000000..53178a8c --- /dev/null +++ b/.butcher/types/Giveaway/entity.json @@ -0,0 +1,81 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "giveaway", + "name": "Giveaway", + "description": "This object represents a message about a scheduled giveaway.", + "html_description": "

This object represents a message about a scheduled giveaway.

", + "rst_description": "This object represents a message about a scheduled giveaway.", + "annotations": [ + { + "type": "Array of Chat", + "description": "The list of chats which the user must join to participate in the giveaway", + "html_description": "The list of chats which the user must join to participate in the giveaway", + "rst_description": "The list of chats which the user must join to participate in the giveaway\n", + "name": "chats", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when winners of the giveaway will be selected", + "html_description": "Point in time (Unix timestamp) when winners of the giveaway will be selected", + "rst_description": "Point in time (Unix timestamp) when winners of the giveaway will be selected\n", + "name": "winners_selection_date", + "required": true + }, + { + "type": "Integer", + "description": "The number of users which are supposed to be selected as winners of the giveaway", + "html_description": "The number of users which are supposed to be selected as winners of the giveaway", + "rst_description": "The number of users which are supposed to be selected as winners of the giveaway\n", + "name": "winner_count", + "required": true + }, + { + "type": "True", + "description": "True, if only users who join the chats after the giveaway started should be eligible to win", + "html_description": "Optional. True, if only users who join the chats after the giveaway started should be eligible to win", + "rst_description": "*Optional*. :code:`True`, if only users who join the chats after the giveaway started should be eligible to win\n", + "name": "only_new_members", + "required": false + }, + { + "type": "True", + "description": "True, if the list of giveaway winners will be visible to everyone", + "html_description": "Optional. True, if the list of giveaway winners will be visible to everyone", + "rst_description": "*Optional*. :code:`True`, if the list of giveaway winners will be visible to everyone\n", + "name": "has_public_winners", + "required": false + }, + { + "type": "String", + "description": "Description of additional giveaway prize", + "html_description": "Optional. Description of additional giveaway prize", + "rst_description": "*Optional*. Description of additional giveaway prize\n", + "name": "prize_description", + "required": false + }, + { + "type": "Array of String", + "description": "A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.", + "html_description": "Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.", + "rst_description": "*Optional*. A list of two-letter `ISO 3166-1 alpha-2 `_ country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.\n", + "name": "country_codes", + "required": false + }, + { + "type": "Integer", + "description": "The number of months the Telegram Premium subscription won from the giveaway will be active for", + "html_description": "Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for", + "rst_description": "*Optional*. The number of months the Telegram Premium subscription won from the giveaway will be active for\n", + "name": "premium_subscription_month_count", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/Giveaway/replace.yml b/.butcher/types/Giveaway/replace.yml new file mode 100644 index 00000000..fb29ba77 --- /dev/null +++ b/.butcher/types/Giveaway/replace.yml @@ -0,0 +1,5 @@ +annotations: + winners_selection_date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/GiveawayCompleted/entity.json b/.butcher/types/GiveawayCompleted/entity.json new file mode 100644 index 00000000..169d3446 --- /dev/null +++ b/.butcher/types/GiveawayCompleted/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "giveawaycompleted", + "name": "GiveawayCompleted", + "description": "This object represents a service message about the completion of a giveaway without public winners.", + "html_description": "

This object represents a service message about the completion of a giveaway without public winners.

", + "rst_description": "This object represents a service message about the completion of a giveaway without public winners.", + "annotations": [ + { + "type": "Integer", + "description": "Number of winners in the giveaway", + "html_description": "Number of winners in the giveaway", + "rst_description": "Number of winners in the giveaway\n", + "name": "winner_count", + "required": true + }, + { + "type": "Integer", + "description": "Number of undistributed prizes", + "html_description": "Optional. Number of undistributed prizes", + "rst_description": "*Optional*. Number of undistributed prizes\n", + "name": "unclaimed_prize_count", + "required": false + }, + { + "type": "Message", + "description": "Message with the giveaway that was completed, if it wasn't deleted", + "html_description": "Optional. Message with the giveaway that was completed, if it wasn't deleted", + "rst_description": "*Optional*. Message with the giveaway that was completed, if it wasn't deleted\n", + "name": "giveaway_message", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/GiveawayCreated/entity.json b/.butcher/types/GiveawayCreated/entity.json new file mode 100644 index 00000000..38e68bf3 --- /dev/null +++ b/.butcher/types/GiveawayCreated/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "giveawaycreated", + "name": "GiveawayCreated", + "description": "This object represents a service message about the creation of a scheduled giveaway. Currently holds no information.", + "html_description": "

This object represents a service message about the creation of a scheduled giveaway. Currently holds no information.

", + "rst_description": "This object represents a service message about the creation of a scheduled giveaway. Currently holds no information.", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/GiveawayWinners/entity.json b/.butcher/types/GiveawayWinners/entity.json new file mode 100644 index 00000000..ae4e7514 --- /dev/null +++ b/.butcher/types/GiveawayWinners/entity.json @@ -0,0 +1,105 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "giveawaywinners", + "name": "GiveawayWinners", + "description": "This object represents a message about the completion of a giveaway with public winners.", + "html_description": "

This object represents a message about the completion of a giveaway with public winners.

", + "rst_description": "This object represents a message about the completion of a giveaway with public winners.", + "annotations": [ + { + "type": "Chat", + "description": "The chat that created the giveaway", + "html_description": "The chat that created the giveaway", + "rst_description": "The chat that created the giveaway\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Identifier of the messsage with the giveaway in the chat", + "html_description": "Identifier of the messsage with the giveaway in the chat", + "rst_description": "Identifier of the messsage with the giveaway in the chat\n", + "name": "giveaway_message_id", + "required": true + }, + { + "type": "Integer", + "description": "Point in time (Unix timestamp) when winners of the giveaway were selected", + "html_description": "Point in time (Unix timestamp) when winners of the giveaway were selected", + "rst_description": "Point in time (Unix timestamp) when winners of the giveaway were selected\n", + "name": "winners_selection_date", + "required": true + }, + { + "type": "Integer", + "description": "Total number of winners in the giveaway", + "html_description": "Total number of winners in the giveaway", + "rst_description": "Total number of winners in the giveaway\n", + "name": "winner_count", + "required": true + }, + { + "type": "Array of User", + "description": "List of up to 100 winners of the giveaway", + "html_description": "List of up to 100 winners of the giveaway", + "rst_description": "List of up to 100 winners of the giveaway\n", + "name": "winners", + "required": true + }, + { + "type": "Integer", + "description": "The number of other chats the user had to join in order to be eligible for the giveaway", + "html_description": "Optional. The number of other chats the user had to join in order to be eligible for the giveaway", + "rst_description": "*Optional*. The number of other chats the user had to join in order to be eligible for the giveaway\n", + "name": "additional_chat_count", + "required": false + }, + { + "type": "Integer", + "description": "The number of months the Telegram Premium subscription won from the giveaway will be active for", + "html_description": "Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for", + "rst_description": "*Optional*. The number of months the Telegram Premium subscription won from the giveaway will be active for\n", + "name": "premium_subscription_month_count", + "required": false + }, + { + "type": "Integer", + "description": "Number of undistributed prizes", + "html_description": "Optional. Number of undistributed prizes", + "rst_description": "*Optional*. Number of undistributed prizes\n", + "name": "unclaimed_prize_count", + "required": false + }, + { + "type": "True", + "description": "True, if only users who had joined the chats after the giveaway started were eligible to win", + "html_description": "Optional. True, if only users who had joined the chats after the giveaway started were eligible to win", + "rst_description": "*Optional*. :code:`True`, if only users who had joined the chats after the giveaway started were eligible to win\n", + "name": "only_new_members", + "required": false + }, + { + "type": "True", + "description": "True, if the giveaway was canceled because the payment for it was refunded", + "html_description": "Optional. True, if the giveaway was canceled because the payment for it was refunded", + "rst_description": "*Optional*. :code:`True`, if the giveaway was canceled because the payment for it was refunded\n", + "name": "was_refunded", + "required": false + }, + { + "type": "String", + "description": "Description of additional giveaway prize", + "html_description": "Optional. Description of additional giveaway prize", + "rst_description": "*Optional*. Description of additional giveaway prize\n", + "name": "prize_description", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/GiveawayWinners/replace.yml b/.butcher/types/GiveawayWinners/replace.yml new file mode 100644 index 00000000..fb29ba77 --- /dev/null +++ b/.butcher/types/GiveawayWinners/replace.yml @@ -0,0 +1,5 @@ +annotations: + winners_selection_date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/InaccessibleMessage/entity.json b/.butcher/types/InaccessibleMessage/entity.json new file mode 100644 index 00000000..f78ab11f --- /dev/null +++ b/.butcher/types/InaccessibleMessage/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "inaccessiblemessage", + "name": "InaccessibleMessage", + "description": "This object describes a message that was deleted or is otherwise inaccessible to the bot.", + "html_description": "

This object describes a message that was deleted or is otherwise inaccessible to the bot.

", + "rst_description": "This object describes a message that was deleted or is otherwise inaccessible to the bot.", + "annotations": [ + { + "type": "Chat", + "description": "Chat the message belonged to", + "html_description": "Chat the message belonged to", + "rst_description": "Chat the message belonged to\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Unique message identifier inside the chat", + "html_description": "Unique message identifier inside the chat", + "rst_description": "Unique message identifier inside the chat\n", + "name": "message_id", + "required": true + }, + { + "type": "Integer", + "description": "Always 0. The field can be used to differentiate regular and inaccessible messages.", + "html_description": "Always 0. The field can be used to differentiate regular and inaccessible messages.", + "rst_description": "Always 0. The field can be used to differentiate regular and inaccessible messages.\n", + "name": "date", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/InaccessibleMessage/replace.yml b/.butcher/types/InaccessibleMessage/replace.yml new file mode 100644 index 00000000..4155caee --- /dev/null +++ b/.butcher/types/InaccessibleMessage/replace.yml @@ -0,0 +1,7 @@ +annotations: + date: +# date: +# type: std +# name: DateTime + const: "0" +# final: true diff --git a/.butcher/types/InputTextMessageContent/entity.json b/.butcher/types/InputTextMessageContent/entity.json index bc4b79d2..4e96def9 100644 --- a/.butcher/types/InputTextMessageContent/entity.json +++ b/.butcher/types/InputTextMessageContent/entity.json @@ -35,13 +35,25 @@ "name": "entities", "required": false }, + { + "type": "LinkPreviewOptions", + "description": "Link preview generation options for the message", + "html_description": "Optional. Link preview generation options for the message", + "rst_description": "*Optional*. Link preview generation options for the message\n", + "name": "link_preview_options", + "required": false + }, { "type": "Boolean", "description": "Disables link previews for links in the sent message", "html_description": "Optional. Disables link previews for links in the sent message", "rst_description": "*Optional*. Disables link previews for links in the sent message\n", "name": "disable_web_page_preview", - "required": false + "required": false, + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "types" diff --git a/.butcher/types/KeyboardButton/entity.json b/.butcher/types/KeyboardButton/entity.json index 2a75141c..641df7ca 100644 --- a/.butcher/types/KeyboardButton/entity.json +++ b/.butcher/types/KeyboardButton/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "keyboardbutton", "name": "KeyboardButton", - "description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.\nNote: request_user and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", - "html_description": "

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.
\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.
\nNote: request_user and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", - "rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_user*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.\n\n**Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.\n\n**Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*.\n\n**Note:** *request_user* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", + "description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", + "html_description": "

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
\nNote: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.
\nNote: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message.
\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", + "rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_users*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*.\n\n**Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*.\n\n**Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*.\n\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", "annotations": [ { "type": "String", @@ -20,11 +20,11 @@ "required": true }, { - "type": "KeyboardButtonRequestUser", - "description": "If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only.", - "html_description": "Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only.", - "rst_description": "*Optional.* If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only.\n", - "name": "request_user", + "type": "KeyboardButtonRequestUsers", + "description": "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.", + "html_description": "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.", + "rst_description": "*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.\n", + "name": "request_users", "required": false }, { @@ -66,6 +66,18 @@ "rst_description": "*Optional*. If specified, the described `Web App `_ will be launched when the button is pressed. The Web App will be able to send a 'web_app_data' service message. Available in private chats only.\n", "name": "web_app", "required": false + }, + { + "type": "KeyboardButtonRequestUser", + "description": "If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only.", + "html_description": "Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only.", + "rst_description": "*Optional.* If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only.\n", + "name": "request_user", + "required": false, + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "types" diff --git a/.butcher/types/KeyboardButtonRequestUser/entity.json b/.butcher/types/KeyboardButtonRequestUser/entity.json index 0540e916..b9cd01e6 100644 --- a/.butcher/types/KeyboardButtonRequestUser/entity.json +++ b/.butcher/types/KeyboardButtonRequestUser/entity.json @@ -1,5 +1,10 @@ { - "meta": {}, + "meta": { + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, "group": { "title": "Available types", "anchor": "available-types" diff --git a/.butcher/types/KeyboardButtonRequestUsers/entity.json b/.butcher/types/KeyboardButtonRequestUsers/entity.json new file mode 100644 index 00000000..d49552ed --- /dev/null +++ b/.butcher/types/KeyboardButtonRequestUsers/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "keyboardbuttonrequestusers", + "name": "KeyboardButtonRequestUsers", + "description": "This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed.", + "html_description": "

This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »

", + "rst_description": "This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_", + "annotations": [ + { + "type": "Integer", + "description": "Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message", + "html_description": "Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message", + "rst_description": "Signed 32-bit identifier of the request that will be received back in the :class:`aiogram.types.users_shared.UsersShared` object. Must be unique within the message\n", + "name": "request_id", + "required": true + }, + { + "type": "Boolean", + "description": "Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.", + "html_description": "Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.", + "rst_description": "*Optional*. Pass :code:`True` to request bots, pass :code:`False` to request regular users. If not specified, no additional restrictions are applied.\n", + "name": "user_is_bot", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied.", + "html_description": "Optional. Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied.", + "rst_description": "*Optional*. Pass :code:`True` to request premium users, pass :code:`False` to request non-premium users. If not specified, no additional restrictions are applied.\n", + "name": "user_is_premium", + "required": false + }, + { + "type": "Integer", + "description": "The maximum number of users to be selected; 1-10. Defaults to 1.", + "html_description": "Optional. The maximum number of users to be selected; 1-10. Defaults to 1.", + "rst_description": "*Optional*. The maximum number of users to be selected; 1-10. Defaults to 1.\n", + "name": "max_quantity", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/LinkPreviewOptions/entity.json b/.butcher/types/LinkPreviewOptions/entity.json new file mode 100644 index 00000000..1b13b26a --- /dev/null +++ b/.butcher/types/LinkPreviewOptions/entity.json @@ -0,0 +1,57 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "linkpreviewoptions", + "name": "LinkPreviewOptions", + "description": "Describes the options used for link preview generation.", + "html_description": "

Describes the options used for link preview generation.

", + "rst_description": "Describes the options used for link preview generation.", + "annotations": [ + { + "type": "Boolean", + "description": "True, if the link preview is disabled", + "html_description": "Optional. True, if the link preview is disabled", + "rst_description": "*Optional*. :code:`True`, if the link preview is disabled\n", + "name": "is_disabled", + "required": false + }, + { + "type": "String", + "description": "URL to use for the link preview. If empty, then the first URL found in the message text will be used", + "html_description": "Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used", + "rst_description": "*Optional*. URL to use for the link preview. If empty, then the first URL found in the message text will be used\n", + "name": "url", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview", + "html_description": "Optional. True, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview", + "rst_description": "*Optional*. :code:`True`, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview\n", + "name": "prefer_small_media", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview", + "html_description": "Optional. True, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview", + "rst_description": "*Optional*. :code:`True`, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview\n", + "name": "prefer_large_media", + "required": false + }, + { + "type": "Boolean", + "description": "True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text", + "html_description": "Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text", + "rst_description": "*Optional*. :code:`True`, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text\n", + "name": "show_above_text", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/MaybeInaccessibleMessage/entity.json b/.butcher/types/MaybeInaccessibleMessage/entity.json new file mode 100644 index 00000000..98696110 --- /dev/null +++ b/.butcher/types/MaybeInaccessibleMessage/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "maybeinaccessiblemessage", + "name": "MaybeInaccessibleMessage", + "description": "This object describes a message that can be inaccessible to the bot. It can be one of\n - Message\n - InaccessibleMessage", + "html_description": "

This object describes a message that can be inaccessible to the bot. It can be one of

", + "rst_description": "This object describes a message that can be inaccessible to the bot. It can be one of\n\n - :class:`aiogram.types.message.Message`\n - :class:`aiogram.types.inaccessible_message.InaccessibleMessage`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/MaybeInaccessibleMessage/subtypes.yml b/.butcher/types/MaybeInaccessibleMessage/subtypes.yml new file mode 100644 index 00000000..1f4769f8 --- /dev/null +++ b/.butcher/types/MaybeInaccessibleMessage/subtypes.yml @@ -0,0 +1 @@ +tagged: true diff --git a/.butcher/types/Message/aliases.yml b/.butcher/types/Message/aliases.yml index 341919cc..d0abce81 100644 --- a/.butcher/types/Message/aliases.yml +++ b/.butcher/types/Message/aliases.yml @@ -240,3 +240,8 @@ unpin: method: unpinChatMessage code: *assert-chat fill: *message-target + +react: + method: setMessageReaction + code: *assert-chat + fill: *message-target diff --git a/.butcher/types/Message/entity.json b/.butcher/types/Message/entity.json index 993d37eb..2edf2dac 100644 --- a/.butcher/types/Message/entity.json +++ b/.butcher/types/Message/entity.json @@ -45,66 +45,26 @@ }, { "type": "Integer", - "description": "Date the message was sent in Unix time", - "html_description": "Date the message was sent in Unix time", - "rst_description": "Date the message was sent in Unix time\n", + "description": "Date the message was sent in Unix time. It is always a positive number, representing a valid date.", + "html_description": "Date the message was sent in Unix time. It is always a positive number, representing a valid date.", + "rst_description": "Date the message was sent in Unix time. It is always a positive number, representing a valid date.\n", "name": "date", "required": true }, { "type": "Chat", - "description": "Conversation the message belongs to", - "html_description": "Conversation the message belongs to", - "rst_description": "Conversation the message belongs to\n", + "description": "Chat the message belongs to", + "html_description": "Chat the message belongs to", + "rst_description": "Chat the message belongs to\n", "name": "chat", "required": true }, { - "type": "User", - "description": "For forwarded messages, sender of the original message", - "html_description": "Optional. For forwarded messages, sender of the original message", - "rst_description": "*Optional*. For forwarded messages, sender of the original message\n", - "name": "forward_from", - "required": false - }, - { - "type": "Chat", - "description": "For messages forwarded from channels or from anonymous administrators, information about the original sender chat", - "html_description": "Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat", - "rst_description": "*Optional*. For messages forwarded from channels or from anonymous administrators, information about the original sender chat\n", - "name": "forward_from_chat", - "required": false - }, - { - "type": "Integer", - "description": "For messages forwarded from channels, identifier of the original message in the channel", - "html_description": "Optional. For messages forwarded from channels, identifier of the original message in the channel", - "rst_description": "*Optional*. For messages forwarded from channels, identifier of the original message in the channel\n", - "name": "forward_from_message_id", - "required": false - }, - { - "type": "String", - "description": "For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present", - "html_description": "Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present", - "rst_description": "*Optional*. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present\n", - "name": "forward_signature", - "required": false - }, - { - "type": "String", - "description": "Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages", - "html_description": "Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages", - "rst_description": "*Optional*. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages\n", - "name": "forward_sender_name", - "required": false - }, - { - "type": "Integer", - "description": "For forwarded messages, date the original message was sent in Unix time", - "html_description": "Optional. For forwarded messages, date the original message was sent in Unix time", - "rst_description": "*Optional*. For forwarded messages, date the original message was sent in Unix time\n", - "name": "forward_date", + "type": "MessageOrigin", + "description": "Information about the original message for forwarded messages", + "html_description": "Optional. Information about the original message for forwarded messages", + "rst_description": "*Optional*. Information about the original message for forwarded messages\n", + "name": "forward_origin", "required": false }, { @@ -125,12 +85,28 @@ }, { "type": "Message", - "description": "For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", - "html_description": "Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", - "rst_description": "*Optional*. For replies, the original message. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.\n", + "description": "For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", + "html_description": "Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", + "rst_description": "*Optional*. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.\n", "name": "reply_to_message", "required": false }, + { + "type": "ExternalReplyInfo", + "description": "Information about the message that is being replied to, which may come from another chat or forum topic", + "html_description": "Optional. Information about the message that is being replied to, which may come from another chat or forum topic", + "rst_description": "*Optional*. Information about the message that is being replied to, which may come from another chat or forum topic\n", + "name": "external_reply", + "required": false + }, + { + "type": "TextQuote", + "description": "For replies that quote part of the original message, the quoted part of the message", + "html_description": "Optional. For replies that quote part of the original message, the quoted part of the message", + "rst_description": "*Optional*. For replies that quote part of the original message, the quoted part of the message\n", + "name": "quote", + "required": false + }, { "type": "User", "description": "Bot through which the message was sent", @@ -187,6 +163,14 @@ "name": "entities", "required": false }, + { + "type": "LinkPreviewOptions", + "description": "Options used for link preview generation for the message, if it is a text message and link preview options were changed", + "html_description": "Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed", + "rst_description": "*Optional*. Options used for link preview generation for the message, if it is a text message and link preview options were changed\n", + "name": "link_preview_options", + "required": false + }, { "type": "Animation", "description": "Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set", @@ -420,10 +404,10 @@ "required": false }, { - "type": "Message", - "description": "Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.", - "html_description": "Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.", - "rst_description": "*Optional*. Specified message was pinned. Note that the Message object in this field will not contain further *reply_to_message* fields even if it is itself a reply.\n", + "type": "MaybeInaccessibleMessage", + "description": "Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", + "html_description": "Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.", + "rst_description": "*Optional*. Specified message was pinned. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.\n", "name": "pinned_message", "required": false }, @@ -444,11 +428,11 @@ "required": false }, { - "type": "UserShared", - "description": "Service message: a user was shared with the bot", - "html_description": "Optional. Service message: a user was shared with the bot", - "rst_description": "*Optional*. Service message: a user was shared with the bot\n", - "name": "user_shared", + "type": "UsersShared", + "description": "Service message: users were shared with the bot", + "html_description": "Optional. Service message: users were shared with the bot", + "rst_description": "*Optional*. Service message: users were shared with the bot\n", + "name": "users_shared", "required": false }, { @@ -539,6 +523,38 @@ "name": "general_forum_topic_unhidden", "required": false }, + { + "type": "GiveawayCreated", + "description": "Service message: a scheduled giveaway was created", + "html_description": "Optional. Service message: a scheduled giveaway was created", + "rst_description": "*Optional*. Service message: a scheduled giveaway was created\n", + "name": "giveaway_created", + "required": false + }, + { + "type": "Giveaway", + "description": "The message is a scheduled giveaway message", + "html_description": "Optional. The message is a scheduled giveaway message", + "rst_description": "*Optional*. The message is a scheduled giveaway message\n", + "name": "giveaway", + "required": false + }, + { + "type": "GiveawayWinners", + "description": "A giveaway with public winners was completed", + "html_description": "Optional. A giveaway with public winners was completed", + "rst_description": "*Optional*. A giveaway with public winners was completed\n", + "name": "giveaway_winners", + "required": false + }, + { + "type": "GiveawayCompleted", + "description": "Service message: a giveaway without public winners was completed", + "html_description": "Optional. Service message: a giveaway without public winners was completed", + "rst_description": "*Optional*. Service message: a giveaway without public winners was completed\n", + "name": "giveaway_completed", + "required": false + }, { "type": "VideoChatScheduled", "description": "Service message: video chat scheduled", @@ -586,6 +602,90 @@ "rst_description": "*Optional*. Inline keyboard attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons.\n", "name": "reply_markup", "required": false + }, + { + "type": "Integer", + "description": "For forwarded messages, date the original message was sent in Unix time", + "html_description": "Optional. For forwarded messages, date the original message was sent in Unix time", + "rst_description": "*Optional*. For forwarded messages, date the original message was sent in Unix time\n", + "name": "forward_date", + "required": false, + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "User", + "description": "For forwarded messages, sender of the original message", + "html_description": "Optional. For forwarded messages, sender of the original message", + "rst_description": "*Optional*. For forwarded messages, sender of the original message\n", + "name": "forward_from", + "required": false, + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Chat", + "description": "For messages forwarded from channels or from anonymous administrators, information about the original sender chat", + "html_description": "Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat", + "rst_description": "*Optional*. For messages forwarded from channels or from anonymous administrators, information about the original sender chat\n", + "name": "forward_from_chat", + "required": false, + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "Integer", + "description": "For messages forwarded from channels, identifier of the original message in the channel", + "html_description": "Optional. For messages forwarded from channels, identifier of the original message in the channel", + "rst_description": "*Optional*. For messages forwarded from channels, identifier of the original message in the channel\n", + "name": "forward_from_message_id", + "required": false, + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "String", + "description": "Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages", + "html_description": "Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages", + "rst_description": "*Optional*. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages\n", + "name": "forward_sender_name", + "required": false, + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "String", + "description": "For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present", + "html_description": "Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present", + "rst_description": "*Optional*. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present\n", + "name": "forward_signature", + "required": false, + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, + { + "type": "UserShared", + "description": "Service message: a user was shared with the bot", + "html_description": "Optional. Service message: a user was shared with the bot", + "rst_description": "*Optional*. Service message: a user was shared with the bot\n", + "name": "user_shared", + "required": false, + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } } ], "category": "types" diff --git a/.butcher/types/MessageEntity/entity.json b/.butcher/types/MessageEntity/entity.json index 663f8957..8de41cef 100644 --- a/.butcher/types/MessageEntity/entity.json +++ b/.butcher/types/MessageEntity/entity.json @@ -13,9 +13,9 @@ "annotations": [ { "type": "String", - "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)", - "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)", - "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n", + "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)", + "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)", + "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n", "name": "type", "required": true }, diff --git a/.butcher/types/MessageOrigin/entity.json b/.butcher/types/MessageOrigin/entity.json new file mode 100644 index 00000000..dae2c8bb --- /dev/null +++ b/.butcher/types/MessageOrigin/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "messageorigin", + "name": "MessageOrigin", + "description": "This object describes the origin of a message. It can be one of\n - MessageOriginUser\n - MessageOriginHiddenUser\n - MessageOriginChat\n - MessageOriginChannel", + "html_description": "

This object describes the origin of a message. It can be one of

", + "rst_description": "This object describes the origin of a message. It can be one of\n\n - :class:`aiogram.types.message_origin_user.MessageOriginUser`\n - :class:`aiogram.types.message_origin_hidden_user.MessageOriginHiddenUser`\n - :class:`aiogram.types.message_origin_chat.MessageOriginChat`\n - :class:`aiogram.types.message_origin_channel.MessageOriginChannel`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/MessageOrigin/subtypes.yml b/.butcher/types/MessageOrigin/subtypes.yml new file mode 100644 index 00000000..6756ad51 --- /dev/null +++ b/.butcher/types/MessageOrigin/subtypes.yml @@ -0,0 +1 @@ +discriminator: "type" diff --git a/.butcher/types/MessageOriginChannel/entity.json b/.butcher/types/MessageOriginChannel/entity.json new file mode 100644 index 00000000..84a072c2 --- /dev/null +++ b/.butcher/types/MessageOriginChannel/entity.json @@ -0,0 +1,57 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "messageoriginchannel", + "name": "MessageOriginChannel", + "description": "The message was originally sent to a channel chat.", + "html_description": "

The message was originally sent to a channel chat.

", + "rst_description": "The message was originally sent to a channel chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the message origin, always 'channel'", + "html_description": "Type of the message origin, always “channel”", + "rst_description": "Type of the message origin, always 'channel'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Date the message was sent originally in Unix time", + "html_description": "Date the message was sent originally in Unix time", + "rst_description": "Date the message was sent originally in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Chat", + "description": "Channel chat to which the message was originally sent", + "html_description": "Channel chat to which the message was originally sent", + "rst_description": "Channel chat to which the message was originally sent\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Unique message identifier inside the chat", + "html_description": "Unique message identifier inside the chat", + "rst_description": "Unique message identifier inside the chat\n", + "name": "message_id", + "required": true + }, + { + "type": "String", + "description": "Signature of the original post author", + "html_description": "Optional. Signature of the original post author", + "rst_description": "*Optional*. Signature of the original post author\n", + "name": "author_signature", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/MessageOriginChannel/replace.yml b/.butcher/types/MessageOriginChannel/replace.yml new file mode 100644 index 00000000..80c48d76 --- /dev/null +++ b/.butcher/types/MessageOriginChannel/replace.yml @@ -0,0 +1,5 @@ +annotations: + date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/MessageOriginChat/entity.json b/.butcher/types/MessageOriginChat/entity.json new file mode 100644 index 00000000..d8e58fad --- /dev/null +++ b/.butcher/types/MessageOriginChat/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "messageoriginchat", + "name": "MessageOriginChat", + "description": "The message was originally sent on behalf of a chat to a group chat.", + "html_description": "

The message was originally sent on behalf of a chat to a group chat.

", + "rst_description": "The message was originally sent on behalf of a chat to a group chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the message origin, always 'chat'", + "html_description": "Type of the message origin, always “chat”", + "rst_description": "Type of the message origin, always 'chat'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Date the message was sent originally in Unix time", + "html_description": "Date the message was sent originally in Unix time", + "rst_description": "Date the message was sent originally in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Chat", + "description": "Chat that sent the message originally", + "html_description": "Chat that sent the message originally", + "rst_description": "Chat that sent the message originally\n", + "name": "sender_chat", + "required": true + }, + { + "type": "String", + "description": "For messages originally sent by an anonymous chat administrator, original message author signature", + "html_description": "Optional. For messages originally sent by an anonymous chat administrator, original message author signature", + "rst_description": "*Optional*. For messages originally sent by an anonymous chat administrator, original message author signature\n", + "name": "author_signature", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/MessageOriginChat/replace.yml b/.butcher/types/MessageOriginChat/replace.yml new file mode 100644 index 00000000..80c48d76 --- /dev/null +++ b/.butcher/types/MessageOriginChat/replace.yml @@ -0,0 +1,5 @@ +annotations: + date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/MessageOriginHiddenUser/entity.json b/.butcher/types/MessageOriginHiddenUser/entity.json new file mode 100644 index 00000000..540768a1 --- /dev/null +++ b/.butcher/types/MessageOriginHiddenUser/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "messageoriginhiddenuser", + "name": "MessageOriginHiddenUser", + "description": "The message was originally sent by an unknown user.", + "html_description": "

The message was originally sent by an unknown user.

", + "rst_description": "The message was originally sent by an unknown user.", + "annotations": [ + { + "type": "String", + "description": "Type of the message origin, always 'hidden_user'", + "html_description": "Type of the message origin, always “hidden_user”", + "rst_description": "Type of the message origin, always 'hidden_user'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Date the message was sent originally in Unix time", + "html_description": "Date the message was sent originally in Unix time", + "rst_description": "Date the message was sent originally in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "String", + "description": "Name of the user that sent the message originally", + "html_description": "Name of the user that sent the message originally", + "rst_description": "Name of the user that sent the message originally\n", + "name": "sender_user_name", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/MessageOriginHiddenUser/replace.yml b/.butcher/types/MessageOriginHiddenUser/replace.yml new file mode 100644 index 00000000..80c48d76 --- /dev/null +++ b/.butcher/types/MessageOriginHiddenUser/replace.yml @@ -0,0 +1,5 @@ +annotations: + date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/MessageOriginUser/entity.json b/.butcher/types/MessageOriginUser/entity.json new file mode 100644 index 00000000..426e6b8a --- /dev/null +++ b/.butcher/types/MessageOriginUser/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "messageoriginuser", + "name": "MessageOriginUser", + "description": "The message was originally sent by a known user.", + "html_description": "

The message was originally sent by a known user.

", + "rst_description": "The message was originally sent by a known user.", + "annotations": [ + { + "type": "String", + "description": "Type of the message origin, always 'user'", + "html_description": "Type of the message origin, always “user”", + "rst_description": "Type of the message origin, always 'user'\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Date the message was sent originally in Unix time", + "html_description": "Date the message was sent originally in Unix time", + "rst_description": "Date the message was sent originally in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "User", + "description": "User that sent the message originally", + "html_description": "User that sent the message originally", + "rst_description": "User that sent the message originally\n", + "name": "sender_user", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/MessageOriginUser/replace.yml b/.butcher/types/MessageOriginUser/replace.yml new file mode 100644 index 00000000..80c48d76 --- /dev/null +++ b/.butcher/types/MessageOriginUser/replace.yml @@ -0,0 +1,5 @@ +annotations: + date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/MessageReactionCountUpdated/entity.json b/.butcher/types/MessageReactionCountUpdated/entity.json new file mode 100644 index 00000000..1a794ecb --- /dev/null +++ b/.butcher/types/MessageReactionCountUpdated/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "messagereactioncountupdated", + "name": "MessageReactionCountUpdated", + "description": "This object represents reaction changes on a message with anonymous reactions.", + "html_description": "

This object represents reaction changes on a message with anonymous reactions.

", + "rst_description": "This object represents reaction changes on a message with anonymous reactions.", + "annotations": [ + { + "type": "Chat", + "description": "The chat containing the message", + "html_description": "The chat containing the message", + "rst_description": "The chat containing the message\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Unique message identifier inside the chat", + "html_description": "Unique message identifier inside the chat", + "rst_description": "Unique message identifier inside the chat\n", + "name": "message_id", + "required": true + }, + { + "type": "Integer", + "description": "Date of the change in Unix time", + "html_description": "Date of the change in Unix time", + "rst_description": "Date of the change in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Array of ReactionCount", + "description": "List of reactions that are present on the message", + "html_description": "List of reactions that are present on the message", + "rst_description": "List of reactions that are present on the message\n", + "name": "reactions", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/MessageReactionCountUpdated/replace.yml b/.butcher/types/MessageReactionCountUpdated/replace.yml new file mode 100644 index 00000000..80c48d76 --- /dev/null +++ b/.butcher/types/MessageReactionCountUpdated/replace.yml @@ -0,0 +1,5 @@ +annotations: + date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/MessageReactionUpdated/entity.json b/.butcher/types/MessageReactionUpdated/entity.json new file mode 100644 index 00000000..70cf9b5b --- /dev/null +++ b/.butcher/types/MessageReactionUpdated/entity.json @@ -0,0 +1,73 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "messagereactionupdated", + "name": "MessageReactionUpdated", + "description": "This object represents a change of a reaction on a message performed by a user.", + "html_description": "

This object represents a change of a reaction on a message performed by a user.

", + "rst_description": "This object represents a change of a reaction on a message performed by a user.", + "annotations": [ + { + "type": "Chat", + "description": "The chat containing the message the user reacted to", + "html_description": "The chat containing the message the user reacted to", + "rst_description": "The chat containing the message the user reacted to\n", + "name": "chat", + "required": true + }, + { + "type": "Integer", + "description": "Unique identifier of the message inside the chat", + "html_description": "Unique identifier of the message inside the chat", + "rst_description": "Unique identifier of the message inside the chat\n", + "name": "message_id", + "required": true + }, + { + "type": "User", + "description": "The user that changed the reaction, if the user isn't anonymous", + "html_description": "Optional. The user that changed the reaction, if the user isn't anonymous", + "rst_description": "*Optional*. The user that changed the reaction, if the user isn't anonymous\n", + "name": "user", + "required": false + }, + { + "type": "Chat", + "description": "The chat on behalf of which the reaction was changed, if the user is anonymous", + "html_description": "Optional. The chat on behalf of which the reaction was changed, if the user is anonymous", + "rst_description": "*Optional*. The chat on behalf of which the reaction was changed, if the user is anonymous\n", + "name": "actor_chat", + "required": false + }, + { + "type": "Integer", + "description": "Date of the change in Unix time", + "html_description": "Date of the change in Unix time", + "rst_description": "Date of the change in Unix time\n", + "name": "date", + "required": true + }, + { + "type": "Array of ReactionType", + "description": "Previous list of reaction types that were set by the user", + "html_description": "Previous list of reaction types that were set by the user", + "rst_description": "Previous list of reaction types that were set by the user\n", + "name": "old_reaction", + "required": true + }, + { + "type": "Array of ReactionType", + "description": "New list of reaction types that have been set by the user", + "html_description": "New list of reaction types that have been set by the user", + "rst_description": "New list of reaction types that have been set by the user\n", + "name": "new_reaction", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/MessageReactionUpdated/replace.yml b/.butcher/types/MessageReactionUpdated/replace.yml new file mode 100644 index 00000000..80c48d76 --- /dev/null +++ b/.butcher/types/MessageReactionUpdated/replace.yml @@ -0,0 +1,5 @@ +annotations: + date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/PassportFile/replace.yml b/.butcher/types/PassportFile/replace.yml new file mode 100644 index 00000000..7a6af790 --- /dev/null +++ b/.butcher/types/PassportFile/replace.yml @@ -0,0 +1,5 @@ +annotations: + file_date: + parsed_type: + type: std + name: DateTime diff --git a/.butcher/types/ReactionCount/entity.json b/.butcher/types/ReactionCount/entity.json new file mode 100644 index 00000000..fc57034b --- /dev/null +++ b/.butcher/types/ReactionCount/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "reactioncount", + "name": "ReactionCount", + "description": "Represents a reaction added to a message along with the number of times it was added.", + "html_description": "

Represents a reaction added to a message along with the number of times it was added.

", + "rst_description": "Represents a reaction added to a message along with the number of times it was added.", + "annotations": [ + { + "type": "ReactionType", + "description": "Type of the reaction", + "html_description": "Type of the reaction", + "rst_description": "Type of the reaction\n", + "name": "type", + "required": true + }, + { + "type": "Integer", + "description": "Number of times the reaction was added", + "html_description": "Number of times the reaction was added", + "rst_description": "Number of times the reaction was added\n", + "name": "total_count", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ReactionType/entity.json b/.butcher/types/ReactionType/entity.json new file mode 100644 index 00000000..e37dcce3 --- /dev/null +++ b/.butcher/types/ReactionType/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "reactiontype", + "name": "ReactionType", + "description": "This object describes the type of a reaction. Currently, it can be one of\n - ReactionTypeEmoji\n - ReactionTypeCustomEmoji", + "html_description": "

This object describes the type of a reaction. Currently, it can be one of

", + "rst_description": "This object describes the type of a reaction. Currently, it can be one of\n\n - :class:`aiogram.types.reaction_type_emoji.ReactionTypeEmoji`\n - :class:`aiogram.types.reaction_type_custom_emoji.ReactionTypeCustomEmoji`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/ReactionType/subtypes.yml b/.butcher/types/ReactionType/subtypes.yml new file mode 100644 index 00000000..6756ad51 --- /dev/null +++ b/.butcher/types/ReactionType/subtypes.yml @@ -0,0 +1 @@ +discriminator: "type" diff --git a/.butcher/types/ReactionTypeCustomEmoji/entity.json b/.butcher/types/ReactionTypeCustomEmoji/entity.json new file mode 100644 index 00000000..a146fa52 --- /dev/null +++ b/.butcher/types/ReactionTypeCustomEmoji/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "reactiontypecustomemoji", + "name": "ReactionTypeCustomEmoji", + "description": "The reaction is based on a custom emoji.", + "html_description": "

The reaction is based on a custom emoji.

", + "rst_description": "The reaction is based on a custom emoji.", + "annotations": [ + { + "type": "String", + "description": "Type of the reaction, always 'custom_emoji'", + "html_description": "Type of the reaction, always “custom_emoji”", + "rst_description": "Type of the reaction, always 'custom_emoji'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Custom emoji identifier", + "html_description": "Custom emoji identifier", + "rst_description": "Custom emoji identifier\n", + "name": "custom_emoji_id", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ReactionTypeEmoji/entity.json b/.butcher/types/ReactionTypeEmoji/entity.json new file mode 100644 index 00000000..d371dcd7 --- /dev/null +++ b/.butcher/types/ReactionTypeEmoji/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "reactiontypeemoji", + "name": "ReactionTypeEmoji", + "description": "The reaction is based on an emoji.", + "html_description": "

The reaction is based on an emoji.

", + "rst_description": "The reaction is based on an emoji.", + "annotations": [ + { + "type": "String", + "description": "Type of the reaction, always 'emoji'", + "html_description": "Type of the reaction, always “emoji”", + "rst_description": "Type of the reaction, always 'emoji'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Reaction emoji. Currently, it can be one of \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"", + "html_description": "Reaction emoji. Currently, it can be one of \"\"👍\"/\", \"\"👎\"/\", \"\"❤\"/\", \"\"🔥\"/\", \"\"🥰\"/\", \"\"👏\"/\", \"\"😁\"/\", \"\"🤔\"/\", \"\"🤯\"/\", \"\"😱\"/\", \"\"🤬\"/\", \"\"😢\"/\", \"\"🎉\"/\", \"\"🤩\"/\", \"\"🤮\"/\", \"\"💩\"/\", \"\"🙏\"/\", \"\"👌\"/\", \"\"🕊\"/\", \"\"🤡\"/\", \"\"🥱\"/\", \"\"🥴\"/\", \"\"😍\"/\", \"\"🐳\"/\", \"\"❤‍🔥\"/\", \"\"🌚\"/\", \"\"🌭\"/\", \"\"💯\"/\", \"\"🤣\"/\", \"\"⚡\"/\", \"\"🍌\"/\", \"\"🏆\"/\", \"\"💔\"/\", \"\"🤨\"/\", \"\"😐\"/\", \"\"🍓\"/\", \"\"🍾\"/\", \"\"💋\"/\", \"\"🖕\"/\", \"\"😈\"/\", \"\"😴\"/\", \"\"😭\"/\", \"\"🤓\"/\", \"\"👻\"/\", \"\"👨‍💻\"/\", \"\"👀\"/\", \"\"🎃\"/\", \"\"🙈\"/\", \"\"😇\"/\", \"\"😨\"/\", \"\"🤝\"/\", \"\"✍\"/\", \"\"🤗\"/\", \"\"🫡\"/\", \"\"🎅\"/\", \"\"🎄\"/\", \"\"☃\"/\", \"\"💅\"/\", \"\"🤪\"/\", \"\"🗿\"/\", \"\"🆒\"/\", \"\"💘\"/\", \"\"🙉\"/\", \"\"🦄\"/\", \"\"😘\"/\", \"\"💊\"/\", \"\"🙊\"/\", \"\"😎\"/\", \"\"👾\"/\", \"\"🤷‍♂\"/\", \"\"🤷\"/\", \"\"🤷‍♀\"/\", \"\"😡\"/\"", + "rst_description": "Reaction emoji. Currently, it can be one of \"👍\", \"👎\", \"❤\", \"🔥\", \"🥰\", \"👏\", \"😁\", \"🤔\", \"🤯\", \"😱\", \"🤬\", \"😢\", \"🎉\", \"🤩\", \"🤮\", \"💩\", \"🙏\", \"👌\", \"🕊\", \"🤡\", \"🥱\", \"🥴\", \"😍\", \"🐳\", \"❤‍🔥\", \"🌚\", \"🌭\", \"💯\", \"🤣\", \"⚡\", \"🍌\", \"🏆\", \"💔\", \"🤨\", \"😐\", \"🍓\", \"🍾\", \"💋\", \"🖕\", \"😈\", \"😴\", \"😭\", \"🤓\", \"👻\", \"👨‍💻\", \"👀\", \"🎃\", \"🙈\", \"😇\", \"😨\", \"🤝\", \"✍\", \"🤗\", \"🫡\", \"🎅\", \"🎄\", \"☃\", \"💅\", \"🤪\", \"🗿\", \"🆒\", \"💘\", \"🙉\", \"🦄\", \"😘\", \"💊\", \"🙊\", \"😎\", \"👾\", \"🤷‍♂\", \"🤷\", \"🤷‍♀\", \"😡\"\n", + "name": "emoji", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ReplyParameters/entity.json b/.butcher/types/ReplyParameters/entity.json new file mode 100644 index 00000000..1e7e2778 --- /dev/null +++ b/.butcher/types/ReplyParameters/entity.json @@ -0,0 +1,73 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "replyparameters", + "name": "ReplyParameters", + "description": "Describes reply parameters for the message that is being sent.", + "html_description": "

Describes reply parameters for the message that is being sent.

", + "rst_description": "Describes reply parameters for the message that is being sent.", + "annotations": [ + { + "type": "Integer", + "description": "Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified", + "html_description": "Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified", + "rst_description": "Identifier of the message that will be replied to in the current chat, or in the chat *chat_id* if it is specified\n", + "name": "message_id", + "required": true + }, + { + "type": "Integer or String", + "description": "If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)", + "html_description": "Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)", + "rst_description": "*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)\n", + "name": "chat_id", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.", + "html_description": "Optional. Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.", + "rst_description": "*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.\n", + "name": "allow_sending_without_reply", + "required": false + }, + { + "type": "String", + "description": "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.", + "html_description": "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.", + "rst_description": "*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.\n", + "name": "quote", + "required": false + }, + { + "type": "String", + "description": "Mode for parsing entities in the quote. See formatting options for more details.", + "html_description": "Optional. Mode for parsing entities in the quote. See formatting options for more details.", + "rst_description": "*Optional*. Mode for parsing entities in the quote. See `formatting options `_ for more details.\n", + "name": "quote_parse_mode", + "required": false + }, + { + "type": "Array of MessageEntity", + "description": "A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.", + "html_description": "Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.", + "rst_description": "*Optional*. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of *quote_parse_mode*.\n", + "name": "quote_entities", + "required": false + }, + { + "type": "Integer", + "description": "Position of the quote in the original message in UTF-16 code units", + "html_description": "Optional. Position of the quote in the original message in UTF-16 code units", + "rst_description": "*Optional*. Position of the quote in the original message in UTF-16 code units\n", + "name": "quote_position", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ReplyParameters/replace.yml b/.butcher/types/ReplyParameters/replace.yml new file mode 100644 index 00000000..2426b4b0 --- /dev/null +++ b/.butcher/types/ReplyParameters/replace.yml @@ -0,0 +1,3 @@ +annotations: + quote_parse_mode: + value: UNSET_PARSE_MODE diff --git a/.butcher/types/ShippingAddress/entity.json b/.butcher/types/ShippingAddress/entity.json index 771d2fe1..6f5263da 100644 --- a/.butcher/types/ShippingAddress/entity.json +++ b/.butcher/types/ShippingAddress/entity.json @@ -14,8 +14,8 @@ { "type": "String", "description": "Two-letter ISO 3166-1 alpha-2 country code", - "html_description": "Two-letter ISO 3166-1 alpha-2 country code", - "rst_description": "Two-letter ISO 3166-1 alpha-2 country code\n", + "html_description": "Two-letter ISO 3166-1 alpha-2 country code", + "rst_description": "Two-letter `ISO 3166-1 alpha-2 `_ country code\n", "name": "country_code", "required": true }, diff --git a/.butcher/types/TextQuote/entity.json b/.butcher/types/TextQuote/entity.json new file mode 100644 index 00000000..f1be593c --- /dev/null +++ b/.butcher/types/TextQuote/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "textquote", + "name": "TextQuote", + "description": "This object contains information about the quoted part of a message that is replied to by the given message.", + "html_description": "

This object contains information about the quoted part of a message that is replied to by the given message.

", + "rst_description": "This object contains information about the quoted part of a message that is replied to by the given message.", + "annotations": [ + { + "type": "String", + "description": "Text of the quoted part of a message that is replied to by the given message", + "html_description": "Text of the quoted part of a message that is replied to by the given message", + "rst_description": "Text of the quoted part of a message that is replied to by the given message\n", + "name": "text", + "required": true + }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.", + "html_description": "Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.", + "rst_description": "*Optional*. Special entities that appear in the quote. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities are kept in quotes.\n", + "name": "entities", + "required": false + }, + { + "type": "Integer", + "description": "Approximate quote position in the original message in UTF-16 code units as specified by the sender", + "html_description": "Approximate quote position in the original message in UTF-16 code units as specified by the sender", + "rst_description": "Approximate quote position in the original message in UTF-16 code units as specified by the sender\n", + "name": "position", + "required": true + }, + { + "type": "True", + "description": "True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.", + "html_description": "Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.", + "rst_description": "*Optional*. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.\n", + "name": "is_manual", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/Update/entity.json b/.butcher/types/Update/entity.json index 9ccf33e5..71468cbe 100644 --- a/.butcher/types/Update/entity.json +++ b/.butcher/types/Update/entity.json @@ -51,6 +51,22 @@ "name": "edited_channel_post", "required": false }, + { + "type": "MessageReactionUpdated", + "description": "A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify \"message_reaction\" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.", + "html_description": "Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify \"message_reaction\" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.", + "rst_description": "*Optional*. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify :code:`\"message_reaction\"` in the list of *allowed_updates* to receive these updates. The update isn't received for reactions set by bots.\n", + "name": "message_reaction", + "required": false + }, + { + "type": "MessageReactionCountUpdated", + "description": "Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify \"message_reaction_count\" in the list of allowed_updates to receive these updates.", + "html_description": "Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify \"message_reaction_count\" in the list of allowed_updates to receive these updates.", + "rst_description": "*Optional*. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify :code:`\"message_reaction_count\"` in the list of *allowed_updates* to receive these updates.\n", + "name": "message_reaction_count", + "required": false + }, { "type": "InlineQuery", "description": "New incoming inline query", @@ -130,6 +146,22 @@ "rst_description": "*Optional*. A request to join the chat has been sent. The bot must have the *can_invite_users* administrator right in the chat to receive these updates.\n", "name": "chat_join_request", "required": false + }, + { + "type": "ChatBoostUpdated", + "description": "A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.", + "html_description": "Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.", + "rst_description": "*Optional*. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.\n", + "name": "chat_boost", + "required": false + }, + { + "type": "ChatBoostRemoved", + "description": "A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.", + "html_description": "Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.", + "rst_description": "*Optional*. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.\n", + "name": "removed_chat_boost", + "required": false } ], "category": "types" diff --git a/.butcher/types/UserChatBoosts/entity.json b/.butcher/types/UserChatBoosts/entity.json new file mode 100644 index 00000000..7c4a7fce --- /dev/null +++ b/.butcher/types/UserChatBoosts/entity.json @@ -0,0 +1,25 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "userchatboosts", + "name": "UserChatBoosts", + "description": "This object represents a list of boosts added to a chat by a user.", + "html_description": "

This object represents a list of boosts added to a chat by a user.

", + "rst_description": "This object represents a list of boosts added to a chat by a user.", + "annotations": [ + { + "type": "Array of ChatBoost", + "description": "The list of boosts added to the chat by the user", + "html_description": "The list of boosts added to the chat by the user", + "rst_description": "The list of boosts added to the chat by the user\n", + "name": "boosts", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/UserShared/entity.json b/.butcher/types/UserShared/entity.json index 1e7f0044..76360ca2 100644 --- a/.butcher/types/UserShared/entity.json +++ b/.butcher/types/UserShared/entity.json @@ -1,5 +1,10 @@ { - "meta": {}, + "meta": { + "deprecated": { + "version": "7.0", + "release_date": "2023-12-29" + } + }, "group": { "title": "Available types", "anchor": "available-types" diff --git a/.butcher/types/UsersShared/entity.json b/.butcher/types/UsersShared/entity.json new file mode 100644 index 00000000..a46f7ddf --- /dev/null +++ b/.butcher/types/UsersShared/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "usersshared", + "name": "UsersShared", + "description": "This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.", + "html_description": "

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

", + "rst_description": "This object contains information about the users whose identifiers were shared with the bot using a :class:`aiogram.types.keyboard_button_request_users.KeyboardButtonRequestUsers` button.", + "annotations": [ + { + "type": "Integer", + "description": "Identifier of the request", + "html_description": "Identifier of the request", + "rst_description": "Identifier of the request\n", + "name": "request_id", + "required": true + }, + { + "type": "Array of Integer", + "description": "Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.", + "html_description": "Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.", + "rst_description": "Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.\n", + "name": "user_ids", + "required": true + } + ], + "category": "types" + } +} diff --git a/CHANGES/1387.feature.rst b/CHANGES/1387.feature.rst new file mode 100644 index 00000000..5f9c5d9b --- /dev/null +++ b/CHANGES/1387.feature.rst @@ -0,0 +1,11 @@ +Added full support of `Bot API 7.0 `_ + +- Reactions +- Replies 2.0 +- Link Preview Customization +- Block Quotation +- Multiple Message Actions +- Requests for multiple users +- Chat Boosts +- Giveaway +- Other changes diff --git a/Makefile b/Makefile index 68f44fe7..128ff5fe 100644 --- a/Makefile +++ b/Makefile @@ -119,16 +119,3 @@ release: git add . git commit -m "Release $(shell poetry version -s)" git tag v$(shell hatch version -s) - - -butcher_version := 0.1.23 - -butcher-install: - pip install -U git+ssh://git@github.com/aiogram/butcher.git@v$(butcher_version) -.PHONY: butcher-install - -butcher: - butcher parse - butcher refresh - butcher apply all -.PHONY: butcher diff --git a/README.rst b/README.rst index 1a2f360a..2c950e66 100644 --- a/README.rst +++ b/README.rst @@ -52,7 +52,7 @@ Features - Asynchronous (`asyncio docs `_, :pep:`492`) - Has type hints (:pep:`484`) and can be used with `mypy `_ - Supports `PyPy `_ -- Supports `Telegram Bot API 6.9 `_ and gets fast updates to the latest versions of the Bot API +- Supports `Telegram Bot API 7.0 `_ and gets fast updates to the latest versions of the Bot API - Telegram Bot API integration code was `autogenerated `_ and can be easily re-generated when API gets updated - Updates router (Blueprints) - Has Finite State Machine diff --git a/aiogram/__meta__.py b/aiogram/__meta__.py index d20e16db..9a429772 100644 --- a/aiogram/__meta__.py +++ b/aiogram/__meta__.py @@ -1,2 +1,2 @@ -__version__ = "3.2.0" -__api_version__ = "6.9" +__version__ = "3.3.0" +__api_version__ = "7.0" diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index bd2329cc..139496fe 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -18,7 +18,6 @@ from typing import ( import aiofiles -from aiogram.utils.mixins import ContextInstanceMixin from aiogram.utils.token import extract_bot_id, validate_token from ..methods import ( @@ -35,6 +34,7 @@ from ..methods import ( CloseForumTopic, CloseGeneralForumTopic, CopyMessage, + CopyMessages, CreateChatInviteLink, CreateForumTopic, CreateInvoiceLink, @@ -44,6 +44,7 @@ from ..methods import ( DeleteChatStickerSet, DeleteForumTopic, DeleteMessage, + DeleteMessages, DeleteMyCommands, DeleteStickerFromSet, DeleteStickerSet, @@ -58,6 +59,7 @@ from ..methods import ( EditMessageText, ExportChatInviteLink, ForwardMessage, + ForwardMessages, GetChat, GetChatAdministrators, GetChatMember, @@ -75,6 +77,7 @@ from ..methods import ( GetMyShortDescription, GetStickerSet, GetUpdates, + GetUserChatBoosts, GetUserProfilePhotos, GetWebhookInfo, HideGeneralForumTopic, @@ -113,6 +116,7 @@ from ..methods import ( SetChatTitle, SetCustomEmojiStickerSetThumbnail, SetGameScore, + SetMessageReaction, SetMyCommands, SetMyDefaultAdministratorRights, SetMyDescription, @@ -196,6 +200,7 @@ from ..types import ( InputMediaVideo, InputSticker, LabeledPrice, + LinkPreviewOptions, MaskPosition, MenuButtonCommands, MenuButtonDefault, @@ -213,14 +218,18 @@ from ..types import ( PassportElementErrorTranslationFiles, PassportElementErrorUnspecified, Poll, + ReactionTypeCustomEmoji, + ReactionTypeEmoji, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, SentWebAppMessage, ShippingOption, Sticker, StickerSet, Update, User, + UserChatBoosts, UserProfilePhotos, WebhookInfo, ) @@ -800,15 +809,16 @@ class Bot: caption_entities: Optional[List[MessageEntity]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> MessageId: """ - Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success. + Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success. Source: https://core.telegram.org/bots/api#copymessage @@ -821,9 +831,10 @@ class Bot: :param caption_entities: A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode* :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success. """ @@ -838,9 +849,10 @@ class Bot: caption_entities=caption_entities, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -1441,8 +1453,9 @@ class Bot: inline_message_id: Optional[str] = None, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, request_timeout: Optional[int] = None, ) -> Union[Message, bool]: """ @@ -1456,8 +1469,9 @@ class Bot: :param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* - :param disable_web_page_preview: Disables link previews for links in this message + :param link_preview_options: Link preview generation options for the message :param reply_markup: A JSON-serialized object for an `inline keyboard `_. + :param disable_web_page_preview: Disables link previews for links in this message :param request_timeout: Request timeout :return: On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. """ @@ -1469,8 +1483,9 @@ class Bot: inline_message_id=inline_message_id, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, reply_markup=reply_markup, + disable_web_page_preview=disable_web_page_preview, ) return await self(call, request_timeout=request_timeout) @@ -1507,7 +1522,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned. + Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#forwardmessage @@ -1537,7 +1552,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> Chat: """ - Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a :class:`aiogram.types.chat.Chat` object on success. + Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success. Source: https://core.telegram.org/bots/api#getchat @@ -1849,7 +1864,7 @@ class Bot: :param offset: Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as :class:`aiogram.methods.get_updates.GetUpdates` is called with an *offset* higher than its *update_id*. The negative offset can be specified to retrieve updates starting from *-offset* update from the end of the updates queue. All previous updates will be forgotten. :param limit: Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. :param timeout: Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. - :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used. + :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used. :param request_timeout: Request timeout :return: Returns an Array of :class:`aiogram.types.update.Update` objects. """ @@ -2127,11 +2142,12 @@ class Bot: has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2152,9 +2168,10 @@ class Bot: :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. """ @@ -2173,9 +2190,10 @@ class Bot: has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2193,11 +2211,12 @@ class Bot: thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2218,9 +2237,10 @@ class Bot: :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. """ @@ -2238,9 +2258,10 @@ class Bot: thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2284,11 +2305,12 @@ class Bot: vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2304,9 +2326,10 @@ class Bot: :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2320,9 +2343,10 @@ class Bot: vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2333,11 +2357,12 @@ class Bot: emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2350,9 +2375,10 @@ class Bot: :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2363,9 +2389,10 @@ class Bot: emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2381,11 +2408,12 @@ class Bot: disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2403,9 +2431,10 @@ class Bot: :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. """ @@ -2421,9 +2450,10 @@ class Bot: disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2434,9 +2464,10 @@ class Bot: message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2449,9 +2480,10 @@ class Bot: :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2462,9 +2494,10 @@ class Bot: message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2495,9 +2528,10 @@ class Bot: is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2530,9 +2564,10 @@ class Bot: :param is_flexible: Pass :code:`True` if the final price depends on the shipping method :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2563,9 +2598,10 @@ class Bot: is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2581,11 +2617,12 @@ class Bot: proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2603,9 +2640,10 @@ class Bot: :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2621,9 +2659,10 @@ class Bot: proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2634,8 +2673,9 @@ class Bot: message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, + reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> List[Message]: """ @@ -2648,8 +2688,9 @@ class Bot: :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving - :param reply_to_message_id: If the messages are a reply, ID of the original message + :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the messages are a reply, ID of the original message :param request_timeout: Request timeout :return: On success, an array of `Messages `_ that were sent is returned. """ @@ -2660,8 +2701,9 @@ class Bot: message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, + reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2672,14 +2714,16 @@ class Bot: message_thread_id: Optional[int] = None, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2692,12 +2736,14 @@ class Bot: :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* - :param disable_web_page_preview: Disables link previews for links in this message + :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param disable_web_page_preview: Disables link previews for links in this message + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2708,12 +2754,14 @@ class Bot: message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + disable_web_page_preview=disable_web_page_preview, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2728,11 +2776,12 @@ class Bot: has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2749,9 +2798,10 @@ class Bot: :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2766,9 +2816,10 @@ class Bot: has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2790,11 +2841,12 @@ class Bot: is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2818,9 +2870,10 @@ class Bot: :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2842,9 +2895,10 @@ class Bot: is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2856,11 +2910,12 @@ class Bot: emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2874,9 +2929,10 @@ class Bot: :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2888,9 +2944,10 @@ class Bot: emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2908,11 +2965,12 @@ class Bot: google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -2932,9 +2990,10 @@ class Bot: :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -2952,9 +3011,10 @@ class Bot: google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -2974,11 +3034,12 @@ class Bot: supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -3000,9 +3061,10 @@ class Bot: :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. """ @@ -3022,9 +3084,10 @@ class Bot: supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -3038,11 +3101,12 @@ class Bot: thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -3058,9 +3122,10 @@ class Bot: :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: On success, the sent :class:`aiogram.types.message.Message` is returned. """ @@ -3074,9 +3139,10 @@ class Bot: thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -3091,11 +3157,12 @@ class Bot: duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, request_timeout: Optional[int] = None, ) -> Message: """ @@ -3112,9 +3179,10 @@ class Bot: :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :param request_timeout: Request timeout :return: Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. """ @@ -3129,9 +3197,10 @@ class Bot: duration=duration, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, ) return await self(call, request_timeout=request_timeout) @@ -3490,7 +3559,7 @@ class Bot: :param certificate: Upload your public key certificate so that the root certificate in use can be checked. See our `self-signed guide `_ for details. :param ip_address: The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS :param max_connections: The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. - :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used. + :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used. :param drop_pending_updates: Pass :code:`True` to drop all pending updates :param secret_token: A secret token to be sent in a header 'X-Telegram-Bot-Api-Secret-Token' in every webhook request, 1-256 characters. Only characters :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed. The header is useful to ensure that the request comes from a webhook set by you. :param request_timeout: Request timeout @@ -4116,3 +4185,151 @@ class Bot: chat_id=chat_id, ) return await self(call, request_timeout=request_timeout) + + async def copy_messages( + self, + chat_id: Union[int, str], + from_chat_id: Union[int, str], + message_ids: List[int], + message_thread_id: Optional[int] = None, + disable_notification: Optional[bool] = None, + protect_content: Optional[bool] = None, + remove_caption: Optional[bool] = None, + request_timeout: Optional[int] = None, + ) -> List[MessageId]: + """ + Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_messages.ForwardMessages`, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned. + + Source: https://core.telegram.org/bots/api#copymessages + + :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) + :param from_chat_id: Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`) + :param message_ids: Identifiers of 1-100 messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order. + :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param disable_notification: Sends the messages `silently `_. Users will receive a notification with no sound. + :param protect_content: Protects the contents of the sent messages from forwarding and saving + :param remove_caption: Pass :code:`True` to copy the messages without their captions + :param request_timeout: Request timeout + :return: On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned. + """ + + call = CopyMessages( + chat_id=chat_id, + from_chat_id=from_chat_id, + message_ids=message_ids, + message_thread_id=message_thread_id, + disable_notification=disable_notification, + protect_content=protect_content, + remove_caption=remove_caption, + ) + return await self(call, request_timeout=request_timeout) + + async def delete_messages( + self, + chat_id: Union[int, str], + message_ids: List[int], + request_timeout: Optional[int] = None, + ) -> bool: + """ + Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#deletemessages + + :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) + :param message_ids: Identifiers of 1-100 messages to delete. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = DeleteMessages( + chat_id=chat_id, + message_ids=message_ids, + ) + return await self(call, request_timeout=request_timeout) + + async def forward_messages( + self, + chat_id: Union[int, str], + from_chat_id: Union[int, str], + message_ids: List[int], + message_thread_id: Optional[int] = None, + disable_notification: Optional[bool] = None, + protect_content: Optional[bool] = None, + request_timeout: Optional[int] = None, + ) -> List[MessageId]: + """ + Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned. + + Source: https://core.telegram.org/bots/api#forwardmessages + + :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) + :param from_chat_id: Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`) + :param message_ids: Identifiers of 1-100 messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order. + :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param disable_notification: Sends the messages `silently `_. Users will receive a notification with no sound. + :param protect_content: Protects the contents of the forwarded messages from forwarding and saving + :param request_timeout: Request timeout + :return: On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned. + """ + + call = ForwardMessages( + chat_id=chat_id, + from_chat_id=from_chat_id, + message_ids=message_ids, + message_thread_id=message_thread_id, + disable_notification=disable_notification, + protect_content=protect_content, + ) + return await self(call, request_timeout=request_timeout) + + async def get_user_chat_boosts( + self, + chat_id: Union[int, str], + user_id: int, + request_timeout: Optional[int] = None, + ) -> UserChatBoosts: + """ + Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a :class:`aiogram.types.user_chat_boosts.UserChatBoosts` object. + + Source: https://core.telegram.org/bots/api#getuserchatboosts + + :param chat_id: Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) + :param user_id: Unique identifier of the target user + :param request_timeout: Request timeout + :return: Returns a :class:`aiogram.types.user_chat_boosts.UserChatBoosts` object. + """ + + call = GetUserChatBoosts( + chat_id=chat_id, + user_id=user_id, + ) + return await self(call, request_timeout=request_timeout) + + async def set_message_reaction( + self, + chat_id: Union[int, str], + message_id: int, + reaction: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None, + is_big: Optional[bool] = None, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setmessagereaction + + :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) + :param message_id: Identifier of the target message + :param reaction: New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. + :param is_big: Pass :code:`True` to set the reaction with a big animation + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = SetMessageReaction( + chat_id=chat_id, + message_id=message_id, + reaction=reaction, + is_big=is_big, + ) + return await self(call, request_timeout=request_timeout) diff --git a/aiogram/dispatcher/middlewares/user_context.py b/aiogram/dispatcher/middlewares/user_context.py index 12bb4864..84af8eb6 100644 --- a/aiogram/dispatcher/middlewares/user_context.py +++ b/aiogram/dispatcher/middlewares/user_context.py @@ -1,7 +1,7 @@ from typing import Any, Awaitable, Callable, Dict, Optional, Tuple from aiogram.dispatcher.middlewares.base import BaseMiddleware -from aiogram.types import Chat, TelegramObject, Update, User +from aiogram.types import Chat, InaccessibleMessage, TelegramObject, Update, User EVENT_FROM_USER_KEY = "event_from_user" EVENT_CHAT_KEY = "event_chat" @@ -61,7 +61,8 @@ class UserContextMiddleware(BaseMiddleware): event.callback_query.message.chat, event.callback_query.from_user, event.callback_query.message.message_thread_id - if event.callback_query.message.is_topic_message + if not isinstance(event.callback_query.message, InaccessibleMessage) + and event.callback_query.message.is_topic_message else None, ) return None, event.callback_query.from_user, None @@ -77,4 +78,12 @@ class UserContextMiddleware(BaseMiddleware): return event.chat_member.chat, event.chat_member.from_user, None if event.chat_join_request: return event.chat_join_request.chat, event.chat_join_request.from_user, None + if event.message_reaction: + return event.message_reaction.chat, event.message_reaction.user, None + if event.message_reaction_count: + return event.message_reaction_count.chat, None, None + if event.chat_boost: + return event.chat_boost.chat, None, None + if event.removed_chat_boost: + return event.removed_chat_boost.chat, None, None return None, None, None diff --git a/aiogram/dispatcher/router.py b/aiogram/dispatcher/router.py index 4dd4284f..c8ea9788 100644 --- a/aiogram/dispatcher/router.py +++ b/aiogram/dispatcher/router.py @@ -52,6 +52,14 @@ class Router: self.my_chat_member = TelegramEventObserver(router=self, event_name="my_chat_member") self.chat_member = TelegramEventObserver(router=self, event_name="chat_member") self.chat_join_request = TelegramEventObserver(router=self, event_name="chat_join_request") + self.message_reaction = TelegramEventObserver(router=self, event_name="message_reaction") + self.message_reaction_count = TelegramEventObserver( + router=self, event_name="message_reaction_count" + ) + self.chat_boost = TelegramEventObserver(router=self, event_name="chat_boost") + self.removed_chat_boost = TelegramEventObserver( + router=self, event_name="removed_chat_boost" + ) self.errors = self.error = TelegramEventObserver(router=self, event_name="error") @@ -73,6 +81,10 @@ class Router: "my_chat_member": self.my_chat_member, "chat_member": self.chat_member, "chat_join_request": self.chat_join_request, + "message_reaction": self.message_reaction, + "message_reaction_count": self.message_reaction_count, + "chat_boost": self.chat_boost, + "removed_chat_boost": self.removed_chat_boost, "error": self.errors, } diff --git a/aiogram/enums/__init__.py b/aiogram/enums/__init__.py index a999001c..079fdc0f 100644 --- a/aiogram/enums/__init__.py +++ b/aiogram/enums/__init__.py @@ -1,5 +1,6 @@ from .bot_command_scope_type import BotCommandScopeType from .chat_action import ChatAction +from .chat_boost_source_type import ChatBoostSourceType from .chat_member_status import ChatMemberStatus from .chat_type import ChatType from .content_type import ContentType @@ -11,9 +12,11 @@ from .input_media_type import InputMediaType from .mask_position_point import MaskPositionPoint from .menu_button_type import MenuButtonType from .message_entity_type import MessageEntityType +from .message_origin_type import MessageOriginType from .parse_mode import ParseMode from .passport_element_error_type import PassportElementErrorType from .poll_type import PollType +from .reaction_type_type import ReactionTypeType from .sticker_format import StickerFormat from .sticker_type import StickerType from .topic_icon_color import TopicIconColor @@ -22,6 +25,7 @@ from .update_type import UpdateType __all__ = ( "BotCommandScopeType", "ChatAction", + "ChatBoostSourceType", "ChatMemberStatus", "ChatType", "ContentType", @@ -33,9 +37,11 @@ __all__ = ( "MaskPositionPoint", "MenuButtonType", "MessageEntityType", + "MessageOriginType", "ParseMode", "PassportElementErrorType", "PollType", + "ReactionTypeType", "StickerFormat", "StickerType", "TopicIconColor", diff --git a/aiogram/enums/chat_boost_source_type.py b/aiogram/enums/chat_boost_source_type.py new file mode 100644 index 00000000..c95c31dc --- /dev/null +++ b/aiogram/enums/chat_boost_source_type.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class ChatBoostSourceType(str, Enum): + """ + This object represents a type of chat boost source. + + Source: https://core.telegram.org/bots/api#chatboostsource + """ + + PREMIUM = "premium" + GIFT_CODE = "gift_code" + GIVEAWAY = "giveaway" diff --git a/aiogram/enums/content_type.py b/aiogram/enums/content_type.py index d34d878e..386bf924 100644 --- a/aiogram/enums/content_type.py +++ b/aiogram/enums/content_type.py @@ -39,7 +39,7 @@ class ContentType(str, Enum): PINNED_MESSAGE = "pinned_message" INVOICE = "invoice" SUCCESSFUL_PAYMENT = "successful_payment" - USER_SHARED = "user_shared" + USERS_SHARED = "users_shared" CHAT_SHARED = "chat_shared" CONNECTED_WEBSITE = "connected_website" WRITE_ACCESS_ALLOWED = "write_access_allowed" @@ -51,8 +51,13 @@ class ContentType(str, Enum): FORUM_TOPIC_REOPENED = "forum_topic_reopened" GENERAL_FORUM_TOPIC_HIDDEN = "general_forum_topic_hidden" GENERAL_FORUM_TOPIC_UNHIDDEN = "general_forum_topic_unhidden" + GIVEAWAY_CREATED = "giveaway_created" + GIVEAWAY = "giveaway" + GIVEAWAY_WINNERS = "giveaway_winners" + GIVEAWAY_COMPLETED = "giveaway_completed" VIDEO_CHAT_SCHEDULED = "video_chat_scheduled" VIDEO_CHAT_STARTED = "video_chat_started" VIDEO_CHAT_ENDED = "video_chat_ended" VIDEO_CHAT_PARTICIPANTS_INVITED = "video_chat_participants_invited" WEB_APP_DATA = "web_app_data" + USER_SHARED = "user_shared" diff --git a/aiogram/enums/message_entity_type.py b/aiogram/enums/message_entity_type.py index f58f487a..81bddd81 100644 --- a/aiogram/enums/message_entity_type.py +++ b/aiogram/enums/message_entity_type.py @@ -20,6 +20,7 @@ class MessageEntityType(str, Enum): UNDERLINE = "underline" STRIKETHROUGH = "strikethrough" SPOILER = "spoiler" + BLOCKQUOTE = "blockquote" CODE = "code" PRE = "pre" TEXT_LINK = "text_link" diff --git a/aiogram/enums/message_origin_type.py b/aiogram/enums/message_origin_type.py new file mode 100644 index 00000000..95436651 --- /dev/null +++ b/aiogram/enums/message_origin_type.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class MessageOriginType(str, Enum): + """ + This object represents origin of a message. + + Source: https://core.telegram.org/bots/api#messageorigin + """ + + USER = "user" + HIDDEN_USER = "hidden_user" + CHAT = "chat" + CHANNEL = "channel" diff --git a/aiogram/enums/reaction_type_type.py b/aiogram/enums/reaction_type_type.py new file mode 100644 index 00000000..5b0b8804 --- /dev/null +++ b/aiogram/enums/reaction_type_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class ReactionTypeType(str, Enum): + """ + This object represents reaction type. + + Source: https://core.telegram.org/bots/api#reactiontype + """ + + EMOJI = "emoji" + CUSTOM_EMOJI = "custom_emoji" diff --git a/aiogram/enums/update_type.py b/aiogram/enums/update_type.py index 6025accc..3571a457 100644 --- a/aiogram/enums/update_type.py +++ b/aiogram/enums/update_type.py @@ -12,6 +12,8 @@ class UpdateType(str, Enum): EDITED_MESSAGE = "edited_message" CHANNEL_POST = "channel_post" EDITED_CHANNEL_POST = "edited_channel_post" + MESSAGE_REACTION = "message_reaction" + MESSAGE_REACTION_COUNT = "message_reaction_count" INLINE_QUERY = "inline_query" CHOSEN_INLINE_RESULT = "chosen_inline_result" CALLBACK_QUERY = "callback_query" @@ -22,3 +24,5 @@ class UpdateType(str, Enum): MY_CHAT_MEMBER = "my_chat_member" CHAT_MEMBER = "chat_member" CHAT_JOIN_REQUEST = "chat_join_request" + CHAT_BOOST = "chat_boost" + REMOVED_CHAT_BOOST = "removed_chat_boost" diff --git a/aiogram/handlers/callback_query.py b/aiogram/handlers/callback_query.py index 31fc9b3d..342b11b8 100644 --- a/aiogram/handlers/callback_query.py +++ b/aiogram/handlers/callback_query.py @@ -2,7 +2,7 @@ from abc import ABC from typing import Optional from aiogram.handlers import BaseHandler -from aiogram.types import CallbackQuery, Message, User +from aiogram.types import CallbackQuery, MaybeInaccessibleMessage, Message, User class CallbackQueryHandler(BaseHandler[CallbackQuery], ABC): @@ -29,7 +29,7 @@ class CallbackQueryHandler(BaseHandler[CallbackQuery], ABC): return self.event.from_user @property - def message(self) -> Optional[Message]: + def message(self) -> Optional[MaybeInaccessibleMessage]: """ Is alias for `event.message` """ diff --git a/aiogram/methods/__init__.py b/aiogram/methods/__init__.py index 32909f4a..370cbee1 100644 --- a/aiogram/methods/__init__.py +++ b/aiogram/methods/__init__.py @@ -12,6 +12,7 @@ from .close import Close from .close_forum_topic import CloseForumTopic from .close_general_forum_topic import CloseGeneralForumTopic from .copy_message import CopyMessage +from .copy_messages import CopyMessages from .create_chat_invite_link import CreateChatInviteLink from .create_forum_topic import CreateForumTopic from .create_invoice_link import CreateInvoiceLink @@ -21,6 +22,7 @@ from .delete_chat_photo import DeleteChatPhoto from .delete_chat_sticker_set import DeleteChatStickerSet from .delete_forum_topic import DeleteForumTopic from .delete_message import DeleteMessage +from .delete_messages import DeleteMessages from .delete_my_commands import DeleteMyCommands from .delete_sticker_from_set import DeleteStickerFromSet from .delete_sticker_set import DeleteStickerSet @@ -35,6 +37,7 @@ from .edit_message_reply_markup import EditMessageReplyMarkup from .edit_message_text import EditMessageText from .export_chat_invite_link import ExportChatInviteLink from .forward_message import ForwardMessage +from .forward_messages import ForwardMessages from .get_chat import GetChat from .get_chat_administrators import GetChatAdministrators from .get_chat_member import GetChatMember @@ -52,6 +55,7 @@ from .get_my_name import GetMyName from .get_my_short_description import GetMyShortDescription from .get_sticker_set import GetStickerSet from .get_updates import GetUpdates +from .get_user_chat_boosts import GetUserChatBoosts from .get_user_profile_photos import GetUserProfilePhotos from .get_webhook_info import GetWebhookInfo from .hide_general_forum_topic import HideGeneralForumTopic @@ -90,6 +94,7 @@ from .set_chat_sticker_set import SetChatStickerSet from .set_chat_title import SetChatTitle from .set_custom_emoji_sticker_set_thumbnail import SetCustomEmojiStickerSetThumbnail from .set_game_score import SetGameScore +from .set_message_reaction import SetMessageReaction from .set_my_commands import SetMyCommands from .set_my_default_administrator_rights import SetMyDefaultAdministratorRights from .set_my_description import SetMyDescription @@ -128,6 +133,7 @@ __all__ = ( "CloseForumTopic", "CloseGeneralForumTopic", "CopyMessage", + "CopyMessages", "CreateChatInviteLink", "CreateForumTopic", "CreateInvoiceLink", @@ -137,6 +143,7 @@ __all__ = ( "DeleteChatStickerSet", "DeleteForumTopic", "DeleteMessage", + "DeleteMessages", "DeleteMyCommands", "DeleteStickerFromSet", "DeleteStickerSet", @@ -151,6 +158,7 @@ __all__ = ( "EditMessageText", "ExportChatInviteLink", "ForwardMessage", + "ForwardMessages", "GetChat", "GetChatAdministrators", "GetChatMember", @@ -168,6 +176,7 @@ __all__ = ( "GetMyShortDescription", "GetStickerSet", "GetUpdates", + "GetUserChatBoosts", "GetUserProfilePhotos", "GetWebhookInfo", "HideGeneralForumTopic", @@ -208,6 +217,7 @@ __all__ = ( "SetChatTitle", "SetCustomEmojiStickerSetThumbnail", "SetGameScore", + "SetMessageReaction", "SetMyCommands", "SetMyDefaultAdministratorRights", "SetMyDescription", diff --git a/aiogram/methods/copy_message.py b/aiogram/methods/copy_message.py index b707580e..4fda2cb9 100644 --- a/aiogram/methods/copy_message.py +++ b/aiogram/methods/copy_message.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( UNSET_PARSE_MODE, ForceReply, @@ -10,6 +12,7 @@ from ..types import ( MessageId, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -17,7 +20,7 @@ from .base import TelegramMethod class CopyMessage(TelegramMethod[MessageId]): """ - Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success. + Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success. Source: https://core.telegram.org/bots/api#copymessage """ @@ -43,14 +46,24 @@ class CopyMessage(TelegramMethod[MessageId]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -68,11 +81,12 @@ class CopyMessage(TelegramMethod[MessageId]): caption_entities: Optional[List[MessageEntity]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -89,8 +103,9 @@ class CopyMessage(TelegramMethod[MessageId]): caption_entities=caption_entities, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/copy_messages.py b/aiogram/methods/copy_messages.py new file mode 100644 index 00000000..a7d88124 --- /dev/null +++ b/aiogram/methods/copy_messages.py @@ -0,0 +1,61 @@ +from typing import TYPE_CHECKING, Any, List, Optional, Union + +from ..types import MessageId +from .base import TelegramMethod + + +class CopyMessages(TelegramMethod[List[MessageId]]): + """ + Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_messages.ForwardMessages`, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned. + + Source: https://core.telegram.org/bots/api#copymessages + """ + + __returning__ = List[MessageId] + __api_method__ = "copyMessages" + + chat_id: Union[int, str] + """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" + from_chat_id: Union[int, str] + """Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)""" + message_ids: List[int] + """Identifiers of 1-100 messages in the chat *from_chat_id* to copy. The identifiers must be specified in a strictly increasing order.""" + message_thread_id: Optional[int] = None + """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" + disable_notification: Optional[bool] = None + """Sends the messages `silently `_. Users will receive a notification with no sound.""" + protect_content: Optional[bool] = None + """Protects the contents of the sent messages from forwarding and saving""" + remove_caption: Optional[bool] = None + """Pass :code:`True` to copy the messages without their captions""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chat_id: Union[int, str], + from_chat_id: Union[int, str], + message_ids: List[int], + message_thread_id: Optional[int] = None, + disable_notification: Optional[bool] = None, + protect_content: Optional[bool] = None, + remove_caption: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + chat_id=chat_id, + from_chat_id=from_chat_id, + message_ids=message_ids, + message_thread_id=message_thread_id, + disable_notification=disable_notification, + protect_content=protect_content, + remove_caption=remove_caption, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/delete_messages.py b/aiogram/methods/delete_messages.py new file mode 100644 index 00000000..6e5ad063 --- /dev/null +++ b/aiogram/methods/delete_messages.py @@ -0,0 +1,36 @@ +from typing import TYPE_CHECKING, Any, List, Union + +from .base import TelegramMethod + + +class DeleteMessages(TelegramMethod[bool]): + """ + Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#deletemessages + """ + + __returning__ = bool + __api_method__ = "deleteMessages" + + chat_id: Union[int, str] + """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" + message_ids: List[int] + """Identifiers of 1-100 messages to delete. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chat_id: Union[int, str], + message_ids: List[int], + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(chat_id=chat_id, message_ids=message_ids, **__pydantic_kwargs) diff --git a/aiogram/methods/edit_message_text.py b/aiogram/methods/edit_message_text.py index c795e0f2..756f1951 100644 --- a/aiogram/methods/edit_message_text.py +++ b/aiogram/methods/edit_message_text.py @@ -2,7 +2,15 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union -from ..types import UNSET_PARSE_MODE, InlineKeyboardMarkup, Message, MessageEntity +from pydantic import Field + +from ..types import ( + UNSET_PARSE_MODE, + InlineKeyboardMarkup, + LinkPreviewOptions, + Message, + MessageEntity, +) from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW from .base import TelegramMethod @@ -29,10 +37,17 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]): """Mode for parsing entities in the message text. See `formatting options `_ for more details.""" entities: Optional[List[MessageEntity]] = None """A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*""" - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW - """Disables link previews for links in this message""" + link_preview_options: Optional[LinkPreviewOptions] = None + """Link preview generation options for the message""" reply_markup: Optional[InlineKeyboardMarkup] = None """A JSON-serialized object for an `inline keyboard `_.""" + disable_web_page_preview: Optional[bool] = Field( + UNSET_DISABLE_WEB_PAGE_PREVIEW, json_schema_extra={"deprecated": True} + ) + """Disables link previews for links in this message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -47,8 +62,9 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]): inline_message_id: Optional[str] = None, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -62,7 +78,8 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]): inline_message_id=inline_message_id, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, reply_markup=reply_markup, + disable_web_page_preview=disable_web_page_preview, **__pydantic_kwargs, ) diff --git a/aiogram/methods/forward_message.py b/aiogram/methods/forward_message.py index a0eeb79f..d195f465 100644 --- a/aiogram/methods/forward_message.py +++ b/aiogram/methods/forward_message.py @@ -9,7 +9,7 @@ from .base import TelegramMethod class ForwardMessage(TelegramMethod[Message]): """ - Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned. + Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#forwardmessage """ diff --git a/aiogram/methods/forward_messages.py b/aiogram/methods/forward_messages.py new file mode 100644 index 00000000..0cceff05 --- /dev/null +++ b/aiogram/methods/forward_messages.py @@ -0,0 +1,57 @@ +from typing import TYPE_CHECKING, Any, List, Optional, Union + +from ..types import MessageId +from .base import TelegramMethod + + +class ForwardMessages(TelegramMethod[List[MessageId]]): + """ + Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of :class:`aiogram.types.message_id.MessageId` of the sent messages is returned. + + Source: https://core.telegram.org/bots/api#forwardmessages + """ + + __returning__ = List[MessageId] + __api_method__ = "forwardMessages" + + chat_id: Union[int, str] + """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" + from_chat_id: Union[int, str] + """Unique identifier for the chat where the original messages were sent (or channel username in the format :code:`@channelusername`)""" + message_ids: List[int] + """Identifiers of 1-100 messages in the chat *from_chat_id* to forward. The identifiers must be specified in a strictly increasing order.""" + message_thread_id: Optional[int] = None + """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" + disable_notification: Optional[bool] = None + """Sends the messages `silently `_. Users will receive a notification with no sound.""" + protect_content: Optional[bool] = None + """Protects the contents of the forwarded messages from forwarding and saving""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chat_id: Union[int, str], + from_chat_id: Union[int, str], + message_ids: List[int], + message_thread_id: Optional[int] = None, + disable_notification: Optional[bool] = None, + protect_content: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + chat_id=chat_id, + from_chat_id=from_chat_id, + message_ids=message_ids, + message_thread_id=message_thread_id, + disable_notification=disable_notification, + protect_content=protect_content, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/get_chat.py b/aiogram/methods/get_chat.py index d835aa55..9b80b490 100644 --- a/aiogram/methods/get_chat.py +++ b/aiogram/methods/get_chat.py @@ -8,7 +8,7 @@ from .base import TelegramMethod class GetChat(TelegramMethod[Chat]): """ - Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a :class:`aiogram.types.chat.Chat` object on success. + Use this method to get up to date information about the chat. Returns a :class:`aiogram.types.chat.Chat` object on success. Source: https://core.telegram.org/bots/api#getchat """ diff --git a/aiogram/methods/get_updates.py b/aiogram/methods/get_updates.py index dd9f855e..d1f6371e 100644 --- a/aiogram/methods/get_updates.py +++ b/aiogram/methods/get_updates.py @@ -29,7 +29,7 @@ class GetUpdates(TelegramMethod[List[Update]]): timeout: Optional[int] = None """Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.""" allowed_updates: Optional[List[str]] = None - """A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.""" + """A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/methods/get_user_chat_boosts.py b/aiogram/methods/get_user_chat_boosts.py new file mode 100644 index 00000000..f3eae261 --- /dev/null +++ b/aiogram/methods/get_user_chat_boosts.py @@ -0,0 +1,33 @@ +from typing import TYPE_CHECKING, Any, Union + +from ..types import UserChatBoosts +from .base import TelegramMethod + + +class GetUserChatBoosts(TelegramMethod[UserChatBoosts]): + """ + Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a :class:`aiogram.types.user_chat_boosts.UserChatBoosts` object. + + Source: https://core.telegram.org/bots/api#getuserchatboosts + """ + + __returning__ = UserChatBoosts + __api_method__ = "getUserChatBoosts" + + chat_id: Union[int, str] + """Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)""" + user_id: int + """Unique identifier of the target user""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, chat_id: Union[int, str], 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__(chat_id=chat_id, user_id=user_id, **__pydantic_kwargs) diff --git a/aiogram/methods/send_animation.py b/aiogram/methods/send_animation.py index cb737aa2..fac20375 100644 --- a/aiogram/methods/send_animation.py +++ b/aiogram/methods/send_animation.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( UNSET_PARSE_MODE, ForceReply, @@ -11,6 +13,7 @@ from ..types import ( MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -52,14 +55,24 @@ class SendAnimation(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -81,11 +94,12 @@ class SendAnimation(TelegramMethod[Message]): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -106,8 +120,9 @@ class SendAnimation(TelegramMethod[Message]): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_audio.py b/aiogram/methods/send_audio.py index 98826340..a13d8645 100644 --- a/aiogram/methods/send_audio.py +++ b/aiogram/methods/send_audio.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( UNSET_PARSE_MODE, ForceReply, @@ -11,6 +13,7 @@ from ..types import ( MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -51,14 +54,24 @@ class SendAudio(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -79,11 +92,12 @@ class SendAudio(TelegramMethod[Message]): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -103,8 +117,9 @@ class SendAudio(TelegramMethod[Message]): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_contact.py b/aiogram/methods/send_contact.py index 0053b1ea..9bef3e31 100644 --- a/aiogram/methods/send_contact.py +++ b/aiogram/methods/send_contact.py @@ -2,12 +2,15 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional, Union +from pydantic import Field + from ..types import ( ForceReply, InlineKeyboardMarkup, Message, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -39,14 +42,24 @@ class SendContact(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -63,11 +76,12 @@ class SendContact(TelegramMethod[Message]): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -83,8 +97,9 @@ class SendContact(TelegramMethod[Message]): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_dice.py b/aiogram/methods/send_dice.py index a06442d5..31e0c8de 100644 --- a/aiogram/methods/send_dice.py +++ b/aiogram/methods/send_dice.py @@ -2,12 +2,15 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional, Union +from pydantic import Field + from ..types import ( ForceReply, InlineKeyboardMarkup, Message, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -33,14 +36,24 @@ class SendDice(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -54,11 +67,12 @@ class SendDice(TelegramMethod[Message]): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -71,8 +85,9 @@ class SendDice(TelegramMethod[Message]): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_document.py b/aiogram/methods/send_document.py index e73b2603..2360eef6 100644 --- a/aiogram/methods/send_document.py +++ b/aiogram/methods/send_document.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( UNSET_PARSE_MODE, ForceReply, @@ -11,6 +13,7 @@ from ..types import ( MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -46,14 +49,24 @@ class SendDocument(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -72,11 +85,12 @@ class SendDocument(TelegramMethod[Message]): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -94,8 +108,9 @@ class SendDocument(TelegramMethod[Message]): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_game.py b/aiogram/methods/send_game.py index e7d0e667..a055ec9d 100644 --- a/aiogram/methods/send_game.py +++ b/aiogram/methods/send_game.py @@ -2,7 +2,9 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional -from ..types import InlineKeyboardMarkup, Message +from pydantic import Field + +from ..types import InlineKeyboardMarkup, Message, ReplyParameters from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -27,12 +29,22 @@ class SendGame(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[InlineKeyboardMarkup] = None """A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -46,9 +58,10 @@ class SendGame(TelegramMethod[Message]): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -61,8 +74,9 @@ class SendGame(TelegramMethod[Message]): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_invoice.py b/aiogram/methods/send_invoice.py index 71bed6df..5bdb31eb 100644 --- a/aiogram/methods/send_invoice.py +++ b/aiogram/methods/send_invoice.py @@ -2,7 +2,9 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union -from ..types import InlineKeyboardMarkup, LabeledPrice, Message +from pydantic import Field + +from ..types import InlineKeyboardMarkup, LabeledPrice, Message, ReplyParameters from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -67,12 +69,22 @@ class SendInvoice(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[InlineKeyboardMarkup] = None """A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -106,9 +118,10 @@ class SendInvoice(TelegramMethod[Message]): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -141,8 +154,9 @@ class SendInvoice(TelegramMethod[Message]): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_location.py b/aiogram/methods/send_location.py index 4eac028c..46599575 100644 --- a/aiogram/methods/send_location.py +++ b/aiogram/methods/send_location.py @@ -2,12 +2,15 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional, Union +from pydantic import Field + from ..types import ( ForceReply, InlineKeyboardMarkup, Message, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -43,14 +46,24 @@ class SendLocation(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -69,11 +82,12 @@ class SendLocation(TelegramMethod[Message]): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -91,8 +105,9 @@ class SendLocation(TelegramMethod[Message]): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_media_group.py b/aiogram/methods/send_media_group.py index 3fa31852..ac1bae15 100644 --- a/aiogram/methods/send_media_group.py +++ b/aiogram/methods/send_media_group.py @@ -2,12 +2,15 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo, Message, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -33,10 +36,20 @@ class SendMediaGroup(TelegramMethod[List[Message]]): """Sends messages `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent messages from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the messages are a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the messages are a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -52,8 +65,9 @@ class SendMediaGroup(TelegramMethod[List[Message]]): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, + reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -66,7 +80,8 @@ class SendMediaGroup(TelegramMethod[List[Message]]): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, + reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_message.py b/aiogram/methods/send_message.py index 8e33687c..e354429d 100644 --- a/aiogram/methods/send_message.py +++ b/aiogram/methods/send_message.py @@ -2,14 +2,18 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( UNSET_PARSE_MODE, ForceReply, InlineKeyboardMarkup, + LinkPreviewOptions, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -35,20 +39,37 @@ class SendMessage(TelegramMethod[Message]): """Mode for parsing entities in the message text. See `formatting options `_ for more details.""" entities: Optional[List[MessageEntity]] = None """A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*""" - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW - """Disables link previews for links in this message""" + link_preview_options: Optional[LinkPreviewOptions] = None + """Link preview generation options for the message""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + disable_web_page_preview: Optional[bool] = Field( + UNSET_DISABLE_WEB_PAGE_PREVIEW, json_schema_extra={"deprecated": True} + ) + """Disables link previews for links in this message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -62,14 +83,16 @@ class SendMessage(TelegramMethod[Message]): message_thread_id: Optional[int] = None, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -82,11 +105,13 @@ class SendMessage(TelegramMethod[Message]): message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + disable_web_page_preview=disable_web_page_preview, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_photo.py b/aiogram/methods/send_photo.py index 521b2b70..c17d86b5 100644 --- a/aiogram/methods/send_photo.py +++ b/aiogram/methods/send_photo.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( UNSET_PARSE_MODE, ForceReply, @@ -11,6 +13,7 @@ from ..types import ( MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -44,14 +47,24 @@ class SendPhoto(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -69,11 +82,12 @@ class SendPhoto(TelegramMethod[Message]): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -90,8 +104,9 @@ class SendPhoto(TelegramMethod[Message]): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_poll.py b/aiogram/methods/send_poll.py index f67ca805..fd51b17c 100644 --- a/aiogram/methods/send_poll.py +++ b/aiogram/methods/send_poll.py @@ -3,6 +3,8 @@ from __future__ import annotations import datetime from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( UNSET_PARSE_MODE, ForceReply, @@ -11,6 +13,7 @@ from ..types import ( MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -58,14 +61,24 @@ class SendPoll(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -90,11 +103,12 @@ class SendPoll(TelegramMethod[Message]): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -118,8 +132,9 @@ class SendPoll(TelegramMethod[Message]): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_sticker.py b/aiogram/methods/send_sticker.py index 6e270024..ae6a5091 100644 --- a/aiogram/methods/send_sticker.py +++ b/aiogram/methods/send_sticker.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional, Union +from pydantic import Field + from ..types import ( ForceReply, InlineKeyboardMarkup, @@ -9,6 +11,7 @@ from ..types import ( Message, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -36,14 +39,24 @@ class SendSticker(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -58,11 +71,12 @@ class SendSticker(TelegramMethod[Message]): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -76,8 +90,9 @@ class SendSticker(TelegramMethod[Message]): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_venue.py b/aiogram/methods/send_venue.py index 85137d42..4d8199d9 100644 --- a/aiogram/methods/send_venue.py +++ b/aiogram/methods/send_venue.py @@ -2,12 +2,15 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional, Union +from pydantic import Field + from ..types import ( ForceReply, InlineKeyboardMarkup, Message, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -47,14 +50,24 @@ class SendVenue(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -75,11 +88,12 @@ class SendVenue(TelegramMethod[Message]): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -99,8 +113,9 @@ class SendVenue(TelegramMethod[Message]): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_video.py b/aiogram/methods/send_video.py index 6f5a5ff2..70a80a55 100644 --- a/aiogram/methods/send_video.py +++ b/aiogram/methods/send_video.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( UNSET_PARSE_MODE, ForceReply, @@ -11,6 +13,7 @@ from ..types import ( MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -54,14 +57,24 @@ class SendVideo(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -84,11 +97,12 @@ class SendVideo(TelegramMethod[Message]): supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -110,8 +124,9 @@ class SendVideo(TelegramMethod[Message]): supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_video_note.py b/aiogram/methods/send_video_note.py index bd6a1cb1..fd4ac48b 100644 --- a/aiogram/methods/send_video_note.py +++ b/aiogram/methods/send_video_note.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional, Union +from pydantic import Field + from ..types import ( ForceReply, InlineKeyboardMarkup, @@ -9,6 +11,7 @@ from ..types import ( Message, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -40,14 +43,24 @@ class SendVideoNote(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -64,11 +77,12 @@ class SendVideoNote(TelegramMethod[Message]): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -84,8 +98,9 @@ class SendVideoNote(TelegramMethod[Message]): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/send_voice.py b/aiogram/methods/send_voice.py index 24fd86e2..d410b765 100644 --- a/aiogram/methods/send_voice.py +++ b/aiogram/methods/send_voice.py @@ -2,6 +2,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional, Union +from pydantic import Field + from ..types import ( UNSET_PARSE_MODE, ForceReply, @@ -11,6 +13,7 @@ from ..types import ( MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove, + ReplyParameters, ) from ..types.base import UNSET_PROTECT_CONTENT from .base import TelegramMethod @@ -44,14 +47,24 @@ class SendVoice(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[bool] = UNSET_PROTECT_CONTENT """Protects the contents of the sent message from forwarding and saving""" - reply_to_message_id: Optional[int] = None - """If the message is a reply, ID of the original message""" - allow_sending_without_reply: Optional[bool] = None - """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found""" + reply_parameters: Optional[ReplyParameters] = None + """Description of the message to reply to""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None """Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user.""" + allow_sending_without_reply: Optional[bool] = Field( + None, json_schema_extra={"deprecated": True} + ) + """Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + reply_to_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """If the message is a reply, ID of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -69,11 +82,12 @@ class SendVoice(TelegramMethod[Message]): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -90,8 +104,9 @@ class SendVoice(TelegramMethod[Message]): duration=duration, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **__pydantic_kwargs, ) diff --git a/aiogram/methods/set_message_reaction.py b/aiogram/methods/set_message_reaction.py new file mode 100644 index 00000000..87f08b32 --- /dev/null +++ b/aiogram/methods/set_message_reaction.py @@ -0,0 +1,49 @@ +from typing import TYPE_CHECKING, Any, List, Optional, Union + +from ..types import ReactionTypeCustomEmoji, ReactionTypeEmoji +from .base import TelegramMethod + + +class SetMessageReaction(TelegramMethod[bool]): + """ + Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setmessagereaction + """ + + __returning__ = bool + __api_method__ = "setMessageReaction" + + chat_id: Union[int, str] + """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" + message_id: int + """Identifier of the target message""" + reaction: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None + """New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.""" + is_big: Optional[bool] = None + """Pass :code:`True` to set the reaction with a big animation""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chat_id: Union[int, str], + message_id: int, + reaction: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None, + is_big: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + chat_id=chat_id, + message_id=message_id, + reaction=reaction, + is_big=is_big, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/set_webhook.py b/aiogram/methods/set_webhook.py index da8ec9d4..998e51b0 100644 --- a/aiogram/methods/set_webhook.py +++ b/aiogram/methods/set_webhook.py @@ -35,7 +35,7 @@ class SetWebhook(TelegramMethod[bool]): max_connections: Optional[int] = None """The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.""" allowed_updates: Optional[List[str]] = None - """A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member* (default). If not specified, the previous setting will be used.""" + """A JSON-serialized list of the update types you want your bot to receive. For example, specify :code:`["message", "edited_channel_post", "callback_query"]` to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all update types except *chat_member*, *message_reaction*, and *message_reaction_count* (default). If not specified, the previous setting will be used.""" drop_pending_updates: Optional[bool] = None """Pass :code:`True` to drop all pending updates""" secret_token: Optional[str] = None diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index 8f4b6f34..11ed4c0f 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -21,6 +21,13 @@ from .callback_game import CallbackGame from .callback_query import CallbackQuery from .chat import Chat from .chat_administrator_rights import ChatAdministratorRights +from .chat_boost import ChatBoost +from .chat_boost_removed import ChatBoostRemoved +from .chat_boost_source import ChatBoostSource +from .chat_boost_source_gift_code import ChatBoostSourceGiftCode +from .chat_boost_source_giveaway import ChatBoostSourceGiveaway +from .chat_boost_source_premium import ChatBoostSourcePremium +from .chat_boost_updated import ChatBoostUpdated from .chat_invite_link import ChatInviteLink from .chat_join_request import ChatJoinRequest from .chat_location import ChatLocation @@ -44,6 +51,7 @@ from .downloadable import Downloadable from .encrypted_credentials import EncryptedCredentials from .encrypted_passport_element import EncryptedPassportElement from .error_event import ErrorEvent +from .external_reply_info import ExternalReplyInfo from .file import File from .force_reply import ForceReply from .forum_topic import ForumTopic @@ -55,6 +63,11 @@ from .game import Game from .game_high_score import GameHighScore from .general_forum_topic_hidden import GeneralForumTopicHidden from .general_forum_topic_unhidden import GeneralForumTopicUnhidden +from .giveaway import Giveaway +from .giveaway_completed import GiveawayCompleted +from .giveaway_created import GiveawayCreated +from .giveaway_winners import GiveawayWinners +from .inaccessible_message import InaccessibleMessage from .inline_keyboard_button import InlineKeyboardButton from .inline_keyboard_markup import InlineKeyboardMarkup from .inline_query import InlineQuery @@ -99,10 +112,13 @@ from .keyboard_button import KeyboardButton from .keyboard_button_poll_type import KeyboardButtonPollType from .keyboard_button_request_chat import KeyboardButtonRequestChat from .keyboard_button_request_user import KeyboardButtonRequestUser +from .keyboard_button_request_users import KeyboardButtonRequestUsers from .labeled_price import LabeledPrice +from .link_preview_options import LinkPreviewOptions from .location import Location from .login_url import LoginUrl from .mask_position import MaskPosition +from .maybe_inaccessible_message import MaybeInaccessibleMessage from .menu_button import MenuButton from .menu_button_commands import MenuButtonCommands from .menu_button_default import MenuButtonDefault @@ -111,6 +127,13 @@ from .message import ContentType, Message from .message_auto_delete_timer_changed import MessageAutoDeleteTimerChanged from .message_entity import MessageEntity from .message_id import MessageId +from .message_origin import MessageOrigin +from .message_origin_channel import MessageOriginChannel +from .message_origin_chat import MessageOriginChat +from .message_origin_hidden_user import MessageOriginHiddenUser +from .message_origin_user import MessageOriginUser +from .message_reaction_count_updated import MessageReactionCountUpdated +from .message_reaction_updated import MessageReactionUpdated from .order_info import OrderInfo from .passport_data import PassportData from .passport_element_error import PassportElementError @@ -132,8 +155,13 @@ from .poll_answer import PollAnswer from .poll_option import PollOption from .pre_checkout_query import PreCheckoutQuery from .proximity_alert_triggered import ProximityAlertTriggered +from .reaction_count import ReactionCount +from .reaction_type import ReactionType +from .reaction_type_custom_emoji import ReactionTypeCustomEmoji +from .reaction_type_emoji import ReactionTypeEmoji from .reply_keyboard_markup import ReplyKeyboardMarkup from .reply_keyboard_remove import ReplyKeyboardRemove +from .reply_parameters import ReplyParameters from .response_parameters import ResponseParameters from .sent_web_app_message import SentWebAppMessage from .shipping_address import ShippingAddress @@ -144,10 +172,13 @@ from .sticker_set import StickerSet from .story import Story from .successful_payment import SuccessfulPayment from .switch_inline_query_chosen_chat import SwitchInlineQueryChosenChat +from .text_quote import TextQuote from .update import Update from .user import User +from .user_chat_boosts import UserChatBoosts from .user_profile_photos import UserProfilePhotos from .user_shared import UserShared +from .users_shared import UsersShared from .venue import Venue from .video import Video from .video_chat_ended import VideoChatEnded @@ -181,6 +212,13 @@ __all__ = ( "CallbackQuery", "Chat", "ChatAdministratorRights", + "ChatBoost", + "ChatBoostRemoved", + "ChatBoostSource", + "ChatBoostSourceGiftCode", + "ChatBoostSourceGiveaway", + "ChatBoostSourcePremium", + "ChatBoostUpdated", "ChatInviteLink", "ChatJoinRequest", "ChatLocation", @@ -205,6 +243,7 @@ __all__ = ( "EncryptedCredentials", "EncryptedPassportElement", "ErrorEvent", + "ExternalReplyInfo", "FSInputFile", "File", "ForceReply", @@ -217,6 +256,11 @@ __all__ = ( "GameHighScore", "GeneralForumTopicHidden", "GeneralForumTopicUnhidden", + "Giveaway", + "GiveawayCompleted", + "GiveawayCreated", + "GiveawayWinners", + "InaccessibleMessage", "InlineKeyboardButton", "InlineKeyboardMarkup", "InlineQuery", @@ -261,10 +305,13 @@ __all__ = ( "KeyboardButtonPollType", "KeyboardButtonRequestChat", "KeyboardButtonRequestUser", + "KeyboardButtonRequestUsers", "LabeledPrice", + "LinkPreviewOptions", "Location", "LoginUrl", "MaskPosition", + "MaybeInaccessibleMessage", "MenuButton", "MenuButtonCommands", "MenuButtonDefault", @@ -273,6 +320,13 @@ __all__ = ( "MessageAutoDeleteTimerChanged", "MessageEntity", "MessageId", + "MessageOrigin", + "MessageOriginChannel", + "MessageOriginChat", + "MessageOriginHiddenUser", + "MessageOriginUser", + "MessageReactionCountUpdated", + "MessageReactionUpdated", "OrderInfo", "PassportData", "PassportElementError", @@ -292,8 +346,13 @@ __all__ = ( "PollOption", "PreCheckoutQuery", "ProximityAlertTriggered", + "ReactionCount", + "ReactionType", + "ReactionTypeCustomEmoji", + "ReactionTypeEmoji", "ReplyKeyboardMarkup", "ReplyKeyboardRemove", + "ReplyParameters", "ResponseParameters", "SentWebAppMessage", "ShippingAddress", @@ -305,12 +364,15 @@ __all__ = ( "SuccessfulPayment", "SwitchInlineQueryChosenChat", "TelegramObject", + "TextQuote", "UNSET_PARSE_MODE", "URLInputFile", "Update", "User", + "UserChatBoosts", "UserProfilePhotos", "UserShared", + "UsersShared", "Venue", "Video", "VideoChatEnded", diff --git a/aiogram/types/callback_query.py b/aiogram/types/callback_query.py index f6e95b1c..c3b33b5f 100644 --- a/aiogram/types/callback_query.py +++ b/aiogram/types/callback_query.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Optional +from typing import TYPE_CHECKING, Any, Optional, Union from pydantic import Field @@ -8,6 +8,7 @@ from .base import TelegramObject if TYPE_CHECKING: from ..methods import AnswerCallbackQuery + from .inaccessible_message import InaccessibleMessage from .message import Message from .user import User @@ -27,8 +28,8 @@ class CallbackQuery(TelegramObject): """Sender""" chat_instance: str """Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in :class:`aiogram.methods.games.Games`.""" - message: Optional[Message] = None - """*Optional*. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old""" + message: Optional[Union[Message, InaccessibleMessage]] = None + """*Optional*. Message sent by the bot with the callback button that originated the query""" inline_message_id: Optional[str] = None """*Optional*. Identifier of the message sent via the bot in inline mode, that originated the query.""" data: Optional[str] = None @@ -46,7 +47,7 @@ class CallbackQuery(TelegramObject): id: str, from_user: User, chat_instance: str, - message: Optional[Message] = None, + message: Optional[Union[Message, InaccessibleMessage]] = None, inline_message_id: Optional[str] = None, data: Optional[str] = None, game_short_name: Optional[str] = None, diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index d2ef2487..76b64879 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -42,6 +42,8 @@ if TYPE_CHECKING: from .chat_photo import ChatPhoto from .input_file import InputFile from .message import Message + from .reaction_type_custom_emoji import ReactionTypeCustomEmoji + from .reaction_type_emoji import ReactionTypeEmoji class Chat(TelegramObject): @@ -69,10 +71,20 @@ class Chat(TelegramObject): """*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" active_usernames: Optional[List[str]] = None """*Optional*. If non-empty, the list of all `active chat usernames `_; for private chats, supergroups and channels. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + available_reactions: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None + """*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions `_ are allowed. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + accent_color_id: Optional[int] = None + """*Optional*. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`. Always returned in :class:`aiogram.methods.get_chat.GetChat`.""" + background_custom_emoji_id: Optional[str] = None + """*Optional*. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + profile_accent_color_id: Optional[int] = None + """*Optional*. Identifier of the accent color for the chat's profile background. See `profile accent colors `_ for more details. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + profile_background_custom_emoji_id: Optional[str] = None + """*Optional*. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" emoji_status_custom_emoji_id: Optional[str] = None - """*Optional*. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + """*Optional*. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" emoji_status_expiration_date: Optional[DateTime] = None - """*Optional*. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + """*Optional*. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" bio: Optional[str] = None """*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" has_private_forwards: Optional[bool] = None @@ -101,6 +113,8 @@ class Chat(TelegramObject): """*Optional*. :code:`True`, if non-administrators can only get the list of bots and administrators in the chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" has_protected_content: Optional[bool] = None """*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + has_visible_history: Optional[bool] = None + """*Optional*. :code:`True`, if new chat members will have access to old messages; available only to chat administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" sticker_set_name: Optional[str] = None """*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" can_set_sticker_set: Optional[bool] = None @@ -126,6 +140,13 @@ class Chat(TelegramObject): is_forum: Optional[bool] = None, photo: Optional[ChatPhoto] = None, active_usernames: Optional[List[str]] = None, + available_reactions: Optional[ + List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]] + ] = None, + accent_color_id: Optional[int] = None, + background_custom_emoji_id: Optional[str] = None, + profile_accent_color_id: Optional[int] = None, + profile_background_custom_emoji_id: Optional[str] = None, emoji_status_custom_emoji_id: Optional[str] = None, emoji_status_expiration_date: Optional[DateTime] = None, bio: Optional[str] = None, @@ -142,6 +163,7 @@ class Chat(TelegramObject): has_aggressive_anti_spam_enabled: Optional[bool] = None, has_hidden_members: Optional[bool] = None, has_protected_content: Optional[bool] = None, + has_visible_history: Optional[bool] = None, sticker_set_name: Optional[str] = None, can_set_sticker_set: Optional[bool] = None, linked_chat_id: Optional[int] = None, @@ -162,6 +184,11 @@ class Chat(TelegramObject): is_forum=is_forum, photo=photo, active_usernames=active_usernames, + available_reactions=available_reactions, + accent_color_id=accent_color_id, + background_custom_emoji_id=background_custom_emoji_id, + profile_accent_color_id=profile_accent_color_id, + profile_background_custom_emoji_id=profile_background_custom_emoji_id, emoji_status_custom_emoji_id=emoji_status_custom_emoji_id, emoji_status_expiration_date=emoji_status_expiration_date, bio=bio, @@ -178,6 +205,7 @@ class Chat(TelegramObject): has_aggressive_anti_spam_enabled=has_aggressive_anti_spam_enabled, has_hidden_members=has_hidden_members, has_protected_content=has_protected_content, + has_visible_history=has_visible_history, sticker_set_name=sticker_set_name, can_set_sticker_set=can_set_sticker_set, linked_chat_id=linked_chat_id, diff --git a/aiogram/types/chat_boost.py b/aiogram/types/chat_boost.py new file mode 100644 index 00000000..96e444f9 --- /dev/null +++ b/aiogram/types/chat_boost.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Union + +from .base import TelegramObject +from .custom import DateTime + +if TYPE_CHECKING: + from .chat_boost_source_gift_code import ChatBoostSourceGiftCode + from .chat_boost_source_giveaway import ChatBoostSourceGiveaway + from .chat_boost_source_premium import ChatBoostSourcePremium + + +class ChatBoost(TelegramObject): + """ + This object contains information about a chat boost. + + Source: https://core.telegram.org/bots/api#chatboost + """ + + boost_id: str + """Unique identifier of the boost""" + add_date: DateTime + """Point in time (Unix timestamp) when the chat was boosted""" + expiration_date: DateTime + """Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged""" + source: Union[ChatBoostSourcePremium, ChatBoostSourceGiftCode, ChatBoostSourceGiveaway] + """Source of the added boost""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + boost_id: str, + add_date: DateTime, + expiration_date: DateTime, + source: Union[ + ChatBoostSourcePremium, ChatBoostSourceGiftCode, ChatBoostSourceGiveaway + ], + **__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__( + boost_id=boost_id, + add_date=add_date, + expiration_date=expiration_date, + source=source, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/chat_boost_removed.py b/aiogram/types/chat_boost_removed.py new file mode 100644 index 00000000..094b0572 --- /dev/null +++ b/aiogram/types/chat_boost_removed.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Union + +from .base import TelegramObject +from .custom import DateTime + +if TYPE_CHECKING: + from .chat import Chat + from .chat_boost_source_gift_code import ChatBoostSourceGiftCode + from .chat_boost_source_giveaway import ChatBoostSourceGiveaway + from .chat_boost_source_premium import ChatBoostSourcePremium + + +class ChatBoostRemoved(TelegramObject): + """ + This object represents a boost removed from a chat. + + Source: https://core.telegram.org/bots/api#chatboostremoved + """ + + chat: Chat + """Chat which was boosted""" + boost_id: str + """Unique identifier of the boost""" + remove_date: DateTime + """Point in time (Unix timestamp) when the boost was removed""" + source: Union[ChatBoostSourcePremium, ChatBoostSourceGiftCode, ChatBoostSourceGiveaway] + """Source of the removed boost""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chat: Chat, + boost_id: str, + remove_date: DateTime, + source: Union[ + ChatBoostSourcePremium, ChatBoostSourceGiftCode, ChatBoostSourceGiveaway + ], + **__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__( + chat=chat, + boost_id=boost_id, + remove_date=remove_date, + source=source, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/chat_boost_source.py b/aiogram/types/chat_boost_source.py new file mode 100644 index 00000000..3d2c262e --- /dev/null +++ b/aiogram/types/chat_boost_source.py @@ -0,0 +1,13 @@ +from aiogram.types import TelegramObject + + +class ChatBoostSource(TelegramObject): + """ + This object describes the source of a chat boost. It can be one of + + - :class:`aiogram.types.chat_boost_source_premium.ChatBoostSourcePremium` + - :class:`aiogram.types.chat_boost_source_gift_code.ChatBoostSourceGiftCode` + - :class:`aiogram.types.chat_boost_source_giveaway.ChatBoostSourceGiveaway` + + Source: https://core.telegram.org/bots/api#chatboostsource + """ diff --git a/aiogram/types/chat_boost_source_gift_code.py b/aiogram/types/chat_boost_source_gift_code.py new file mode 100644 index 00000000..554e58fe --- /dev/null +++ b/aiogram/types/chat_boost_source_gift_code.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from ..enums import ChatBoostSourceType +from .chat_boost_source import ChatBoostSource + +if TYPE_CHECKING: + from .user import User + + +class ChatBoostSourceGiftCode(ChatBoostSource): + """ + The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. + + Source: https://core.telegram.org/bots/api#chatboostsourcegiftcode + """ + + source: Literal[ChatBoostSourceType.GIFT_CODE] = ChatBoostSourceType.GIFT_CODE + """Source of the boost, always 'gift_code'""" + user: User + """User for which the gift code was created""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + source: Literal[ChatBoostSourceType.GIFT_CODE] = ChatBoostSourceType.GIFT_CODE, + 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__(source=source, user=user, **__pydantic_kwargs) diff --git a/aiogram/types/chat_boost_source_giveaway.py b/aiogram/types/chat_boost_source_giveaway.py new file mode 100644 index 00000000..dbb81507 --- /dev/null +++ b/aiogram/types/chat_boost_source_giveaway.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from ..enums import ChatBoostSourceType +from .chat_boost_source import ChatBoostSource + +if TYPE_CHECKING: + from .user import User + + +class ChatBoostSourceGiveaway(ChatBoostSource): + """ + The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. + + Source: https://core.telegram.org/bots/api#chatboostsourcegiveaway + """ + + source: Literal[ChatBoostSourceType.GIVEAWAY] = ChatBoostSourceType.GIVEAWAY + """Source of the boost, always 'giveaway'""" + giveaway_message_id: int + """Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet.""" + user: Optional[User] = None + """*Optional*. User that won the prize in the giveaway if any""" + is_unclaimed: Optional[bool] = None + """*Optional*. True, if the giveaway was completed, but there was no user to win the prize""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + source: Literal[ChatBoostSourceType.GIVEAWAY] = ChatBoostSourceType.GIVEAWAY, + giveaway_message_id: int, + user: Optional[User] = None, + is_unclaimed: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + source=source, + giveaway_message_id=giveaway_message_id, + user=user, + is_unclaimed=is_unclaimed, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/chat_boost_source_premium.py b/aiogram/types/chat_boost_source_premium.py new file mode 100644 index 00000000..97b47e65 --- /dev/null +++ b/aiogram/types/chat_boost_source_premium.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from ..enums import ChatBoostSourceType +from .chat_boost_source import ChatBoostSource + +if TYPE_CHECKING: + from .user import User + + +class ChatBoostSourcePremium(ChatBoostSource): + """ + The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. + + Source: https://core.telegram.org/bots/api#chatboostsourcepremium + """ + + source: Literal[ChatBoostSourceType.PREMIUM] = ChatBoostSourceType.PREMIUM + """Source of the boost, always 'premium'""" + user: User + """User that boosted the chat""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + source: Literal[ChatBoostSourceType.PREMIUM] = ChatBoostSourceType.PREMIUM, + 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__(source=source, user=user, **__pydantic_kwargs) diff --git a/aiogram/types/chat_boost_updated.py b/aiogram/types/chat_boost_updated.py new file mode 100644 index 00000000..78a423be --- /dev/null +++ b/aiogram/types/chat_boost_updated.py @@ -0,0 +1,35 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + +if TYPE_CHECKING: + from .chat import Chat + from .chat_boost import ChatBoost + + +class ChatBoostUpdated(TelegramObject): + """ + This object represents a boost added to a chat or changed. + + Source: https://core.telegram.org/bots/api#chatboostupdated + """ + + chat: Chat + """Chat which was boosted""" + boost: ChatBoost + """Infomation about the chat boost""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, chat: Chat, boost: ChatBoost, **__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__(chat=chat, boost=boost, **__pydantic_kwargs) diff --git a/aiogram/types/chat_join_request.py b/aiogram/types/chat_join_request.py index 47774e61..42990496 100644 --- a/aiogram/types/chat_join_request.py +++ b/aiogram/types/chat_join_request.py @@ -45,9 +45,11 @@ if TYPE_CHECKING: from .input_media_photo import InputMediaPhoto from .input_media_video import InputMediaVideo from .labeled_price import LabeledPrice + from .link_preview_options import LinkPreviewOptions from .message_entity import MessageEntity from .reply_keyboard_markup import ReplyKeyboardMarkup from .reply_keyboard_remove import ReplyKeyboardRemove + from .reply_parameters import ReplyParameters from .user import User @@ -162,14 +164,16 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendMessage: """ @@ -186,12 +190,14 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* - :param disable_web_page_preview: Disables link previews for links in this message + :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param disable_web_page_preview: Disables link previews for links in this message + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_message.SendMessage` """ # DO NOT EDIT MANUALLY!!! @@ -205,12 +211,14 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + disable_web_page_preview=disable_web_page_preview, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -220,14 +228,16 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendMessage: """ @@ -244,12 +254,14 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* - :param disable_web_page_preview: Disables link previews for links in this message + :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param disable_web_page_preview: Disables link previews for links in this message + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_message.SendMessage` """ # DO NOT EDIT MANUALLY!!! @@ -263,12 +275,14 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + disable_web_page_preview=disable_web_page_preview, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -286,11 +300,12 @@ class ChatJoinRequest(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendAnimation: """ @@ -315,9 +330,10 @@ class ChatJoinRequest(TelegramObject): :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` """ # DO NOT EDIT MANUALLY!!! @@ -339,9 +355,10 @@ class ChatJoinRequest(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -359,11 +376,12 @@ class ChatJoinRequest(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendAnimation: """ @@ -388,9 +406,10 @@ class ChatJoinRequest(TelegramObject): :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` """ # DO NOT EDIT MANUALLY!!! @@ -412,9 +431,10 @@ class ChatJoinRequest(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -431,11 +451,12 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendAudio: """ @@ -460,9 +481,10 @@ class ChatJoinRequest(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` """ # DO NOT EDIT MANUALLY!!! @@ -483,9 +505,10 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -502,11 +525,12 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendAudio: """ @@ -531,9 +555,10 @@ class ChatJoinRequest(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` """ # DO NOT EDIT MANUALLY!!! @@ -554,9 +579,10 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -569,11 +595,12 @@ class ChatJoinRequest(TelegramObject): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendContact: """ @@ -593,9 +620,10 @@ class ChatJoinRequest(TelegramObject): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_contact.SendContact` """ # DO NOT EDIT MANUALLY!!! @@ -612,9 +640,10 @@ class ChatJoinRequest(TelegramObject): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -627,11 +656,12 @@ class ChatJoinRequest(TelegramObject): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendContact: """ @@ -651,9 +681,10 @@ class ChatJoinRequest(TelegramObject): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_contact.SendContact` """ # DO NOT EDIT MANUALLY!!! @@ -670,9 +701,10 @@ class ChatJoinRequest(TelegramObject): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -687,11 +719,12 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendDocument: """ @@ -713,9 +746,10 @@ class ChatJoinRequest(TelegramObject): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_document.SendDocument` """ # DO NOT EDIT MANUALLY!!! @@ -734,9 +768,10 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -751,11 +786,12 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendDocument: """ @@ -777,9 +813,10 @@ class ChatJoinRequest(TelegramObject): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_document.SendDocument` """ # DO NOT EDIT MANUALLY!!! @@ -798,9 +835,10 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -810,9 +848,10 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendGame: """ @@ -829,9 +868,10 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_game.SendGame` """ # DO NOT EDIT MANUALLY!!! @@ -845,9 +885,10 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -857,9 +898,10 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendGame: """ @@ -876,9 +918,10 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_game.SendGame` """ # DO NOT EDIT MANUALLY!!! @@ -892,9 +935,10 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -924,9 +968,10 @@ class ChatJoinRequest(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendInvoice: """ @@ -963,9 +1008,10 @@ class ChatJoinRequest(TelegramObject): :param is_flexible: Pass :code:`True` if the final price depends on the shipping method :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_invoice.SendInvoice` """ # DO NOT EDIT MANUALLY!!! @@ -999,9 +1045,10 @@ class ChatJoinRequest(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1031,9 +1078,10 @@ class ChatJoinRequest(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendInvoice: """ @@ -1070,9 +1118,10 @@ class ChatJoinRequest(TelegramObject): :param is_flexible: Pass :code:`True` if the final price depends on the shipping method :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_invoice.SendInvoice` """ # DO NOT EDIT MANUALLY!!! @@ -1106,9 +1155,10 @@ class ChatJoinRequest(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1123,11 +1173,12 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendLocation: """ @@ -1149,9 +1200,10 @@ class ChatJoinRequest(TelegramObject): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_location.SendLocation` """ # DO NOT EDIT MANUALLY!!! @@ -1170,9 +1222,10 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1187,11 +1240,12 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendLocation: """ @@ -1213,9 +1267,10 @@ class ChatJoinRequest(TelegramObject): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_location.SendLocation` """ # DO NOT EDIT MANUALLY!!! @@ -1234,9 +1289,10 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1246,8 +1302,9 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, + reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendMediaGroup: """ @@ -1264,8 +1321,9 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving - :param reply_to_message_id: If the messages are a reply, ID of the original message + :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the messages are a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_media_group.SendMediaGroup` """ # DO NOT EDIT MANUALLY!!! @@ -1279,8 +1337,9 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, + reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1290,8 +1349,9 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, + reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendMediaGroup: """ @@ -1308,8 +1368,9 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving - :param reply_to_message_id: If the messages are a reply, ID of the original message + :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the messages are a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_media_group.SendMediaGroup` """ # DO NOT EDIT MANUALLY!!! @@ -1323,8 +1384,9 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, + reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1338,11 +1400,12 @@ class ChatJoinRequest(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendPhoto: """ @@ -1363,9 +1426,10 @@ class ChatJoinRequest(TelegramObject): :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` """ # DO NOT EDIT MANUALLY!!! @@ -1383,9 +1447,10 @@ class ChatJoinRequest(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1399,11 +1464,12 @@ class ChatJoinRequest(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendPhoto: """ @@ -1424,9 +1490,10 @@ class ChatJoinRequest(TelegramObject): :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` """ # DO NOT EDIT MANUALLY!!! @@ -1444,9 +1511,10 @@ class ChatJoinRequest(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1467,11 +1535,12 @@ class ChatJoinRequest(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendPoll: """ @@ -1499,9 +1568,10 @@ class ChatJoinRequest(TelegramObject): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` """ # DO NOT EDIT MANUALLY!!! @@ -1526,9 +1596,10 @@ class ChatJoinRequest(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1549,11 +1620,12 @@ class ChatJoinRequest(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendPoll: """ @@ -1581,9 +1653,10 @@ class ChatJoinRequest(TelegramObject): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` """ # DO NOT EDIT MANUALLY!!! @@ -1608,9 +1681,10 @@ class ChatJoinRequest(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1620,11 +1694,12 @@ class ChatJoinRequest(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendDice: """ @@ -1641,9 +1716,10 @@ class ChatJoinRequest(TelegramObject): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_dice.SendDice` """ # DO NOT EDIT MANUALLY!!! @@ -1657,9 +1733,10 @@ class ChatJoinRequest(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1669,11 +1746,12 @@ class ChatJoinRequest(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendDice: """ @@ -1690,9 +1768,10 @@ class ChatJoinRequest(TelegramObject): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_dice.SendDice` """ # DO NOT EDIT MANUALLY!!! @@ -1706,9 +1785,10 @@ class ChatJoinRequest(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1719,11 +1799,12 @@ class ChatJoinRequest(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendSticker: """ @@ -1741,9 +1822,10 @@ class ChatJoinRequest(TelegramObject): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` """ # DO NOT EDIT MANUALLY!!! @@ -1758,9 +1840,10 @@ class ChatJoinRequest(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1771,11 +1854,12 @@ class ChatJoinRequest(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendSticker: """ @@ -1793,9 +1877,10 @@ class ChatJoinRequest(TelegramObject): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` """ # DO NOT EDIT MANUALLY!!! @@ -1810,9 +1895,10 @@ class ChatJoinRequest(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1829,11 +1915,12 @@ class ChatJoinRequest(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVenue: """ @@ -1857,9 +1944,10 @@ class ChatJoinRequest(TelegramObject): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` """ # DO NOT EDIT MANUALLY!!! @@ -1880,9 +1968,10 @@ class ChatJoinRequest(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1899,11 +1988,12 @@ class ChatJoinRequest(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVenue: """ @@ -1927,9 +2017,10 @@ class ChatJoinRequest(TelegramObject): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` """ # DO NOT EDIT MANUALLY!!! @@ -1950,9 +2041,10 @@ class ChatJoinRequest(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1971,11 +2063,12 @@ class ChatJoinRequest(TelegramObject): supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVideo: """ @@ -2001,9 +2094,10 @@ class ChatJoinRequest(TelegramObject): :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video.SendVideo` """ # DO NOT EDIT MANUALLY!!! @@ -2026,9 +2120,10 @@ class ChatJoinRequest(TelegramObject): supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2047,11 +2142,12 @@ class ChatJoinRequest(TelegramObject): supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVideo: """ @@ -2077,9 +2173,10 @@ class ChatJoinRequest(TelegramObject): :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video.SendVideo` """ # DO NOT EDIT MANUALLY!!! @@ -2102,9 +2199,10 @@ class ChatJoinRequest(TelegramObject): supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2117,11 +2215,12 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVideoNote: """ @@ -2141,9 +2240,10 @@ class ChatJoinRequest(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` """ # DO NOT EDIT MANUALLY!!! @@ -2160,9 +2260,10 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2175,11 +2276,12 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVideoNote: """ @@ -2199,9 +2301,10 @@ class ChatJoinRequest(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` """ # DO NOT EDIT MANUALLY!!! @@ -2218,9 +2321,10 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2234,11 +2338,12 @@ class ChatJoinRequest(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVoice: """ @@ -2259,9 +2364,10 @@ class ChatJoinRequest(TelegramObject): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` """ # DO NOT EDIT MANUALLY!!! @@ -2279,9 +2385,10 @@ class ChatJoinRequest(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2295,11 +2402,12 @@ class ChatJoinRequest(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVoice: """ @@ -2320,9 +2428,10 @@ class ChatJoinRequest(TelegramObject): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` """ # DO NOT EDIT MANUALLY!!! @@ -2340,8 +2449,9 @@ class ChatJoinRequest(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) diff --git a/aiogram/types/chat_member_restricted.py b/aiogram/types/chat_member_restricted.py index b27d72a2..edda75e4 100644 --- a/aiogram/types/chat_member_restricted.py +++ b/aiogram/types/chat_member_restricted.py @@ -24,7 +24,7 @@ class ChatMemberRestricted(ChatMember): is_member: bool """:code:`True`, if the user is a member of the chat at the moment of the request""" can_send_messages: bool - """:code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues""" + """:code:`True`, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues""" can_send_audios: bool """:code:`True`, if the user is allowed to send audios""" can_send_documents: bool diff --git a/aiogram/types/chat_member_updated.py b/aiogram/types/chat_member_updated.py index 1ce453ad..488b2a9c 100644 --- a/aiogram/types/chat_member_updated.py +++ b/aiogram/types/chat_member_updated.py @@ -49,9 +49,11 @@ if TYPE_CHECKING: from .input_media_photo import InputMediaPhoto from .input_media_video import InputMediaVideo from .labeled_price import LabeledPrice + from .link_preview_options import LinkPreviewOptions from .message_entity import MessageEntity from .reply_keyboard_markup import ReplyKeyboardMarkup from .reply_keyboard_remove import ReplyKeyboardRemove + from .reply_parameters import ReplyParameters from .user import User @@ -142,14 +144,16 @@ class ChatMemberUpdated(TelegramObject): message_thread_id: Optional[int] = None, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendMessage: """ @@ -166,12 +170,14 @@ class ChatMemberUpdated(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* - :param disable_web_page_preview: Disables link previews for links in this message + :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param disable_web_page_preview: Disables link previews for links in this message + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_message.SendMessage` """ # DO NOT EDIT MANUALLY!!! @@ -185,12 +191,14 @@ class ChatMemberUpdated(TelegramObject): message_thread_id=message_thread_id, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + disable_web_page_preview=disable_web_page_preview, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -208,11 +216,12 @@ class ChatMemberUpdated(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendAnimation: """ @@ -237,9 +246,10 @@ class ChatMemberUpdated(TelegramObject): :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` """ # DO NOT EDIT MANUALLY!!! @@ -261,9 +271,10 @@ class ChatMemberUpdated(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -280,11 +291,12 @@ class ChatMemberUpdated(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendAudio: """ @@ -309,9 +321,10 @@ class ChatMemberUpdated(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` """ # DO NOT EDIT MANUALLY!!! @@ -332,9 +345,10 @@ class ChatMemberUpdated(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -347,11 +361,12 @@ class ChatMemberUpdated(TelegramObject): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendContact: """ @@ -371,9 +386,10 @@ class ChatMemberUpdated(TelegramObject): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_contact.SendContact` """ # DO NOT EDIT MANUALLY!!! @@ -390,9 +406,10 @@ class ChatMemberUpdated(TelegramObject): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -407,11 +424,12 @@ class ChatMemberUpdated(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendDocument: """ @@ -433,9 +451,10 @@ class ChatMemberUpdated(TelegramObject): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_document.SendDocument` """ # DO NOT EDIT MANUALLY!!! @@ -454,9 +473,10 @@ class ChatMemberUpdated(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -466,9 +486,10 @@ class ChatMemberUpdated(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendGame: """ @@ -485,9 +506,10 @@ class ChatMemberUpdated(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_game.SendGame` """ # DO NOT EDIT MANUALLY!!! @@ -501,9 +523,10 @@ class ChatMemberUpdated(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -533,9 +556,10 @@ class ChatMemberUpdated(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendInvoice: """ @@ -572,9 +596,10 @@ class ChatMemberUpdated(TelegramObject): :param is_flexible: Pass :code:`True` if the final price depends on the shipping method :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_invoice.SendInvoice` """ # DO NOT EDIT MANUALLY!!! @@ -608,9 +633,10 @@ class ChatMemberUpdated(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -625,11 +651,12 @@ class ChatMemberUpdated(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendLocation: """ @@ -651,9 +678,10 @@ class ChatMemberUpdated(TelegramObject): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_location.SendLocation` """ # DO NOT EDIT MANUALLY!!! @@ -672,9 +700,10 @@ class ChatMemberUpdated(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -684,8 +713,9 @@ class ChatMemberUpdated(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, + reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendMediaGroup: """ @@ -702,8 +732,9 @@ class ChatMemberUpdated(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving - :param reply_to_message_id: If the messages are a reply, ID of the original message + :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the messages are a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_media_group.SendMediaGroup` """ # DO NOT EDIT MANUALLY!!! @@ -717,8 +748,9 @@ class ChatMemberUpdated(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, + reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -732,11 +764,12 @@ class ChatMemberUpdated(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendPhoto: """ @@ -757,9 +790,10 @@ class ChatMemberUpdated(TelegramObject): :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` """ # DO NOT EDIT MANUALLY!!! @@ -777,9 +811,10 @@ class ChatMemberUpdated(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -800,11 +835,12 @@ class ChatMemberUpdated(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendPoll: """ @@ -832,9 +868,10 @@ class ChatMemberUpdated(TelegramObject): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` """ # DO NOT EDIT MANUALLY!!! @@ -859,9 +896,10 @@ class ChatMemberUpdated(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -871,11 +909,12 @@ class ChatMemberUpdated(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendDice: """ @@ -892,9 +931,10 @@ class ChatMemberUpdated(TelegramObject): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_dice.SendDice` """ # DO NOT EDIT MANUALLY!!! @@ -908,9 +948,10 @@ class ChatMemberUpdated(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -921,11 +962,12 @@ class ChatMemberUpdated(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendSticker: """ @@ -943,9 +985,10 @@ class ChatMemberUpdated(TelegramObject): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` """ # DO NOT EDIT MANUALLY!!! @@ -960,9 +1003,10 @@ class ChatMemberUpdated(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -979,11 +1023,12 @@ class ChatMemberUpdated(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVenue: """ @@ -1007,9 +1052,10 @@ class ChatMemberUpdated(TelegramObject): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` """ # DO NOT EDIT MANUALLY!!! @@ -1030,9 +1076,10 @@ class ChatMemberUpdated(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1051,11 +1098,12 @@ class ChatMemberUpdated(TelegramObject): supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVideo: """ @@ -1081,9 +1129,10 @@ class ChatMemberUpdated(TelegramObject): :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video.SendVideo` """ # DO NOT EDIT MANUALLY!!! @@ -1106,9 +1155,10 @@ class ChatMemberUpdated(TelegramObject): supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1121,11 +1171,12 @@ class ChatMemberUpdated(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVideoNote: """ @@ -1145,9 +1196,10 @@ class ChatMemberUpdated(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` """ # DO NOT EDIT MANUALLY!!! @@ -1164,9 +1216,10 @@ class ChatMemberUpdated(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1180,11 +1233,12 @@ class ChatMemberUpdated(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVoice: """ @@ -1205,9 +1259,10 @@ class ChatMemberUpdated(TelegramObject): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` """ # DO NOT EDIT MANUALLY!!! @@ -1225,8 +1280,9 @@ class ChatMemberUpdated(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) diff --git a/aiogram/types/chat_permissions.py b/aiogram/types/chat_permissions.py index 671ebc26..6270cc3f 100644 --- a/aiogram/types/chat_permissions.py +++ b/aiogram/types/chat_permissions.py @@ -13,7 +13,7 @@ class ChatPermissions(MutableTelegramObject): """ can_send_messages: Optional[bool] = None - """*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, invoices, locations and venues""" + """*Optional*. :code:`True`, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues""" can_send_audios: Optional[bool] = None """*Optional*. :code:`True`, if the user is allowed to send audios""" can_send_documents: Optional[bool] = None diff --git a/aiogram/types/external_reply_info.py b/aiogram/types/external_reply_info.py new file mode 100644 index 00000000..d66f70ba --- /dev/null +++ b/aiogram/types/external_reply_info.py @@ -0,0 +1,153 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional, Union + +from .base import TelegramObject + +if TYPE_CHECKING: + from .animation import Animation + from .audio import Audio + from .chat import Chat + from .contact import Contact + from .dice import Dice + from .document import Document + from .game import Game + from .giveaway import Giveaway + from .giveaway_winners import GiveawayWinners + from .invoice import Invoice + from .link_preview_options import LinkPreviewOptions + from .location import Location + from .message_origin_channel import MessageOriginChannel + from .message_origin_chat import MessageOriginChat + from .message_origin_hidden_user import MessageOriginHiddenUser + from .message_origin_user import MessageOriginUser + from .photo_size import PhotoSize + from .poll import Poll + from .sticker import Sticker + from .story import Story + from .venue import Venue + from .video import Video + from .video_note import VideoNote + from .voice import Voice + + +class ExternalReplyInfo(TelegramObject): + """ + This object contains information about a message that is being replied to, which may come from another chat or forum topic. + + Source: https://core.telegram.org/bots/api#externalreplyinfo + """ + + origin: Union[ + MessageOriginUser, MessageOriginHiddenUser, MessageOriginChat, MessageOriginChannel + ] + """Origin of the message replied to by the given message""" + chat: Optional[Chat] = None + """*Optional*. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.""" + message_id: Optional[int] = None + """*Optional*. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.""" + link_preview_options: Optional[LinkPreviewOptions] = None + """*Optional*. Options used for link preview generation for the original message, if it is a text message""" + animation: Optional[Animation] = None + """*Optional*. Message is an animation, information about the animation""" + audio: Optional[Audio] = None + """*Optional*. Message is an audio file, information about the file""" + document: Optional[Document] = None + """*Optional*. Message is a general file, information about the file""" + photo: Optional[List[PhotoSize]] = None + """*Optional*. Message is a photo, available sizes of the photo""" + sticker: Optional[Sticker] = None + """*Optional*. Message is a sticker, information about the sticker""" + story: Optional[Story] = None + """*Optional*. Message is a forwarded story""" + video: Optional[Video] = None + """*Optional*. Message is a video, information about the video""" + video_note: Optional[VideoNote] = None + """*Optional*. Message is a `video note `_, information about the video message""" + voice: Optional[Voice] = None + """*Optional*. Message is a voice message, information about the file""" + has_media_spoiler: Optional[bool] = None + """*Optional*. :code:`True`, if the message media is covered by a spoiler animation""" + contact: Optional[Contact] = None + """*Optional*. Message is a shared contact, information about the contact""" + dice: Optional[Dice] = None + """*Optional*. Message is a dice with random value""" + game: Optional[Game] = None + """*Optional*. Message is a game, information about the game. `More about games » `_""" + giveaway: Optional[Giveaway] = None + """*Optional*. Message is a scheduled giveaway, information about the giveaway""" + giveaway_winners: Optional[GiveawayWinners] = None + """*Optional*. A giveaway with public winners was completed""" + invoice: Optional[Invoice] = None + """*Optional*. Message is an invoice for a `payment `_, information about the invoice. `More about payments » `_""" + location: Optional[Location] = None + """*Optional*. Message is a shared location, information about the location""" + poll: Optional[Poll] = None + """*Optional*. Message is a native poll, information about the poll""" + venue: Optional[Venue] = None + """*Optional*. Message is a venue, information about the venue""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + origin: Union[ + MessageOriginUser, MessageOriginHiddenUser, MessageOriginChat, MessageOriginChannel + ], + chat: Optional[Chat] = None, + message_id: Optional[int] = None, + link_preview_options: Optional[LinkPreviewOptions] = None, + animation: Optional[Animation] = None, + audio: Optional[Audio] = None, + document: Optional[Document] = None, + photo: Optional[List[PhotoSize]] = None, + sticker: Optional[Sticker] = None, + story: Optional[Story] = None, + video: Optional[Video] = None, + video_note: Optional[VideoNote] = None, + voice: Optional[Voice] = None, + has_media_spoiler: Optional[bool] = None, + contact: Optional[Contact] = None, + dice: Optional[Dice] = None, + game: Optional[Game] = None, + giveaway: Optional[Giveaway] = None, + giveaway_winners: Optional[GiveawayWinners] = None, + invoice: Optional[Invoice] = None, + location: Optional[Location] = None, + poll: Optional[Poll] = None, + venue: Optional[Venue] = 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__( + origin=origin, + chat=chat, + message_id=message_id, + link_preview_options=link_preview_options, + animation=animation, + audio=audio, + document=document, + photo=photo, + sticker=sticker, + story=story, + video=video, + video_note=video_note, + voice=voice, + has_media_spoiler=has_media_spoiler, + contact=contact, + dice=dice, + game=game, + giveaway=giveaway, + giveaway_winners=giveaway_winners, + invoice=invoice, + location=location, + poll=poll, + venue=venue, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/giveaway.py b/aiogram/types/giveaway.py new file mode 100644 index 00000000..1fa4f508 --- /dev/null +++ b/aiogram/types/giveaway.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .chat import Chat + from .custom import DateTime + + +class Giveaway(TelegramObject): + """ + This object represents a message about a scheduled giveaway. + + Source: https://core.telegram.org/bots/api#giveaway + """ + + chats: List[Chat] + """The list of chats which the user must join to participate in the giveaway""" + winners_selection_date: DateTime + """Point in time (Unix timestamp) when winners of the giveaway will be selected""" + winner_count: int + """The number of users which are supposed to be selected as winners of the giveaway""" + only_new_members: Optional[bool] = None + """*Optional*. :code:`True`, if only users who join the chats after the giveaway started should be eligible to win""" + has_public_winners: Optional[bool] = None + """*Optional*. :code:`True`, if the list of giveaway winners will be visible to everyone""" + prize_description: Optional[str] = None + """*Optional*. Description of additional giveaway prize""" + country_codes: Optional[List[str]] = None + """*Optional*. A list of two-letter `ISO 3166-1 alpha-2 `_ country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.""" + premium_subscription_month_count: Optional[int] = None + """*Optional*. The number of months the Telegram Premium subscription won from the giveaway will be active for""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chats: List[Chat], + winners_selection_date: DateTime, + winner_count: int, + only_new_members: Optional[bool] = None, + has_public_winners: Optional[bool] = None, + prize_description: Optional[str] = None, + country_codes: Optional[List[str]] = None, + premium_subscription_month_count: Optional[int] = 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__( + chats=chats, + winners_selection_date=winners_selection_date, + winner_count=winner_count, + only_new_members=only_new_members, + has_public_winners=has_public_winners, + prize_description=prize_description, + country_codes=country_codes, + premium_subscription_month_count=premium_subscription_month_count, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/giveaway_completed.py b/aiogram/types/giveaway_completed.py new file mode 100644 index 00000000..71d525af --- /dev/null +++ b/aiogram/types/giveaway_completed.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .message import Message + + +class GiveawayCompleted(TelegramObject): + """ + This object represents a service message about the completion of a giveaway without public winners. + + Source: https://core.telegram.org/bots/api#giveawaycompleted + """ + + winner_count: int + """Number of winners in the giveaway""" + unclaimed_prize_count: Optional[int] = None + """*Optional*. Number of undistributed prizes""" + giveaway_message: Optional[Message] = None + """*Optional*. Message with the giveaway that was completed, if it wasn't deleted""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + winner_count: int, + unclaimed_prize_count: Optional[int] = None, + giveaway_message: Optional[Message] = 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__( + winner_count=winner_count, + unclaimed_prize_count=unclaimed_prize_count, + giveaway_message=giveaway_message, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/giveaway_created.py b/aiogram/types/giveaway_created.py new file mode 100644 index 00000000..cd66d75a --- /dev/null +++ b/aiogram/types/giveaway_created.py @@ -0,0 +1,9 @@ +from .base import TelegramObject + + +class GiveawayCreated(TelegramObject): + """ + This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. + + Source: https://core.telegram.org/bots/api#giveawaycreated + """ diff --git a/aiogram/types/giveaway_winners.py b/aiogram/types/giveaway_winners.py new file mode 100644 index 00000000..41a4b5ca --- /dev/null +++ b/aiogram/types/giveaway_winners.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .chat import Chat + from .custom import DateTime + from .user import User + + +class GiveawayWinners(TelegramObject): + """ + This object represents a message about the completion of a giveaway with public winners. + + Source: https://core.telegram.org/bots/api#giveawaywinners + """ + + chat: Chat + """The chat that created the giveaway""" + giveaway_message_id: int + """Identifier of the messsage with the giveaway in the chat""" + winners_selection_date: DateTime + """Point in time (Unix timestamp) when winners of the giveaway were selected""" + winner_count: int + """Total number of winners in the giveaway""" + winners: List[User] + """List of up to 100 winners of the giveaway""" + additional_chat_count: Optional[int] = None + """*Optional*. The number of other chats the user had to join in order to be eligible for the giveaway""" + premium_subscription_month_count: Optional[int] = None + """*Optional*. The number of months the Telegram Premium subscription won from the giveaway will be active for""" + unclaimed_prize_count: Optional[int] = None + """*Optional*. Number of undistributed prizes""" + only_new_members: Optional[bool] = None + """*Optional*. :code:`True`, if only users who had joined the chats after the giveaway started were eligible to win""" + was_refunded: Optional[bool] = None + """*Optional*. :code:`True`, if the giveaway was canceled because the payment for it was refunded""" + prize_description: Optional[str] = None + """*Optional*. Description of additional giveaway prize""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chat: Chat, + giveaway_message_id: int, + winners_selection_date: DateTime, + winner_count: int, + winners: List[User], + additional_chat_count: Optional[int] = None, + premium_subscription_month_count: Optional[int] = None, + unclaimed_prize_count: Optional[int] = None, + only_new_members: Optional[bool] = None, + was_refunded: Optional[bool] = None, + prize_description: Optional[str] = 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__( + chat=chat, + giveaway_message_id=giveaway_message_id, + winners_selection_date=winners_selection_date, + winner_count=winner_count, + winners=winners, + additional_chat_count=additional_chat_count, + premium_subscription_month_count=premium_subscription_month_count, + unclaimed_prize_count=unclaimed_prize_count, + only_new_members=only_new_members, + was_refunded=was_refunded, + prize_description=prize_description, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/inaccessible_message.py b/aiogram/types/inaccessible_message.py new file mode 100644 index 00000000..6ed38fe0 --- /dev/null +++ b/aiogram/types/inaccessible_message.py @@ -0,0 +1,41 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from .maybe_inaccessible_message import MaybeInaccessibleMessage + +if TYPE_CHECKING: + from .chat import Chat + + +class InaccessibleMessage(MaybeInaccessibleMessage): + """ + This object describes a message that was deleted or is otherwise inaccessible to the bot. + + Source: https://core.telegram.org/bots/api#inaccessiblemessage + """ + + chat: Chat + """Chat the message belonged to""" + message_id: int + """Unique message identifier inside the chat""" + date: Literal[0] = 0 + """Always 0. The field can be used to differentiate regular and inaccessible messages.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chat: Chat, + message_id: int, + date: Literal[0] = 0, + **__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__(chat=chat, message_id=message_id, date=date, **__pydantic_kwargs) diff --git a/aiogram/types/input_text_message_content.py b/aiogram/types/input_text_message_content.py index 57d5acba..419159b5 100644 --- a/aiogram/types/input_text_message_content.py +++ b/aiogram/types/input_text_message_content.py @@ -2,10 +2,13 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional +from pydantic import Field + from .base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PARSE_MODE from .input_message_content import InputMessageContent if TYPE_CHECKING: + from .link_preview_options import LinkPreviewOptions from .message_entity import MessageEntity @@ -22,8 +25,15 @@ class InputTextMessageContent(InputMessageContent): """*Optional*. Mode for parsing entities in the message text. See `formatting options `_ for more details.""" entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in message text, which can be specified instead of *parse_mode*""" - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW - """*Optional*. Disables link previews for links in the sent message""" + link_preview_options: Optional[LinkPreviewOptions] = None + """*Optional*. Link preview generation options for the message""" + disable_web_page_preview: Optional[bool] = Field( + UNSET_DISABLE_WEB_PAGE_PREVIEW, json_schema_extra={"deprecated": True} + ) + """*Optional*. Disables link previews for links in the sent message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -35,6 +45,7 @@ class InputTextMessageContent(InputMessageContent): message_text: str, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, + link_preview_options: Optional[LinkPreviewOptions] = None, disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, **__pydantic_kwargs: Any, ) -> None: @@ -46,6 +57,7 @@ class InputTextMessageContent(InputMessageContent): message_text=message_text, parse_mode=parse_mode, entities=entities, + link_preview_options=link_preview_options, disable_web_page_preview=disable_web_page_preview, **__pydantic_kwargs, ) diff --git a/aiogram/types/keyboard_button.py b/aiogram/types/keyboard_button.py index 2c9e1834..ade3b008 100644 --- a/aiogram/types/keyboard_button.py +++ b/aiogram/types/keyboard_button.py @@ -2,33 +2,36 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional +from pydantic import Field + 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_user import KeyboardButtonRequestUser + from .keyboard_button_request_users import KeyboardButtonRequestUsers from .web_app_info import WebAppInfo class KeyboardButton(MutableTelegramObject): """ - This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_user*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive. + This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_users*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive. **Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*. **Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*. **Note:** *web_app* option will only work in Telegram versions released after 16 April, 2022. Older clients will display *unsupported message*. - **Note:** *request_user* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*. + **Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*. Source: https://core.telegram.org/bots/api#keyboardbutton """ text: str """Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed""" - request_user: Optional[KeyboardButtonRequestUser] = None - """*Optional.* If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only.""" + request_users: Optional[KeyboardButtonRequestUsers] = None + """*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: Optional[KeyboardButtonRequestChat] = 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_contact: Optional[bool] = None @@ -39,6 +42,13 @@ class KeyboardButton(MutableTelegramObject): """*Optional*. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.""" web_app: Optional[WebAppInfo] = None """*Optional*. If specified, the described `Web App `_ will be launched when the button is pressed. The Web App will be able to send a 'web_app_data' service message. Available in private chats only.""" + request_user: Optional[KeyboardButtonRequestUser] = Field( + None, json_schema_extra={"deprecated": True} + ) + """*Optional.* If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a 'user_shared' service message. Available in private chats only. + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -48,12 +58,13 @@ class KeyboardButton(MutableTelegramObject): __pydantic__self__, *, text: str, - request_user: Optional[KeyboardButtonRequestUser] = None, + request_users: Optional[KeyboardButtonRequestUsers] = None, request_chat: Optional[KeyboardButtonRequestChat] = None, request_contact: Optional[bool] = None, request_location: Optional[bool] = None, request_poll: Optional[KeyboardButtonPollType] = None, web_app: Optional[WebAppInfo] = None, + request_user: Optional[KeyboardButtonRequestUser] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -62,11 +73,12 @@ class KeyboardButton(MutableTelegramObject): super().__init__( text=text, - request_user=request_user, + request_users=request_users, request_chat=request_chat, request_contact=request_contact, request_location=request_location, request_poll=request_poll, web_app=web_app, + request_user=request_user, **__pydantic_kwargs, ) diff --git a/aiogram/types/keyboard_button_request_user.py b/aiogram/types/keyboard_button_request_user.py index 443f3403..ab44ab20 100644 --- a/aiogram/types/keyboard_button_request_user.py +++ b/aiogram/types/keyboard_button_request_user.py @@ -7,6 +7,9 @@ class KeyboardButtonRequestUser(TelegramObject): """ This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_ + .. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023 + Source: https://core.telegram.org/bots/api#keyboardbuttonrequestuser """ diff --git a/aiogram/types/keyboard_button_request_users.py b/aiogram/types/keyboard_button_request_users.py new file mode 100644 index 00000000..c005d153 --- /dev/null +++ b/aiogram/types/keyboard_button_request_users.py @@ -0,0 +1,45 @@ +from typing import TYPE_CHECKING, Any, Optional + +from aiogram.types import TelegramObject + + +class KeyboardButtonRequestUsers(TelegramObject): + """ + This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. `More about requesting users » `_ + + Source: https://core.telegram.org/bots/api#keyboardbuttonrequestusers + """ + + request_id: int + """Signed 32-bit identifier of the request that will be received back in the :class:`aiogram.types.users_shared.UsersShared` object. Must be unique within the message""" + user_is_bot: Optional[bool] = None + """*Optional*. Pass :code:`True` to request bots, pass :code:`False` to request regular users. If not specified, no additional restrictions are applied.""" + user_is_premium: Optional[bool] = None + """*Optional*. Pass :code:`True` to request premium users, pass :code:`False` to request non-premium users. If not specified, no additional restrictions are applied.""" + max_quantity: Optional[int] = None + """*Optional*. The maximum number of users to be selected; 1-10. Defaults to 1.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + request_id: int, + user_is_bot: Optional[bool] = None, + user_is_premium: Optional[bool] = None, + max_quantity: Optional[int] = 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, + user_is_bot=user_is_bot, + user_is_premium=user_is_premium, + max_quantity=max_quantity, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/link_preview_options.py b/aiogram/types/link_preview_options.py new file mode 100644 index 00000000..b13a1ccf --- /dev/null +++ b/aiogram/types/link_preview_options.py @@ -0,0 +1,49 @@ +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + + +class LinkPreviewOptions(TelegramObject): + """ + Describes the options used for link preview generation. + + Source: https://core.telegram.org/bots/api#linkpreviewoptions + """ + + is_disabled: Optional[bool] = None + """*Optional*. :code:`True`, if the link preview is disabled""" + url: Optional[str] = None + """*Optional*. URL to use for the link preview. If empty, then the first URL found in the message text will be used""" + prefer_small_media: Optional[bool] = None + """*Optional*. :code:`True`, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview""" + prefer_large_media: Optional[bool] = None + """*Optional*. :code:`True`, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview""" + show_above_text: Optional[bool] = None + """*Optional*. :code:`True`, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + is_disabled: Optional[bool] = None, + url: Optional[str] = None, + prefer_small_media: Optional[bool] = None, + prefer_large_media: Optional[bool] = None, + show_above_text: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + is_disabled=is_disabled, + url=url, + prefer_small_media=prefer_small_media, + prefer_large_media=prefer_large_media, + show_above_text=show_above_text, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/maybe_inaccessible_message.py b/aiogram/types/maybe_inaccessible_message.py new file mode 100644 index 00000000..fe95ced7 --- /dev/null +++ b/aiogram/types/maybe_inaccessible_message.py @@ -0,0 +1,12 @@ +from aiogram.types import TelegramObject + + +class MaybeInaccessibleMessage(TelegramObject): + """ + This object describes a message that can be inaccessible to the bot. It can be one of + + - :class:`aiogram.types.message.Message` + - :class:`aiogram.types.inaccessible_message.InaccessibleMessage` + + Source: https://core.telegram.org/bots/api#maybeinaccessiblemessage + """ diff --git a/aiogram/types/message.py b/aiogram/types/message.py index dc22f192..b02ab69d 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -16,9 +16,9 @@ from .base import ( UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PARSE_MODE, UNSET_PROTECT_CONTENT, - TelegramObject, ) from .custom import DateTime +from .maybe_inaccessible_message import MaybeInaccessibleMessage if TYPE_CHECKING: from ..methods import ( @@ -48,6 +48,7 @@ if TYPE_CHECKING: SendVideo, SendVideoNote, SendVoice, + SetMessageReaction, StopMessageLiveLocation, UnpinChatMessage, ) @@ -58,6 +59,7 @@ if TYPE_CHECKING: from .contact import Contact from .dice import Dice from .document import Document + from .external_reply_info import ExternalReplyInfo from .force_reply import ForceReply from .forum_topic_closed import ForumTopicClosed from .forum_topic_created import ForumTopicCreated @@ -66,6 +68,11 @@ if TYPE_CHECKING: from .game import Game from .general_forum_topic_hidden import GeneralForumTopicHidden from .general_forum_topic_unhidden import GeneralForumTopicUnhidden + from .giveaway import Giveaway + from .giveaway_completed import GiveawayCompleted + from .giveaway_created import GiveawayCreated + from .giveaway_winners import GiveawayWinners + from .inaccessible_message import InaccessibleMessage from .inline_keyboard_markup import InlineKeyboardMarkup from .input_file import InputFile from .input_media_animation import InputMediaAnimation @@ -75,20 +82,30 @@ if TYPE_CHECKING: from .input_media_video import InputMediaVideo from .invoice import Invoice from .labeled_price import LabeledPrice + from .link_preview_options import LinkPreviewOptions from .location import Location from .message_auto_delete_timer_changed import MessageAutoDeleteTimerChanged from .message_entity import MessageEntity + from .message_origin_channel import MessageOriginChannel + from .message_origin_chat import MessageOriginChat + from .message_origin_hidden_user import MessageOriginHiddenUser + from .message_origin_user import MessageOriginUser from .passport_data import PassportData from .photo_size import PhotoSize from .poll import Poll from .proximity_alert_triggered import ProximityAlertTriggered + from .reaction_type_custom_emoji import ReactionTypeCustomEmoji + from .reaction_type_emoji import ReactionTypeEmoji from .reply_keyboard_markup import ReplyKeyboardMarkup from .reply_keyboard_remove import ReplyKeyboardRemove + from .reply_parameters import ReplyParameters from .sticker import Sticker from .story import Story from .successful_payment import SuccessfulPayment + from .text_quote import TextQuote from .user import User from .user_shared import UserShared + from .users_shared import UsersShared from .venue import Venue from .video import Video from .video_chat_ended import VideoChatEnded @@ -101,7 +118,7 @@ if TYPE_CHECKING: from .write_access_allowed import WriteAccessAllowed -class Message(TelegramObject): +class Message(MaybeInaccessibleMessage): """ This object represents a message. @@ -111,33 +128,29 @@ class Message(TelegramObject): message_id: int """Unique message identifier inside this chat""" date: DateTime - """Date the message was sent in Unix time""" + """Date the message was sent in Unix time. It is always a positive number, representing a valid date.""" chat: Chat - """Conversation the message belongs to""" + """Chat the message belongs to""" message_thread_id: Optional[int] = None """*Optional*. Unique identifier of a message thread to which the message belongs; for supergroups only""" from_user: Optional[User] = Field(None, alias="from") """*Optional*. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.""" sender_chat: Optional[Chat] = None """*Optional*. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field *from* contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.""" - forward_from: Optional[User] = None - """*Optional*. For forwarded messages, sender of the original message""" - forward_from_chat: Optional[Chat] = None - """*Optional*. For messages forwarded from channels or from anonymous administrators, information about the original sender chat""" - forward_from_message_id: Optional[int] = None - """*Optional*. For messages forwarded from channels, identifier of the original message in the channel""" - forward_signature: Optional[str] = None - """*Optional*. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present""" - forward_sender_name: Optional[str] = None - """*Optional*. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages""" - forward_date: Optional[DateTime] = None - """*Optional*. For forwarded messages, date the original message was sent in Unix time""" + forward_origin: Optional[ + Union[MessageOriginUser, MessageOriginHiddenUser, MessageOriginChat, MessageOriginChannel] + ] = None + """*Optional*. Information about the original message for forwarded messages""" is_topic_message: Optional[bool] = None """*Optional*. :code:`True`, if the message is sent to a forum topic""" is_automatic_forward: Optional[bool] = None """*Optional*. :code:`True`, if the message is a channel post that was automatically forwarded to the connected discussion group""" reply_to_message: Optional[Message] = None - """*Optional*. For replies, the original message. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.""" + """*Optional*. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.""" + external_reply: Optional[ExternalReplyInfo] = None + """*Optional*. Information about the message that is being replied to, which may come from another chat or forum topic""" + quote: Optional[TextQuote] = None + """*Optional*. For replies that quote part of the original message, the quoted part of the message""" via_bot: Optional[User] = None """*Optional*. Bot through which the message was sent""" edit_date: Optional[int] = None @@ -152,6 +165,8 @@ class Message(TelegramObject): """*Optional*. For text messages, the actual UTF-8 text of the message""" entities: Optional[List[MessageEntity]] = None """*Optional*. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text""" + link_preview_options: Optional[LinkPreviewOptions] = None + """*Optional*. Options used for link preview generation for the message, if it is a text message and link preview options were changed""" animation: Optional[Animation] = None """*Optional*. Message is an animation, information about the animation. For backward compatibility, when this field is set, the *document* field will also be set""" audio: Optional[Audio] = None @@ -210,14 +225,14 @@ class Message(TelegramObject): """*Optional*. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.""" migrate_from_chat_id: Optional[int] = None """*Optional*. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.""" - pinned_message: Optional[Message] = None - """*Optional*. Specified message was pinned. Note that the Message object in this field will not contain further *reply_to_message* fields even if it is itself a reply.""" + pinned_message: Optional[Union[Message, InaccessibleMessage]] = None + """*Optional*. Specified message was pinned. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.""" invoice: Optional[Invoice] = None """*Optional*. Message is an invoice for a `payment `_, information about the invoice. `More about payments » `_""" successful_payment: Optional[SuccessfulPayment] = None """*Optional*. Message is a service message about a successful payment, information about the payment. `More about payments » `_""" - user_shared: Optional[UserShared] = None - """*Optional*. Service message: a user was shared with the bot""" + users_shared: Optional[UsersShared] = None + """*Optional*. Service message: users were shared with the bot""" chat_shared: Optional[ChatShared] = None """*Optional*. Service message: a chat was shared with the bot""" connected_website: Optional[str] = None @@ -240,6 +255,14 @@ class Message(TelegramObject): """*Optional*. Service message: the 'General' forum topic hidden""" general_forum_topic_unhidden: Optional[GeneralForumTopicUnhidden] = None """*Optional*. Service message: the 'General' forum topic unhidden""" + giveaway_created: Optional[GiveawayCreated] = None + """*Optional*. Service message: a scheduled giveaway was created""" + giveaway: Optional[Giveaway] = None + """*Optional*. The message is a scheduled giveaway message""" + giveaway_winners: Optional[GiveawayWinners] = None + """*Optional*. A giveaway with public winners was completed""" + giveaway_completed: Optional[GiveawayCompleted] = None + """*Optional*. Service message: a giveaway without public winners was completed""" video_chat_scheduled: Optional[VideoChatScheduled] = None """*Optional*. Service message: video chat scheduled""" video_chat_started: Optional[VideoChatStarted] = None @@ -252,6 +275,41 @@ class Message(TelegramObject): """*Optional*. Service message: data sent by a Web App""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. Inline keyboard attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons.""" + forward_date: Optional[DateTime] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For forwarded messages, date the original message was sent in Unix time + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + forward_from: Optional[User] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For forwarded messages, sender of the original message + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + forward_from_chat: Optional[Chat] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For messages forwarded from channels or from anonymous administrators, information about the original sender chat + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + forward_from_message_id: Optional[int] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For messages forwarded from channels, identifier of the original message in the channel + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + forward_sender_name: Optional[str] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + forward_signature: Optional[str] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" + user_shared: Optional[UserShared] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. Service message: a user was shared with the bot + +.. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -266,15 +324,19 @@ class Message(TelegramObject): message_thread_id: Optional[int] = None, from_user: Optional[User] = None, sender_chat: Optional[Chat] = None, - forward_from: Optional[User] = None, - forward_from_chat: Optional[Chat] = None, - forward_from_message_id: Optional[int] = None, - forward_signature: Optional[str] = None, - forward_sender_name: Optional[str] = None, - forward_date: Optional[DateTime] = None, + forward_origin: Optional[ + Union[ + MessageOriginUser, + MessageOriginHiddenUser, + MessageOriginChat, + MessageOriginChannel, + ] + ] = None, is_topic_message: Optional[bool] = None, is_automatic_forward: Optional[bool] = None, reply_to_message: Optional[Message] = None, + external_reply: Optional[ExternalReplyInfo] = None, + quote: Optional[TextQuote] = None, via_bot: Optional[User] = None, edit_date: Optional[int] = None, has_protected_content: Optional[bool] = None, @@ -282,6 +344,7 @@ class Message(TelegramObject): author_signature: Optional[str] = None, text: Optional[str] = None, entities: Optional[List[MessageEntity]] = None, + link_preview_options: Optional[LinkPreviewOptions] = None, animation: Optional[Animation] = None, audio: Optional[Audio] = None, document: Optional[Document] = None, @@ -311,10 +374,10 @@ class Message(TelegramObject): message_auto_delete_timer_changed: Optional[MessageAutoDeleteTimerChanged] = None, migrate_to_chat_id: Optional[int] = None, migrate_from_chat_id: Optional[int] = None, - pinned_message: Optional[Message] = None, + pinned_message: Optional[Union[Message, InaccessibleMessage]] = None, invoice: Optional[Invoice] = None, successful_payment: Optional[SuccessfulPayment] = None, - user_shared: Optional[UserShared] = None, + users_shared: Optional[UsersShared] = None, chat_shared: Optional[ChatShared] = None, connected_website: Optional[str] = None, write_access_allowed: Optional[WriteAccessAllowed] = None, @@ -326,12 +389,23 @@ class Message(TelegramObject): forum_topic_reopened: Optional[ForumTopicReopened] = None, general_forum_topic_hidden: Optional[GeneralForumTopicHidden] = None, general_forum_topic_unhidden: Optional[GeneralForumTopicUnhidden] = None, + giveaway_created: Optional[GiveawayCreated] = None, + giveaway: Optional[Giveaway] = None, + giveaway_winners: Optional[GiveawayWinners] = None, + giveaway_completed: Optional[GiveawayCompleted] = None, video_chat_scheduled: Optional[VideoChatScheduled] = None, video_chat_started: Optional[VideoChatStarted] = None, video_chat_ended: Optional[VideoChatEnded] = None, video_chat_participants_invited: Optional[VideoChatParticipantsInvited] = None, web_app_data: Optional[WebAppData] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + forward_date: Optional[DateTime] = None, + forward_from: Optional[User] = None, + forward_from_chat: Optional[Chat] = None, + forward_from_message_id: Optional[int] = None, + forward_sender_name: Optional[str] = None, + forward_signature: Optional[str] = None, + user_shared: Optional[UserShared] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -345,15 +419,12 @@ class Message(TelegramObject): message_thread_id=message_thread_id, from_user=from_user, sender_chat=sender_chat, - forward_from=forward_from, - forward_from_chat=forward_from_chat, - forward_from_message_id=forward_from_message_id, - forward_signature=forward_signature, - forward_sender_name=forward_sender_name, - forward_date=forward_date, + forward_origin=forward_origin, is_topic_message=is_topic_message, is_automatic_forward=is_automatic_forward, reply_to_message=reply_to_message, + external_reply=external_reply, + quote=quote, via_bot=via_bot, edit_date=edit_date, has_protected_content=has_protected_content, @@ -361,6 +432,7 @@ class Message(TelegramObject): author_signature=author_signature, text=text, entities=entities, + link_preview_options=link_preview_options, animation=animation, audio=audio, document=document, @@ -393,7 +465,7 @@ class Message(TelegramObject): pinned_message=pinned_message, invoice=invoice, successful_payment=successful_payment, - user_shared=user_shared, + users_shared=users_shared, chat_shared=chat_shared, connected_website=connected_website, write_access_allowed=write_access_allowed, @@ -405,12 +477,23 @@ class Message(TelegramObject): forum_topic_reopened=forum_topic_reopened, general_forum_topic_hidden=general_forum_topic_hidden, general_forum_topic_unhidden=general_forum_topic_unhidden, + giveaway_created=giveaway_created, + giveaway=giveaway, + giveaway_winners=giveaway_winners, + giveaway_completed=giveaway_completed, video_chat_scheduled=video_chat_scheduled, video_chat_started=video_chat_started, video_chat_ended=video_chat_ended, video_chat_participants_invited=video_chat_participants_invited, web_app_data=web_app_data, reply_markup=reply_markup, + forward_date=forward_date, + forward_from=forward_from, + forward_from_chat=forward_from_chat, + forward_from_message_id=forward_from_message_id, + forward_sender_name=forward_sender_name, + forward_signature=forward_signature, + user_shared=user_shared, **__pydantic_kwargs, ) @@ -450,6 +533,8 @@ class Message(TelegramObject): return ContentType.INVOICE if self.successful_payment: return ContentType.SUCCESSFUL_PAYMENT + if self.users_shared: + return ContentType.USERS_SHARED if self.connected_website: return ContentType.CONNECTED_WEBSITE if self.migrate_from_chat_id: @@ -488,6 +573,18 @@ class Message(TelegramObject): return ContentType.FORUM_TOPIC_CLOSED if self.forum_topic_reopened: return ContentType.FORUM_TOPIC_REOPENED + if self.general_forum_topic_hidden: + return ContentType.GENERAL_FORUM_TOPIC_HIDDEN + if self.general_forum_topic_unhidden: + return ContentType.GENERAL_FORUM_TOPIC_UNHIDDEN + if self.giveaway_created: + return ContentType.GIVEAWAY_CREATED + if self.giveaway: + return ContentType.GIVEAWAY + if self.giveaway_completed: + return ContentType.GIVEAWAY_COMPLETED + if self.giveaway_winners: + return ContentType.GIVEAWAY_WINNERS if self.video_chat_scheduled: return ContentType.VIDEO_CHAT_SCHEDULED if self.video_chat_started: @@ -504,6 +601,10 @@ class Message(TelegramObject): return ContentType.CHAT_SHARED if self.story: return ContentType.STORY + if self.has_media_spoiler: + return ContentType.HAS_MEDIA_SPOILER + if self.write_access_allowed: + return ContentType.WRITE_ACCESS_ALLOWED return ContentType.UNKNOWN @@ -533,10 +634,11 @@ class Message(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendAnimation: """ @@ -562,8 +664,9 @@ class Message(TelegramObject): :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` """ # DO NOT EDIT MANUALLY!!! @@ -590,8 +693,9 @@ class Message(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -608,11 +712,12 @@ class Message(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendAnimation: """ @@ -637,9 +742,10 @@ class Message(TelegramObject): :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_animation.SendAnimation` """ # DO NOT EDIT MANUALLY!!! @@ -665,9 +771,10 @@ class Message(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -683,10 +790,11 @@ class Message(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendAudio: """ @@ -712,8 +820,9 @@ class Message(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` """ # DO NOT EDIT MANUALLY!!! @@ -739,8 +848,9 @@ class Message(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -756,11 +866,12 @@ class Message(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendAudio: """ @@ -785,9 +896,10 @@ class Message(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_audio.SendAudio` """ # DO NOT EDIT MANUALLY!!! @@ -812,9 +924,10 @@ class Message(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -826,10 +939,11 @@ class Message(TelegramObject): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendContact: """ @@ -850,8 +964,9 @@ class Message(TelegramObject): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_contact.SendContact` """ # DO NOT EDIT MANUALLY!!! @@ -873,8 +988,9 @@ class Message(TelegramObject): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -886,11 +1002,12 @@ class Message(TelegramObject): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendContact: """ @@ -910,9 +1027,10 @@ class Message(TelegramObject): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_contact.SendContact` """ # DO NOT EDIT MANUALLY!!! @@ -933,9 +1051,10 @@ class Message(TelegramObject): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -949,10 +1068,11 @@ class Message(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendDocument: """ @@ -975,8 +1095,9 @@ class Message(TelegramObject): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_document.SendDocument` """ # DO NOT EDIT MANUALLY!!! @@ -1000,8 +1121,9 @@ class Message(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -1015,11 +1137,12 @@ class Message(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendDocument: """ @@ -1041,9 +1164,10 @@ class Message(TelegramObject): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_document.SendDocument` """ # DO NOT EDIT MANUALLY!!! @@ -1066,9 +1190,10 @@ class Message(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1077,8 +1202,9 @@ class Message(TelegramObject): game_short_name: str, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendGame: """ @@ -1096,8 +1222,9 @@ class Message(TelegramObject): :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_game.SendGame` """ # DO NOT EDIT MANUALLY!!! @@ -1116,8 +1243,9 @@ class Message(TelegramObject): game_short_name=game_short_name, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -1126,9 +1254,10 @@ class Message(TelegramObject): game_short_name: str, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendGame: """ @@ -1145,9 +1274,10 @@ class Message(TelegramObject): :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_game.SendGame` """ # DO NOT EDIT MANUALLY!!! @@ -1165,9 +1295,10 @@ class Message(TelegramObject): game_short_name=game_short_name, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1196,8 +1327,9 @@ class Message(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendInvoice: """ @@ -1235,8 +1367,9 @@ class Message(TelegramObject): :param is_flexible: Pass :code:`True` if the final price depends on the shipping method :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_invoice.SendInvoice` """ # DO NOT EDIT MANUALLY!!! @@ -1275,8 +1408,9 @@ class Message(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -1305,9 +1439,10 @@ class Message(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendInvoice: """ @@ -1344,9 +1479,10 @@ class Message(TelegramObject): :param is_flexible: Pass :code:`True` if the final price depends on the shipping method :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_invoice.SendInvoice` """ # DO NOT EDIT MANUALLY!!! @@ -1384,9 +1520,10 @@ class Message(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1400,10 +1537,11 @@ class Message(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendLocation: """ @@ -1426,8 +1564,9 @@ class Message(TelegramObject): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_location.SendLocation` """ # DO NOT EDIT MANUALLY!!! @@ -1451,8 +1590,9 @@ class Message(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -1466,11 +1606,12 @@ class Message(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendLocation: """ @@ -1492,9 +1633,10 @@ class Message(TelegramObject): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_location.SendLocation` """ # DO NOT EDIT MANUALLY!!! @@ -1517,9 +1659,10 @@ class Message(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1528,6 +1671,7 @@ class Message(TelegramObject): media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, + reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendMediaGroup: @@ -1546,6 +1690,7 @@ class Message(TelegramObject): :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving + :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_media_group.SendMediaGroup` """ @@ -1565,6 +1710,7 @@ class Message(TelegramObject): media=media, disable_notification=disable_notification, protect_content=protect_content, + reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -1574,8 +1720,9 @@ class Message(TelegramObject): media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, + reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendMediaGroup: """ @@ -1592,8 +1739,9 @@ class Message(TelegramObject): :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving - :param reply_to_message_id: If the messages are a reply, ID of the original message + :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the messages are a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_media_group.SendMediaGroup` """ # DO NOT EDIT MANUALLY!!! @@ -1611,8 +1759,9 @@ class Message(TelegramObject): media=media, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, + reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1621,13 +1770,15 @@ class Message(TelegramObject): text: str, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, **kwargs: Any, ) -> SendMessage: """ @@ -1645,11 +1796,13 @@ class Message(TelegramObject): :param text: Text of the message to be sent, 1-4096 characters after entities parsing :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* - :param disable_web_page_preview: Disables link previews for links in this message + :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param disable_web_page_preview: Disables link previews for links in this message :return: instance of method :class:`aiogram.methods.send_message.SendMessage` """ # DO NOT EDIT MANUALLY!!! @@ -1668,11 +1821,13 @@ class Message(TelegramObject): text=text, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + disable_web_page_preview=disable_web_page_preview, **kwargs, ).as_(self._bot) @@ -1681,14 +1836,16 @@ class Message(TelegramObject): text: str, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendMessage: """ @@ -1705,12 +1862,14 @@ class Message(TelegramObject): :param text: Text of the message to be sent, 1-4096 characters after entities parsing :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* - :param disable_web_page_preview: Disables link previews for links in this message + :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param disable_web_page_preview: Disables link previews for links in this message + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_message.SendMessage` """ # DO NOT EDIT MANUALLY!!! @@ -1728,12 +1887,14 @@ class Message(TelegramObject): text=text, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + disable_web_page_preview=disable_web_page_preview, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1746,10 +1907,11 @@ class Message(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendPhoto: """ @@ -1771,8 +1933,9 @@ class Message(TelegramObject): :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` """ # DO NOT EDIT MANUALLY!!! @@ -1795,8 +1958,9 @@ class Message(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -1809,11 +1973,12 @@ class Message(TelegramObject): has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendPhoto: """ @@ -1834,9 +1999,10 @@ class Message(TelegramObject): :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_photo.SendPhoto` """ # DO NOT EDIT MANUALLY!!! @@ -1858,9 +2024,10 @@ class Message(TelegramObject): has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -1880,10 +2047,11 @@ class Message(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendPoll: """ @@ -1912,8 +2080,9 @@ class Message(TelegramObject): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` """ # DO NOT EDIT MANUALLY!!! @@ -1943,8 +2112,9 @@ class Message(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -1964,11 +2134,12 @@ class Message(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendPoll: """ @@ -1996,9 +2167,10 @@ class Message(TelegramObject): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_poll.SendPoll` """ # DO NOT EDIT MANUALLY!!! @@ -2027,9 +2199,10 @@ class Message(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2038,10 +2211,11 @@ class Message(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendDice: """ @@ -2059,8 +2233,9 @@ class Message(TelegramObject): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_dice.SendDice` """ # DO NOT EDIT MANUALLY!!! @@ -2079,8 +2254,9 @@ class Message(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -2089,11 +2265,12 @@ class Message(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendDice: """ @@ -2110,9 +2287,10 @@ class Message(TelegramObject): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_dice.SendDice` """ # DO NOT EDIT MANUALLY!!! @@ -2130,9 +2308,10 @@ class Message(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2142,10 +2321,11 @@ class Message(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendSticker: """ @@ -2164,8 +2344,9 @@ class Message(TelegramObject): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` """ # DO NOT EDIT MANUALLY!!! @@ -2185,8 +2366,9 @@ class Message(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -2196,11 +2378,12 @@ class Message(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendSticker: """ @@ -2218,9 +2401,10 @@ class Message(TelegramObject): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_sticker.SendSticker` """ # DO NOT EDIT MANUALLY!!! @@ -2239,9 +2423,10 @@ class Message(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2257,10 +2442,11 @@ class Message(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendVenue: """ @@ -2285,8 +2471,9 @@ class Message(TelegramObject): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` """ # DO NOT EDIT MANUALLY!!! @@ -2312,8 +2499,9 @@ class Message(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -2329,11 +2517,12 @@ class Message(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVenue: """ @@ -2357,9 +2546,10 @@ class Message(TelegramObject): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_venue.SendVenue` """ # DO NOT EDIT MANUALLY!!! @@ -2384,9 +2574,10 @@ class Message(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2404,10 +2595,11 @@ class Message(TelegramObject): supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendVideo: """ @@ -2434,8 +2626,9 @@ class Message(TelegramObject): :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_video.SendVideo` """ # DO NOT EDIT MANUALLY!!! @@ -2463,8 +2656,9 @@ class Message(TelegramObject): supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -2482,11 +2676,12 @@ class Message(TelegramObject): supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVideo: """ @@ -2512,9 +2707,10 @@ class Message(TelegramObject): :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video.SendVideo` """ # DO NOT EDIT MANUALLY!!! @@ -2541,9 +2737,10 @@ class Message(TelegramObject): supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2555,10 +2752,11 @@ class Message(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendVideoNote: """ @@ -2579,8 +2777,9 @@ class Message(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` """ # DO NOT EDIT MANUALLY!!! @@ -2602,8 +2801,9 @@ class Message(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -2615,11 +2815,12 @@ class Message(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVideoNote: """ @@ -2639,9 +2840,10 @@ class Message(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_video_note.SendVideoNote` """ # DO NOT EDIT MANUALLY!!! @@ -2662,9 +2864,10 @@ class Message(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2677,10 +2880,11 @@ class Message(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, ) -> SendVoice: """ @@ -2702,8 +2906,9 @@ class Message(TelegramObject): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` """ # DO NOT EDIT MANUALLY!!! @@ -2726,8 +2931,9 @@ class Message(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, **kwargs, ).as_(self._bot) @@ -2740,11 +2946,12 @@ class Message(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> SendVoice: """ @@ -2765,9 +2972,10 @@ class Message(TelegramObject): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.send_voice.SendVoice` """ # DO NOT EDIT MANUALLY!!! @@ -2789,9 +2997,10 @@ class Message(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -2982,11 +3191,12 @@ class Message(TelegramObject): caption_entities: Optional[List[MessageEntity]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[bool] = UNSET_PROTECT_CONTENT, - reply_to_message_id: Optional[int] = None, - allow_sending_without_reply: Optional[bool] = None, + reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None, + allow_sending_without_reply: Optional[bool] = None, + reply_to_message_id: Optional[int] = None, **kwargs: Any, ) -> CopyMessage: """ @@ -2996,7 +3206,7 @@ class Message(TelegramObject): - :code:`from_chat_id` - :code:`message_id` - Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success. + Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success. Source: https://core.telegram.org/bots/api#copymessage @@ -3007,9 +3217,10 @@ class Message(TelegramObject): :param caption_entities: A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode* :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving - :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. + :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found + :param reply_to_message_id: If the message is a reply, ID of the original message :return: instance of method :class:`aiogram.methods.copy_message.CopyMessage` """ # DO NOT EDIT MANUALLY!!! @@ -3031,9 +3242,10 @@ class Message(TelegramObject): caption_entities=caption_entities, disable_notification=disable_notification, protect_content=protect_content, - reply_to_message_id=reply_to_message_id, - allow_sending_without_reply=allow_sending_without_reply, + reply_parameters=reply_parameters, reply_markup=reply_markup, + allow_sending_without_reply=allow_sending_without_reply, + reply_to_message_id=reply_to_message_id, **kwargs, ).as_(self._bot) @@ -3043,8 +3255,9 @@ class Message(TelegramObject): inline_message_id: Optional[str] = None, parse_mode: Optional[str] = UNSET_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, - disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, + link_preview_options: Optional[LinkPreviewOptions] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, + disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW, **kwargs: Any, ) -> EditMessageText: """ @@ -3062,8 +3275,9 @@ class Message(TelegramObject): :param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message :param parse_mode: Mode for parsing entities in the message text. See `formatting options `_ for more details. :param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode* - :param disable_web_page_preview: Disables link previews for links in this message + :param link_preview_options: Link preview generation options for the message :param reply_markup: A JSON-serialized object for an `inline keyboard `_. + :param disable_web_page_preview: Disables link previews for links in this message :return: instance of method :class:`aiogram.methods.edit_message_text.EditMessageText` """ # DO NOT EDIT MANUALLY!!! @@ -3082,8 +3296,9 @@ class Message(TelegramObject): inline_message_id=inline_message_id, parse_mode=parse_mode, entities=entities, - disable_web_page_preview=disable_web_page_preview, + link_preview_options=link_preview_options, reply_markup=reply_markup, + disable_web_page_preview=disable_web_page_preview, **kwargs, ).as_(self._bot) @@ -3102,7 +3317,7 @@ class Message(TelegramObject): - :code:`from_chat_id` - :code:`message_id` - Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned. + Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#forwardmessage @@ -3527,3 +3742,41 @@ class Message(TelegramObject): ) return f"https://t.me/{chat_value}/{self.message_id}" + + def react( + self, + reaction: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None, + is_big: Optional[bool] = None, + **kwargs: Any, + ) -> SetMessageReaction: + """ + Shortcut for method :class:`aiogram.methods.set_message_reaction.SetMessageReaction` + will automatically fill method attributes: + + - :code:`chat_id` + - :code:`message_id` + + Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setmessagereaction + + :param reaction: New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. + :param is_big: Pass :code:`True` to set the reaction with a big animation + :return: instance of method :class:`aiogram.methods.set_message_reaction.SetMessageReaction` + """ + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + + from aiogram.methods import SetMessageReaction + + assert ( + self.chat is not None + ), "This method can be used only if chat is present in the message." + + return SetMessageReaction( + chat_id=self.chat.id, + message_id=self.message_id, + reaction=reaction, + is_big=is_big, + **kwargs, + ).as_(self._bot) diff --git a/aiogram/types/message_entity.py b/aiogram/types/message_entity.py index 79ba5980..b1c08ffc 100644 --- a/aiogram/types/message_entity.py +++ b/aiogram/types/message_entity.py @@ -17,7 +17,7 @@ class MessageEntity(MutableTelegramObject): """ type: str - """Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)""" + """Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)""" offset: int """Offset in `UTF-16 code units `_ to the start of the entity""" length: int diff --git a/aiogram/types/message_origin.py b/aiogram/types/message_origin.py new file mode 100644 index 00000000..01f99771 --- /dev/null +++ b/aiogram/types/message_origin.py @@ -0,0 +1,14 @@ +from aiogram.types import TelegramObject + + +class MessageOrigin(TelegramObject): + """ + This object describes the origin of a message. It can be one of + + - :class:`aiogram.types.message_origin_user.MessageOriginUser` + - :class:`aiogram.types.message_origin_hidden_user.MessageOriginHiddenUser` + - :class:`aiogram.types.message_origin_chat.MessageOriginChat` + - :class:`aiogram.types.message_origin_channel.MessageOriginChannel` + + Source: https://core.telegram.org/bots/api#messageorigin + """ diff --git a/aiogram/types/message_origin_channel.py b/aiogram/types/message_origin_channel.py new file mode 100644 index 00000000..9decfafe --- /dev/null +++ b/aiogram/types/message_origin_channel.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from ..enums import MessageOriginType +from .custom import DateTime +from .message_origin import MessageOrigin + +if TYPE_CHECKING: + from .chat import Chat + + +class MessageOriginChannel(MessageOrigin): + """ + The message was originally sent to a channel chat. + + Source: https://core.telegram.org/bots/api#messageoriginchannel + """ + + type: Literal[MessageOriginType.CHANNEL] = MessageOriginType.CHANNEL + """Type of the message origin, always 'channel'""" + date: DateTime + """Date the message was sent originally in Unix time""" + chat: Chat + """Channel chat to which the message was originally sent""" + message_id: int + """Unique message identifier inside the chat""" + author_signature: Optional[str] = None + """*Optional*. Signature of the original post author""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[MessageOriginType.CHANNEL] = MessageOriginType.CHANNEL, + date: DateTime, + chat: Chat, + message_id: int, + author_signature: Optional[str] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + type=type, + date=date, + chat=chat, + message_id=message_id, + author_signature=author_signature, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/message_origin_chat.py b/aiogram/types/message_origin_chat.py new file mode 100644 index 00000000..b1e5fb9f --- /dev/null +++ b/aiogram/types/message_origin_chat.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from ..enums import MessageOriginType +from .custom import DateTime +from .message_origin import MessageOrigin + +if TYPE_CHECKING: + from .chat import Chat + + +class MessageOriginChat(MessageOrigin): + """ + The message was originally sent on behalf of a chat to a group chat. + + Source: https://core.telegram.org/bots/api#messageoriginchat + """ + + type: Literal[MessageOriginType.CHAT] = MessageOriginType.CHAT + """Type of the message origin, always 'chat'""" + date: DateTime + """Date the message was sent originally in Unix time""" + sender_chat: Chat + """Chat that sent the message originally""" + author_signature: Optional[str] = None + """*Optional*. For messages originally sent by an anonymous chat administrator, original message author signature""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[MessageOriginType.CHAT] = MessageOriginType.CHAT, + date: DateTime, + sender_chat: Chat, + author_signature: Optional[str] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + type=type, + date=date, + sender_chat=sender_chat, + author_signature=author_signature, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/message_origin_hidden_user.py b/aiogram/types/message_origin_hidden_user.py new file mode 100644 index 00000000..cd702f13 --- /dev/null +++ b/aiogram/types/message_origin_hidden_user.py @@ -0,0 +1,40 @@ +from typing import TYPE_CHECKING, Any, Literal + +from ..enums import MessageOriginType +from .custom import DateTime +from .message_origin import MessageOrigin + + +class MessageOriginHiddenUser(MessageOrigin): + """ + The message was originally sent by an unknown user. + + Source: https://core.telegram.org/bots/api#messageoriginhiddenuser + """ + + type: Literal[MessageOriginType.HIDDEN_USER] = MessageOriginType.HIDDEN_USER + """Type of the message origin, always 'hidden_user'""" + date: DateTime + """Date the message was sent originally in Unix time""" + sender_user_name: str + """Name of the user that sent the message originally""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[MessageOriginType.HIDDEN_USER] = MessageOriginType.HIDDEN_USER, + date: DateTime, + sender_user_name: str, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + type=type, date=date, sender_user_name=sender_user_name, **__pydantic_kwargs + ) diff --git a/aiogram/types/message_origin_user.py b/aiogram/types/message_origin_user.py new file mode 100644 index 00000000..d77ac7ad --- /dev/null +++ b/aiogram/types/message_origin_user.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from ..enums import MessageOriginType +from .custom import DateTime +from .message_origin import MessageOrigin + +if TYPE_CHECKING: + from .user import User + + +class MessageOriginUser(MessageOrigin): + """ + The message was originally sent by a known user. + + Source: https://core.telegram.org/bots/api#messageoriginuser + """ + + type: Literal[MessageOriginType.USER] = MessageOriginType.USER + """Type of the message origin, always 'user'""" + date: DateTime + """Date the message was sent originally in Unix time""" + sender_user: User + """User that sent the message originally""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[MessageOriginType.USER] = MessageOriginType.USER, + date: DateTime, + sender_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__(type=type, date=date, sender_user=sender_user, **__pydantic_kwargs) diff --git a/aiogram/types/message_reaction_count_updated.py b/aiogram/types/message_reaction_count_updated.py new file mode 100644 index 00000000..e9d0f8b5 --- /dev/null +++ b/aiogram/types/message_reaction_count_updated.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List + +from .base import TelegramObject + +if TYPE_CHECKING: + from .chat import Chat + from .custom import DateTime + from .reaction_count import ReactionCount + + +class MessageReactionCountUpdated(TelegramObject): + """ + This object represents reaction changes on a message with anonymous reactions. + + Source: https://core.telegram.org/bots/api#messagereactioncountupdated + """ + + chat: Chat + """The chat containing the message""" + message_id: int + """Unique message identifier inside the chat""" + date: DateTime + """Date of the change in Unix time""" + reactions: List[ReactionCount] + """List of reactions that are present on the message""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chat: Chat, + message_id: int, + date: DateTime, + reactions: List[ReactionCount], + **__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__( + chat=chat, + message_id=message_id, + date=date, + reactions=reactions, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/message_reaction_updated.py b/aiogram/types/message_reaction_updated.py new file mode 100644 index 00000000..714029e9 --- /dev/null +++ b/aiogram/types/message_reaction_updated.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional, Union + +from .base import TelegramObject + +if TYPE_CHECKING: + from .chat import Chat + from .custom import DateTime + from .reaction_type_custom_emoji import ReactionTypeCustomEmoji + from .reaction_type_emoji import ReactionTypeEmoji + from .user import User + + +class MessageReactionUpdated(TelegramObject): + """ + This object represents a change of a reaction on a message performed by a user. + + Source: https://core.telegram.org/bots/api#messagereactionupdated + """ + + chat: Chat + """The chat containing the message the user reacted to""" + message_id: int + """Unique identifier of the message inside the chat""" + date: DateTime + """Date of the change in Unix time""" + old_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]] + """Previous list of reaction types that were set by the user""" + new_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]] + """New list of reaction types that have been set by the user""" + user: Optional[User] = None + """*Optional*. The user that changed the reaction, if the user isn't anonymous""" + actor_chat: Optional[Chat] = None + """*Optional*. The chat on behalf of which the reaction was changed, if the user is anonymous""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + chat: Chat, + message_id: int, + date: DateTime, + old_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]], + new_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]], + user: Optional[User] = None, + actor_chat: Optional[Chat] = 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__( + chat=chat, + message_id=message_id, + date=date, + old_reaction=old_reaction, + new_reaction=new_reaction, + user=user, + actor_chat=actor_chat, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/passport_file.py b/aiogram/types/passport_file.py index 1e80048b..d95da61a 100644 --- a/aiogram/types/passport_file.py +++ b/aiogram/types/passport_file.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any from .base import TelegramObject +from .custom import DateTime class PassportFile(TelegramObject): @@ -18,7 +19,7 @@ class PassportFile(TelegramObject): """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" file_size: int """File size in bytes""" - file_date: int + file_date: DateTime """Unix time when the file was uploaded""" if TYPE_CHECKING: @@ -31,7 +32,7 @@ class PassportFile(TelegramObject): file_id: str, file_unique_id: str, file_size: int, - file_date: int, + file_date: DateTime, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/reaction_count.py b/aiogram/types/reaction_count.py new file mode 100644 index 00000000..6ec4794e --- /dev/null +++ b/aiogram/types/reaction_count.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Union + +from .base import TelegramObject + +if TYPE_CHECKING: + from .reaction_type_custom_emoji import ReactionTypeCustomEmoji + from .reaction_type_emoji import ReactionTypeEmoji + + +class ReactionCount(TelegramObject): + """ + Represents a reaction added to a message along with the number of times it was added. + + Source: https://core.telegram.org/bots/api#reactioncount + """ + + type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji] + """Type of the reaction""" + total_count: int + """Number of times the reaction was added""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji], + total_count: int, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(type=type, total_count=total_count, **__pydantic_kwargs) diff --git a/aiogram/types/reaction_type.py b/aiogram/types/reaction_type.py new file mode 100644 index 00000000..c7a87728 --- /dev/null +++ b/aiogram/types/reaction_type.py @@ -0,0 +1,12 @@ +from .base import TelegramObject + + +class ReactionType(TelegramObject): + """ + This object describes the type of a reaction. Currently, it can be one of + + - :class:`aiogram.types.reaction_type_emoji.ReactionTypeEmoji` + - :class:`aiogram.types.reaction_type_custom_emoji.ReactionTypeCustomEmoji` + + Source: https://core.telegram.org/bots/api#reactiontype + """ diff --git a/aiogram/types/reaction_type_custom_emoji.py b/aiogram/types/reaction_type_custom_emoji.py new file mode 100644 index 00000000..c86ec5ed --- /dev/null +++ b/aiogram/types/reaction_type_custom_emoji.py @@ -0,0 +1,34 @@ +from typing import TYPE_CHECKING, Any, Literal + +from ..enums import ReactionTypeType +from .reaction_type import ReactionType + + +class ReactionTypeCustomEmoji(ReactionType): + """ + The reaction is based on a custom emoji. + + Source: https://core.telegram.org/bots/api#reactiontypecustomemoji + """ + + type: Literal[ReactionTypeType.CUSTOM_EMOJI] = ReactionTypeType.CUSTOM_EMOJI + """Type of the reaction, always 'custom_emoji'""" + custom_emoji_id: str + """Custom emoji identifier""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[ReactionTypeType.CUSTOM_EMOJI] = ReactionTypeType.CUSTOM_EMOJI, + custom_emoji_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__(type=type, custom_emoji_id=custom_emoji_id, **__pydantic_kwargs) diff --git a/aiogram/types/reaction_type_emoji.py b/aiogram/types/reaction_type_emoji.py new file mode 100644 index 00000000..a209fe2f --- /dev/null +++ b/aiogram/types/reaction_type_emoji.py @@ -0,0 +1,34 @@ +from typing import TYPE_CHECKING, Any, Literal + +from ..enums import ReactionTypeType +from .reaction_type import ReactionType + + +class ReactionTypeEmoji(ReactionType): + """ + The reaction is based on an emoji. + + Source: https://core.telegram.org/bots/api#reactiontypeemoji + """ + + type: Literal[ReactionTypeType.EMOJI] = ReactionTypeType.EMOJI + """Type of the reaction, always 'emoji'""" + emoji: str + """Reaction emoji. Currently, it can be one of "👍", "👎", "❤", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤‍🔥", "🌚", "🌭", "💯", "🤣", "⚡", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨‍💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍", "🤗", "🫡", "🎅", "🎄", "☃", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷‍♂", "🤷", "🤷‍♀", "😡" """ + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[ReactionTypeType.EMOJI] = ReactionTypeType.EMOJI, + emoji: str, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(type=type, emoji=emoji, **__pydantic_kwargs) diff --git a/aiogram/types/reply_parameters.py b/aiogram/types/reply_parameters.py new file mode 100644 index 00000000..db2bdcbf --- /dev/null +++ b/aiogram/types/reply_parameters.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional, Union + +from .base import UNSET_PARSE_MODE, TelegramObject + +if TYPE_CHECKING: + from .message_entity import MessageEntity + + +class ReplyParameters(TelegramObject): + """ + Describes reply parameters for the message that is being sent. + + Source: https://core.telegram.org/bots/api#replyparameters + """ + + message_id: int + """Identifier of the message that will be replied to in the current chat, or in the chat *chat_id* if it is specified""" + chat_id: Optional[Union[int, str]] = None + """*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)""" + allow_sending_without_reply: Optional[bool] = None + """*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.""" + quote: Optional[str] = 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.""" + quote_parse_mode: Optional[str] = UNSET_PARSE_MODE + """*Optional*. Mode for parsing entities in the quote. See `formatting options `_ for more details.""" + quote_entities: Optional[List[MessageEntity]] = None + """*Optional*. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of *quote_parse_mode*.""" + quote_position: Optional[int] = None + """*Optional*. Position of the quote in the original message in UTF-16 code units""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + message_id: int, + chat_id: Optional[Union[int, str]] = None, + allow_sending_without_reply: Optional[bool] = None, + quote: Optional[str] = None, + quote_parse_mode: Optional[str] = UNSET_PARSE_MODE, + quote_entities: Optional[List[MessageEntity]] = None, + quote_position: Optional[int] = 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__( + message_id=message_id, + chat_id=chat_id, + allow_sending_without_reply=allow_sending_without_reply, + quote=quote, + quote_parse_mode=quote_parse_mode, + quote_entities=quote_entities, + quote_position=quote_position, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/shipping_address.py b/aiogram/types/shipping_address.py index 735e2ce3..a8293cd2 100644 --- a/aiogram/types/shipping_address.py +++ b/aiogram/types/shipping_address.py @@ -13,7 +13,7 @@ class ShippingAddress(TelegramObject): """ country_code: str - """Two-letter ISO 3166-1 alpha-2 country code""" + """Two-letter `ISO 3166-1 alpha-2 `_ country code""" state: str """State, if applicable""" city: str diff --git a/aiogram/types/text_quote.py b/aiogram/types/text_quote.py new file mode 100644 index 00000000..a882ccf6 --- /dev/null +++ b/aiogram/types/text_quote.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .message_entity import MessageEntity + + +class TextQuote(TelegramObject): + """ + This object contains information about the quoted part of a message that is replied to by the given message. + + Source: https://core.telegram.org/bots/api#textquote + """ + + text: str + """Text of the quoted part of a message that is replied to by the given message""" + position: int + """Approximate quote position in the original message in UTF-16 code units as specified by the sender""" + entities: Optional[List[MessageEntity]] = None + """*Optional*. Special entities that appear in the quote. Currently, only *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities are kept in quotes.""" + is_manual: Optional[bool] = None + """*Optional*. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + text: str, + position: int, + entities: Optional[List[MessageEntity]] = None, + is_manual: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + text=text, + position=position, + entities=entities, + is_manual=is_manual, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/update.py b/aiogram/types/update.py index aed68270..f21f4989 100644 --- a/aiogram/types/update.py +++ b/aiogram/types/update.py @@ -7,11 +7,15 @@ from .base import TelegramObject if TYPE_CHECKING: from .callback_query import CallbackQuery + from .chat_boost_removed import ChatBoostRemoved + from .chat_boost_updated import ChatBoostUpdated from .chat_join_request import ChatJoinRequest from .chat_member_updated import ChatMemberUpdated from .chosen_inline_result import ChosenInlineResult from .inline_query import InlineQuery from .message import Message + from .message_reaction_count_updated import MessageReactionCountUpdated + from .message_reaction_updated import MessageReactionUpdated from .poll import Poll from .poll_answer import PollAnswer from .pre_checkout_query import PreCheckoutQuery @@ -37,6 +41,10 @@ class Update(TelegramObject): """*Optional*. New incoming channel post of any kind - text, photo, sticker, etc.""" edited_channel_post: Optional[Message] = None """*Optional*. New version of a channel post that is known to the bot and was edited""" + message_reaction: Optional[MessageReactionUpdated] = None + """*Optional*. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify :code:`"message_reaction"` in the list of *allowed_updates* to receive these updates. The update isn't received for reactions set by bots.""" + message_reaction_count: Optional[MessageReactionCountUpdated] = None + """*Optional*. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify :code:`"message_reaction_count"` in the list of *allowed_updates* to receive these updates.""" inline_query: Optional[InlineQuery] = None """*Optional*. New incoming `inline `_ query""" chosen_inline_result: Optional[ChosenInlineResult] = None @@ -57,6 +65,10 @@ class Update(TelegramObject): """*Optional*. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify :code:`"chat_member"` in the list of *allowed_updates* to receive these updates.""" chat_join_request: Optional[ChatJoinRequest] = None """*Optional*. A request to join the chat has been sent. The bot must have the *can_invite_users* administrator right in the chat to receive these updates.""" + chat_boost: Optional[ChatBoostUpdated] = None + """*Optional*. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.""" + removed_chat_boost: Optional[ChatBoostRemoved] = None + """*Optional*. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -70,6 +82,8 @@ class Update(TelegramObject): edited_message: Optional[Message] = None, channel_post: Optional[Message] = None, edited_channel_post: Optional[Message] = None, + message_reaction: Optional[MessageReactionUpdated] = None, + message_reaction_count: Optional[MessageReactionCountUpdated] = None, inline_query: Optional[InlineQuery] = None, chosen_inline_result: Optional[ChosenInlineResult] = None, callback_query: Optional[CallbackQuery] = None, @@ -80,6 +94,8 @@ class Update(TelegramObject): my_chat_member: Optional[ChatMemberUpdated] = None, chat_member: Optional[ChatMemberUpdated] = None, chat_join_request: Optional[ChatJoinRequest] = None, + chat_boost: Optional[ChatBoostUpdated] = None, + removed_chat_boost: Optional[ChatBoostRemoved] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -92,6 +108,8 @@ class Update(TelegramObject): edited_message=edited_message, channel_post=channel_post, edited_channel_post=edited_channel_post, + message_reaction=message_reaction, + message_reaction_count=message_reaction_count, inline_query=inline_query, chosen_inline_result=chosen_inline_result, callback_query=callback_query, @@ -102,6 +120,8 @@ class Update(TelegramObject): my_chat_member=my_chat_member, chat_member=chat_member, chat_join_request=chat_join_request, + chat_boost=chat_boost, + removed_chat_boost=removed_chat_boost, **__pydantic_kwargs, ) @@ -145,6 +165,14 @@ class Update(TelegramObject): return "chat_member" if self.chat_join_request: return "chat_join_request" + if self.message_reaction: + return "message_reaction" + if self.message_reaction_count: + return "message_reaction_count" + if self.chat_boost: + return "chat_boost" + if self.removed_chat_boost: + return "removed_chat_boost" raise UpdateTypeLookupError("Update does not contain any known event type.") diff --git a/aiogram/types/user_chat_boosts.py b/aiogram/types/user_chat_boosts.py new file mode 100644 index 00000000..3da8d370 --- /dev/null +++ b/aiogram/types/user_chat_boosts.py @@ -0,0 +1,32 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, List + +from .base import TelegramObject + +if TYPE_CHECKING: + from .chat_boost import ChatBoost + + +class UserChatBoosts(TelegramObject): + """ + This object represents a list of boosts added to a chat by a user. + + Source: https://core.telegram.org/bots/api#userchatboosts + """ + + boosts: List[ChatBoost] + """The list of boosts added to the chat by the user""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, boosts: List[ChatBoost], **__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__(boosts=boosts, **__pydantic_kwargs) diff --git a/aiogram/types/user_shared.py b/aiogram/types/user_shared.py index 65305679..59d1ede1 100644 --- a/aiogram/types/user_shared.py +++ b/aiogram/types/user_shared.py @@ -7,6 +7,9 @@ class UserShared(TelegramObject): """ This object contains information about the user whose identifier was shared with the bot using a :class:`aiogram.types.keyboard_button_request_user.KeyboardButtonRequestUser` button. + .. deprecated:: API:7.0 + https://core.telegram.org/bots/api-changelog#december-29-2023 + Source: https://core.telegram.org/bots/api#usershared """ diff --git a/aiogram/types/users_shared.py b/aiogram/types/users_shared.py new file mode 100644 index 00000000..b175aaf7 --- /dev/null +++ b/aiogram/types/users_shared.py @@ -0,0 +1,29 @@ +from typing import TYPE_CHECKING, Any, List + +from aiogram.types import TelegramObject + + +class UsersShared(TelegramObject): + """ + This object contains information about the users whose identifiers were shared with the bot using a :class:`aiogram.types.keyboard_button_request_users.KeyboardButtonRequestUsers` button. + + Source: https://core.telegram.org/bots/api#usersshared + """ + + request_id: int + """Identifier of the request""" + user_ids: List[int] + """Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, request_id: int, user_ids: List[int], **__pydantic_kwargs: Any + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(request_id=request_id, user_ids=user_ids, **__pydantic_kwargs) diff --git a/aiogram/utils/formatting.py b/aiogram/utils/formatting.py index 2379418a..9aa3466e 100644 --- a/aiogram/utils/formatting.py +++ b/aiogram/utils/formatting.py @@ -431,6 +431,17 @@ class CustomEmoji(Text): super().__init__(*body, custom_emoji_id=custom_emoji_id, **params) +class BlockQuote(Text): + """ + Block quote element. + + Will be wrapped into :obj:`aiogram.types.message_entity.MessageEntity` + with type :obj:`aiogram.enums.message_entity_type.MessageEntityType.BLOCKQUOTE` + """ + + type = MessageEntityType.BLOCKQUOTE + + NODE_TYPES: Dict[Optional[str], Type[Text]] = { Text.type: Text, HashTag.type: HashTag, @@ -448,6 +459,8 @@ NODE_TYPES: Dict[Optional[str], Type[Text]] = { Pre.type: Pre, TextLink.type: TextLink, TextMention.type: TextMention, + CustomEmoji.type: CustomEmoji, + BlockQuote.type: BlockQuote, } diff --git a/aiogram/utils/markdown.py b/aiogram/utils/markdown.py index 08b14a77..52c6e1d9 100644 --- a/aiogram/utils/markdown.py +++ b/aiogram/utils/markdown.py @@ -174,6 +174,30 @@ def hlink(title: str, url: str) -> str: return html_decoration.link(value=html_decoration.quote(title), link=url) +def blockquote(*content: Any, sep: str = "\n") -> str: + """ + Make blockquote (Markdown) + + :param content: + :param sep: + :return: + """ + return markdown_decoration.blockquote( + value=markdown_decoration.quote(_join(*content, sep=sep)) + ) + + +def hblockquote(*content: Any, sep: str = "\n") -> str: + """ + Make blockquote (HTML) + + :param content: + :param sep: + :return: + """ + return html_decoration.blockquote(value=html_decoration.quote(_join(*content, sep=sep))) + + def hide_link(url: str) -> str: """ Hide URL (HTML only) diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index eaff6f2c..58d6c0f4 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -56,6 +56,7 @@ class TextDecoration(ABC): MessageEntityType.UNDERLINE, MessageEntityType.STRIKETHROUGH, MessageEntityType.SPOILER, + MessageEntityType.BLOCKQUOTE, }: return cast(str, getattr(self, entity.type)(value=text)) if entity.type == MessageEntityType.PRE: @@ -167,6 +168,10 @@ class TextDecoration(ABC): def custom_emoji(self, value: str, custom_emoji_id: str) -> str: pass + @abstractmethod + def blockquote(self, value: str) -> str: + pass + class HtmlDecoration(TextDecoration): BOLD_TAG = "b" @@ -175,6 +180,7 @@ class HtmlDecoration(TextDecoration): STRIKETHROUGH_TAG = "s" SPOILER_TAG = "tg-spoiler" EMOJI_TAG = "tg-emoji" + BLOCKQUOTE_TAG = "blockquote" def link(self, value: str, link: str) -> str: return f'{value}' @@ -209,6 +215,9 @@ class HtmlDecoration(TextDecoration): def custom_emoji(self, value: str, custom_emoji_id: str) -> str: return f'<{self.EMOJI_TAG} emoji-id="{custom_emoji_id}">{value}' + def blockquote(self, value: str) -> str: + return f"<{self.BLOCKQUOTE_TAG}>{value}" + class MarkdownDecoration(TextDecoration): MARKDOWN_QUOTE_PATTERN: Pattern[str] = re.compile(r"([_*\[\]()~`>#+\-=|{}.!\\])") @@ -246,6 +255,9 @@ class MarkdownDecoration(TextDecoration): def custom_emoji(self, value: str, custom_emoji_id: str) -> str: return self.link(value=value, link=f"tg://emoji?id={custom_emoji_id}") + def blockquote(self, value: str) -> str: + return "\n".join(f">{line}" for line in value.splitlines()) + html_decoration = HtmlDecoration() markdown_decoration = MarkdownDecoration() diff --git a/docs/api/enums/chat_boost_source_type.rst b/docs/api/enums/chat_boost_source_type.rst new file mode 100644 index 00000000..b32ab76e --- /dev/null +++ b/docs/api/enums/chat_boost_source_type.rst @@ -0,0 +1,9 @@ +################### +ChatBoostSourceType +################### + + +.. automodule:: aiogram.enums.chat_boost_source_type + :members: + :member-order: bysource + :undoc-members: True diff --git a/docs/api/enums/index.rst b/docs/api/enums/index.rst index 923319f8..a1e72320 100644 --- a/docs/api/enums/index.rst +++ b/docs/api/enums/index.rst @@ -12,6 +12,7 @@ Here is list of all available enums: bot_command_scope_type chat_action + chat_boost_source_type chat_member_status chat_type content_type @@ -23,9 +24,11 @@ Here is list of all available enums: mask_position_point menu_button_type message_entity_type + message_origin_type parse_mode passport_element_error_type poll_type + reaction_type_type sticker_format sticker_type topic_icon_color diff --git a/docs/api/enums/message_origin_type.rst b/docs/api/enums/message_origin_type.rst new file mode 100644 index 00000000..e30b3e46 --- /dev/null +++ b/docs/api/enums/message_origin_type.rst @@ -0,0 +1,9 @@ +################# +MessageOriginType +################# + + +.. automodule:: aiogram.enums.message_origin_type + :members: + :member-order: bysource + :undoc-members: True diff --git a/docs/api/enums/reaction_type_type.rst b/docs/api/enums/reaction_type_type.rst new file mode 100644 index 00000000..9135db50 --- /dev/null +++ b/docs/api/enums/reaction_type_type.rst @@ -0,0 +1,9 @@ +################ +ReactionTypeType +################ + + +.. automodule:: aiogram.enums.reaction_type_type + :members: + :member-order: bysource + :undoc-members: True diff --git a/docs/api/methods/copy_messages.rst b/docs/api/methods/copy_messages.rst new file mode 100644 index 00000000..ad4fd527 --- /dev/null +++ b/docs/api/methods/copy_messages.rst @@ -0,0 +1,45 @@ +############ +copyMessages +############ + +Returns: :obj:`List[MessageId]` + +.. automodule:: aiogram.methods.copy_messages + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: List[MessageId] = await bot.copy_messages(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.copy_messages import CopyMessages` +- alias: :code:`from aiogram.methods import CopyMessages` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: List[MessageId] = await bot(CopyMessages(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return CopyMessages(...) diff --git a/docs/api/methods/delete_messages.rst b/docs/api/methods/delete_messages.rst new file mode 100644 index 00000000..e61cf392 --- /dev/null +++ b/docs/api/methods/delete_messages.rst @@ -0,0 +1,45 @@ +############## +deleteMessages +############## + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.delete_messages + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.delete_messages(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.delete_messages import DeleteMessages` +- alias: :code:`from aiogram.methods import DeleteMessages` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(DeleteMessages(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return DeleteMessages(...) diff --git a/docs/api/methods/forward_messages.rst b/docs/api/methods/forward_messages.rst new file mode 100644 index 00000000..b1eb4dde --- /dev/null +++ b/docs/api/methods/forward_messages.rst @@ -0,0 +1,45 @@ +############### +forwardMessages +############### + +Returns: :obj:`List[MessageId]` + +.. automodule:: aiogram.methods.forward_messages + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: List[MessageId] = await bot.forward_messages(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.forward_messages import ForwardMessages` +- alias: :code:`from aiogram.methods import ForwardMessages` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: List[MessageId] = await bot(ForwardMessages(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return ForwardMessages(...) diff --git a/docs/api/methods/get_user_chat_boosts.rst b/docs/api/methods/get_user_chat_boosts.rst new file mode 100644 index 00000000..ce2cd4ba --- /dev/null +++ b/docs/api/methods/get_user_chat_boosts.rst @@ -0,0 +1,38 @@ +################# +getUserChatBoosts +################# + +Returns: :obj:`UserChatBoosts` + +.. automodule:: aiogram.methods.get_user_chat_boosts + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: UserChatBoosts = await bot.get_user_chat_boosts(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.get_user_chat_boosts import GetUserChatBoosts` +- alias: :code:`from aiogram.methods import GetUserChatBoosts` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: UserChatBoosts = await bot(GetUserChatBoosts(...)) diff --git a/docs/api/methods/index.rst b/docs/api/methods/index.rst index f8ab38ff..1258e783 100644 --- a/docs/api/methods/index.rst +++ b/docs/api/methods/index.rst @@ -41,6 +41,7 @@ Available methods close_forum_topic close_general_forum_topic copy_message + copy_messages create_chat_invite_link create_forum_topic decline_chat_join_request @@ -53,6 +54,7 @@ Available methods edit_general_forum_topic export_chat_invite_link forward_message + forward_messages get_chat get_chat_administrators get_chat_member @@ -66,6 +68,7 @@ Available methods get_my_description get_my_name get_my_short_description + get_user_chat_boosts get_user_profile_photos hide_general_forum_topic leave_chat @@ -98,6 +101,7 @@ Available methods set_chat_photo set_chat_sticker_set set_chat_title + set_message_reaction set_my_commands set_my_default_administrator_rights set_my_description @@ -118,6 +122,7 @@ Updating messages :maxdepth: 1 delete_message + delete_messages edit_message_caption edit_message_live_location edit_message_media diff --git a/docs/api/methods/set_message_reaction.rst b/docs/api/methods/set_message_reaction.rst new file mode 100644 index 00000000..88a60445 --- /dev/null +++ b/docs/api/methods/set_message_reaction.rst @@ -0,0 +1,51 @@ +################## +setMessageReaction +################## + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.set_message_reaction + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.set_message_reaction(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.set_message_reaction import SetMessageReaction` +- alias: :code:`from aiogram.methods import SetMessageReaction` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(SetMessageReaction(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return SetMessageReaction(...) + + +As shortcut from received object +-------------------------------- + +- :meth:`aiogram.types.message.Message.react` diff --git a/docs/api/types/chat_boost.rst b/docs/api/types/chat_boost.rst new file mode 100644 index 00000000..be3a4c07 --- /dev/null +++ b/docs/api/types/chat_boost.rst @@ -0,0 +1,10 @@ +######### +ChatBoost +######### + + +.. automodule:: aiogram.types.chat_boost + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_boost_added.rst b/docs/api/types/chat_boost_added.rst new file mode 100644 index 00000000..a62a05f8 --- /dev/null +++ b/docs/api/types/chat_boost_added.rst @@ -0,0 +1,10 @@ +############## +ChatBoostAdded +############## + + +.. automodule:: aiogram.types.chat_boost_added + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_boost_removed.rst b/docs/api/types/chat_boost_removed.rst new file mode 100644 index 00000000..b3b1d70f --- /dev/null +++ b/docs/api/types/chat_boost_removed.rst @@ -0,0 +1,10 @@ +################ +ChatBoostRemoved +################ + + +.. automodule:: aiogram.types.chat_boost_removed + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_boost_source.rst b/docs/api/types/chat_boost_source.rst new file mode 100644 index 00000000..cb5ca355 --- /dev/null +++ b/docs/api/types/chat_boost_source.rst @@ -0,0 +1,10 @@ +############### +ChatBoostSource +############### + + +.. automodule:: aiogram.types.chat_boost_source + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_boost_source_gift_code.rst b/docs/api/types/chat_boost_source_gift_code.rst new file mode 100644 index 00000000..f79c99aa --- /dev/null +++ b/docs/api/types/chat_boost_source_gift_code.rst @@ -0,0 +1,10 @@ +####################### +ChatBoostSourceGiftCode +####################### + + +.. automodule:: aiogram.types.chat_boost_source_gift_code + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_boost_source_giveaway.rst b/docs/api/types/chat_boost_source_giveaway.rst new file mode 100644 index 00000000..549d64e0 --- /dev/null +++ b/docs/api/types/chat_boost_source_giveaway.rst @@ -0,0 +1,10 @@ +####################### +ChatBoostSourceGiveaway +####################### + + +.. automodule:: aiogram.types.chat_boost_source_giveaway + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_boost_source_premium.rst b/docs/api/types/chat_boost_source_premium.rst new file mode 100644 index 00000000..d8720a33 --- /dev/null +++ b/docs/api/types/chat_boost_source_premium.rst @@ -0,0 +1,10 @@ +###################### +ChatBoostSourcePremium +###################### + + +.. automodule:: aiogram.types.chat_boost_source_premium + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_boost_updated.rst b/docs/api/types/chat_boost_updated.rst new file mode 100644 index 00000000..14332673 --- /dev/null +++ b/docs/api/types/chat_boost_updated.rst @@ -0,0 +1,10 @@ +################ +ChatBoostUpdated +################ + + +.. automodule:: aiogram.types.chat_boost_updated + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/external_reply_info.rst b/docs/api/types/external_reply_info.rst new file mode 100644 index 00000000..86040076 --- /dev/null +++ b/docs/api/types/external_reply_info.rst @@ -0,0 +1,10 @@ +################# +ExternalReplyInfo +################# + + +.. automodule:: aiogram.types.external_reply_info + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/giveaway.rst b/docs/api/types/giveaway.rst new file mode 100644 index 00000000..6b0ce93f --- /dev/null +++ b/docs/api/types/giveaway.rst @@ -0,0 +1,10 @@ +######## +Giveaway +######## + + +.. automodule:: aiogram.types.giveaway + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/giveaway_completed.rst b/docs/api/types/giveaway_completed.rst new file mode 100644 index 00000000..1733cf94 --- /dev/null +++ b/docs/api/types/giveaway_completed.rst @@ -0,0 +1,10 @@ +################# +GiveawayCompleted +################# + + +.. automodule:: aiogram.types.giveaway_completed + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/giveaway_created.rst b/docs/api/types/giveaway_created.rst new file mode 100644 index 00000000..5830708d --- /dev/null +++ b/docs/api/types/giveaway_created.rst @@ -0,0 +1,10 @@ +############### +GiveawayCreated +############### + + +.. automodule:: aiogram.types.giveaway_created + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/giveaway_winners.rst b/docs/api/types/giveaway_winners.rst new file mode 100644 index 00000000..bb6a0d0b --- /dev/null +++ b/docs/api/types/giveaway_winners.rst @@ -0,0 +1,10 @@ +############### +GiveawayWinners +############### + + +.. automodule:: aiogram.types.giveaway_winners + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/inaccessible_message.rst b/docs/api/types/inaccessible_message.rst new file mode 100644 index 00000000..d70aec55 --- /dev/null +++ b/docs/api/types/inaccessible_message.rst @@ -0,0 +1,10 @@ +################### +InaccessibleMessage +################### + + +.. automodule:: aiogram.types.inaccessible_message + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/index.rst b/docs/api/types/index.rst index be0769ec..4190293e 100644 --- a/docs/api/types/index.rst +++ b/docs/api/types/index.rst @@ -28,6 +28,13 @@ Available types callback_query chat chat_administrator_rights + chat_boost + chat_boost_removed + chat_boost_source + chat_boost_source_gift_code + chat_boost_source_giveaway + chat_boost_source_premium + chat_boost_updated chat_invite_link chat_join_request chat_location @@ -45,6 +52,7 @@ Available types contact dice document + external_reply_info file force_reply forum_topic @@ -54,6 +62,11 @@ Available types forum_topic_reopened general_forum_topic_hidden general_forum_topic_unhidden + giveaway + giveaway_completed + giveaway_created + giveaway_winners + inaccessible_message inline_keyboard_button inline_keyboard_markup input_file @@ -67,8 +80,11 @@ Available types keyboard_button_poll_type keyboard_button_request_chat keyboard_button_request_user + keyboard_button_request_users + link_preview_options location login_url + maybe_inaccessible_message menu_button menu_button_commands menu_button_default @@ -77,19 +93,34 @@ Available types message_auto_delete_timer_changed message_entity message_id + message_origin + message_origin_channel + message_origin_chat + message_origin_hidden_user + message_origin_user + message_reaction_count_updated + message_reaction_updated photo_size poll poll_answer poll_option proximity_alert_triggered + reaction_count + reaction_type + reaction_type_custom_emoji + reaction_type_emoji reply_keyboard_markup reply_keyboard_remove + reply_parameters response_parameters story switch_inline_query_chosen_chat + text_quote user + user_chat_boosts user_profile_photos user_shared + users_shared venue video video_chat_ended diff --git a/docs/api/types/keyboard_button_request_users.rst b/docs/api/types/keyboard_button_request_users.rst new file mode 100644 index 00000000..7c130394 --- /dev/null +++ b/docs/api/types/keyboard_button_request_users.rst @@ -0,0 +1,10 @@ +########################## +KeyboardButtonRequestUsers +########################## + + +.. automodule:: aiogram.types.keyboard_button_request_users + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/link_preview_options.rst b/docs/api/types/link_preview_options.rst new file mode 100644 index 00000000..636553ac --- /dev/null +++ b/docs/api/types/link_preview_options.rst @@ -0,0 +1,10 @@ +################## +LinkPreviewOptions +################## + + +.. automodule:: aiogram.types.link_preview_options + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/maybe_inaccessible_message.rst b/docs/api/types/maybe_inaccessible_message.rst new file mode 100644 index 00000000..fade915c --- /dev/null +++ b/docs/api/types/maybe_inaccessible_message.rst @@ -0,0 +1,10 @@ +######################## +MaybeInaccessibleMessage +######################## + + +.. automodule:: aiogram.types.maybe_inaccessible_message + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/message_origin.rst b/docs/api/types/message_origin.rst new file mode 100644 index 00000000..cda0f666 --- /dev/null +++ b/docs/api/types/message_origin.rst @@ -0,0 +1,10 @@ +############# +MessageOrigin +############# + + +.. automodule:: aiogram.types.message_origin + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/message_origin_channel.rst b/docs/api/types/message_origin_channel.rst new file mode 100644 index 00000000..f60cc7c0 --- /dev/null +++ b/docs/api/types/message_origin_channel.rst @@ -0,0 +1,10 @@ +#################### +MessageOriginChannel +#################### + + +.. automodule:: aiogram.types.message_origin_channel + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/message_origin_chat.rst b/docs/api/types/message_origin_chat.rst new file mode 100644 index 00000000..f084219a --- /dev/null +++ b/docs/api/types/message_origin_chat.rst @@ -0,0 +1,10 @@ +################# +MessageOriginChat +################# + + +.. automodule:: aiogram.types.message_origin_chat + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/message_origin_hidden_user.rst b/docs/api/types/message_origin_hidden_user.rst new file mode 100644 index 00000000..3a8b5291 --- /dev/null +++ b/docs/api/types/message_origin_hidden_user.rst @@ -0,0 +1,10 @@ +####################### +MessageOriginHiddenUser +####################### + + +.. automodule:: aiogram.types.message_origin_hidden_user + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/message_origin_user.rst b/docs/api/types/message_origin_user.rst new file mode 100644 index 00000000..99e1f261 --- /dev/null +++ b/docs/api/types/message_origin_user.rst @@ -0,0 +1,10 @@ +################# +MessageOriginUser +################# + + +.. automodule:: aiogram.types.message_origin_user + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/message_reaction_count_updated.rst b/docs/api/types/message_reaction_count_updated.rst new file mode 100644 index 00000000..6951609e --- /dev/null +++ b/docs/api/types/message_reaction_count_updated.rst @@ -0,0 +1,10 @@ +########################### +MessageReactionCountUpdated +########################### + + +.. automodule:: aiogram.types.message_reaction_count_updated + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/message_reaction_updated.rst b/docs/api/types/message_reaction_updated.rst new file mode 100644 index 00000000..527219c4 --- /dev/null +++ b/docs/api/types/message_reaction_updated.rst @@ -0,0 +1,10 @@ +###################### +MessageReactionUpdated +###################### + + +.. automodule:: aiogram.types.message_reaction_updated + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/reaction_count.rst b/docs/api/types/reaction_count.rst new file mode 100644 index 00000000..5d61e4ce --- /dev/null +++ b/docs/api/types/reaction_count.rst @@ -0,0 +1,10 @@ +############# +ReactionCount +############# + + +.. automodule:: aiogram.types.reaction_count + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/reaction_type.rst b/docs/api/types/reaction_type.rst new file mode 100644 index 00000000..174bc444 --- /dev/null +++ b/docs/api/types/reaction_type.rst @@ -0,0 +1,10 @@ +############ +ReactionType +############ + + +.. automodule:: aiogram.types.reaction_type + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/reaction_type_custom_emoji.rst b/docs/api/types/reaction_type_custom_emoji.rst new file mode 100644 index 00000000..184a6976 --- /dev/null +++ b/docs/api/types/reaction_type_custom_emoji.rst @@ -0,0 +1,10 @@ +####################### +ReactionTypeCustomEmoji +####################### + + +.. automodule:: aiogram.types.reaction_type_custom_emoji + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/reaction_type_emoji.rst b/docs/api/types/reaction_type_emoji.rst new file mode 100644 index 00000000..d01b5fcb --- /dev/null +++ b/docs/api/types/reaction_type_emoji.rst @@ -0,0 +1,10 @@ +################# +ReactionTypeEmoji +################# + + +.. automodule:: aiogram.types.reaction_type_emoji + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/reply_parameters.rst b/docs/api/types/reply_parameters.rst new file mode 100644 index 00000000..22c3c734 --- /dev/null +++ b/docs/api/types/reply_parameters.rst @@ -0,0 +1,10 @@ +############### +ReplyParameters +############### + + +.. automodule:: aiogram.types.reply_parameters + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/text_quote.rst b/docs/api/types/text_quote.rst new file mode 100644 index 00000000..2bf3372e --- /dev/null +++ b/docs/api/types/text_quote.rst @@ -0,0 +1,10 @@ +######### +TextQuote +######### + + +.. automodule:: aiogram.types.text_quote + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/user_chat_boosts.rst b/docs/api/types/user_chat_boosts.rst new file mode 100644 index 00000000..597c9d15 --- /dev/null +++ b/docs/api/types/user_chat_boosts.rst @@ -0,0 +1,10 @@ +############## +UserChatBoosts +############## + + +.. automodule:: aiogram.types.user_chat_boosts + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/users_shared.rst b/docs/api/types/users_shared.rst new file mode 100644 index 00000000..c9ff42a1 --- /dev/null +++ b/docs/api/types/users_shared.rst @@ -0,0 +1,10 @@ +########### +UsersShared +########### + + +.. automodule:: aiogram.types.users_shared + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/tests/test_api/test_methods/test_copy_messages.py b/tests/test_api/test_methods/test_copy_messages.py new file mode 100644 index 00000000..f24b95fb --- /dev/null +++ b/tests/test_api/test_methods/test_copy_messages.py @@ -0,0 +1,29 @@ +from random import randint + +from aiogram.methods import CopyMessages +from aiogram.types import MessageId +from tests.mocked_bot import MockedBot + + +class TestCopyMessages: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + CopyMessages, + ok=True, + result=[ + MessageId(message_id=randint(100, 200)), + MessageId(message_id=randint(300, 400)), + ], + ) + + response: list[MessageId] = await bot.copy_messages( + chat_id=randint(1000, 9999), + from_chat_id=randint(1000, 9999), + message_ids=[ + randint(1000, 4999), + randint(5000, 9999), + ], + ) + request = bot.get_request() + assert request + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_delete_messages.py b/tests/test_api/test_methods/test_delete_messages.py new file mode 100644 index 00000000..fba51ec6 --- /dev/null +++ b/tests/test_api/test_methods/test_delete_messages.py @@ -0,0 +1,19 @@ +from aiogram.methods import DeleteMessages +from tests.mocked_bot import MockedBot + + +class TestDeleteMessages: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + DeleteMessages, + ok=True, + result=True, + ) + + response: bool = await bot.delete_messages( + chat_id=42, + message_ids=[13, 77], + ) + request = bot.get_request() + assert request + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_forward_message.py b/tests/test_api/test_methods/test_forward_message.py index f04ec0f0..daa434db 100644 --- a/tests/test_api/test_methods/test_forward_message.py +++ b/tests/test_api/test_methods/test_forward_message.py @@ -20,4 +20,5 @@ class TestForwardMessage: response: Message = await bot.forward_message(chat_id=42, from_chat_id=42, message_id=42) request = bot.get_request() + assert request assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_forward_messages.py b/tests/test_api/test_methods/test_forward_messages.py new file mode 100644 index 00000000..2d431bb3 --- /dev/null +++ b/tests/test_api/test_methods/test_forward_messages.py @@ -0,0 +1,29 @@ +from random import randint + +from aiogram.methods import ForwardMessages +from aiogram.types import MessageId +from tests.mocked_bot import MockedBot + + +class TestForwardMessages: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + ForwardMessages, + ok=True, + result=[ + MessageId(message_id=randint(100, 200)), + MessageId(message_id=randint(200, 300)), + ], + ) + + response: list[MessageId] = await bot.forward_messages( + chat_id=randint(10, 50), + from_chat_id=randint(50, 99), + message_ids=[ + randint(400, 500), + randint(600, 700), + ], + ) + request = bot.get_request() + assert request + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_get_user_chat_boosts.py b/tests/test_api/test_methods/test_get_user_chat_boosts.py new file mode 100644 index 00000000..be261159 --- /dev/null +++ b/tests/test_api/test_methods/test_get_user_chat_boosts.py @@ -0,0 +1,52 @@ +from datetime import datetime, timedelta +from random import randint + +from aiogram.methods import GetUserChatBoosts +from aiogram.types import ( + ChatBoost, + ChatBoostSourceGiveaway, + ChatBoostSourcePremium, + User, + UserChatBoosts, +) +from tests.mocked_bot import MockedBot + + +class TestGetUserChatBoosts: + async def test_bot_method(self, bot: MockedBot): + now = datetime.now() + user = User( + id=randint(200, 500), + is_bot=False, + first_name="name", + ) + prepare_result = bot.add_result_for( + GetUserChatBoosts, + ok=True, + result=UserChatBoosts( + boosts=[ + ChatBoost( + boost_id="eggs", + add_date=now - timedelta(days=7), + expiration_date=now + timedelta(days=14), + source=ChatBoostSourceGiveaway( + giveaway_message_id=randint(100, 300), + ), + ), + ChatBoost( + boost_id="spam", + add_date=now - timedelta(days=3), + expiration_date=now + timedelta(days=21), + source=ChatBoostSourcePremium(user=user), + ), + ] + ), + ) + + response: UserChatBoosts = await bot.get_user_chat_boosts( + chat_id=randint(100, 200), + user_id=user.id, + ) + request = bot.get_request() + assert request + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_set_message_reaction.py b/tests/test_api/test_methods/test_set_message_reaction.py new file mode 100644 index 00000000..5bdb3cf4 --- /dev/null +++ b/tests/test_api/test_methods/test_set_message_reaction.py @@ -0,0 +1,25 @@ +from random import randint + +from aiogram.methods import SetMessageReaction +from aiogram.types import ReactionTypeCustomEmoji +from tests.mocked_bot import MockedBot + + +class TestSetMessageReaction: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + SetMessageReaction, + ok=True, + result=True, + ) + + response: bool = await bot.set_message_reaction( + chat_id=randint(200, 300), + message_id=randint(100, 200), + reaction=[ + ReactionTypeCustomEmoji(custom_emoji_id="qwerty"), + ], + ) + request = bot.get_request() + assert request + assert response == prepare_result.result diff --git a/tests/test_api/test_types/test_callback_query.py b/tests/test_api/test_types/test_callback_query.py index 3eae5a07..f3716fe1 100644 --- a/tests/test_api/test_types/test_callback_query.py +++ b/tests/test_api/test_types/test_callback_query.py @@ -1,5 +1,5 @@ from aiogram.methods import AnswerCallbackQuery -from aiogram.types import CallbackQuery, User +from aiogram.types import CallbackQuery, InaccessibleMessage, Message, User class TestCallbackQuery: @@ -17,3 +17,34 @@ class TestCallbackQuery: for key, value in kwargs.items(): assert getattr(api_method, key) == value + + def test_parse_message(self): + data = { + "id": "id", + "from": {"id": 42, "is_bot": False, "first_name": "name"}, + "message": { + "message_id": 123, + "date": 1234567890, + "chat": {"id": 42, "type": "private"}, + }, + "chat_instance": "chat", + "data": "data", + } + callback_query = CallbackQuery.model_validate(data) + assert isinstance(callback_query.message, Message) + + def test_parse_inaccessible_message(self): + data = { + "id": "id", + "from": {"id": 42, "is_bot": False, "first_name": "name"}, + "message": { + "message_id": 123, + "date": 0, + "chat": {"id": 42, "type": "private"}, + }, + "chat_instance": "chat", + "data": "data", + } + callback_query = CallbackQuery.model_validate(data) + + assert isinstance(callback_query.message, InaccessibleMessage) diff --git a/tests/test_api/test_types/test_message.py b/tests/test_api/test_types/test_message.py index 7efe6c89..457787ef 100644 --- a/tests/test_api/test_types/test_message.py +++ b/tests/test_api/test_types/test_message.py @@ -31,6 +31,7 @@ from aiogram.methods import ( SendVideo, SendVideoNote, SendVoice, + SetMessageReaction, StopMessageLiveLocation, TelegramMethod, UnpinChatMessage, @@ -50,6 +51,12 @@ from aiogram.types import ( ForumTopicEdited, ForumTopicReopened, Game, + GeneralForumTopicHidden, + GeneralForumTopicUnhidden, + Giveaway, + GiveawayCompleted, + GiveawayCreated, + GiveawayWinners, InlineKeyboardButton, InlineKeyboardMarkup, InputMediaPhoto, @@ -62,11 +69,13 @@ from aiogram.types import ( Poll, PollOption, ProximityAlertTriggered, + ReactionTypeCustomEmoji, Sticker, Story, SuccessfulPayment, User, UserShared, + UsersShared, Venue, Video, VideoChatEnded, @@ -76,6 +85,7 @@ from aiogram.types import ( VideoNote, Voice, WebAppData, + WriteAccessAllowed, ) from aiogram.types.message import ContentType, Message @@ -444,13 +454,23 @@ TEST_FORUM_TOPIC_REOPENED = Message( from_user=User(id=42, is_bot=False, first_name="Test"), forum_topic_reopened=ForumTopicReopened(), ) -TEST_USER_SHARED = Message( +TEST_MESSAGE_USER_SHARED = Message( message_id=42, date=datetime.datetime.now(), chat=Chat(id=42, type="private"), from_user=User(id=42, is_bot=False, first_name="Test"), user_shared=UserShared(request_id=42, user_id=42), ) +TEST_MESSAGE_USERS_SHARED = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=None, + users_shared=UsersShared( + request_id=0, + user_ids=[1, 2], + ), +) TEST_CHAT_SHARED = Message( message_id=42, date=datetime.datetime.now(), @@ -467,6 +487,73 @@ TEST_MESSAGE_STORY = Message( forward_signature="Test", forward_date=datetime.datetime.now(), ) + +TEST_MESSAGE_GIVEAWAY = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=None, + giveaway=Giveaway( + chats=[Chat(id=42, type="private")], + winners_selection_date=datetime.datetime.now() + datetime.timedelta(days=7), + winner_count=10, + ), +) +TEST_MESSAGE_GIVEAWAY_CREATED = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=None, + giveaway_created=GiveawayCreated(), +) +TEST_MESSAGE_GIVEAWAY_WINNERS = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=None, + giveaway_winners=GiveawayWinners( + chat=Chat(id=77, type="private"), + giveaway_message_id=123, + winners_selection_date=datetime.datetime.now(), + winner_count=1, + winners=[User(id=42, is_bot=False, first_name="Test")], + ), +) +TEST_MESSAGE_GIVEAWAY_COMPLETED = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=None, + giveaway_completed=GiveawayCompleted(winner_count=10), +) +TEST_MESSAGE_HAS_MEDIA_SPOILER = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=None, + has_media_spoiler=True, +) +TEST_MESSAGE_GENERAL_FORUM_TOPIC_HIDDEN = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=None, + general_forum_topic_hidden=GeneralForumTopicHidden(), +) +TEST_MESSAGE_GENERAL_FORUM_TOPIC_UNHIDDEN = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=None, + general_forum_topic_unhidden=GeneralForumTopicUnhidden(), +) +TEST_MESSAGE_WRITE_ACCESS_ALLOWED = Message( + message_id=42, + date=datetime.datetime.now(), + chat=Chat(id=42, type="private"), + from_user=None, + write_access_allowed=WriteAccessAllowed(), +) TEST_MESSAGE_UNKNOWN = Message( message_id=42, date=datetime.datetime.now(), @@ -474,63 +561,161 @@ TEST_MESSAGE_UNKNOWN = Message( from_user=User(id=42, is_bot=False, first_name="Test"), ) +MESSAGES_AND_CONTENT_TYPES = [ + [TEST_MESSAGE_TEXT, ContentType.TEXT], + [TEST_MESSAGE_AUDIO, ContentType.AUDIO], + [TEST_MESSAGE_ANIMATION, ContentType.ANIMATION], + [TEST_MESSAGE_DOCUMENT, ContentType.DOCUMENT], + [TEST_MESSAGE_GAME, ContentType.GAME], + [TEST_MESSAGE_PHOTO, ContentType.PHOTO], + [TEST_MESSAGE_STICKER, ContentType.STICKER], + [TEST_MESSAGE_VIDEO, ContentType.VIDEO], + [TEST_MESSAGE_VIDEO_NOTE, ContentType.VIDEO_NOTE], + [TEST_MESSAGE_VOICE, ContentType.VOICE], + [TEST_MESSAGE_CONTACT, ContentType.CONTACT], + [TEST_MESSAGE_VENUE, ContentType.VENUE], + [TEST_MESSAGE_LOCATION, ContentType.LOCATION], + [TEST_MESSAGE_NEW_CHAT_MEMBERS, ContentType.NEW_CHAT_MEMBERS], + [TEST_MESSAGE_LEFT_CHAT_MEMBER, ContentType.LEFT_CHAT_MEMBER], + [TEST_MESSAGE_INVOICE, ContentType.INVOICE], + [TEST_MESSAGE_SUCCESSFUL_PAYMENT, ContentType.SUCCESSFUL_PAYMENT], + [TEST_MESSAGE_CONNECTED_WEBSITE, ContentType.CONNECTED_WEBSITE], + [TEST_MESSAGE_MIGRATE_FROM_CHAT_ID, ContentType.MIGRATE_FROM_CHAT_ID], + [TEST_MESSAGE_MIGRATE_TO_CHAT_ID, ContentType.MIGRATE_TO_CHAT_ID], + [TEST_MESSAGE_PINNED_MESSAGE, ContentType.PINNED_MESSAGE], + [TEST_MESSAGE_NEW_CHAT_TITLE, ContentType.NEW_CHAT_TITLE], + [TEST_MESSAGE_NEW_CHAT_PHOTO, ContentType.NEW_CHAT_PHOTO], + [TEST_MESSAGE_DELETE_CHAT_PHOTO, ContentType.DELETE_CHAT_PHOTO], + [TEST_MESSAGE_GROUP_CHAT_CREATED, ContentType.GROUP_CHAT_CREATED], + [TEST_MESSAGE_SUPERGROUP_CHAT_CREATED, ContentType.SUPERGROUP_CHAT_CREATED], + [TEST_MESSAGE_CHANNEL_CHAT_CREATED, ContentType.CHANNEL_CHAT_CREATED], + [TEST_MESSAGE_PASSPORT_DATA, ContentType.PASSPORT_DATA], + [TEST_MESSAGE_PROXIMITY_ALERT_TRIGGERED, ContentType.PROXIMITY_ALERT_TRIGGERED], + [TEST_MESSAGE_POLL, ContentType.POLL], + [ + TEST_MESSAGE_MESSAGE_AUTO_DELETE_TIMER_CHANGED, + ContentType.MESSAGE_AUTO_DELETE_TIMER_CHANGED, + ], + [TEST_MESSAGE_VIDEO_CHAT_SCHEDULED, ContentType.VIDEO_CHAT_SCHEDULED], + [TEST_MESSAGE_VIDEO_CHAT_STARTED, ContentType.VIDEO_CHAT_STARTED], + [TEST_MESSAGE_VIDEO_CHAT_ENDED, ContentType.VIDEO_CHAT_ENDED], + [ + TEST_MESSAGE_VIDEO_CHAT_PARTICIPANTS_INVITED, + ContentType.VIDEO_CHAT_PARTICIPANTS_INVITED, + ], + [TEST_MESSAGE_DICE, ContentType.DICE], + [TEST_MESSAGE_WEB_APP_DATA, ContentType.WEB_APP_DATA], + [TEST_FORUM_TOPIC_CREATED, ContentType.FORUM_TOPIC_CREATED], + [TEST_FORUM_TOPIC_EDITED, ContentType.FORUM_TOPIC_EDITED], + [TEST_FORUM_TOPIC_CLOSED, ContentType.FORUM_TOPIC_CLOSED], + [TEST_FORUM_TOPIC_REOPENED, ContentType.FORUM_TOPIC_REOPENED], + [TEST_MESSAGE_USER_SHARED, ContentType.USER_SHARED], + [TEST_MESSAGE_USERS_SHARED, ContentType.USERS_SHARED], + [TEST_CHAT_SHARED, ContentType.CHAT_SHARED], + [TEST_MESSAGE_STORY, ContentType.STORY], + [TEST_MESSAGE_GIVEAWAY, ContentType.GIVEAWAY], + [TEST_MESSAGE_GIVEAWAY_CREATED, ContentType.GIVEAWAY_CREATED], + [TEST_MESSAGE_GIVEAWAY_WINNERS, ContentType.GIVEAWAY_WINNERS], + [TEST_MESSAGE_GIVEAWAY_COMPLETED, ContentType.GIVEAWAY_COMPLETED], + [TEST_MESSAGE_HAS_MEDIA_SPOILER, ContentType.HAS_MEDIA_SPOILER], + [TEST_MESSAGE_GENERAL_FORUM_TOPIC_HIDDEN, ContentType.GENERAL_FORUM_TOPIC_HIDDEN], + [TEST_MESSAGE_GENERAL_FORUM_TOPIC_UNHIDDEN, ContentType.GENERAL_FORUM_TOPIC_UNHIDDEN], + [TEST_MESSAGE_WRITE_ACCESS_ALLOWED, ContentType.WRITE_ACCESS_ALLOWED], + [TEST_MESSAGE_UNKNOWN, ContentType.UNKNOWN], +] + + +MESSAGES_AND_COPY_METHODS = [ + [TEST_MESSAGE_TEXT, SendMessage], + [TEST_MESSAGE_AUDIO, SendAudio], + [TEST_MESSAGE_ANIMATION, SendAnimation], + [TEST_MESSAGE_DOCUMENT, SendDocument], + [TEST_MESSAGE_GAME, None], + [TEST_MESSAGE_PHOTO, SendPhoto], + [TEST_MESSAGE_STICKER, SendSticker], + [TEST_MESSAGE_VIDEO, SendVideo], + [TEST_MESSAGE_VIDEO_NOTE, SendVideoNote], + [TEST_MESSAGE_VOICE, SendVoice], + [TEST_MESSAGE_CONTACT, SendContact], + [TEST_MESSAGE_VENUE, SendVenue], + [TEST_MESSAGE_LOCATION, SendLocation], + [TEST_MESSAGE_STORY, ForwardMessage], + [TEST_MESSAGE_NEW_CHAT_MEMBERS, None], + [TEST_MESSAGE_LEFT_CHAT_MEMBER, None], + [TEST_MESSAGE_INVOICE, None], + [TEST_MESSAGE_SUCCESSFUL_PAYMENT, None], + [TEST_MESSAGE_CONNECTED_WEBSITE, None], + [TEST_MESSAGE_MIGRATE_FROM_CHAT_ID, None], + [TEST_MESSAGE_MIGRATE_TO_CHAT_ID, None], + [TEST_MESSAGE_PINNED_MESSAGE, None], + [TEST_MESSAGE_NEW_CHAT_TITLE, None], + [TEST_MESSAGE_NEW_CHAT_PHOTO, None], + [TEST_MESSAGE_DELETE_CHAT_PHOTO, None], + [TEST_MESSAGE_GROUP_CHAT_CREATED, None], + [TEST_MESSAGE_SUPERGROUP_CHAT_CREATED, None], + [TEST_MESSAGE_CHANNEL_CHAT_CREATED, None], + [TEST_MESSAGE_PASSPORT_DATA, None], + [TEST_MESSAGE_PROXIMITY_ALERT_TRIGGERED, None], + [TEST_MESSAGE_POLL, SendPoll], + [TEST_MESSAGE_MESSAGE_AUTO_DELETE_TIMER_CHANGED, None], + [TEST_MESSAGE_VIDEO_CHAT_STARTED, None], + [TEST_MESSAGE_VIDEO_CHAT_ENDED, None], + [TEST_MESSAGE_VIDEO_CHAT_PARTICIPANTS_INVITED, None], + [TEST_MESSAGE_DICE, SendDice], + [TEST_MESSAGE_USER_SHARED, None], + [TEST_CHAT_SHARED, None], + [TEST_MESSAGE_GIVEAWAY_COMPLETED, None], + [TEST_MESSAGE_HAS_MEDIA_SPOILER, None], + [TEST_MESSAGE_WEB_APP_DATA, None], + [TEST_FORUM_TOPIC_CREATED, None], + [TEST_FORUM_TOPIC_EDITED, None], + [TEST_FORUM_TOPIC_CLOSED, None], + [TEST_FORUM_TOPIC_REOPENED, None], + [TEST_MESSAGE_GENERAL_FORUM_TOPIC_HIDDEN, None], + [TEST_MESSAGE_GENERAL_FORUM_TOPIC_UNHIDDEN, None], + [TEST_MESSAGE_GIVEAWAY_CREATED, None], + [TEST_MESSAGE_USERS_SHARED, None], + [TEST_MESSAGE_VIDEO_CHAT_SCHEDULED, None], + [TEST_MESSAGE_WRITE_ACCESS_ALLOWED, None], + [TEST_MESSAGE_GIVEAWAY, None], + [TEST_MESSAGE_GIVEAWAY_WINNERS, None], + [TEST_MESSAGE_UNKNOWN, None], +] + + +class TestAllMessageTypesTested: + @pytest.fixture(scope="function") + def known_content_types(self): + content_types = {t for t in ContentType} + content_types.remove(ContentType.ANY) + return content_types + + def test_for_content_type_tests(self, known_content_types): + """ + Test if all ContentType options have example messages. + + On new Bot API updates new ContentType entries are created. + TestMessage.test_content_type checks what content type is returned. + Make sure MESSAGES_AND_CONTENT_TYPES has examples + for all the ContentType entries, fail otherwise. + """ + content_types_w_example_messages = {t[1] for t in MESSAGES_AND_CONTENT_TYPES} + assert content_types_w_example_messages == known_content_types + + def test_for_copy_methods(self, known_content_types): + """ + Test if all known message types are checked for copy_message. + + Also relies on the previous test (both should be green) + """ + checked_content_types = {m[0].content_type for m in MESSAGES_AND_COPY_METHODS} + assert checked_content_types == known_content_types + class TestMessage: @pytest.mark.parametrize( "message,content_type", - [ - [TEST_MESSAGE_TEXT, ContentType.TEXT], - [TEST_MESSAGE_AUDIO, ContentType.AUDIO], - [TEST_MESSAGE_ANIMATION, ContentType.ANIMATION], - [TEST_MESSAGE_DOCUMENT, ContentType.DOCUMENT], - [TEST_MESSAGE_GAME, ContentType.GAME], - [TEST_MESSAGE_PHOTO, ContentType.PHOTO], - [TEST_MESSAGE_STICKER, ContentType.STICKER], - [TEST_MESSAGE_VIDEO, ContentType.VIDEO], - [TEST_MESSAGE_VIDEO_NOTE, ContentType.VIDEO_NOTE], - [TEST_MESSAGE_VOICE, ContentType.VOICE], - [TEST_MESSAGE_CONTACT, ContentType.CONTACT], - [TEST_MESSAGE_VENUE, ContentType.VENUE], - [TEST_MESSAGE_LOCATION, ContentType.LOCATION], - [TEST_MESSAGE_NEW_CHAT_MEMBERS, ContentType.NEW_CHAT_MEMBERS], - [TEST_MESSAGE_LEFT_CHAT_MEMBER, ContentType.LEFT_CHAT_MEMBER], - [TEST_MESSAGE_INVOICE, ContentType.INVOICE], - [TEST_MESSAGE_SUCCESSFUL_PAYMENT, ContentType.SUCCESSFUL_PAYMENT], - [TEST_MESSAGE_CONNECTED_WEBSITE, ContentType.CONNECTED_WEBSITE], - [TEST_MESSAGE_MIGRATE_FROM_CHAT_ID, ContentType.MIGRATE_FROM_CHAT_ID], - [TEST_MESSAGE_MIGRATE_TO_CHAT_ID, ContentType.MIGRATE_TO_CHAT_ID], - [TEST_MESSAGE_PINNED_MESSAGE, ContentType.PINNED_MESSAGE], - [TEST_MESSAGE_NEW_CHAT_TITLE, ContentType.NEW_CHAT_TITLE], - [TEST_MESSAGE_NEW_CHAT_PHOTO, ContentType.NEW_CHAT_PHOTO], - [TEST_MESSAGE_DELETE_CHAT_PHOTO, ContentType.DELETE_CHAT_PHOTO], - [TEST_MESSAGE_GROUP_CHAT_CREATED, ContentType.GROUP_CHAT_CREATED], - [TEST_MESSAGE_SUPERGROUP_CHAT_CREATED, ContentType.SUPERGROUP_CHAT_CREATED], - [TEST_MESSAGE_CHANNEL_CHAT_CREATED, ContentType.CHANNEL_CHAT_CREATED], - [TEST_MESSAGE_PASSPORT_DATA, ContentType.PASSPORT_DATA], - [TEST_MESSAGE_PROXIMITY_ALERT_TRIGGERED, ContentType.PROXIMITY_ALERT_TRIGGERED], - [TEST_MESSAGE_POLL, ContentType.POLL], - [ - TEST_MESSAGE_MESSAGE_AUTO_DELETE_TIMER_CHANGED, - ContentType.MESSAGE_AUTO_DELETE_TIMER_CHANGED, - ], - [TEST_MESSAGE_VIDEO_CHAT_SCHEDULED, ContentType.VIDEO_CHAT_SCHEDULED], - [TEST_MESSAGE_VIDEO_CHAT_STARTED, ContentType.VIDEO_CHAT_STARTED], - [TEST_MESSAGE_VIDEO_CHAT_ENDED, ContentType.VIDEO_CHAT_ENDED], - [ - TEST_MESSAGE_VIDEO_CHAT_PARTICIPANTS_INVITED, - ContentType.VIDEO_CHAT_PARTICIPANTS_INVITED, - ], - [TEST_MESSAGE_DICE, ContentType.DICE], - [TEST_MESSAGE_WEB_APP_DATA, ContentType.WEB_APP_DATA], - [TEST_FORUM_TOPIC_CREATED, ContentType.FORUM_TOPIC_CREATED], - [TEST_FORUM_TOPIC_EDITED, ContentType.FORUM_TOPIC_EDITED], - [TEST_FORUM_TOPIC_CLOSED, ContentType.FORUM_TOPIC_CLOSED], - [TEST_FORUM_TOPIC_REOPENED, ContentType.FORUM_TOPIC_REOPENED], - [TEST_USER_SHARED, ContentType.USER_SHARED], - [TEST_CHAT_SHARED, ContentType.CHAT_SHARED], - [TEST_MESSAGE_STORY, ContentType.STORY], - [TEST_MESSAGE_UNKNOWN, ContentType.UNKNOWN], - ], + MESSAGES_AND_CONTENT_TYPES, ) def test_content_type(self, message: Message, content_type: str): assert message.content_type == content_type @@ -637,47 +822,7 @@ class TestMessage: @pytest.mark.parametrize( "message,expected_method", - [ - [TEST_MESSAGE_TEXT, SendMessage], - [TEST_MESSAGE_AUDIO, SendAudio], - [TEST_MESSAGE_ANIMATION, SendAnimation], - [TEST_MESSAGE_DOCUMENT, SendDocument], - [TEST_MESSAGE_GAME, None], - [TEST_MESSAGE_PHOTO, SendPhoto], - [TEST_MESSAGE_STICKER, SendSticker], - [TEST_MESSAGE_VIDEO, SendVideo], - [TEST_MESSAGE_VIDEO_NOTE, SendVideoNote], - [TEST_MESSAGE_VOICE, SendVoice], - [TEST_MESSAGE_CONTACT, SendContact], - [TEST_MESSAGE_VENUE, SendVenue], - [TEST_MESSAGE_LOCATION, SendLocation], - [TEST_MESSAGE_STORY, ForwardMessage], - [TEST_MESSAGE_NEW_CHAT_MEMBERS, None], - [TEST_MESSAGE_LEFT_CHAT_MEMBER, None], - [TEST_MESSAGE_INVOICE, None], - [TEST_MESSAGE_SUCCESSFUL_PAYMENT, None], - [TEST_MESSAGE_CONNECTED_WEBSITE, None], - [TEST_MESSAGE_MIGRATE_FROM_CHAT_ID, None], - [TEST_MESSAGE_MIGRATE_TO_CHAT_ID, None], - [TEST_MESSAGE_PINNED_MESSAGE, None], - [TEST_MESSAGE_NEW_CHAT_TITLE, None], - [TEST_MESSAGE_NEW_CHAT_PHOTO, None], - [TEST_MESSAGE_DELETE_CHAT_PHOTO, None], - [TEST_MESSAGE_GROUP_CHAT_CREATED, None], - [TEST_MESSAGE_SUPERGROUP_CHAT_CREATED, None], - [TEST_MESSAGE_CHANNEL_CHAT_CREATED, None], - [TEST_MESSAGE_PASSPORT_DATA, None], - [TEST_MESSAGE_PROXIMITY_ALERT_TRIGGERED, None], - [TEST_MESSAGE_POLL, SendPoll], - [TEST_MESSAGE_MESSAGE_AUTO_DELETE_TIMER_CHANGED, None], - [TEST_MESSAGE_VIDEO_CHAT_STARTED, None], - [TEST_MESSAGE_VIDEO_CHAT_ENDED, None], - [TEST_MESSAGE_VIDEO_CHAT_PARTICIPANTS_INVITED, None], - [TEST_MESSAGE_DICE, SendDice], - [TEST_USER_SHARED, None], - [TEST_CHAT_SHARED, None], - [TEST_MESSAGE_UNKNOWN, None], - ], + MESSAGES_AND_COPY_METHODS, ) def test_send_copy( self, @@ -861,6 +1006,20 @@ class TestMessage: assert isinstance(method, UnpinChatMessage) assert method.chat_id == message.chat.id + def test_react(self): + message = Message( + message_id=777, + chat=Chat(id=-42, type="channel"), + date=datetime.datetime.now(), + ) + emoji_reaction = ReactionTypeCustomEmoji(custom_emoji_id="qwerty") + method = message.react( + reaction=[emoji_reaction], + ) + assert isinstance(method, SetMessageReaction) + assert method.chat_id == message.chat.id + assert method.reaction == [emoji_reaction] + @pytest.mark.parametrize( "text,entities,mode,expected_value", [ diff --git a/tests/test_dispatcher/test_dispatcher.py b/tests/test_dispatcher/test_dispatcher.py index b85cfc98..ccac7c1e 100644 --- a/tests/test_dispatcher/test_dispatcher.py +++ b/tests/test_dispatcher/test_dispatcher.py @@ -18,16 +18,24 @@ from aiogram.methods import GetMe, GetUpdates, SendMessage, TelegramMethod from aiogram.types import ( CallbackQuery, Chat, + ChatBoost, + ChatBoostRemoved, + ChatBoostSourceGiveaway, + ChatBoostUpdated, ChatJoinRequest, ChatMemberMember, ChatMemberUpdated, ChosenInlineResult, InlineQuery, Message, + MessageReactionCountUpdated, + MessageReactionUpdated, Poll, PollAnswer, PollOption, PreCheckoutQuery, + ReactionCount, + ReactionTypeCustomEmoji, ShippingAddress, ShippingQuery, Update, @@ -447,6 +455,76 @@ class TestDispatcher: True, True, ), + pytest.param( + "message_reaction", + Update( + update_id=42, + message_reaction=MessageReactionUpdated( + chat=Chat(id=-42, type="channel"), + message_id=12345, + user=User(id=42, is_bot=False, first_name="Test"), + date=datetime.datetime.now(), + old_reaction=[], + new_reaction=[ReactionTypeCustomEmoji(custom_emoji_id="qwerty")], + ), + ), + True, + True, + ), + pytest.param( + "message_reaction_count", + Update( + update_id=42, + message_reaction_count=MessageReactionCountUpdated( + chat=Chat(id=-42, type="channel"), + message_id=12345, + date=datetime.datetime.now(), + reactions=[ + ReactionCount( + type=ReactionTypeCustomEmoji(custom_emoji_id="qwerty"), + total_count=123, + ), + ], + ), + ), + True, + False, + ), + pytest.param( + "chat_boost", + Update( + update_id=42, + chat_boost=ChatBoostUpdated( + chat=Chat(id=-42, type="channel"), + boost=ChatBoost( + boost_id="qwerty", + add_date=datetime.datetime.now(), + expiration_date=datetime.datetime.now(), + source=ChatBoostSourceGiveaway( + giveaway_message_id=77, + ), + ), + ), + ), + True, + False, + ), + pytest.param( + "removed_chat_boost", + Update( + update_id=42, + removed_chat_boost=ChatBoostRemoved( + chat=Chat(id=-42, type="channel"), + boost_id="qwerty", + remove_date=datetime.datetime.now(), + source=ChatBoostSourceGiveaway( + giveaway_message_id=77, + ), + ), + ), + True, + False, + ), ], ) async def test_listen_update( diff --git a/tests/test_utils/test_formatting.py b/tests/test_utils/test_formatting.py index f135aca6..b39ceb32 100644 --- a/tests/test_utils/test_formatting.py +++ b/tests/test_utils/test_formatting.py @@ -268,7 +268,7 @@ class TestNode: assert ( node.as_pretty_string(indent=True) == """Strikethrough( - Text( + CustomEmoji( 'X', custom_emoji_id='42' ) diff --git a/tests/test_utils/test_markdown.py b/tests/test_utils/test_markdown.py index 815b1c5d..786cc321 100644 --- a/tests/test_utils/test_markdown.py +++ b/tests/test_utils/test_markdown.py @@ -3,8 +3,10 @@ from typing import Any, Callable, Optional, Tuple import pytest from aiogram.utils.markdown import ( + blockquote, bold, code, + hblockquote, hbold, hcode, hide_link, @@ -54,6 +56,22 @@ class TestMarkdown: None, '', ], + [blockquote, ("spam", "eggs"), " ", ">spam eggs"], + pytest.param( + blockquote, + ("spam", "eggs"), + "\n", + ">spam\n>eggs", + id="Markdown V2 blockquote multiline", + ), + [hblockquote, ("spam", "eggs"), " ", "
spam eggs
"], + pytest.param( + hblockquote, + ("spam", "eggs"), + "\n", + "
spam\neggs
", + id="HTML blockquote multiline", + ), ], ) def test_formatter( diff --git a/tests/test_utils/test_text_decorations.py b/tests/test_utils/test_text_decorations.py index 25f222f0..6a177ab3 100644 --- a/tests/test_utils/test_text_decorations.py +++ b/tests/test_utils/test_text_decorations.py @@ -66,6 +66,11 @@ class TestTextDecoration: MessageEntity(type="text_link", offset=0, length=5, url="https://aiogram.dev"), 'test', ], + [ + html_decoration, + MessageEntity(type="blockquote", offset=0, length=5), + "
test
", + ], [markdown_decoration, MessageEntity(type="bold", offset=0, length=5), "*test*"], [markdown_decoration, MessageEntity(type="italic", offset=0, length=5), "_\rtest_\r"], [markdown_decoration, MessageEntity(type="code", offset=0, length=5), "`test`"], @@ -106,6 +111,11 @@ class TestTextDecoration: ), "[test](tg://user?id=42)", ], + [ + markdown_decoration, + MessageEntity(type="blockquote", offset=0, length=5), + ">test", + ], ], ) def test_apply_single_entity(