From 2c2bd61551936f8e75adb73fdb20ad06b45dc24c Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sat, 12 Apr 2025 23:29:48 +0300 Subject: [PATCH] Added full support for the Bot API 9.0 (#1671) * Added full support for the Bot API 9.0 * Bump version --- .apiversion | 2 +- .butcher/enums/ContentType.yml | 1 + .butcher/enums/InputProfileType.yml | 11 + .butcher/enums/InputStoryContentPhotoType.yml | 11 + .butcher/enums/OwnedGiftType.yml | 11 + .butcher/enums/StoryAreaTypeType.yml | 14 + .../TransactionPartnerUserTransactionType.yml | 10 + .../methods/convertGiftToStars/entity.json | 33 + .../entity.json | 6 +- .../methods/createInvoiceLink/entity.json | 6 +- .../deleteBusinessMessages/entity.json | 33 + .butcher/methods/deleteStory/entity.json | 33 + .butcher/methods/editStory/entity.json | 73 + .../methods/getAvailableGifts/entity.json | 4 +- .../getBusinessAccountGifts/entity.json | 89 + .../getBusinessAccountStarBalance/entity.json | 25 + .../giftPremiumSubscription/entity.json | 65 + .butcher/methods/postStory/entity.json | 89 + .../methods/readBusinessMessage/entity.json | 41 + .../entity.json | 33 + .../removeChatVerification/entity.json | 4 +- .../removeUserVerification/entity.json | 4 +- .butcher/methods/sendGift/entity.json | 10 +- .butcher/methods/sendPaidMedia/entity.json | 6 +- .../methods/setBusinessAccountBio/entity.json | 33 + .../entity.json | 41 + .../setBusinessAccountName/entity.json | 41 + .../entity.json | 41 + .../setBusinessAccountUsername/entity.json | 33 + .../transferBusinessAccountStars/entity.json | 33 + .butcher/methods/transferGift/entity.json | 49 + .butcher/methods/upgradeGift/entity.json | 49 + .butcher/methods/verifyChat/entity.json | 4 +- .butcher/methods/verifyUser/entity.json | 4 +- .butcher/schema/schema.json | 2548 +++++++++++++++-- .butcher/types/AcceptedGiftTypes/entity.json | 49 + .butcher/types/BusinessBotRights/entity.json | 129 + .butcher/types/BusinessConnection/entity.json | 24 +- .butcher/types/ChatFullInfo/entity.json | 24 +- .butcher/types/Gift/entity.json | 4 +- .butcher/types/GiftInfo/entity.json | 81 + .butcher/types/Gifts/entity.json | 4 +- .butcher/types/InputProfilePhoto/entity.json | 16 + .butcher/types/InputProfilePhoto/subtypes.yml | 1 + .../InputProfilePhotoAnimated/entity.json | 41 + .../InputProfilePhotoAnimated/replace.yml | 11 + .../types/InputProfilePhotoStatic/entity.json | 33 + .../types/InputProfilePhotoStatic/replace.yml | 11 + .butcher/types/InputSticker/entity.json | 8 +- .butcher/types/InputSticker/replace.yml | 11 + .butcher/types/InputStoryContent/entity.json | 16 + .butcher/types/InputStoryContent/subtypes.yml | 1 + .../types/InputStoryContentPhoto/entity.json | 33 + .../types/InputStoryContentVideo/entity.json | 57 + .butcher/types/LocationAddress/entity.json | 49 + .butcher/types/Message/entity.json | 32 + .butcher/types/OwnedGift/entity.json | 16 + .butcher/types/OwnedGift/subtypes.yml | 1 + .butcher/types/OwnedGiftRegular/entity.json | 121 + .butcher/types/OwnedGiftUnique/entity.json | 81 + .butcher/types/OwnedGifts/entity.json | 41 + .../types/PaidMessagePriceChanged/entity.json | 25 + .butcher/types/StarAmount/entity.json | 33 + .butcher/types/StoryArea/entity.json | 33 + .butcher/types/StoryAreaPosition/entity.json | 65 + .butcher/types/StoryAreaType/entity.json | 16 + .butcher/types/StoryAreaType/subtypes.yml | 1 + .butcher/types/StoryAreaTypeLink/entity.json | 33 + .../types/StoryAreaTypeLocation/entity.json | 49 + .../entity.json | 49 + .../types/StoryAreaTypeUniqueGift/entity.json | 33 + .../types/StoryAreaTypeWeather/entity.json | 49 + .../types/TransactionPartnerUser/entity.json | 52 +- .butcher/types/UniqueGift/entity.json | 65 + .butcher/types/UniqueGiftBackdrop/entity.json | 41 + .../UniqueGiftBackdropColors/entity.json | 49 + .butcher/types/UniqueGiftInfo/entity.json | 49 + .butcher/types/UniqueGiftModel/entity.json | 41 + .butcher/types/UniqueGiftSymbol/entity.json | 41 + CHANGES/1671.feature.rst | 107 + README.rst | 2 +- aiogram/__meta__.py | 2 +- aiogram/client/bot.py | 537 +++- aiogram/enums/__init__.py | 12 + aiogram/enums/content_type.py | 3 + aiogram/enums/input_profile_photo_type.py | 12 + aiogram/enums/input_story_content_type.py | 12 + aiogram/enums/owned_gift_type.py | 12 + aiogram/enums/story_area_type_type.py | 15 + ...tion_partner_user_transaction_type_enum.py | 15 + aiogram/methods/__init__.py | 36 + aiogram/methods/convert_gift_to_stars.py | 42 + .../create_chat_subscription_invite_link.py | 2 +- aiogram/methods/create_invoice_link.py | 2 +- aiogram/methods/delete_business_messages.py | 42 + aiogram/methods/delete_story.py | 42 + aiogram/methods/edit_story.py | 63 + aiogram/methods/get_business_account_gifts.py | 71 + .../get_business_account_star_balance.py | 33 + aiogram/methods/gift_premium_subscription.py | 59 + aiogram/methods/post_story.py | 71 + aiogram/methods/read_business_message.py | 46 + .../remove_business_account_profile_photo.py | 42 + aiogram/methods/send_gift.py | 2 +- aiogram/methods/send_paid_media.py | 2 +- aiogram/methods/set_business_account_bio.py | 40 + .../set_business_account_gift_settings.py | 47 + aiogram/methods/set_business_account_name.py | 46 + .../set_business_account_profile_photo.py | 47 + .../methods/set_business_account_username.py | 42 + .../transfer_business_account_stars.py | 42 + aiogram/methods/transfer_gift.py | 50 + aiogram/methods/upgrade_gift.py | 50 + aiogram/types/__init__.py | 68 + aiogram/types/accepted_gift_types.py | 47 + aiogram/types/business_bot_rights.py | 87 + aiogram/types/business_connection.py | 20 +- aiogram/types/chat_full_info.py | 18 +- aiogram/types/gift_info.py | 67 + aiogram/types/inaccessible_message.py | 4 +- aiogram/types/input_profile_photo.py | 14 + aiogram/types/input_profile_photo_animated.py | 46 + aiogram/types/input_profile_photo_static.py | 38 + aiogram/types/input_profile_photo_union.py | 6 + aiogram/types/input_sticker.py | 2 +- aiogram/types/input_story_content.py | 14 + aiogram/types/input_story_content_photo.py | 37 + aiogram/types/input_story_content_union.py | 6 + aiogram/types/input_story_content_video.py | 53 + aiogram/types/location_address.py | 47 + aiogram/types/message.py | 31 +- aiogram/types/owned_gift.py | 14 + aiogram/types/owned_gift_regular.py | 90 + aiogram/types/owned_gift_union.py | 6 + aiogram/types/owned_gift_unique.py | 69 + aiogram/types/owned_gifts.py | 43 + aiogram/types/paid_message_price_changed.py | 29 + aiogram/types/star_amount.py | 35 + aiogram/types/story_area.py | 39 + aiogram/types/story_area_position.py | 55 + aiogram/types/story_area_type.py | 17 + aiogram/types/story_area_type_link.py | 37 + aiogram/types/story_area_type_location.py | 52 + .../story_area_type_suggested_reaction.py | 54 + aiogram/types/story_area_type_union.py | 15 + aiogram/types/story_area_type_unique_gift.py | 37 + aiogram/types/story_area_type_weather.py | 49 + aiogram/types/transaction_partner_user.py | 20 +- aiogram/types/unique_gift.py | 60 + aiogram/types/unique_gift_backdrop.py | 43 + aiogram/types/unique_gift_backdrop_colors.py | 47 + aiogram/types/unique_gift_info.py | 50 + aiogram/types/unique_gift_model.py | 43 + aiogram/types/unique_gift_symbol.py | 43 + docs/api/enums/index.rst | 5 + docs/api/enums/input_profile_photo_type.rst | 9 + docs/api/enums/input_story_content_type.rst | 9 + docs/api/enums/owned_gift_type.rst | 9 + docs/api/enums/story_area_type_type.rst | 9 + ...ion_partner_user_transaction_type_enum.rst | 9 + docs/api/methods/convert_gift_to_stars.rst | 45 + docs/api/methods/delete_business_messages.rst | 45 + docs/api/methods/delete_story.rst | 45 + docs/api/methods/edit_story.rst | 45 + .../methods/get_business_account_gifts.rst | 38 + .../get_business_account_star_balance.rst | 38 + .../api/methods/gift_premium_subscription.rst | 45 + docs/api/methods/index.rst | 30 +- docs/api/methods/post_story.rst | 45 + docs/api/methods/read_business_message.rst | 45 + .../remove_business_account_profile_photo.rst | 45 + docs/api/methods/set_business_account_bio.rst | 45 + .../set_business_account_gift_settings.rst | 45 + .../api/methods/set_business_account_name.rst | 45 + .../set_business_account_profile_photo.rst | 45 + .../methods/set_business_account_username.rst | 45 + .../transfer_business_account_stars.rst | 45 + docs/api/methods/transfer_gift.rst | 45 + docs/api/methods/upgrade_gift.rst | 45 + docs/api/types/accepted_gift_types.rst | 10 + docs/api/types/business_bot_rights.rst | 10 + docs/api/types/gift_info.rst | 10 + docs/api/types/index.rst | 34 +- docs/api/types/input_profile_photo.rst | 10 + .../types/input_profile_photo_animated.rst | 10 + docs/api/types/input_profile_photo_static.rst | 10 + docs/api/types/input_story_content.rst | 10 + docs/api/types/input_story_content_photo.rst | 10 + docs/api/types/input_story_content_video.rst | 10 + docs/api/types/location_address.rst | 10 + docs/api/types/owned_gift.rst | 10 + docs/api/types/owned_gift_regular.rst | 10 + docs/api/types/owned_gift_unique.rst | 10 + docs/api/types/owned_gifts.rst | 10 + docs/api/types/paid_message_price_changed.rst | 10 + docs/api/types/star_amount.rst | 10 + docs/api/types/story_area.rst | 10 + docs/api/types/story_area_position.rst | 10 + docs/api/types/story_area_type.rst | 10 + docs/api/types/story_area_type_link.rst | 10 + docs/api/types/story_area_type_location.rst | 10 + .../story_area_type_suggested_reaction.rst | 10 + .../api/types/story_area_type_unique_gift.rst | 10 + docs/api/types/story_area_type_weather.rst | 10 + docs/api/types/unique_gift.rst | 10 + docs/api/types/unique_gift_backdrop.rst | 10 + .../api/types/unique_gift_backdrop_colors.rst | 10 + docs/api/types/unique_gift_info.rst | 10 + docs/api/types/unique_gift_model.rst | 10 + docs/api/types/unique_gift_symbol.rst | 10 + .../test_convert_gift_to_stars.py | 13 + .../test_delete_business_messages.py | 13 + .../test_methods/test_delete_story.py | 13 + .../test_api/test_methods/test_edit_story.py | 26 + .../test_get_business_account_gifts.py | 41 + .../test_get_business_account_star_balance.py | 21 + tests/test_api/test_methods/test_get_chat.py | 8 +- .../test_get_star_transactions.py | 5 +- .../test_gift_premium_subscription.py | 16 + .../test_api/test_methods/test_post_story.py | 26 + .../test_read_business_message.py | 13 + ...t_remove_business_account_profile_photo.py | 15 + .../test_set_business_account_bio.py | 14 + ...test_set_business_account_gift_settings.py | 21 + .../test_set_business_account_name.py | 15 + ...test_set_business_account_profile_photo.py | 16 + .../test_set_business_account_username.py | 13 + .../test_transfer_business_account_stars.py | 13 + .../test_methods/test_transfer_gift.py | 16 + .../test_methods/test_upgrade_gift.py | 16 + tests/test_api/test_types/test_message.py | 101 + 231 files changed, 9565 insertions(+), 389 deletions(-) create mode 100644 .butcher/enums/InputProfileType.yml create mode 100644 .butcher/enums/InputStoryContentPhotoType.yml create mode 100644 .butcher/enums/OwnedGiftType.yml create mode 100644 .butcher/enums/StoryAreaTypeType.yml create mode 100644 .butcher/enums/TransactionPartnerUserTransactionType.yml create mode 100644 .butcher/methods/convertGiftToStars/entity.json create mode 100644 .butcher/methods/deleteBusinessMessages/entity.json create mode 100644 .butcher/methods/deleteStory/entity.json create mode 100644 .butcher/methods/editStory/entity.json create mode 100644 .butcher/methods/getBusinessAccountGifts/entity.json create mode 100644 .butcher/methods/getBusinessAccountStarBalance/entity.json create mode 100644 .butcher/methods/giftPremiumSubscription/entity.json create mode 100644 .butcher/methods/postStory/entity.json create mode 100644 .butcher/methods/readBusinessMessage/entity.json create mode 100644 .butcher/methods/removeBusinessAccountProfilePhoto/entity.json create mode 100644 .butcher/methods/setBusinessAccountBio/entity.json create mode 100644 .butcher/methods/setBusinessAccountGiftSettings/entity.json create mode 100644 .butcher/methods/setBusinessAccountName/entity.json create mode 100644 .butcher/methods/setBusinessAccountProfilePhoto/entity.json create mode 100644 .butcher/methods/setBusinessAccountUsername/entity.json create mode 100644 .butcher/methods/transferBusinessAccountStars/entity.json create mode 100644 .butcher/methods/transferGift/entity.json create mode 100644 .butcher/methods/upgradeGift/entity.json create mode 100644 .butcher/types/AcceptedGiftTypes/entity.json create mode 100644 .butcher/types/BusinessBotRights/entity.json create mode 100644 .butcher/types/GiftInfo/entity.json create mode 100644 .butcher/types/InputProfilePhoto/entity.json create mode 100644 .butcher/types/InputProfilePhoto/subtypes.yml create mode 100644 .butcher/types/InputProfilePhotoAnimated/entity.json create mode 100644 .butcher/types/InputProfilePhotoAnimated/replace.yml create mode 100644 .butcher/types/InputProfilePhotoStatic/entity.json create mode 100644 .butcher/types/InputProfilePhotoStatic/replace.yml create mode 100644 .butcher/types/InputSticker/replace.yml create mode 100644 .butcher/types/InputStoryContent/entity.json create mode 100644 .butcher/types/InputStoryContent/subtypes.yml create mode 100644 .butcher/types/InputStoryContentPhoto/entity.json create mode 100644 .butcher/types/InputStoryContentVideo/entity.json create mode 100644 .butcher/types/LocationAddress/entity.json create mode 100644 .butcher/types/OwnedGift/entity.json create mode 100644 .butcher/types/OwnedGift/subtypes.yml create mode 100644 .butcher/types/OwnedGiftRegular/entity.json create mode 100644 .butcher/types/OwnedGiftUnique/entity.json create mode 100644 .butcher/types/OwnedGifts/entity.json create mode 100644 .butcher/types/PaidMessagePriceChanged/entity.json create mode 100644 .butcher/types/StarAmount/entity.json create mode 100644 .butcher/types/StoryArea/entity.json create mode 100644 .butcher/types/StoryAreaPosition/entity.json create mode 100644 .butcher/types/StoryAreaType/entity.json create mode 100644 .butcher/types/StoryAreaType/subtypes.yml create mode 100644 .butcher/types/StoryAreaTypeLink/entity.json create mode 100644 .butcher/types/StoryAreaTypeLocation/entity.json create mode 100644 .butcher/types/StoryAreaTypeSuggestedReaction/entity.json create mode 100644 .butcher/types/StoryAreaTypeUniqueGift/entity.json create mode 100644 .butcher/types/StoryAreaTypeWeather/entity.json create mode 100644 .butcher/types/UniqueGift/entity.json create mode 100644 .butcher/types/UniqueGiftBackdrop/entity.json create mode 100644 .butcher/types/UniqueGiftBackdropColors/entity.json create mode 100644 .butcher/types/UniqueGiftInfo/entity.json create mode 100644 .butcher/types/UniqueGiftModel/entity.json create mode 100644 .butcher/types/UniqueGiftSymbol/entity.json create mode 100644 CHANGES/1671.feature.rst create mode 100644 aiogram/enums/input_profile_photo_type.py create mode 100644 aiogram/enums/input_story_content_type.py create mode 100644 aiogram/enums/owned_gift_type.py create mode 100644 aiogram/enums/story_area_type_type.py create mode 100644 aiogram/enums/transaction_partner_user_transaction_type_enum.py create mode 100644 aiogram/methods/convert_gift_to_stars.py create mode 100644 aiogram/methods/delete_business_messages.py create mode 100644 aiogram/methods/delete_story.py create mode 100644 aiogram/methods/edit_story.py create mode 100644 aiogram/methods/get_business_account_gifts.py create mode 100644 aiogram/methods/get_business_account_star_balance.py create mode 100644 aiogram/methods/gift_premium_subscription.py create mode 100644 aiogram/methods/post_story.py create mode 100644 aiogram/methods/read_business_message.py create mode 100644 aiogram/methods/remove_business_account_profile_photo.py create mode 100644 aiogram/methods/set_business_account_bio.py create mode 100644 aiogram/methods/set_business_account_gift_settings.py create mode 100644 aiogram/methods/set_business_account_name.py create mode 100644 aiogram/methods/set_business_account_profile_photo.py create mode 100644 aiogram/methods/set_business_account_username.py create mode 100644 aiogram/methods/transfer_business_account_stars.py create mode 100644 aiogram/methods/transfer_gift.py create mode 100644 aiogram/methods/upgrade_gift.py create mode 100644 aiogram/types/accepted_gift_types.py create mode 100644 aiogram/types/business_bot_rights.py create mode 100644 aiogram/types/gift_info.py create mode 100644 aiogram/types/input_profile_photo.py create mode 100644 aiogram/types/input_profile_photo_animated.py create mode 100644 aiogram/types/input_profile_photo_static.py create mode 100644 aiogram/types/input_profile_photo_union.py create mode 100644 aiogram/types/input_story_content.py create mode 100644 aiogram/types/input_story_content_photo.py create mode 100644 aiogram/types/input_story_content_union.py create mode 100644 aiogram/types/input_story_content_video.py create mode 100644 aiogram/types/location_address.py create mode 100644 aiogram/types/owned_gift.py create mode 100644 aiogram/types/owned_gift_regular.py create mode 100644 aiogram/types/owned_gift_union.py create mode 100644 aiogram/types/owned_gift_unique.py create mode 100644 aiogram/types/owned_gifts.py create mode 100644 aiogram/types/paid_message_price_changed.py create mode 100644 aiogram/types/star_amount.py create mode 100644 aiogram/types/story_area.py create mode 100644 aiogram/types/story_area_position.py create mode 100644 aiogram/types/story_area_type.py create mode 100644 aiogram/types/story_area_type_link.py create mode 100644 aiogram/types/story_area_type_location.py create mode 100644 aiogram/types/story_area_type_suggested_reaction.py create mode 100644 aiogram/types/story_area_type_union.py create mode 100644 aiogram/types/story_area_type_unique_gift.py create mode 100644 aiogram/types/story_area_type_weather.py create mode 100644 aiogram/types/unique_gift.py create mode 100644 aiogram/types/unique_gift_backdrop.py create mode 100644 aiogram/types/unique_gift_backdrop_colors.py create mode 100644 aiogram/types/unique_gift_info.py create mode 100644 aiogram/types/unique_gift_model.py create mode 100644 aiogram/types/unique_gift_symbol.py create mode 100644 docs/api/enums/input_profile_photo_type.rst create mode 100644 docs/api/enums/input_story_content_type.rst create mode 100644 docs/api/enums/owned_gift_type.rst create mode 100644 docs/api/enums/story_area_type_type.rst create mode 100644 docs/api/enums/transaction_partner_user_transaction_type_enum.rst create mode 100644 docs/api/methods/convert_gift_to_stars.rst create mode 100644 docs/api/methods/delete_business_messages.rst create mode 100644 docs/api/methods/delete_story.rst create mode 100644 docs/api/methods/edit_story.rst create mode 100644 docs/api/methods/get_business_account_gifts.rst create mode 100644 docs/api/methods/get_business_account_star_balance.rst create mode 100644 docs/api/methods/gift_premium_subscription.rst create mode 100644 docs/api/methods/post_story.rst create mode 100644 docs/api/methods/read_business_message.rst create mode 100644 docs/api/methods/remove_business_account_profile_photo.rst create mode 100644 docs/api/methods/set_business_account_bio.rst create mode 100644 docs/api/methods/set_business_account_gift_settings.rst create mode 100644 docs/api/methods/set_business_account_name.rst create mode 100644 docs/api/methods/set_business_account_profile_photo.rst create mode 100644 docs/api/methods/set_business_account_username.rst create mode 100644 docs/api/methods/transfer_business_account_stars.rst create mode 100644 docs/api/methods/transfer_gift.rst create mode 100644 docs/api/methods/upgrade_gift.rst create mode 100644 docs/api/types/accepted_gift_types.rst create mode 100644 docs/api/types/business_bot_rights.rst create mode 100644 docs/api/types/gift_info.rst create mode 100644 docs/api/types/input_profile_photo.rst create mode 100644 docs/api/types/input_profile_photo_animated.rst create mode 100644 docs/api/types/input_profile_photo_static.rst create mode 100644 docs/api/types/input_story_content.rst create mode 100644 docs/api/types/input_story_content_photo.rst create mode 100644 docs/api/types/input_story_content_video.rst create mode 100644 docs/api/types/location_address.rst create mode 100644 docs/api/types/owned_gift.rst create mode 100644 docs/api/types/owned_gift_regular.rst create mode 100644 docs/api/types/owned_gift_unique.rst create mode 100644 docs/api/types/owned_gifts.rst create mode 100644 docs/api/types/paid_message_price_changed.rst create mode 100644 docs/api/types/star_amount.rst create mode 100644 docs/api/types/story_area.rst create mode 100644 docs/api/types/story_area_position.rst create mode 100644 docs/api/types/story_area_type.rst create mode 100644 docs/api/types/story_area_type_link.rst create mode 100644 docs/api/types/story_area_type_location.rst create mode 100644 docs/api/types/story_area_type_suggested_reaction.rst create mode 100644 docs/api/types/story_area_type_unique_gift.rst create mode 100644 docs/api/types/story_area_type_weather.rst create mode 100644 docs/api/types/unique_gift.rst create mode 100644 docs/api/types/unique_gift_backdrop.rst create mode 100644 docs/api/types/unique_gift_backdrop_colors.rst create mode 100644 docs/api/types/unique_gift_info.rst create mode 100644 docs/api/types/unique_gift_model.rst create mode 100644 docs/api/types/unique_gift_symbol.rst create mode 100644 tests/test_api/test_methods/test_convert_gift_to_stars.py create mode 100644 tests/test_api/test_methods/test_delete_business_messages.py create mode 100644 tests/test_api/test_methods/test_delete_story.py create mode 100644 tests/test_api/test_methods/test_edit_story.py create mode 100644 tests/test_api/test_methods/test_get_business_account_gifts.py create mode 100644 tests/test_api/test_methods/test_get_business_account_star_balance.py create mode 100644 tests/test_api/test_methods/test_gift_premium_subscription.py create mode 100644 tests/test_api/test_methods/test_post_story.py create mode 100644 tests/test_api/test_methods/test_read_business_message.py create mode 100644 tests/test_api/test_methods/test_remove_business_account_profile_photo.py create mode 100644 tests/test_api/test_methods/test_set_business_account_bio.py create mode 100644 tests/test_api/test_methods/test_set_business_account_gift_settings.py create mode 100644 tests/test_api/test_methods/test_set_business_account_name.py create mode 100644 tests/test_api/test_methods/test_set_business_account_profile_photo.py create mode 100644 tests/test_api/test_methods/test_set_business_account_username.py create mode 100644 tests/test_api/test_methods/test_transfer_business_account_stars.py create mode 100644 tests/test_api/test_methods/test_transfer_gift.py create mode 100644 tests/test_api/test_methods/test_upgrade_gift.py diff --git a/.apiversion b/.apiversion index cf022018..dd98ee6c 100644 --- a/.apiversion +++ b/.apiversion @@ -1 +1 @@ -8.3 +9.0 diff --git a/.butcher/enums/ContentType.yml b/.butcher/enums/ContentType.yml index 321d6b92..d4848e37 100644 --- a/.butcher/enums/ContentType.yml +++ b/.butcher/enums/ContentType.yml @@ -43,3 +43,4 @@ extract: - has_media_spoiler - effect_id - show_caption_above_media + - paid_star_count diff --git a/.butcher/enums/InputProfileType.yml b/.butcher/enums/InputProfileType.yml new file mode 100644 index 00000000..6a1660af --- /dev/null +++ b/.butcher/enums/InputProfileType.yml @@ -0,0 +1,11 @@ +name: InputProfilePhotoType +description: | + This object represents input profile photo type + + Source: https://core.telegram.org/bots/api#inputprofilephoto +multi_parse: + attribute: type + regexp: "must be '([a-z_]+)'" + entities: + - InputProfilePhotoStatic + - InputProfilePhotoAnimated diff --git a/.butcher/enums/InputStoryContentPhotoType.yml b/.butcher/enums/InputStoryContentPhotoType.yml new file mode 100644 index 00000000..f4464de3 --- /dev/null +++ b/.butcher/enums/InputStoryContentPhotoType.yml @@ -0,0 +1,11 @@ +name: InputStoryContentType +description: | + This object represents input story content photo type. + + Source: https://core.telegram.org/bots/api#inputstorycontentphoto +multi_parse: + attribute: type + regexp: "must be '([a-z_]+)'" + entities: + - InputStoryContentPhoto + - InputStoryContentVideo diff --git a/.butcher/enums/OwnedGiftType.yml b/.butcher/enums/OwnedGiftType.yml new file mode 100644 index 00000000..3b161775 --- /dev/null +++ b/.butcher/enums/OwnedGiftType.yml @@ -0,0 +1,11 @@ +name: OwnedGiftType +description: | + This object represents owned gift type + + Source: https://core.telegram.org/bots/api#ownedgift +multi_parse: + attribute: type + regexp: "'([a-z_]+)'" + entities: + - OwnedGiftRegular + - OwnedGiftUnique diff --git a/.butcher/enums/StoryAreaTypeType.yml b/.butcher/enums/StoryAreaTypeType.yml new file mode 100644 index 00000000..6e4e899f --- /dev/null +++ b/.butcher/enums/StoryAreaTypeType.yml @@ -0,0 +1,14 @@ +name: StoryAreaTypeType +description: | + This object represents input profile photo type + + Source: https://core.telegram.org/bots/api#storyareatype +multi_parse: + attribute: type + regexp: "'([a-z_]+)'" + entities: + - StoryAreaTypeLocation + - StoryAreaTypeSuggestedReaction + - StoryAreaTypeLink + - StoryAreaTypeWeather + - StoryAreaTypeUniqueGift diff --git a/.butcher/enums/TransactionPartnerUserTransactionType.yml b/.butcher/enums/TransactionPartnerUserTransactionType.yml new file mode 100644 index 00000000..cd787f3a --- /dev/null +++ b/.butcher/enums/TransactionPartnerUserTransactionType.yml @@ -0,0 +1,10 @@ +name: TransactionPartnerUserTransactionTypeEnum +description: | + This object represents type of the transaction that were made by partner user. + + Source: https://core.telegram.org/bots/api#transactionpartneruser +parse: + entity: TransactionPartnerUser + category: types + attribute: transaction_type + regexp: "'([a-z_]+)'" diff --git a/.butcher/methods/convertGiftToStars/entity.json b/.butcher/methods/convertGiftToStars/entity.json new file mode 100644 index 00000000..9ab07b66 --- /dev/null +++ b/.butcher/methods/convertGiftToStars/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "convertgifttostars", + "name": "convertGiftToStars", + "description": "Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.", + "html_description": "

Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.

", + "rst_description": "Converts a given regular gift to Telegram Stars. Requires the *can_convert_gifts_to_stars* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": true, + "description": "Unique identifier of the regular gift that should be converted to Telegram Stars", + "html_description": "Unique identifier of the regular gift that should be converted to Telegram Stars", + "rst_description": "Unique identifier of the regular gift that should be converted to Telegram Stars\n", + "name": "owned_gift_id" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/createChatSubscriptionInviteLink/entity.json b/.butcher/methods/createChatSubscriptionInviteLink/entity.json index 48872035..2b77775e 100644 --- a/.butcher/methods/createChatSubscriptionInviteLink/entity.json +++ b/.butcher/methods/createChatSubscriptionInviteLink/entity.json @@ -38,9 +38,9 @@ { "type": "Integer", "required": true, - "description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500", - "html_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500", - "rst_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500\n", + "description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000", + "html_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000", + "rst_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000\n", "name": "subscription_price" } ], diff --git a/.butcher/methods/createInvoiceLink/entity.json b/.butcher/methods/createInvoiceLink/entity.json index 6d4a7202..daa2da71 100644 --- a/.butcher/methods/createInvoiceLink/entity.json +++ b/.butcher/methods/createInvoiceLink/entity.json @@ -70,9 +70,9 @@ { "type": "Integer", "required": false, - "description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.", - "html_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.", - "rst_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.\n", + "description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.", + "html_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.", + "rst_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.\n", "name": "subscription_period" }, { diff --git a/.butcher/methods/deleteBusinessMessages/entity.json b/.butcher/methods/deleteBusinessMessages/entity.json new file mode 100644 index 00000000..d4948805 --- /dev/null +++ b/.butcher/methods/deleteBusinessMessages/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "deletebusinessmessages", + "name": "deleteBusinessMessages", + "description": "Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.", + "html_description": "

Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.

", + "rst_description": "Delete messages on behalf of a business account. Requires the *can_delete_outgoing_messages* business bot right to delete messages sent by the bot itself, or the *can_delete_all_messages* business bot right to delete any message. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection on behalf of which to delete the messages", + "html_description": "Unique identifier of the business connection on behalf of which to delete the messages", + "rst_description": "Unique identifier of the business connection on behalf of which to delete the messages\n", + "name": "business_connection_id" + }, + { + "type": "Array of Integer", + "required": true, + "description": "A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted", + "html_description": "A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted", + "rst_description": "A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. 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/deleteStory/entity.json b/.butcher/methods/deleteStory/entity.json new file mode 100644 index 00000000..b874a259 --- /dev/null +++ b/.butcher/methods/deleteStory/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "deletestory", + "name": "deleteStory", + "description": "Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.", + "html_description": "

Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.

", + "rst_description": "Deletes a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the story to delete", + "html_description": "Unique identifier of the story to delete", + "rst_description": "Unique identifier of the story to delete\n", + "name": "story_id" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/editStory/entity.json b/.butcher/methods/editStory/entity.json new file mode 100644 index 00000000..112ba693 --- /dev/null +++ b/.butcher/methods/editStory/entity.json @@ -0,0 +1,73 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "editstory", + "name": "editStory", + "description": "Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.", + "html_description": "

Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.

", + "rst_description": "Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the story to edit", + "html_description": "Unique identifier of the story to edit", + "rst_description": "Unique identifier of the story to edit\n", + "name": "story_id" + }, + { + "type": "InputStoryContent", + "required": true, + "description": "Content of the story", + "html_description": "Content of the story", + "rst_description": "Content of the story\n", + "name": "content" + }, + { + "type": "String", + "required": false, + "description": "Caption of the story, 0-2048 characters after entities parsing", + "html_description": "Caption of the story, 0-2048 characters after entities parsing", + "rst_description": "Caption of the story, 0-2048 characters after entities parsing\n", + "name": "caption" + }, + { + "type": "String", + "required": false, + "description": "Mode for parsing entities in the story caption. See formatting options for more details.", + "html_description": "Mode for parsing entities in the story caption. See formatting options for more details.", + "rst_description": "Mode for parsing entities in the story caption. See `formatting options `_ for more details.\n", + "name": "parse_mode" + }, + { + "type": "Array of MessageEntity", + "required": false, + "description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode", + "html_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode", + "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", + "name": "caption_entities" + }, + { + "type": "Array of StoryArea", + "required": false, + "description": "A JSON-serialized list of clickable areas to be shown on the story", + "html_description": "A JSON-serialized list of clickable areas to be shown on the story", + "rst_description": "A JSON-serialized list of clickable areas to be shown on the story\n", + "name": "areas" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/getAvailableGifts/entity.json b/.butcher/methods/getAvailableGifts/entity.json index 6ea51e70..01884670 100644 --- a/.butcher/methods/getAvailableGifts/entity.json +++ b/.butcher/methods/getAvailableGifts/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Stickers", - "anchor": "stickers" + "title": "Updating messages", + "anchor": "updating-messages" }, "object": { "anchor": "getavailablegifts", diff --git a/.butcher/methods/getBusinessAccountGifts/entity.json b/.butcher/methods/getBusinessAccountGifts/entity.json new file mode 100644 index 00000000..a3ca0ff7 --- /dev/null +++ b/.butcher/methods/getBusinessAccountGifts/entity.json @@ -0,0 +1,89 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "getbusinessaccountgifts", + "name": "getBusinessAccountGifts", + "description": "Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.", + "html_description": "

Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.

", + "rst_description": "Returns the gifts received and owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude gifts that aren't saved to the account's profile page", + "html_description": "Pass True to exclude gifts that aren't saved to the account's profile page", + "rst_description": "Pass True to exclude gifts that aren't saved to the account's profile page\n", + "name": "exclude_unsaved" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude gifts that are saved to the account's profile page", + "html_description": "Pass True to exclude gifts that are saved to the account's profile page", + "rst_description": "Pass True to exclude gifts that are saved to the account's profile page\n", + "name": "exclude_saved" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude gifts that can be purchased an unlimited number of times", + "html_description": "Pass True to exclude gifts that can be purchased an unlimited number of times", + "rst_description": "Pass True to exclude gifts that can be purchased an unlimited number of times\n", + "name": "exclude_unlimited" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude gifts that can be purchased a limited number of times", + "html_description": "Pass True to exclude gifts that can be purchased a limited number of times", + "rst_description": "Pass True to exclude gifts that can be purchased a limited number of times\n", + "name": "exclude_limited" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude unique gifts", + "html_description": "Pass True to exclude unique gifts", + "rst_description": "Pass True to exclude unique gifts\n", + "name": "exclude_unique" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.", + "html_description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.", + "rst_description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.\n", + "name": "sort_by_price" + }, + { + "type": "String", + "required": false, + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results", + "html_description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results", + "rst_description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results\n", + "name": "offset" + }, + { + "type": "Integer", + "required": false, + "description": "The maximum number of gifts to be returned; 1-100. Defaults to 100", + "html_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100", + "rst_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100\n", + "name": "limit" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/getBusinessAccountStarBalance/entity.json b/.butcher/methods/getBusinessAccountStarBalance/entity.json new file mode 100644 index 00000000..cf740ab6 --- /dev/null +++ b/.butcher/methods/getBusinessAccountStarBalance/entity.json @@ -0,0 +1,25 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "getbusinessaccountstarbalance", + "name": "getBusinessAccountStarBalance", + "description": "Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.", + "html_description": "

Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.

", + "rst_description": "Returns the amount of Telegram Stars owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.star_amount.StarAmount` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/giftPremiumSubscription/entity.json b/.butcher/methods/giftPremiumSubscription/entity.json new file mode 100644 index 00000000..ea9716bf --- /dev/null +++ b/.butcher/methods/giftPremiumSubscription/entity.json @@ -0,0 +1,65 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "giftpremiumsubscription", + "name": "giftPremiumSubscription", + "description": "Gifts a Telegram Premium subscription to the given user. Returns True on success.", + "html_description": "

Gifts a Telegram Premium subscription to the given user. Returns True on success.

", + "rst_description": "Gifts a Telegram Premium subscription to the given user. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the target user who will receive a Telegram Premium subscription", + "html_description": "Unique identifier of the target user who will receive a Telegram Premium subscription", + "rst_description": "Unique identifier of the target user who will receive a Telegram Premium subscription\n", + "name": "user_id" + }, + { + "type": "Integer", + "required": true, + "description": "Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12", + "html_description": "Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12", + "rst_description": "Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12\n", + "name": "month_count" + }, + { + "type": "Integer", + "required": true, + "description": "Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months", + "html_description": "Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months", + "rst_description": "Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months\n", + "name": "star_count" + }, + { + "type": "String", + "required": false, + "description": "Text that will be shown along with the service message about the subscription; 0-128 characters", + "html_description": "Text that will be shown along with the service message about the subscription; 0-128 characters", + "rst_description": "Text that will be shown along with the service message about the subscription; 0-128 characters\n", + "name": "text" + }, + { + "type": "String", + "required": false, + "description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.", + "html_description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.", + "rst_description": "Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n", + "name": "text_parse_mode" + }, + { + "type": "Array of MessageEntity", + "required": false, + "description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.", + "html_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.", + "rst_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n", + "name": "text_entities" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/postStory/entity.json b/.butcher/methods/postStory/entity.json new file mode 100644 index 00000000..22d8fef1 --- /dev/null +++ b/.butcher/methods/postStory/entity.json @@ -0,0 +1,89 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "poststory", + "name": "postStory", + "description": "Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.", + "html_description": "

Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.

", + "rst_description": "Posts a story on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "InputStoryContent", + "required": true, + "description": "Content of the story", + "html_description": "Content of the story", + "rst_description": "Content of the story\n", + "name": "content" + }, + { + "type": "Integer", + "required": true, + "description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400", + "html_description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400", + "rst_description": "Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`\n", + "name": "active_period" + }, + { + "type": "String", + "required": false, + "description": "Caption of the story, 0-2048 characters after entities parsing", + "html_description": "Caption of the story, 0-2048 characters after entities parsing", + "rst_description": "Caption of the story, 0-2048 characters after entities parsing\n", + "name": "caption" + }, + { + "type": "String", + "required": false, + "description": "Mode for parsing entities in the story caption. See formatting options for more details.", + "html_description": "Mode for parsing entities in the story caption. See formatting options for more details.", + "rst_description": "Mode for parsing entities in the story caption. See `formatting options `_ for more details.\n", + "name": "parse_mode" + }, + { + "type": "Array of MessageEntity", + "required": false, + "description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode", + "html_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode", + "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", + "name": "caption_entities" + }, + { + "type": "Array of StoryArea", + "required": false, + "description": "A JSON-serialized list of clickable areas to be shown on the story", + "html_description": "A JSON-serialized list of clickable areas to be shown on the story", + "rst_description": "A JSON-serialized list of clickable areas to be shown on the story\n", + "name": "areas" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to keep the story accessible after it expires", + "html_description": "Pass True to keep the story accessible after it expires", + "rst_description": "Pass :code:`True` to keep the story accessible after it expires\n", + "name": "post_to_chat_page" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the content of the story must be protected from forwarding and screenshotting", + "html_description": "Pass True if the content of the story must be protected from forwarding and screenshotting", + "rst_description": "Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting\n", + "name": "protect_content" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/readBusinessMessage/entity.json b/.butcher/methods/readBusinessMessage/entity.json new file mode 100644 index 00000000..c3ed874e --- /dev/null +++ b/.butcher/methods/readBusinessMessage/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "readbusinessmessage", + "name": "readBusinessMessage", + "description": "Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.", + "html_description": "

Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.

", + "rst_description": "Marks incoming message as read on behalf of a business account. Requires the *can_read_messages* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection on behalf of which to read the message", + "html_description": "Unique identifier of the business connection on behalf of which to read the message", + "rst_description": "Unique identifier of the business connection on behalf of which to read the message\n", + "name": "business_connection_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.", + "html_description": "Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.", + "rst_description": "Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the message to mark as read", + "html_description": "Unique identifier of the message to mark as read", + "rst_description": "Unique identifier of the message to mark as read\n", + "name": "message_id" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/removeBusinessAccountProfilePhoto/entity.json b/.butcher/methods/removeBusinessAccountProfilePhoto/entity.json new file mode 100644 index 00000000..25b03338 --- /dev/null +++ b/.butcher/methods/removeBusinessAccountProfilePhoto/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "removebusinessaccountprofilephoto", + "name": "removeBusinessAccountProfilePhoto", + "description": "Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.", + "html_description": "

Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.

", + "rst_description": "Removes the current profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.", + "html_description": "Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.", + "rst_description": "Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.\n", + "name": "is_public" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/removeChatVerification/entity.json b/.butcher/methods/removeChatVerification/entity.json index 907b16da..f04a4730 100644 --- a/.butcher/methods/removeChatVerification/entity.json +++ b/.butcher/methods/removeChatVerification/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Stickers", - "anchor": "stickers" + "title": "Updating messages", + "anchor": "updating-messages" }, "object": { "anchor": "removechatverification", diff --git a/.butcher/methods/removeUserVerification/entity.json b/.butcher/methods/removeUserVerification/entity.json index 769267e3..51f14e99 100644 --- a/.butcher/methods/removeUserVerification/entity.json +++ b/.butcher/methods/removeUserVerification/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Stickers", - "anchor": "stickers" + "title": "Updating messages", + "anchor": "updating-messages" }, "object": { "anchor": "removeuserverification", diff --git a/.butcher/methods/sendGift/entity.json b/.butcher/methods/sendGift/entity.json index 83050afa..a424d520 100644 --- a/.butcher/methods/sendGift/entity.json +++ b/.butcher/methods/sendGift/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Stickers", - "anchor": "stickers" + "title": "Updating messages", + "anchor": "updating-messages" }, "object": { "anchor": "sendgift", @@ -46,9 +46,9 @@ { "type": "String", "required": false, - "description": "Text that will be shown along with the gift; 0-255 characters", - "html_description": "Text that will be shown along with the gift; 0-255 characters", - "rst_description": "Text that will be shown along with the gift; 0-255 characters\n", + "description": "Text that will be shown along with the gift; 0-128 characters", + "html_description": "Text that will be shown along with the gift; 0-128 characters", + "rst_description": "Text that will be shown along with the gift; 0-128 characters\n", "name": "text" }, { diff --git a/.butcher/methods/sendPaidMedia/entity.json b/.butcher/methods/sendPaidMedia/entity.json index cb6d7412..10d070e8 100644 --- a/.butcher/methods/sendPaidMedia/entity.json +++ b/.butcher/methods/sendPaidMedia/entity.json @@ -30,9 +30,9 @@ { "type": "Integer", "required": true, - "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-2500", - "html_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-2500", - "rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-2500\n", + "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000", + "html_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000", + "rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000\n", "name": "star_count" }, { diff --git a/.butcher/methods/setBusinessAccountBio/entity.json b/.butcher/methods/setBusinessAccountBio/entity.json new file mode 100644 index 00000000..69e00aab --- /dev/null +++ b/.butcher/methods/setBusinessAccountBio/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "setbusinessaccountbio", + "name": "setBusinessAccountBio", + "description": "Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.", + "html_description": "

Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.

", + "rst_description": "Changes the bio of a managed business account. Requires the *can_change_bio* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": false, + "description": "The new value of the bio for the business account; 0-140 characters", + "html_description": "The new value of the bio for the business account; 0-140 characters", + "rst_description": "The new value of the bio for the business account; 0-140 characters\n", + "name": "bio" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/setBusinessAccountGiftSettings/entity.json b/.butcher/methods/setBusinessAccountGiftSettings/entity.json new file mode 100644 index 00000000..2e3ad816 --- /dev/null +++ b/.butcher/methods/setBusinessAccountGiftSettings/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "setbusinessaccountgiftsettings", + "name": "setBusinessAccountGiftSettings", + "description": "Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.", + "html_description": "

Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.

", + "rst_description": "Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can_change_gift_settings* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Boolean", + "required": true, + "description": "Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field", + "html_description": "Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field", + "rst_description": "Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field\n", + "name": "show_gift_button" + }, + { + "type": "AcceptedGiftTypes", + "required": true, + "description": "Types of gifts accepted by the business account", + "html_description": "Types of gifts accepted by the business account", + "rst_description": "Types of gifts accepted by the business account\n", + "name": "accepted_gift_types" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/setBusinessAccountName/entity.json b/.butcher/methods/setBusinessAccountName/entity.json new file mode 100644 index 00000000..cc02f733 --- /dev/null +++ b/.butcher/methods/setBusinessAccountName/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "setbusinessaccountname", + "name": "setBusinessAccountName", + "description": "Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.", + "html_description": "

Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.

", + "rst_description": "Changes the first and last name of a managed business account. Requires the *can_change_name* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": true, + "description": "The new value of the first name for the business account; 1-64 characters", + "html_description": "The new value of the first name for the business account; 1-64 characters", + "rst_description": "The new value of the first name for the business account; 1-64 characters\n", + "name": "first_name" + }, + { + "type": "String", + "required": false, + "description": "The new value of the last name for the business account; 0-64 characters", + "html_description": "The new value of the last name for the business account; 0-64 characters", + "rst_description": "The new value of the last name for the business account; 0-64 characters\n", + "name": "last_name" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/setBusinessAccountProfilePhoto/entity.json b/.butcher/methods/setBusinessAccountProfilePhoto/entity.json new file mode 100644 index 00000000..5815eb78 --- /dev/null +++ b/.butcher/methods/setBusinessAccountProfilePhoto/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "setbusinessaccountprofilephoto", + "name": "setBusinessAccountProfilePhoto", + "description": "Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.", + "html_description": "

Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.

", + "rst_description": "Changes the profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "InputProfilePhoto", + "required": true, + "description": "The new profile photo to set", + "html_description": "The new profile photo to set", + "rst_description": "The new profile photo to set\n", + "name": "photo" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.", + "html_description": "Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.", + "rst_description": "Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.\n", + "name": "is_public" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/setBusinessAccountUsername/entity.json b/.butcher/methods/setBusinessAccountUsername/entity.json new file mode 100644 index 00000000..fe0971ef --- /dev/null +++ b/.butcher/methods/setBusinessAccountUsername/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "setbusinessaccountusername", + "name": "setBusinessAccountUsername", + "description": "Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.", + "html_description": "

Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.

", + "rst_description": "Changes the username of a managed business account. Requires the *can_change_username* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": false, + "description": "The new value of the username for the business account; 0-32 characters", + "html_description": "The new value of the username for the business account; 0-32 characters", + "rst_description": "The new value of the username for the business account; 0-32 characters\n", + "name": "username" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/transferBusinessAccountStars/entity.json b/.butcher/methods/transferBusinessAccountStars/entity.json new file mode 100644 index 00000000..18dcf0a1 --- /dev/null +++ b/.butcher/methods/transferBusinessAccountStars/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "transferbusinessaccountstars", + "name": "transferBusinessAccountStars", + "description": "Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.", + "html_description": "

Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.

", + "rst_description": "Transfers Telegram Stars from the business account balance to the bot's balance. Requires the *can_transfer_stars* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Integer", + "required": true, + "description": "Number of Telegram Stars to transfer; 1-10000", + "html_description": "Number of Telegram Stars to transfer; 1-10000", + "rst_description": "Number of Telegram Stars to transfer; 1-10000\n", + "name": "star_count" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/transferGift/entity.json b/.butcher/methods/transferGift/entity.json new file mode 100644 index 00000000..6de2ab9c --- /dev/null +++ b/.butcher/methods/transferGift/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "transfergift", + "name": "transferGift", + "description": "Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.", + "html_description": "

Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.

", + "rst_description": "Transfers an owned unique gift to another user. Requires the *can_transfer_and_upgrade_gifts* business bot right. Requires *can_transfer_stars* business bot right if the transfer is paid. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": true, + "description": "Unique identifier of the regular gift that should be transferred", + "html_description": "Unique identifier of the regular gift that should be transferred", + "rst_description": "Unique identifier of the regular gift that should be transferred\n", + "name": "owned_gift_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.", + "html_description": "Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.", + "rst_description": "Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.\n", + "name": "new_owner_chat_id" + }, + { + "type": "Integer", + "required": false, + "description": "The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.", + "html_description": "The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.", + "rst_description": "The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the *can_transfer_stars* business bot right is required.\n", + "name": "star_count" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/upgradeGift/entity.json b/.butcher/methods/upgradeGift/entity.json new file mode 100644 index 00000000..971bbdee --- /dev/null +++ b/.butcher/methods/upgradeGift/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Updating messages", + "anchor": "updating-messages" + }, + "object": { + "anchor": "upgradegift", + "name": "upgradeGift", + "description": "Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.", + "html_description": "

Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.

", + "rst_description": "Upgrades a given regular gift to a unique gift. Requires the *can_transfer_and_upgrade_gifts* business bot right. Additionally requires the *can_transfer_stars* business bot right if the upgrade is paid. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": true, + "description": "Unique identifier of the regular gift that should be upgraded to a unique one", + "html_description": "Unique identifier of the regular gift that should be upgraded to a unique one", + "rst_description": "Unique identifier of the regular gift that should be upgraded to a unique one\n", + "name": "owned_gift_id" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to keep the original gift text, sender and receiver in the upgraded gift", + "html_description": "Pass True to keep the original gift text, sender and receiver in the upgraded gift", + "rst_description": "Pass True to keep the original gift text, sender and receiver in the upgraded gift\n", + "name": "keep_original_details" + }, + { + "type": "Integer", + "required": false, + "description": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed.", + "html_description": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed.", + "rst_description": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If :code:`gift.prepaid_upgrade_star_count > 0`, then pass 0, otherwise, the *can_transfer_stars* business bot right is required and :code:`gift.upgrade_star_count` must be passed.\n", + "name": "star_count" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/verifyChat/entity.json b/.butcher/methods/verifyChat/entity.json index 22d4002e..fe6ba2f0 100644 --- a/.butcher/methods/verifyChat/entity.json +++ b/.butcher/methods/verifyChat/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Stickers", - "anchor": "stickers" + "title": "Updating messages", + "anchor": "updating-messages" }, "object": { "anchor": "verifychat", diff --git a/.butcher/methods/verifyUser/entity.json b/.butcher/methods/verifyUser/entity.json index ab3a9522..e9faa10a 100644 --- a/.butcher/methods/verifyUser/entity.json +++ b/.butcher/methods/verifyUser/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Stickers", - "anchor": "stickers" + "title": "Updating messages", + "anchor": "updating-messages" }, "object": { "anchor": "verifyuser", diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index 472e0cab..57e6e931 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -1,7 +1,7 @@ { "api": { - "version": "8.3", - "release_date": "2025-02-12" + "version": "9.0", + "release_date": "2025-04-11" }, "items": [ { @@ -870,12 +870,12 @@ "required": false }, { - "type": "True", - "description": "True, if gifts can be sent to the chat", - "html_description": "Optional. True, if gifts can be sent to the chat", - "rst_description": "*Optional*. :code:`True`, if gifts can be sent to the chat\n", - "name": "can_send_gift", - "required": false + "type": "AcceptedGiftTypes", + "description": "Information about types of gifts that are accepted by the chat or by the corresponding user for private chats", + "html_description": "Information about types of gifts that are accepted by the chat or by the corresponding user for private chats", + "rst_description": "Information about types of gifts that are accepted by the chat or by the corresponding user for private chats\n", + "name": "accepted_gift_types", + "required": true }, { "type": "True", @@ -1167,6 +1167,14 @@ "name": "author_signature", "required": false }, + { + "type": "Integer", + "description": "The number of Telegram Stars that were paid by the sender of the message to send it", + "html_description": "Optional. The number of Telegram Stars that were paid by the sender of the message to send it", + "rst_description": "*Optional*. The number of Telegram Stars that were paid by the sender of the message to send it\n", + "name": "paid_star_count", + "required": false + }, { "type": "String", "description": "For text messages, the actual UTF-8 text of the message", @@ -1495,6 +1503,22 @@ "name": "chat_shared", "required": false }, + { + "type": "GiftInfo", + "description": "Service message: a regular gift was sent or received", + "html_description": "Optional. Service message: a regular gift was sent or received", + "rst_description": "*Optional*. Service message: a regular gift was sent or received\n", + "name": "gift", + "required": false + }, + { + "type": "UniqueGiftInfo", + "description": "Service message: a unique gift was sent or received", + "html_description": "Optional. Service message: a unique gift was sent or received", + "rst_description": "*Optional*. Service message: a unique gift was sent or received\n", + "name": "unique_gift", + "required": false + }, { "type": "String", "description": "The domain name of the website on which the user has logged in.", @@ -1623,6 +1647,14 @@ "name": "giveaway_completed", "required": false }, + { + "type": "PaidMessagePriceChanged", + "description": "Service message: the price for paid messages has changed in the chat", + "html_description": "Optional. Service message: the price for paid messages has changed in the chat", + "rst_description": "*Optional*. Service message: the price for paid messages has changed in the chat\n", + "name": "paid_message_price_changed", + "required": false + }, { "type": "VideoChatScheduled", "description": "Service message: video chat scheduled", @@ -4058,6 +4090,24 @@ ], "category": "types" }, + { + "anchor": "paidmessagepricechanged", + "name": "PaidMessagePriceChanged", + "description": "Describes a service message about a change in the price of paid messages within a chat.", + "html_description": "

Describes a service message about a change in the price of paid messages within a chat.

", + "rst_description": "Describes a service message about a change in the price of paid messages within a chat.", + "annotations": [ + { + "type": "Integer", + "description": "The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message", + "html_description": "The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message", + "rst_description": "The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message\n", + "name": "paid_message_star_count", + "required": true + } + ], + "category": "types" + }, { "anchor": "giveawaycreated", "name": "GiveawayCreated", @@ -6231,6 +6281,319 @@ ], "category": "types" }, + { + "anchor": "storyareaposition", + "name": "StoryAreaPosition", + "description": "Describes the position of a clickable area within a story.", + "html_description": "

Describes the position of a clickable area within a story.

", + "rst_description": "Describes the position of a clickable area within a story.", + "annotations": [ + { + "type": "Float", + "description": "The abscissa of the area's center, as a percentage of the media width", + "html_description": "The abscissa of the area's center, as a percentage of the media width", + "rst_description": "The abscissa of the area's center, as a percentage of the media width\n", + "name": "x_percentage", + "required": true + }, + { + "type": "Float", + "description": "The ordinate of the area's center, as a percentage of the media height", + "html_description": "The ordinate of the area's center, as a percentage of the media height", + "rst_description": "The ordinate of the area's center, as a percentage of the media height\n", + "name": "y_percentage", + "required": true + }, + { + "type": "Float", + "description": "The width of the area's rectangle, as a percentage of the media width", + "html_description": "The width of the area's rectangle, as a percentage of the media width", + "rst_description": "The width of the area's rectangle, as a percentage of the media width\n", + "name": "width_percentage", + "required": true + }, + { + "type": "Float", + "description": "The height of the area's rectangle, as a percentage of the media height", + "html_description": "The height of the area's rectangle, as a percentage of the media height", + "rst_description": "The height of the area's rectangle, as a percentage of the media height\n", + "name": "height_percentage", + "required": true + }, + { + "type": "Float", + "description": "The clockwise rotation angle of the rectangle, in degrees; 0-360", + "html_description": "The clockwise rotation angle of the rectangle, in degrees; 0-360", + "rst_description": "The clockwise rotation angle of the rectangle, in degrees; 0-360\n", + "name": "rotation_angle", + "required": true + }, + { + "type": "Float", + "description": "The radius of the rectangle corner rounding, as a percentage of the media width", + "html_description": "The radius of the rectangle corner rounding, as a percentage of the media width", + "rst_description": "The radius of the rectangle corner rounding, as a percentage of the media width\n", + "name": "corner_radius_percentage", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "locationaddress", + "name": "LocationAddress", + "description": "Describes the physical address of a location.", + "html_description": "

Describes the physical address of a location.

", + "rst_description": "Describes the physical address of a location.", + "annotations": [ + { + "type": "String", + "description": "The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located", + "html_description": "The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located", + "rst_description": "The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located\n", + "name": "country_code", + "required": true + }, + { + "type": "String", + "description": "State of the location", + "html_description": "Optional. State of the location", + "rst_description": "*Optional*. State of the location\n", + "name": "state", + "required": false + }, + { + "type": "String", + "description": "City of the location", + "html_description": "Optional. City of the location", + "rst_description": "*Optional*. City of the location\n", + "name": "city", + "required": false + }, + { + "type": "String", + "description": "Street address of the location", + "html_description": "Optional. Street address of the location", + "rst_description": "*Optional*. Street address of the location\n", + "name": "street", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "storyareatype", + "name": "StoryAreaType", + "description": "Describes the type of a clickable area on a story. Currently, it can be one of\n - StoryAreaTypeLocation\n - StoryAreaTypeSuggestedReaction\n - StoryAreaTypeLink\n - StoryAreaTypeWeather\n - StoryAreaTypeUniqueGift", + "html_description": "

Describes the type of a clickable area on a story. Currently, it can be one of

", + "rst_description": "Describes the type of a clickable area on a story. Currently, it can be one of\n\n - :class:`aiogram.types.story_area_type_location.StoryAreaTypeLocation`\n - :class:`aiogram.types.story_area_type_suggested_reaction.StoryAreaTypeSuggestedReaction`\n - :class:`aiogram.types.story_area_type_link.StoryAreaTypeLink`\n - :class:`aiogram.types.story_area_type_weather.StoryAreaTypeWeather`\n - :class:`aiogram.types.story_area_type_unique_gift.StoryAreaTypeUniqueGift`", + "annotations": [], + "category": "types" + }, + { + "anchor": "storyareatypelocation", + "name": "StoryAreaTypeLocation", + "description": "Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.", + "html_description": "

Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.

", + "rst_description": "Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'location'", + "html_description": "Type of the area, always “location”", + "rst_description": "Type of the area, always 'location'\n", + "name": "type", + "required": true + }, + { + "type": "Float", + "description": "Location latitude in degrees", + "html_description": "Location latitude in degrees", + "rst_description": "Location latitude in degrees\n", + "name": "latitude", + "required": true + }, + { + "type": "Float", + "description": "Location longitude in degrees", + "html_description": "Location longitude in degrees", + "rst_description": "Location longitude in degrees\n", + "name": "longitude", + "required": true + }, + { + "type": "LocationAddress", + "description": "Address of the location", + "html_description": "Optional. Address of the location", + "rst_description": "*Optional*. Address of the location\n", + "name": "address", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "storyareatypesuggestedreaction", + "name": "StoryAreaTypeSuggestedReaction", + "description": "Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.", + "html_description": "

Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.

", + "rst_description": "Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'suggested_reaction'", + "html_description": "Type of the area, always “suggested_reaction”", + "rst_description": "Type of the area, always 'suggested_reaction'\n", + "name": "type", + "required": true + }, + { + "type": "ReactionType", + "description": "Type of the reaction", + "html_description": "Type of the reaction", + "rst_description": "Type of the reaction\n", + "name": "reaction_type", + "required": true + }, + { + "type": "Boolean", + "description": "Pass True if the reaction area has a dark background", + "html_description": "Optional. Pass True if the reaction area has a dark background", + "rst_description": "*Optional*. Pass :code:`True` if the reaction area has a dark background\n", + "name": "is_dark", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True if reaction area corner is flipped", + "html_description": "Optional. Pass True if reaction area corner is flipped", + "rst_description": "*Optional*. Pass :code:`True` if reaction area corner is flipped\n", + "name": "is_flipped", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "storyareatypelink", + "name": "StoryAreaTypeLink", + "description": "Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.", + "html_description": "

Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.

", + "rst_description": "Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'link'", + "html_description": "Type of the area, always “link”", + "rst_description": "Type of the area, always 'link'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "HTTP or tg:// URL to be opened when the area is clicked", + "html_description": "HTTP or tg:// URL to be opened when the area is clicked", + "rst_description": "HTTP or tg:// URL to be opened when the area is clicked\n", + "name": "url", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "storyareatypeweather", + "name": "StoryAreaTypeWeather", + "description": "Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.", + "html_description": "

Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.

", + "rst_description": "Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'weather'", + "html_description": "Type of the area, always “weather”", + "rst_description": "Type of the area, always 'weather'\n", + "name": "type", + "required": true + }, + { + "type": "Float", + "description": "Temperature, in degree Celsius", + "html_description": "Temperature, in degree Celsius", + "rst_description": "Temperature, in degree Celsius\n", + "name": "temperature", + "required": true + }, + { + "type": "String", + "description": "Emoji representing the weather", + "html_description": "Emoji representing the weather", + "rst_description": "Emoji representing the weather\n", + "name": "emoji", + "required": true + }, + { + "type": "Integer", + "description": "A color of the area background in the ARGB format", + "html_description": "A color of the area background in the ARGB format", + "rst_description": "A color of the area background in the ARGB format\n", + "name": "background_color", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "storyareatypeuniquegift", + "name": "StoryAreaTypeUniqueGift", + "description": "Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.", + "html_description": "

Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.

", + "rst_description": "Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'unique_gift'", + "html_description": "Type of the area, always “unique_gift”", + "rst_description": "Type of the area, always 'unique_gift'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Unique name of the gift", + "html_description": "Unique name of the gift", + "rst_description": "Unique name of the gift\n", + "name": "name", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "storyarea", + "name": "StoryArea", + "description": "Describes a clickable area on a story media.", + "html_description": "

Describes a clickable area on a story media.

", + "rst_description": "Describes a clickable area on a story media.", + "annotations": [ + { + "type": "StoryAreaPosition", + "description": "Position of the area", + "html_description": "Position of the area", + "rst_description": "Position of the area\n", + "name": "position", + "required": true + }, + { + "type": "StoryAreaType", + "description": "Type of the area", + "html_description": "Type of the area", + "rst_description": "Type of the area\n", + "name": "type", + "required": true + } + ], + "category": "types" + }, { "anchor": "chatlocation", "name": "ChatLocation", @@ -6512,6 +6875,699 @@ ], "category": "types" }, + { + "anchor": "gift", + "name": "Gift", + "description": "This object represents a gift that can be sent by the bot.", + "html_description": "

This object represents a gift that can be sent by the bot.

", + "rst_description": "This object represents a gift that can be sent by the bot.", + "annotations": [ + { + "type": "String", + "description": "Unique identifier of the gift", + "html_description": "Unique identifier of the gift", + "rst_description": "Unique identifier of the gift\n", + "name": "id", + "required": true + }, + { + "type": "Sticker", + "description": "The sticker that represents the gift", + "html_description": "The sticker that represents the gift", + "rst_description": "The sticker that represents the gift\n", + "name": "sticker", + "required": true + }, + { + "type": "Integer", + "description": "The number of Telegram Stars that must be paid to send the sticker", + "html_description": "The number of Telegram Stars that must be paid to send the sticker", + "rst_description": "The number of Telegram Stars that must be paid to send the sticker\n", + "name": "star_count", + "required": true + }, + { + "type": "Integer", + "description": "The number of Telegram Stars that must be paid to upgrade the gift to a unique one", + "html_description": "Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one", + "rst_description": "*Optional*. The number of Telegram Stars that must be paid to upgrade the gift to a unique one\n", + "name": "upgrade_star_count", + "required": false + }, + { + "type": "Integer", + "description": "The total number of the gifts of this type that can be sent; for limited gifts only", + "html_description": "Optional. The total number of the gifts of this type that can be sent; for limited gifts only", + "rst_description": "*Optional*. The total number of the gifts of this type that can be sent; for limited gifts only\n", + "name": "total_count", + "required": false + }, + { + "type": "Integer", + "description": "The number of remaining gifts of this type that can be sent; for limited gifts only", + "html_description": "Optional. The number of remaining gifts of this type that can be sent; for limited gifts only", + "rst_description": "*Optional*. The number of remaining gifts of this type that can be sent; for limited gifts only\n", + "name": "remaining_count", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "gifts", + "name": "Gifts", + "description": "This object represent a list of gifts.", + "html_description": "

This object represent a list of gifts.

", + "rst_description": "This object represent a list of gifts.", + "annotations": [ + { + "type": "Array of Gift", + "description": "The list of gifts", + "html_description": "The list of gifts", + "rst_description": "The list of gifts\n", + "name": "gifts", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "uniquegiftmodel", + "name": "UniqueGiftModel", + "description": "This object describes the model of a unique gift.", + "html_description": "

This object describes the model of a unique gift.

", + "rst_description": "This object describes the model of a unique gift.", + "annotations": [ + { + "type": "String", + "description": "Name of the model", + "html_description": "Name of the model", + "rst_description": "Name of the model\n", + "name": "name", + "required": true + }, + { + "type": "Sticker", + "description": "The sticker that represents the unique gift", + "html_description": "The sticker that represents the unique gift", + "rst_description": "The sticker that represents the unique gift\n", + "name": "sticker", + "required": true + }, + { + "type": "Integer", + "description": "The number of unique gifts that receive this model for every 1000 gifts upgraded", + "html_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded", + "rst_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded\n", + "name": "rarity_per_mille", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "uniquegiftsymbol", + "name": "UniqueGiftSymbol", + "description": "This object describes the symbol shown on the pattern of a unique gift.", + "html_description": "

This object describes the symbol shown on the pattern of a unique gift.

", + "rst_description": "This object describes the symbol shown on the pattern of a unique gift.", + "annotations": [ + { + "type": "String", + "description": "Name of the symbol", + "html_description": "Name of the symbol", + "rst_description": "Name of the symbol\n", + "name": "name", + "required": true + }, + { + "type": "Sticker", + "description": "The sticker that represents the unique gift", + "html_description": "The sticker that represents the unique gift", + "rst_description": "The sticker that represents the unique gift\n", + "name": "sticker", + "required": true + }, + { + "type": "Integer", + "description": "The number of unique gifts that receive this model for every 1000 gifts upgraded", + "html_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded", + "rst_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded\n", + "name": "rarity_per_mille", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "uniquegiftbackdropcolors", + "name": "UniqueGiftBackdropColors", + "description": "This object describes the colors of the backdrop of a unique gift.", + "html_description": "

This object describes the colors of the backdrop of a unique gift.

", + "rst_description": "This object describes the colors of the backdrop of a unique gift.", + "annotations": [ + { + "type": "Integer", + "description": "The color in the center of the backdrop in RGB format", + "html_description": "The color in the center of the backdrop in RGB format", + "rst_description": "The color in the center of the backdrop in RGB format\n", + "name": "center_color", + "required": true + }, + { + "type": "Integer", + "description": "The color on the edges of the backdrop in RGB format", + "html_description": "The color on the edges of the backdrop in RGB format", + "rst_description": "The color on the edges of the backdrop in RGB format\n", + "name": "edge_color", + "required": true + }, + { + "type": "Integer", + "description": "The color to be applied to the symbol in RGB format", + "html_description": "The color to be applied to the symbol in RGB format", + "rst_description": "The color to be applied to the symbol in RGB format\n", + "name": "symbol_color", + "required": true + }, + { + "type": "Integer", + "description": "The color for the text on the backdrop in RGB format", + "html_description": "The color for the text on the backdrop in RGB format", + "rst_description": "The color for the text on the backdrop in RGB format\n", + "name": "text_color", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "uniquegiftbackdrop", + "name": "UniqueGiftBackdrop", + "description": "This object describes the backdrop of a unique gift.", + "html_description": "

This object describes the backdrop of a unique gift.

", + "rst_description": "This object describes the backdrop of a unique gift.", + "annotations": [ + { + "type": "String", + "description": "Name of the backdrop", + "html_description": "Name of the backdrop", + "rst_description": "Name of the backdrop\n", + "name": "name", + "required": true + }, + { + "type": "UniqueGiftBackdropColors", + "description": "Colors of the backdrop", + "html_description": "Colors of the backdrop", + "rst_description": "Colors of the backdrop\n", + "name": "colors", + "required": true + }, + { + "type": "Integer", + "description": "The number of unique gifts that receive this backdrop for every 1000 gifts upgraded", + "html_description": "The number of unique gifts that receive this backdrop for every 1000 gifts upgraded", + "rst_description": "The number of unique gifts that receive this backdrop for every 1000 gifts upgraded\n", + "name": "rarity_per_mille", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "uniquegift", + "name": "UniqueGift", + "description": "This object describes a unique gift that was upgraded from a regular gift.", + "html_description": "

This object describes a unique gift that was upgraded from a regular gift.

", + "rst_description": "This object describes a unique gift that was upgraded from a regular gift.", + "annotations": [ + { + "type": "String", + "description": "Human-readable name of the regular gift from which this unique gift was upgraded", + "html_description": "Human-readable name of the regular gift from which this unique gift was upgraded", + "rst_description": "Human-readable name of the regular gift from which this unique gift was upgraded\n", + "name": "base_name", + "required": true + }, + { + "type": "String", + "description": "Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas", + "html_description": "Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas", + "rst_description": "Unique name of the gift. This name can be used in :code:`https://t.me/nft/...` links and story areas\n", + "name": "name", + "required": true + }, + { + "type": "Integer", + "description": "Unique number of the upgraded gift among gifts upgraded from the same regular gift", + "html_description": "Unique number of the upgraded gift among gifts upgraded from the same regular gift", + "rst_description": "Unique number of the upgraded gift among gifts upgraded from the same regular gift\n", + "name": "number", + "required": true + }, + { + "type": "UniqueGiftModel", + "description": "Model of the gift", + "html_description": "Model of the gift", + "rst_description": "Model of the gift\n", + "name": "model", + "required": true + }, + { + "type": "UniqueGiftSymbol", + "description": "Symbol of the gift", + "html_description": "Symbol of the gift", + "rst_description": "Symbol of the gift\n", + "name": "symbol", + "required": true + }, + { + "type": "UniqueGiftBackdrop", + "description": "Backdrop of the gift", + "html_description": "Backdrop of the gift", + "rst_description": "Backdrop of the gift\n", + "name": "backdrop", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "giftinfo", + "name": "GiftInfo", + "description": "Describes a service message about a regular gift that was sent or received.", + "html_description": "

Describes a service message about a regular gift that was sent or received.

", + "rst_description": "Describes a service message about a regular gift that was sent or received.", + "annotations": [ + { + "type": "Gift", + "description": "Information about the gift", + "html_description": "Information about the gift", + "rst_description": "Information about the gift\n", + "name": "gift", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts", + "html_description": "Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts", + "rst_description": "*Optional*. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts\n", + "name": "owned_gift_id", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible", + "html_description": "Optional. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible", + "rst_description": "*Optional*. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible\n", + "name": "convert_star_count", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift", + "html_description": "Optional. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift", + "rst_description": "*Optional*. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift\n", + "name": "prepaid_upgrade_star_count", + "required": false + }, + { + "type": "True", + "description": "True, if the gift can be upgraded to a unique gift", + "html_description": "Optional. True, if the gift can be upgraded to a unique gift", + "rst_description": "*Optional*. True, if the gift can be upgraded to a unique gift\n", + "name": "can_be_upgraded", + "required": false + }, + { + "type": "String", + "description": "Text of the message that was added to the gift", + "html_description": "Optional. Text of the message that was added to the gift", + "rst_description": "*Optional*. Text of the message that was added to the gift\n", + "name": "text", + "required": false + }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the text", + "html_description": "Optional. Special entities that appear in the text", + "rst_description": "*Optional*. Special entities that appear in the text\n", + "name": "entities", + "required": false + }, + { + "type": "True", + "description": "True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them", + "html_description": "Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them", + "rst_description": "*Optional*. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them\n", + "name": "is_private", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "uniquegiftinfo", + "name": "UniqueGiftInfo", + "description": "Describes a service message about a unique gift that was sent or received.", + "html_description": "

Describes a service message about a unique gift that was sent or received.

", + "rst_description": "Describes a service message about a unique gift that was sent or received.", + "annotations": [ + { + "type": "UniqueGift", + "description": "Information about the gift", + "html_description": "Information about the gift", + "rst_description": "Information about the gift\n", + "name": "gift", + "required": true + }, + { + "type": "String", + "description": "Origin of the gift. Currently, either 'upgrade' or 'transfer'", + "html_description": "Origin of the gift. Currently, either “upgrade” or “transfer”", + "rst_description": "Origin of the gift. Currently, either 'upgrade' or 'transfer'\n", + "name": "origin", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts", + "html_description": "Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts", + "rst_description": "*Optional*. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts\n", + "name": "owned_gift_id", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift", + "html_description": "Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift", + "rst_description": "*Optional*. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift\n", + "name": "transfer_star_count", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "ownedgift", + "name": "OwnedGift", + "description": "This object describes a gift received and owned by a user or a chat. Currently, it can be one of\n - OwnedGiftRegular\n - OwnedGiftUnique", + "html_description": "

This object describes a gift received and owned by a user or a chat. Currently, it can be one of

", + "rst_description": "This object describes a gift received and owned by a user or a chat. Currently, it can be one of\n\n - :class:`aiogram.types.owned_gift_regular.OwnedGiftRegular`\n - :class:`aiogram.types.owned_gift_unique.OwnedGiftUnique`", + "annotations": [], + "category": "types" + }, + { + "anchor": "ownedgiftregular", + "name": "OwnedGiftRegular", + "description": "Describes a regular gift owned by a user or a chat.", + "html_description": "

Describes a regular gift owned by a user or a chat.

", + "rst_description": "Describes a regular gift owned by a user or a chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the gift, always 'regular'", + "html_description": "Type of the gift, always “regular”", + "rst_description": "Type of the gift, always 'regular'\n", + "name": "type", + "required": true + }, + { + "type": "Gift", + "description": "Information about the regular gift", + "html_description": "Information about the regular gift", + "rst_description": "Information about the regular gift\n", + "name": "gift", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only", + "html_description": "Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only\n", + "name": "owned_gift_id", + "required": false + }, + { + "type": "User", + "description": "Sender of the gift if it is a known user", + "html_description": "Optional. Sender of the gift if it is a known user", + "rst_description": "*Optional*. Sender of the gift if it is a known user\n", + "name": "sender_user", + "required": false + }, + { + "type": "Integer", + "description": "Date the gift was sent in Unix time", + "html_description": "Date the gift was sent in Unix time", + "rst_description": "Date the gift was sent in Unix time\n", + "name": "send_date", + "required": true + }, + { + "type": "String", + "description": "Text of the message that was added to the gift", + "html_description": "Optional. Text of the message that was added to the gift", + "rst_description": "*Optional*. Text of the message that was added to the gift\n", + "name": "text", + "required": false + }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the text", + "html_description": "Optional. Special entities that appear in the text", + "rst_description": "*Optional*. Special entities that appear in the text\n", + "name": "entities", + "required": false + }, + { + "type": "True", + "description": "True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them", + "html_description": "Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them", + "rst_description": "*Optional*. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them\n", + "name": "is_private", + "required": false + }, + { + "type": "True", + "description": "True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only", + "html_description": "Optional. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only\n", + "name": "is_saved", + "required": false + }, + { + "type": "True", + "description": "True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only", + "html_description": "Optional. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only\n", + "name": "can_be_upgraded", + "required": false + }, + { + "type": "True", + "description": "True, if the gift was refunded and isn't available anymore", + "html_description": "Optional. True, if the gift was refunded and isn't available anymore", + "rst_description": "*Optional*. True, if the gift was refunded and isn't available anymore\n", + "name": "was_refunded", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars", + "html_description": "Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars", + "rst_description": "*Optional*. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars\n", + "name": "convert_star_count", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift", + "html_description": "Optional. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift", + "rst_description": "*Optional*. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift\n", + "name": "prepaid_upgrade_star_count", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "ownedgiftunique", + "name": "OwnedGiftUnique", + "description": "Describes a unique gift received and owned by a user or a chat.", + "html_description": "

Describes a unique gift received and owned by a user or a chat.

", + "rst_description": "Describes a unique gift received and owned by a user or a chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the gift, always 'unique'", + "html_description": "Type of the gift, always “unique”", + "rst_description": "Type of the gift, always 'unique'\n", + "name": "type", + "required": true + }, + { + "type": "UniqueGift", + "description": "Information about the unique gift", + "html_description": "Information about the unique gift", + "rst_description": "Information about the unique gift\n", + "name": "gift", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only", + "html_description": "Optional. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only\n", + "name": "owned_gift_id", + "required": false + }, + { + "type": "User", + "description": "Sender of the gift if it is a known user", + "html_description": "Optional. Sender of the gift if it is a known user", + "rst_description": "*Optional*. Sender of the gift if it is a known user\n", + "name": "sender_user", + "required": false + }, + { + "type": "Integer", + "description": "Date the gift was sent in Unix time", + "html_description": "Date the gift was sent in Unix time", + "rst_description": "Date the gift was sent in Unix time\n", + "name": "send_date", + "required": true + }, + { + "type": "True", + "description": "True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only", + "html_description": "Optional. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only\n", + "name": "is_saved", + "required": false + }, + { + "type": "True", + "description": "True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only", + "html_description": "Optional. True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only\n", + "name": "can_be_transferred", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift", + "html_description": "Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift", + "rst_description": "*Optional*. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift\n", + "name": "transfer_star_count", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "ownedgifts", + "name": "OwnedGifts", + "description": "Contains the list of gifts received and owned by a user or a chat.", + "html_description": "

Contains the list of gifts received and owned by a user or a chat.

", + "rst_description": "Contains the list of gifts received and owned by a user or a chat.", + "annotations": [ + { + "type": "Integer", + "description": "The total number of gifts owned by the user or the chat", + "html_description": "The total number of gifts owned by the user or the chat", + "rst_description": "The total number of gifts owned by the user or the chat\n", + "name": "total_count", + "required": true + }, + { + "type": "Array of OwnedGift", + "description": "The list of gifts", + "html_description": "The list of gifts", + "rst_description": "The list of gifts\n", + "name": "gifts", + "required": true + }, + { + "type": "String", + "description": "Offset for the next request. If empty, then there are no more results", + "html_description": "Optional. Offset for the next request. If empty, then there are no more results", + "rst_description": "*Optional*. Offset for the next request. If empty, then there are no more results\n", + "name": "next_offset", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "acceptedgifttypes", + "name": "AcceptedGiftTypes", + "description": "This object describes the types of gifts that can be gifted to a user or a chat.", + "html_description": "

This object describes the types of gifts that can be gifted to a user or a chat.

", + "rst_description": "This object describes the types of gifts that can be gifted to a user or a chat.", + "annotations": [ + { + "type": "Boolean", + "description": "True, if unlimited regular gifts are accepted", + "html_description": "True, if unlimited regular gifts are accepted", + "rst_description": "True, if unlimited regular gifts are accepted\n", + "name": "unlimited_gifts", + "required": true + }, + { + "type": "Boolean", + "description": "True, if limited regular gifts are accepted", + "html_description": "True, if limited regular gifts are accepted", + "rst_description": "True, if limited regular gifts are accepted\n", + "name": "limited_gifts", + "required": true + }, + { + "type": "Boolean", + "description": "True, if unique gifts or gifts that can be upgraded to unique for free are accepted", + "html_description": "True, if unique gifts or gifts that can be upgraded to unique for free are accepted", + "rst_description": "True, if unique gifts or gifts that can be upgraded to unique for free are accepted\n", + "name": "unique_gifts", + "required": true + }, + { + "type": "Boolean", + "description": "True, if a Telegram Premium subscription is accepted", + "html_description": "True, if a Telegram Premium subscription is accepted", + "rst_description": "True, if a Telegram Premium subscription is accepted\n", + "name": "premium_subscription", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "staramount", + "name": "StarAmount", + "description": "Describes an amount of Telegram Stars.", + "html_description": "

Describes an amount of Telegram Stars.

", + "rst_description": "Describes an amount of Telegram Stars.", + "annotations": [ + { + "type": "Integer", + "description": "Integer amount of Telegram Stars, rounded to 0; can be negative", + "html_description": "Integer amount of Telegram Stars, rounded to 0; can be negative", + "rst_description": "Integer amount of Telegram Stars, rounded to 0; can be negative\n", + "name": "amount", + "required": true + }, + { + "type": "Integer", + "description": "The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive", + "html_description": "Optional. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive", + "rst_description": "*Optional*. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if *amount* is non-positive\n", + "name": "nanostar_amount", + "required": false + } + ], + "category": "types" + }, { "anchor": "botcommand", "name": "BotCommand", @@ -7077,6 +8133,128 @@ ], "category": "types" }, + { + "anchor": "businessbotrights", + "name": "BusinessBotRights", + "description": "Represents the rights of a business bot.", + "html_description": "

Represents the rights of a business bot.

", + "rst_description": "Represents the rights of a business bot.", + "annotations": [ + { + "type": "True", + "description": "True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours", + "html_description": "Optional. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours", + "rst_description": "*Optional*. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours\n", + "name": "can_reply", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can mark incoming private messages as read", + "html_description": "Optional. True, if the bot can mark incoming private messages as read", + "rst_description": "*Optional*. True, if the bot can mark incoming private messages as read\n", + "name": "can_read_messages", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can delete messages sent by the bot", + "html_description": "Optional. True, if the bot can delete messages sent by the bot", + "rst_description": "*Optional*. True, if the bot can delete messages sent by the bot\n", + "name": "can_delete_outgoing_messages", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can delete all private messages in managed chats", + "html_description": "Optional. True, if the bot can delete all private messages in managed chats", + "rst_description": "*Optional*. True, if the bot can delete all private messages in managed chats\n", + "name": "can_delete_all_messages", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can edit the first and last name of the business account", + "html_description": "Optional. True, if the bot can edit the first and last name of the business account", + "rst_description": "*Optional*. True, if the bot can edit the first and last name of the business account\n", + "name": "can_edit_name", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can edit the bio of the business account", + "html_description": "Optional. True, if the bot can edit the bio of the business account", + "rst_description": "*Optional*. True, if the bot can edit the bio of the business account\n", + "name": "can_edit_bio", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can edit the profile photo of the business account", + "html_description": "Optional. True, if the bot can edit the profile photo of the business account", + "rst_description": "*Optional*. True, if the bot can edit the profile photo of the business account\n", + "name": "can_edit_profile_photo", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can edit the username of the business account", + "html_description": "Optional. True, if the bot can edit the username of the business account", + "rst_description": "*Optional*. True, if the bot can edit the username of the business account\n", + "name": "can_edit_username", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can change the privacy settings pertaining to gifts for the business account", + "html_description": "Optional. True, if the bot can change the privacy settings pertaining to gifts for the business account", + "rst_description": "*Optional*. True, if the bot can change the privacy settings pertaining to gifts for the business account\n", + "name": "can_change_gift_settings", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can view gifts and the amount of Telegram Stars owned by the business account", + "html_description": "Optional. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account", + "rst_description": "*Optional*. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account\n", + "name": "can_view_gifts_and_stars", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can convert regular gifts owned by the business account to Telegram Stars", + "html_description": "Optional. True, if the bot can convert regular gifts owned by the business account to Telegram Stars", + "rst_description": "*Optional*. True, if the bot can convert regular gifts owned by the business account to Telegram Stars\n", + "name": "can_convert_gifts_to_stars", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can transfer and upgrade gifts owned by the business account", + "html_description": "Optional. True, if the bot can transfer and upgrade gifts owned by the business account", + "rst_description": "*Optional*. True, if the bot can transfer and upgrade gifts owned by the business account\n", + "name": "can_transfer_and_upgrade_gifts", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts", + "html_description": "Optional. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts", + "rst_description": "*Optional*. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts\n", + "name": "can_transfer_stars", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can post, edit and delete stories on behalf of the business account", + "html_description": "Optional. True, if the bot can post, edit and delete stories on behalf of the business account", + "rst_description": "*Optional*. True, if the bot can post, edit and delete stories on behalf of the business account\n", + "name": "can_manage_stories", + "required": false + } + ], + "category": "types" + }, { "anchor": "businessconnection", "name": "BusinessConnection", @@ -7117,12 +8295,12 @@ "required": true }, { - "type": "Boolean", - "description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", - "html_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", - "rst_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours\n", - "name": "can_reply", - "required": true + "type": "BusinessBotRights", + "description": "Rights of the business bot", + "html_description": "Optional. Rights of the business bot", + "rst_description": "*Optional*. Rights of the business bot\n", + "name": "rights", + "required": false }, { "type": "Boolean", @@ -7763,6 +8941,160 @@ } ], "category": "types" + }, + { + "anchor": "inputprofilephoto", + "name": "InputProfilePhoto", + "description": "This object describes a profile photo to set. Currently, it can be one of\n - InputProfilePhotoStatic\n - InputProfilePhotoAnimated", + "html_description": "

This object describes a profile photo to set. Currently, it can be one of

", + "rst_description": "This object describes a profile photo to set. Currently, it can be one of\n\n - :class:`aiogram.types.input_profile_photo_static.InputProfilePhotoStatic`\n - :class:`aiogram.types.input_profile_photo_animated.InputProfilePhotoAnimated`", + "annotations": [], + "category": "types" + }, + { + "anchor": "inputprofilephotostatic", + "name": "InputProfilePhotoStatic", + "description": "A static profile photo in the .JPG format.", + "html_description": "

A static profile photo in the .JPG format.

", + "rst_description": "A static profile photo in the .JPG format.", + "annotations": [ + { + "type": "String", + "description": "Type of the profile photo, must be 'static'", + "html_description": "Type of the profile photo, must be “static”", + "rst_description": "Type of the profile photo, must be 'static'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . More information on Sending Files", + "html_description": "The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", + "rst_description": "The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", + "name": "photo", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "inputprofilephotoanimated", + "name": "InputProfilePhotoAnimated", + "description": "An animated profile photo in the MPEG4 format.", + "html_description": "

An animated profile photo in the MPEG4 format.

", + "rst_description": "An animated profile photo in the MPEG4 format.", + "annotations": [ + { + "type": "String", + "description": "Type of the profile photo, must be 'animated'", + "html_description": "Type of the profile photo, must be “animated”", + "rst_description": "Type of the profile photo, must be 'animated'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . More information on Sending Files", + "html_description": "The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", + "rst_description": "The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", + "name": "animation", + "required": true + }, + { + "type": "Float", + "description": "Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.", + "html_description": "Optional. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.", + "rst_description": "*Optional*. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.\n", + "name": "main_frame_timestamp", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "inputstorycontent", + "name": "InputStoryContent", + "description": "This object describes the content of a story to post. Currently, it can be one of\n - InputStoryContentPhoto\n - InputStoryContentVideo", + "html_description": "

This object describes the content of a story to post. Currently, it can be one of

", + "rst_description": "This object describes the content of a story to post. Currently, it can be one of\n\n - :class:`aiogram.types.input_story_content_photo.InputStoryContentPhoto`\n - :class:`aiogram.types.input_story_content_video.InputStoryContentVideo`", + "annotations": [], + "category": "types" + }, + { + "anchor": "inputstorycontentphoto", + "name": "InputStoryContentPhoto", + "description": "Describes a photo to post as a story.", + "html_description": "

Describes a photo to post as a story.

", + "rst_description": "Describes a photo to post as a story.", + "annotations": [ + { + "type": "String", + "description": "Type of the content, must be 'photo'", + "html_description": "Type of the content, must be “photo”", + "rst_description": "Type of the content, must be 'photo'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . More information on Sending Files", + "html_description": "The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", + "rst_description": "The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", + "name": "photo", + "required": true + } + ], + "category": "types" + }, + { + "anchor": "inputstorycontentvideo", + "name": "InputStoryContentVideo", + "description": "Describes a video to post as a story.", + "html_description": "

Describes a video to post as a story.

", + "rst_description": "Describes a video to post as a story.", + "annotations": [ + { + "type": "String", + "description": "Type of the content, must be 'video'", + "html_description": "Type of the content, must be “video”", + "rst_description": "Type of the content, must be 'video'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the video was uploaded using multipart/form-data under . More information on Sending Files", + "html_description": "The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the video was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", + "rst_description": "The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the video was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", + "name": "video", + "required": true + }, + { + "type": "Float", + "description": "Precise duration of the video in seconds; 0-60", + "html_description": "Optional. Precise duration of the video in seconds; 0-60", + "rst_description": "*Optional*. Precise duration of the video in seconds; 0-60\n", + "name": "duration", + "required": false + }, + { + "type": "Float", + "description": "Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.", + "html_description": "Optional. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.", + "rst_description": "*Optional*. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.\n", + "name": "cover_frame_timestamp", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True if the video has no sound", + "html_description": "Optional. Pass True if the video has no sound", + "rst_description": "*Optional*. Pass :code:`True` if the video has no sound\n", + "name": "is_animation", + "required": false + } + ], + "category": "types" } ], "description": "All types used in the Bot API responses are represented as JSON-objects.\nIt is safe to use 32-bit signed integers for storing all Integer fields unless otherwise noted.\nOptional fields may be not returned when irrelevant." @@ -9240,9 +10572,9 @@ { "type": "Integer", "required": true, - "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-2500", - "html_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-2500", - "rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-2500\n", + "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000", + "html_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000", + "rst_description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000\n", "name": "star_count" }, { @@ -10814,9 +12146,9 @@ { "type": "Integer", "required": true, - "description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500", - "html_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500", - "rst_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500\n", + "description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000", + "html_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000", + "rst_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000\n", "name": "subscription_price" } ], @@ -12499,6 +13831,877 @@ } ], "category": "methods" + }, + { + "anchor": "getavailablegifts", + "name": "getAvailableGifts", + "description": "Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.", + "html_description": "

Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.

", + "rst_description": "Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object.", + "annotations": [], + "category": "methods" + }, + { + "anchor": "sendgift", + "name": "sendGift", + "description": "Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.", + "html_description": "

Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.

", + "rst_description": "Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer", + "required": false, + "description": "Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.", + "html_description": "Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.", + "rst_description": "Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift.\n", + "name": "user_id" + }, + { + "type": "Integer or String", + "required": false, + "description": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.", + "html_description": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.", + "rst_description": "Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift.\n", + "name": "chat_id" + }, + { + "type": "String", + "required": true, + "description": "Identifier of the gift", + "html_description": "Identifier of the gift", + "rst_description": "Identifier of the gift\n", + "name": "gift_id" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver", + "html_description": "Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver", + "rst_description": "Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver\n", + "name": "pay_for_upgrade" + }, + { + "type": "String", + "required": false, + "description": "Text that will be shown along with the gift; 0-128 characters", + "html_description": "Text that will be shown along with the gift; 0-128 characters", + "rst_description": "Text that will be shown along with the gift; 0-128 characters\n", + "name": "text" + }, + { + "type": "String", + "required": false, + "description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.", + "html_description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.", + "rst_description": "Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n", + "name": "text_parse_mode" + }, + { + "type": "Array of MessageEntity", + "required": false, + "description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.", + "html_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.", + "rst_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n", + "name": "text_entities" + } + ], + "category": "methods" + }, + { + "anchor": "giftpremiumsubscription", + "name": "giftPremiumSubscription", + "description": "Gifts a Telegram Premium subscription to the given user. Returns True on success.", + "html_description": "

Gifts a Telegram Premium subscription to the given user. Returns True on success.

", + "rst_description": "Gifts a Telegram Premium subscription to the given user. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the target user who will receive a Telegram Premium subscription", + "html_description": "Unique identifier of the target user who will receive a Telegram Premium subscription", + "rst_description": "Unique identifier of the target user who will receive a Telegram Premium subscription\n", + "name": "user_id" + }, + { + "type": "Integer", + "required": true, + "description": "Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12", + "html_description": "Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12", + "rst_description": "Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12\n", + "name": "month_count" + }, + { + "type": "Integer", + "required": true, + "description": "Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months", + "html_description": "Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months", + "rst_description": "Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months\n", + "name": "star_count" + }, + { + "type": "String", + "required": false, + "description": "Text that will be shown along with the service message about the subscription; 0-128 characters", + "html_description": "Text that will be shown along with the service message about the subscription; 0-128 characters", + "rst_description": "Text that will be shown along with the service message about the subscription; 0-128 characters\n", + "name": "text" + }, + { + "type": "String", + "required": false, + "description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.", + "html_description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.", + "rst_description": "Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n", + "name": "text_parse_mode" + }, + { + "type": "Array of MessageEntity", + "required": false, + "description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.", + "html_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.", + "rst_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n", + "name": "text_entities" + } + ], + "category": "methods" + }, + { + "anchor": "verifyuser", + "name": "verifyUser", + "description": "Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.", + "html_description": "

Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.

", + "rst_description": "Verifies a user `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success.", + "annotations": [ + { + "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" + }, + { + "type": "String", + "required": false, + "description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.", + "html_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.", + "rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n", + "name": "custom_description" + } + ], + "category": "methods" + }, + { + "anchor": "verifychat", + "name": "verifyChat", + "description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.", + "html_description": "

Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.

", + "rst_description": "Verifies a chat `on behalf of the organization `_ which is represented by the bot. 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": "String", + "required": false, + "description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.", + "html_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.", + "rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n", + "name": "custom_description" + } + ], + "category": "methods" + }, + { + "anchor": "removeuserverification", + "name": "removeUserVerification", + "description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.", + "html_description": "

Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.

", + "rst_description": "Removes verification from a user who is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success.", + "annotations": [ + { + "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": "removechatverification", + "name": "removeChatVerification", + "description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.", + "html_description": "

Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.

", + "rst_description": "Removes verification from a chat that is currently verified `on behalf of the organization `_ represented by the bot. 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" + } + ], + "category": "methods" + }, + { + "anchor": "readbusinessmessage", + "name": "readBusinessMessage", + "description": "Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.", + "html_description": "

Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.

", + "rst_description": "Marks incoming message as read on behalf of a business account. Requires the *can_read_messages* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection on behalf of which to read the message", + "html_description": "Unique identifier of the business connection on behalf of which to read the message", + "rst_description": "Unique identifier of the business connection on behalf of which to read the message\n", + "name": "business_connection_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.", + "html_description": "Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.", + "rst_description": "Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.\n", + "name": "chat_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the message to mark as read", + "html_description": "Unique identifier of the message to mark as read", + "rst_description": "Unique identifier of the message to mark as read\n", + "name": "message_id" + } + ], + "category": "methods" + }, + { + "anchor": "deletebusinessmessages", + "name": "deleteBusinessMessages", + "description": "Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.", + "html_description": "

Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.

", + "rst_description": "Delete messages on behalf of a business account. Requires the *can_delete_outgoing_messages* business bot right to delete messages sent by the bot itself, or the *can_delete_all_messages* business bot right to delete any message. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection on behalf of which to delete the messages", + "html_description": "Unique identifier of the business connection on behalf of which to delete the messages", + "rst_description": "Unique identifier of the business connection on behalf of which to delete the messages\n", + "name": "business_connection_id" + }, + { + "type": "Array of Integer", + "required": true, + "description": "A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted", + "html_description": "A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted", + "rst_description": "A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See :class:`aiogram.methods.delete_message.DeleteMessage` for limitations on which messages can be deleted\n", + "name": "message_ids" + } + ], + "category": "methods" + }, + { + "anchor": "setbusinessaccountname", + "name": "setBusinessAccountName", + "description": "Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.", + "html_description": "

Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.

", + "rst_description": "Changes the first and last name of a managed business account. Requires the *can_change_name* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": true, + "description": "The new value of the first name for the business account; 1-64 characters", + "html_description": "The new value of the first name for the business account; 1-64 characters", + "rst_description": "The new value of the first name for the business account; 1-64 characters\n", + "name": "first_name" + }, + { + "type": "String", + "required": false, + "description": "The new value of the last name for the business account; 0-64 characters", + "html_description": "The new value of the last name for the business account; 0-64 characters", + "rst_description": "The new value of the last name for the business account; 0-64 characters\n", + "name": "last_name" + } + ], + "category": "methods" + }, + { + "anchor": "setbusinessaccountusername", + "name": "setBusinessAccountUsername", + "description": "Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.", + "html_description": "

Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.

", + "rst_description": "Changes the username of a managed business account. Requires the *can_change_username* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": false, + "description": "The new value of the username for the business account; 0-32 characters", + "html_description": "The new value of the username for the business account; 0-32 characters", + "rst_description": "The new value of the username for the business account; 0-32 characters\n", + "name": "username" + } + ], + "category": "methods" + }, + { + "anchor": "setbusinessaccountbio", + "name": "setBusinessAccountBio", + "description": "Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.", + "html_description": "

Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.

", + "rst_description": "Changes the bio of a managed business account. Requires the *can_change_bio* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": false, + "description": "The new value of the bio for the business account; 0-140 characters", + "html_description": "The new value of the bio for the business account; 0-140 characters", + "rst_description": "The new value of the bio for the business account; 0-140 characters\n", + "name": "bio" + } + ], + "category": "methods" + }, + { + "anchor": "setbusinessaccountprofilephoto", + "name": "setBusinessAccountProfilePhoto", + "description": "Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.", + "html_description": "

Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.

", + "rst_description": "Changes the profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "InputProfilePhoto", + "required": true, + "description": "The new profile photo to set", + "html_description": "The new profile photo to set", + "rst_description": "The new profile photo to set\n", + "name": "photo" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.", + "html_description": "Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.", + "rst_description": "Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.\n", + "name": "is_public" + } + ], + "category": "methods" + }, + { + "anchor": "removebusinessaccountprofilephoto", + "name": "removeBusinessAccountProfilePhoto", + "description": "Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.", + "html_description": "

Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.

", + "rst_description": "Removes the current profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.", + "html_description": "Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.", + "rst_description": "Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.\n", + "name": "is_public" + } + ], + "category": "methods" + }, + { + "anchor": "setbusinessaccountgiftsettings", + "name": "setBusinessAccountGiftSettings", + "description": "Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.", + "html_description": "

Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.

", + "rst_description": "Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can_change_gift_settings* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Boolean", + "required": true, + "description": "Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field", + "html_description": "Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field", + "rst_description": "Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field\n", + "name": "show_gift_button" + }, + { + "type": "AcceptedGiftTypes", + "required": true, + "description": "Types of gifts accepted by the business account", + "html_description": "Types of gifts accepted by the business account", + "rst_description": "Types of gifts accepted by the business account\n", + "name": "accepted_gift_types" + } + ], + "category": "methods" + }, + { + "anchor": "getbusinessaccountstarbalance", + "name": "getBusinessAccountStarBalance", + "description": "Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.", + "html_description": "

Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.

", + "rst_description": "Returns the amount of Telegram Stars owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.star_amount.StarAmount` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + } + ], + "category": "methods" + }, + { + "anchor": "transferbusinessaccountstars", + "name": "transferBusinessAccountStars", + "description": "Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.", + "html_description": "

Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.

", + "rst_description": "Transfers Telegram Stars from the business account balance to the bot's balance. Requires the *can_transfer_stars* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Integer", + "required": true, + "description": "Number of Telegram Stars to transfer; 1-10000", + "html_description": "Number of Telegram Stars to transfer; 1-10000", + "rst_description": "Number of Telegram Stars to transfer; 1-10000\n", + "name": "star_count" + } + ], + "category": "methods" + }, + { + "anchor": "getbusinessaccountgifts", + "name": "getBusinessAccountGifts", + "description": "Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.", + "html_description": "

Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.

", + "rst_description": "Returns the gifts received and owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude gifts that aren't saved to the account's profile page", + "html_description": "Pass True to exclude gifts that aren't saved to the account's profile page", + "rst_description": "Pass True to exclude gifts that aren't saved to the account's profile page\n", + "name": "exclude_unsaved" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude gifts that are saved to the account's profile page", + "html_description": "Pass True to exclude gifts that are saved to the account's profile page", + "rst_description": "Pass True to exclude gifts that are saved to the account's profile page\n", + "name": "exclude_saved" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude gifts that can be purchased an unlimited number of times", + "html_description": "Pass True to exclude gifts that can be purchased an unlimited number of times", + "rst_description": "Pass True to exclude gifts that can be purchased an unlimited number of times\n", + "name": "exclude_unlimited" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude gifts that can be purchased a limited number of times", + "html_description": "Pass True to exclude gifts that can be purchased a limited number of times", + "rst_description": "Pass True to exclude gifts that can be purchased a limited number of times\n", + "name": "exclude_limited" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to exclude unique gifts", + "html_description": "Pass True to exclude unique gifts", + "rst_description": "Pass True to exclude unique gifts\n", + "name": "exclude_unique" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.", + "html_description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.", + "rst_description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.\n", + "name": "sort_by_price" + }, + { + "type": "String", + "required": false, + "description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results", + "html_description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results", + "rst_description": "Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results\n", + "name": "offset" + }, + { + "type": "Integer", + "required": false, + "description": "The maximum number of gifts to be returned; 1-100. Defaults to 100", + "html_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100", + "rst_description": "The maximum number of gifts to be returned; 1-100. Defaults to 100\n", + "name": "limit" + } + ], + "category": "methods" + }, + { + "anchor": "convertgifttostars", + "name": "convertGiftToStars", + "description": "Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.", + "html_description": "

Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.

", + "rst_description": "Converts a given regular gift to Telegram Stars. Requires the *can_convert_gifts_to_stars* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": true, + "description": "Unique identifier of the regular gift that should be converted to Telegram Stars", + "html_description": "Unique identifier of the regular gift that should be converted to Telegram Stars", + "rst_description": "Unique identifier of the regular gift that should be converted to Telegram Stars\n", + "name": "owned_gift_id" + } + ], + "category": "methods" + }, + { + "anchor": "upgradegift", + "name": "upgradeGift", + "description": "Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.", + "html_description": "

Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.

", + "rst_description": "Upgrades a given regular gift to a unique gift. Requires the *can_transfer_and_upgrade_gifts* business bot right. Additionally requires the *can_transfer_stars* business bot right if the upgrade is paid. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": true, + "description": "Unique identifier of the regular gift that should be upgraded to a unique one", + "html_description": "Unique identifier of the regular gift that should be upgraded to a unique one", + "rst_description": "Unique identifier of the regular gift that should be upgraded to a unique one\n", + "name": "owned_gift_id" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to keep the original gift text, sender and receiver in the upgraded gift", + "html_description": "Pass True to keep the original gift text, sender and receiver in the upgraded gift", + "rst_description": "Pass True to keep the original gift text, sender and receiver in the upgraded gift\n", + "name": "keep_original_details" + }, + { + "type": "Integer", + "required": false, + "description": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed.", + "html_description": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed.", + "rst_description": "The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If :code:`gift.prepaid_upgrade_star_count > 0`, then pass 0, otherwise, the *can_transfer_stars* business bot right is required and :code:`gift.upgrade_star_count` must be passed.\n", + "name": "star_count" + } + ], + "category": "methods" + }, + { + "anchor": "transfergift", + "name": "transferGift", + "description": "Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.", + "html_description": "

Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.

", + "rst_description": "Transfers an owned unique gift to another user. Requires the *can_transfer_and_upgrade_gifts* business bot right. Requires *can_transfer_stars* business bot right if the transfer is paid. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "String", + "required": true, + "description": "Unique identifier of the regular gift that should be transferred", + "html_description": "Unique identifier of the regular gift that should be transferred", + "rst_description": "Unique identifier of the regular gift that should be transferred\n", + "name": "owned_gift_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.", + "html_description": "Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.", + "rst_description": "Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.\n", + "name": "new_owner_chat_id" + }, + { + "type": "Integer", + "required": false, + "description": "The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.", + "html_description": "The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.", + "rst_description": "The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the *can_transfer_stars* business bot right is required.\n", + "name": "star_count" + } + ], + "category": "methods" + }, + { + "anchor": "poststory", + "name": "postStory", + "description": "Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.", + "html_description": "

Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.

", + "rst_description": "Posts a story on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "InputStoryContent", + "required": true, + "description": "Content of the story", + "html_description": "Content of the story", + "rst_description": "Content of the story\n", + "name": "content" + }, + { + "type": "Integer", + "required": true, + "description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400", + "html_description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400", + "rst_description": "Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`\n", + "name": "active_period" + }, + { + "type": "String", + "required": false, + "description": "Caption of the story, 0-2048 characters after entities parsing", + "html_description": "Caption of the story, 0-2048 characters after entities parsing", + "rst_description": "Caption of the story, 0-2048 characters after entities parsing\n", + "name": "caption" + }, + { + "type": "String", + "required": false, + "description": "Mode for parsing entities in the story caption. See formatting options for more details.", + "html_description": "Mode for parsing entities in the story caption. See formatting options for more details.", + "rst_description": "Mode for parsing entities in the story caption. See `formatting options `_ for more details.\n", + "name": "parse_mode" + }, + { + "type": "Array of MessageEntity", + "required": false, + "description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode", + "html_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode", + "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", + "name": "caption_entities" + }, + { + "type": "Array of StoryArea", + "required": false, + "description": "A JSON-serialized list of clickable areas to be shown on the story", + "html_description": "A JSON-serialized list of clickable areas to be shown on the story", + "rst_description": "A JSON-serialized list of clickable areas to be shown on the story\n", + "name": "areas" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True to keep the story accessible after it expires", + "html_description": "Pass True to keep the story accessible after it expires", + "rst_description": "Pass :code:`True` to keep the story accessible after it expires\n", + "name": "post_to_chat_page" + }, + { + "type": "Boolean", + "required": false, + "description": "Pass True if the content of the story must be protected from forwarding and screenshotting", + "html_description": "Pass True if the content of the story must be protected from forwarding and screenshotting", + "rst_description": "Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting\n", + "name": "protect_content" + } + ], + "category": "methods" + }, + { + "anchor": "editstory", + "name": "editStory", + "description": "Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.", + "html_description": "

Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.

", + "rst_description": "Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the story to edit", + "html_description": "Unique identifier of the story to edit", + "rst_description": "Unique identifier of the story to edit\n", + "name": "story_id" + }, + { + "type": "InputStoryContent", + "required": true, + "description": "Content of the story", + "html_description": "Content of the story", + "rst_description": "Content of the story\n", + "name": "content" + }, + { + "type": "String", + "required": false, + "description": "Caption of the story, 0-2048 characters after entities parsing", + "html_description": "Caption of the story, 0-2048 characters after entities parsing", + "rst_description": "Caption of the story, 0-2048 characters after entities parsing\n", + "name": "caption" + }, + { + "type": "String", + "required": false, + "description": "Mode for parsing entities in the story caption. See formatting options for more details.", + "html_description": "Mode for parsing entities in the story caption. See formatting options for more details.", + "rst_description": "Mode for parsing entities in the story caption. See `formatting options `_ for more details.\n", + "name": "parse_mode" + }, + { + "type": "Array of MessageEntity", + "required": false, + "description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode", + "html_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode", + "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", + "name": "caption_entities" + }, + { + "type": "Array of StoryArea", + "required": false, + "description": "A JSON-serialized list of clickable areas to be shown on the story", + "html_description": "A JSON-serialized list of clickable areas to be shown on the story", + "rst_description": "A JSON-serialized list of clickable areas to be shown on the story\n", + "name": "areas" + } + ], + "category": "methods" + }, + { + "anchor": "deletestory", + "name": "deleteStory", + "description": "Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.", + "html_description": "

Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.

", + "rst_description": "Deletes a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :code:`True` on success.", + "annotations": [ + { + "type": "String", + "required": true, + "description": "Unique identifier of the business connection", + "html_description": "Unique identifier of the business connection", + "rst_description": "Unique identifier of the business connection\n", + "name": "business_connection_id" + }, + { + "type": "Integer", + "required": true, + "description": "Unique identifier of the story to delete", + "html_description": "Unique identifier of the story to delete", + "rst_description": "Unique identifier of the story to delete\n", + "name": "story_id" + } + ], + "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." @@ -12737,10 +14940,10 @@ "rst_description": "This object describes a sticker to be added to a sticker set.", "annotations": [ { - "type": "InputFile or String", - "description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://' to upload a new one using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files", - "html_description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »", - "rst_description": "The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://' to upload a new one using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » `\n", + "type": "String", + "description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass 'attach://' to upload a new file using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files", + "html_description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new file using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »", + "rst_description": "The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass 'attach://' to upload a new file using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » `\n", "name": "sticker", "required": true }, @@ -13314,245 +15517,6 @@ } ], "category": "methods" - }, - { - "anchor": "gift", - "name": "Gift", - "description": "This object represents a gift that can be sent by the bot.", - "html_description": "

This object represents a gift that can be sent by the bot.

", - "rst_description": "This object represents a gift that can be sent by the bot.", - "annotations": [ - { - "type": "String", - "description": "Unique identifier of the gift", - "html_description": "Unique identifier of the gift", - "rst_description": "Unique identifier of the gift\n", - "name": "id", - "required": true - }, - { - "type": "Sticker", - "description": "The sticker that represents the gift", - "html_description": "The sticker that represents the gift", - "rst_description": "The sticker that represents the gift\n", - "name": "sticker", - "required": true - }, - { - "type": "Integer", - "description": "The number of Telegram Stars that must be paid to send the sticker", - "html_description": "The number of Telegram Stars that must be paid to send the sticker", - "rst_description": "The number of Telegram Stars that must be paid to send the sticker\n", - "name": "star_count", - "required": true - }, - { - "type": "Integer", - "description": "The number of Telegram Stars that must be paid to upgrade the gift to a unique one", - "html_description": "Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one", - "rst_description": "*Optional*. The number of Telegram Stars that must be paid to upgrade the gift to a unique one\n", - "name": "upgrade_star_count", - "required": false - }, - { - "type": "Integer", - "description": "The total number of the gifts of this type that can be sent; for limited gifts only", - "html_description": "Optional. The total number of the gifts of this type that can be sent; for limited gifts only", - "rst_description": "*Optional*. The total number of the gifts of this type that can be sent; for limited gifts only\n", - "name": "total_count", - "required": false - }, - { - "type": "Integer", - "description": "The number of remaining gifts of this type that can be sent; for limited gifts only", - "html_description": "Optional. The number of remaining gifts of this type that can be sent; for limited gifts only", - "rst_description": "*Optional*. The number of remaining gifts of this type that can be sent; for limited gifts only\n", - "name": "remaining_count", - "required": false - } - ], - "category": "types" - }, - { - "anchor": "gifts", - "name": "Gifts", - "description": "This object represent a list of gifts.", - "html_description": "

This object represent a list of gifts.

", - "rst_description": "This object represent a list of gifts.", - "annotations": [ - { - "type": "Array of Gift", - "description": "The list of gifts", - "html_description": "The list of gifts", - "rst_description": "The list of gifts\n", - "name": "gifts", - "required": true - } - ], - "category": "types" - }, - { - "anchor": "getavailablegifts", - "name": "getAvailableGifts", - "description": "Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.", - "html_description": "

Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.

", - "rst_description": "Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object.", - "annotations": [], - "category": "methods" - }, - { - "anchor": "sendgift", - "name": "sendGift", - "description": "Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.", - "html_description": "

Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.

", - "rst_description": "Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns :code:`True` on success.", - "annotations": [ - { - "type": "Integer", - "required": false, - "description": "Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.", - "html_description": "Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.", - "rst_description": "Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift.\n", - "name": "user_id" - }, - { - "type": "Integer or String", - "required": false, - "description": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.", - "html_description": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.", - "rst_description": "Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift.\n", - "name": "chat_id" - }, - { - "type": "String", - "required": true, - "description": "Identifier of the gift", - "html_description": "Identifier of the gift", - "rst_description": "Identifier of the gift\n", - "name": "gift_id" - }, - { - "type": "Boolean", - "required": false, - "description": "Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver", - "html_description": "Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver", - "rst_description": "Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver\n", - "name": "pay_for_upgrade" - }, - { - "type": "String", - "required": false, - "description": "Text that will be shown along with the gift; 0-255 characters", - "html_description": "Text that will be shown along with the gift; 0-255 characters", - "rst_description": "Text that will be shown along with the gift; 0-255 characters\n", - "name": "text" - }, - { - "type": "String", - "required": false, - "description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.", - "html_description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.", - "rst_description": "Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n", - "name": "text_parse_mode" - }, - { - "type": "Array of MessageEntity", - "required": false, - "description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.", - "html_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.", - "rst_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n", - "name": "text_entities" - } - ], - "category": "methods" - }, - { - "anchor": "verifyuser", - "name": "verifyUser", - "description": "Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.", - "html_description": "

Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.

", - "rst_description": "Verifies a user `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success.", - "annotations": [ - { - "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" - }, - { - "type": "String", - "required": false, - "description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.", - "html_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.", - "rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n", - "name": "custom_description" - } - ], - "category": "methods" - }, - { - "anchor": "verifychat", - "name": "verifyChat", - "description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.", - "html_description": "

Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.

", - "rst_description": "Verifies a chat `on behalf of the organization `_ which is represented by the bot. 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": "String", - "required": false, - "description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.", - "html_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.", - "rst_description": "Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.\n", - "name": "custom_description" - } - ], - "category": "methods" - }, - { - "anchor": "removeuserverification", - "name": "removeUserVerification", - "description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.", - "html_description": "

Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.

", - "rst_description": "Removes verification from a user who is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success.", - "annotations": [ - { - "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": "removechatverification", - "name": "removeChatVerification", - "description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.", - "html_description": "

Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.

", - "rst_description": "Removes verification from a chat that is currently verified `on behalf of the organization `_ represented by the bot. 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" - } - ], - "category": "methods" } ], "description": "The following methods and objects allow your bot to handle stickers and sticker sets." @@ -16592,9 +18556,9 @@ { "type": "Integer", "required": false, - "description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.", - "html_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.", - "rst_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.\n", + "description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.", + "html_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.", + "rst_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.\n", "name": "subscription_period" }, { @@ -17511,6 +19475,14 @@ "name": "type", "required": true }, + { + "type": "String", + "description": "Type of the transaction, currently one of 'invoice_payment' for payments via invoices, 'paid_media_payment' for payments for paid media, 'gift_purchase' for gifts sent by the bot, 'premium_purchase' for Telegram Premium subscriptions gifted by the bot, 'business_account_transfer' for direct transfers from managed business accounts", + "html_description": "Type of the transaction, currently one of “invoice_payment” for payments via invoices, “paid_media_payment” for payments for paid media, “gift_purchase” for gifts sent by the bot, “premium_purchase” for Telegram Premium subscriptions gifted by the bot, “business_account_transfer” for direct transfers from managed business accounts", + "rst_description": "Type of the transaction, currently one of 'invoice_payment' for payments via invoices, 'paid_media_payment' for payments for paid media, 'gift_purchase' for gifts sent by the bot, 'premium_purchase' for Telegram Premium subscriptions gifted by the bot, 'business_account_transfer' for direct transfers from managed business accounts\n", + "name": "transaction_type", + "required": true + }, { "type": "User", "description": "Information about the user", @@ -17521,51 +19493,59 @@ }, { "type": "AffiliateInfo", - "description": "Information about the affiliate that received a commission via this transaction", - "html_description": "Optional. Information about the affiliate that received a commission via this transaction", - "rst_description": "*Optional*. Information about the affiliate that received a commission via this transaction\n", + "description": "Information about the affiliate that received a commission via this transaction. Can be available only for 'invoice_payment' and 'paid_media_payment' transactions.", + "html_description": "Optional. Information about the affiliate that received a commission via this transaction. Can be available only for “invoice_payment” and “paid_media_payment” transactions.", + "rst_description": "*Optional*. Information about the affiliate that received a commission via this transaction. Can be available only for 'invoice_payment' and 'paid_media_payment' transactions.\n", "name": "affiliate", "required": false }, { "type": "String", - "description": "Bot-specified invoice payload", - "html_description": "Optional. Bot-specified invoice payload", - "rst_description": "*Optional*. Bot-specified invoice payload\n", + "description": "Bot-specified invoice payload. Can be available only for 'invoice_payment' transactions.", + "html_description": "Optional. Bot-specified invoice payload. Can be available only for “invoice_payment” transactions.", + "rst_description": "*Optional*. Bot-specified invoice payload. Can be available only for 'invoice_payment' transactions.\n", "name": "invoice_payload", "required": false }, { "type": "Integer", - "description": "The duration of the paid subscription", - "html_description": "Optional. The duration of the paid subscription", - "rst_description": "*Optional*. The duration of the paid subscription\n", + "description": "The duration of the paid subscription. Can be available only for 'invoice_payment' transactions.", + "html_description": "Optional. The duration of the paid subscription. Can be available only for “invoice_payment” transactions.", + "rst_description": "*Optional*. The duration of the paid subscription. Can be available only for 'invoice_payment' transactions.\n", "name": "subscription_period", "required": false }, { "type": "Array of PaidMedia", - "description": "Information about the paid media bought by the user", - "html_description": "Optional. Information about the paid media bought by the user", - "rst_description": "*Optional*. Information about the paid media bought by the user\n", + "description": "Information about the paid media bought by the user; for 'paid_media_payment' transactions only", + "html_description": "Optional. Information about the paid media bought by the user; for “paid_media_payment” transactions only", + "rst_description": "*Optional*. Information about the paid media bought by the user; for 'paid_media_payment' transactions only\n", "name": "paid_media", "required": false }, { "type": "String", - "description": "Bot-specified paid media payload", - "html_description": "Optional. Bot-specified paid media payload", - "rst_description": "*Optional*. Bot-specified paid media payload\n", + "description": "Bot-specified paid media payload. Can be available only for 'paid_media_payment' transactions.", + "html_description": "Optional. Bot-specified paid media payload. Can be available only for “paid_media_payment” transactions.", + "rst_description": "*Optional*. Bot-specified paid media payload. Can be available only for 'paid_media_payment' transactions.\n", "name": "paid_media_payload", "required": false }, { "type": "Gift", - "description": "The gift sent to the user by the bot", - "html_description": "Optional. The gift sent to the user by the bot", - "rst_description": "*Optional*. The gift sent to the user by the bot\n", + "description": "The gift sent to the user by the bot; for 'gift_purchase' transactions only", + "html_description": "Optional. The gift sent to the user by the bot; for “gift_purchase” transactions only", + "rst_description": "*Optional*. The gift sent to the user by the bot; for 'gift_purchase' transactions only\n", "name": "gift", "required": false + }, + { + "type": "Integer", + "description": "Number of months the gifted Telegram Premium subscription will be active for; for 'premium_purchase' transactions only", + "html_description": "Optional. Number of months the gifted Telegram Premium subscription will be active for; for “premium_purchase” transactions only", + "rst_description": "*Optional*. Number of months the gifted Telegram Premium subscription will be active for; for 'premium_purchase' transactions only\n", + "name": "premium_subscription_duration", + "required": false } ], "category": "types" diff --git a/.butcher/types/AcceptedGiftTypes/entity.json b/.butcher/types/AcceptedGiftTypes/entity.json new file mode 100644 index 00000000..982a27d2 --- /dev/null +++ b/.butcher/types/AcceptedGiftTypes/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "acceptedgifttypes", + "name": "AcceptedGiftTypes", + "description": "This object describes the types of gifts that can be gifted to a user or a chat.", + "html_description": "

This object describes the types of gifts that can be gifted to a user or a chat.

", + "rst_description": "This object describes the types of gifts that can be gifted to a user or a chat.", + "annotations": [ + { + "type": "Boolean", + "description": "True, if unlimited regular gifts are accepted", + "html_description": "True, if unlimited regular gifts are accepted", + "rst_description": "True, if unlimited regular gifts are accepted\n", + "name": "unlimited_gifts", + "required": true + }, + { + "type": "Boolean", + "description": "True, if limited regular gifts are accepted", + "html_description": "True, if limited regular gifts are accepted", + "rst_description": "True, if limited regular gifts are accepted\n", + "name": "limited_gifts", + "required": true + }, + { + "type": "Boolean", + "description": "True, if unique gifts or gifts that can be upgraded to unique for free are accepted", + "html_description": "True, if unique gifts or gifts that can be upgraded to unique for free are accepted", + "rst_description": "True, if unique gifts or gifts that can be upgraded to unique for free are accepted\n", + "name": "unique_gifts", + "required": true + }, + { + "type": "Boolean", + "description": "True, if a Telegram Premium subscription is accepted", + "html_description": "True, if a Telegram Premium subscription is accepted", + "rst_description": "True, if a Telegram Premium subscription is accepted\n", + "name": "premium_subscription", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BusinessBotRights/entity.json b/.butcher/types/BusinessBotRights/entity.json new file mode 100644 index 00000000..79e9e77d --- /dev/null +++ b/.butcher/types/BusinessBotRights/entity.json @@ -0,0 +1,129 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "businessbotrights", + "name": "BusinessBotRights", + "description": "Represents the rights of a business bot.", + "html_description": "

Represents the rights of a business bot.

", + "rst_description": "Represents the rights of a business bot.", + "annotations": [ + { + "type": "True", + "description": "True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours", + "html_description": "Optional. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours", + "rst_description": "*Optional*. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours\n", + "name": "can_reply", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can mark incoming private messages as read", + "html_description": "Optional. True, if the bot can mark incoming private messages as read", + "rst_description": "*Optional*. True, if the bot can mark incoming private messages as read\n", + "name": "can_read_messages", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can delete messages sent by the bot", + "html_description": "Optional. True, if the bot can delete messages sent by the bot", + "rst_description": "*Optional*. True, if the bot can delete messages sent by the bot\n", + "name": "can_delete_outgoing_messages", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can delete all private messages in managed chats", + "html_description": "Optional. True, if the bot can delete all private messages in managed chats", + "rst_description": "*Optional*. True, if the bot can delete all private messages in managed chats\n", + "name": "can_delete_all_messages", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can edit the first and last name of the business account", + "html_description": "Optional. True, if the bot can edit the first and last name of the business account", + "rst_description": "*Optional*. True, if the bot can edit the first and last name of the business account\n", + "name": "can_edit_name", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can edit the bio of the business account", + "html_description": "Optional. True, if the bot can edit the bio of the business account", + "rst_description": "*Optional*. True, if the bot can edit the bio of the business account\n", + "name": "can_edit_bio", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can edit the profile photo of the business account", + "html_description": "Optional. True, if the bot can edit the profile photo of the business account", + "rst_description": "*Optional*. True, if the bot can edit the profile photo of the business account\n", + "name": "can_edit_profile_photo", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can edit the username of the business account", + "html_description": "Optional. True, if the bot can edit the username of the business account", + "rst_description": "*Optional*. True, if the bot can edit the username of the business account\n", + "name": "can_edit_username", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can change the privacy settings pertaining to gifts for the business account", + "html_description": "Optional. True, if the bot can change the privacy settings pertaining to gifts for the business account", + "rst_description": "*Optional*. True, if the bot can change the privacy settings pertaining to gifts for the business account\n", + "name": "can_change_gift_settings", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can view gifts and the amount of Telegram Stars owned by the business account", + "html_description": "Optional. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account", + "rst_description": "*Optional*. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account\n", + "name": "can_view_gifts_and_stars", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can convert regular gifts owned by the business account to Telegram Stars", + "html_description": "Optional. True, if the bot can convert regular gifts owned by the business account to Telegram Stars", + "rst_description": "*Optional*. True, if the bot can convert regular gifts owned by the business account to Telegram Stars\n", + "name": "can_convert_gifts_to_stars", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can transfer and upgrade gifts owned by the business account", + "html_description": "Optional. True, if the bot can transfer and upgrade gifts owned by the business account", + "rst_description": "*Optional*. True, if the bot can transfer and upgrade gifts owned by the business account\n", + "name": "can_transfer_and_upgrade_gifts", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts", + "html_description": "Optional. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts", + "rst_description": "*Optional*. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts\n", + "name": "can_transfer_stars", + "required": false + }, + { + "type": "True", + "description": "True, if the bot can post, edit and delete stories on behalf of the business account", + "html_description": "Optional. True, if the bot can post, edit and delete stories on behalf of the business account", + "rst_description": "*Optional*. True, if the bot can post, edit and delete stories on behalf of the business account\n", + "name": "can_manage_stories", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/BusinessConnection/entity.json b/.butcher/types/BusinessConnection/entity.json index 09b9a0ef..1f8f9402 100644 --- a/.butcher/types/BusinessConnection/entity.json +++ b/.butcher/types/BusinessConnection/entity.json @@ -44,12 +44,12 @@ "required": true }, { - "type": "Boolean", - "description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", - "html_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", - "rst_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours\n", - "name": "can_reply", - "required": true + "type": "BusinessBotRights", + "description": "Rights of the business bot", + "html_description": "Optional. Rights of the business bot", + "rst_description": "*Optional*. Rights of the business bot\n", + "name": "rights", + "required": false }, { "type": "Boolean", @@ -58,6 +58,18 @@ "rst_description": "True, if the connection is active\n", "name": "is_enabled", "required": true + }, + { + "type": "Boolean", + "description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", + "html_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours", + "rst_description": "True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours\n", + "name": "can_reply", + "required": false, + "deprecated": { + "version": "9.0", + "release_date": "2025-04-11" + } } ], "category": "types" diff --git a/.butcher/types/ChatFullInfo/entity.json b/.butcher/types/ChatFullInfo/entity.json index d95a8c4d..11b0c738 100644 --- a/.butcher/types/ChatFullInfo/entity.json +++ b/.butcher/types/ChatFullInfo/entity.json @@ -260,12 +260,12 @@ "required": false }, { - "type": "True", - "description": "True, if gifts can be sent to the chat", - "html_description": "Optional. True, if gifts can be sent to the chat", - "rst_description": "*Optional*. :code:`True`, if gifts can be sent to the chat\n", - "name": "can_send_gift", - "required": false + "type": "AcceptedGiftTypes", + "description": "Information about types of gifts that are accepted by the chat or by the corresponding user for private chats", + "html_description": "Information about types of gifts that are accepted by the chat or by the corresponding user for private chats", + "rst_description": "Information about types of gifts that are accepted by the chat or by the corresponding user for private chats\n", + "name": "accepted_gift_types", + "required": true }, { "type": "True", @@ -370,6 +370,18 @@ "rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected\n", "name": "location", "required": false + }, + { + "type": "True", + "description": "True, if gifts can be sent to the chat", + "html_description": "Optional. True, if gifts can be sent to the chat", + "rst_description": "*Optional*. :code:`True`, if gifts can be sent to the chat\n", + "name": "can_send_gift", + "required": false, + "deprecated": { + "version": "9.0", + "release_date": "2025-04-11" + } } ], "category": "types" diff --git a/.butcher/types/Gift/entity.json b/.butcher/types/Gift/entity.json index 46454a3e..45426822 100644 --- a/.butcher/types/Gift/entity.json +++ b/.butcher/types/Gift/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Stickers", - "anchor": "stickers" + "title": "Available types", + "anchor": "available-types" }, "object": { "anchor": "gift", diff --git a/.butcher/types/GiftInfo/entity.json b/.butcher/types/GiftInfo/entity.json new file mode 100644 index 00000000..17ff33e2 --- /dev/null +++ b/.butcher/types/GiftInfo/entity.json @@ -0,0 +1,81 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "giftinfo", + "name": "GiftInfo", + "description": "Describes a service message about a regular gift that was sent or received.", + "html_description": "

Describes a service message about a regular gift that was sent or received.

", + "rst_description": "Describes a service message about a regular gift that was sent or received.", + "annotations": [ + { + "type": "Gift", + "description": "Information about the gift", + "html_description": "Information about the gift", + "rst_description": "Information about the gift\n", + "name": "gift", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts", + "html_description": "Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts", + "rst_description": "*Optional*. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts\n", + "name": "owned_gift_id", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible", + "html_description": "Optional. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible", + "rst_description": "*Optional*. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible\n", + "name": "convert_star_count", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift", + "html_description": "Optional. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift", + "rst_description": "*Optional*. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift\n", + "name": "prepaid_upgrade_star_count", + "required": false + }, + { + "type": "True", + "description": "True, if the gift can be upgraded to a unique gift", + "html_description": "Optional. True, if the gift can be upgraded to a unique gift", + "rst_description": "*Optional*. True, if the gift can be upgraded to a unique gift\n", + "name": "can_be_upgraded", + "required": false + }, + { + "type": "String", + "description": "Text of the message that was added to the gift", + "html_description": "Optional. Text of the message that was added to the gift", + "rst_description": "*Optional*. Text of the message that was added to the gift\n", + "name": "text", + "required": false + }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the text", + "html_description": "Optional. Special entities that appear in the text", + "rst_description": "*Optional*. Special entities that appear in the text\n", + "name": "entities", + "required": false + }, + { + "type": "True", + "description": "True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them", + "html_description": "Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them", + "rst_description": "*Optional*. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them\n", + "name": "is_private", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/Gifts/entity.json b/.butcher/types/Gifts/entity.json index d8546b7c..bca737bd 100644 --- a/.butcher/types/Gifts/entity.json +++ b/.butcher/types/Gifts/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Stickers", - "anchor": "stickers" + "title": "Available types", + "anchor": "available-types" }, "object": { "anchor": "gifts", diff --git a/.butcher/types/InputProfilePhoto/entity.json b/.butcher/types/InputProfilePhoto/entity.json new file mode 100644 index 00000000..f3ae06fd --- /dev/null +++ b/.butcher/types/InputProfilePhoto/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "inputprofilephoto", + "name": "InputProfilePhoto", + "description": "This object describes a profile photo to set. Currently, it can be one of\n - InputProfilePhotoStatic\n - InputProfilePhotoAnimated", + "html_description": "

This object describes a profile photo to set. Currently, it can be one of

", + "rst_description": "This object describes a profile photo to set. Currently, it can be one of\n\n - :class:`aiogram.types.input_profile_photo_static.InputProfilePhotoStatic`\n - :class:`aiogram.types.input_profile_photo_animated.InputProfilePhotoAnimated`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/InputProfilePhoto/subtypes.yml b/.butcher/types/InputProfilePhoto/subtypes.yml new file mode 100644 index 00000000..6756ad51 --- /dev/null +++ b/.butcher/types/InputProfilePhoto/subtypes.yml @@ -0,0 +1 @@ +discriminator: "type" diff --git a/.butcher/types/InputProfilePhotoAnimated/entity.json b/.butcher/types/InputProfilePhotoAnimated/entity.json new file mode 100644 index 00000000..13c83d63 --- /dev/null +++ b/.butcher/types/InputProfilePhotoAnimated/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "inputprofilephotoanimated", + "name": "InputProfilePhotoAnimated", + "description": "An animated profile photo in the MPEG4 format.", + "html_description": "

An animated profile photo in the MPEG4 format.

", + "rst_description": "An animated profile photo in the MPEG4 format.", + "annotations": [ + { + "type": "String", + "description": "Type of the profile photo, must be 'animated'", + "html_description": "Type of the profile photo, must be “animated”", + "rst_description": "Type of the profile photo, must be 'animated'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . More information on Sending Files", + "html_description": "The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", + "rst_description": "The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", + "name": "animation", + "required": true + }, + { + "type": "Float", + "description": "Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.", + "html_description": "Optional. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.", + "rst_description": "*Optional*. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.\n", + "name": "main_frame_timestamp", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/InputProfilePhotoAnimated/replace.yml b/.butcher/types/InputProfilePhotoAnimated/replace.yml new file mode 100644 index 00000000..0e02dfd7 --- /dev/null +++ b/.butcher/types/InputProfilePhotoAnimated/replace.yml @@ -0,0 +1,11 @@ +annotations: + animation: + parsed_type: + type: union + items: + - type: std + name: str + - type: entity + references: + category: types + name: InputFile diff --git a/.butcher/types/InputProfilePhotoStatic/entity.json b/.butcher/types/InputProfilePhotoStatic/entity.json new file mode 100644 index 00000000..887b5589 --- /dev/null +++ b/.butcher/types/InputProfilePhotoStatic/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "inputprofilephotostatic", + "name": "InputProfilePhotoStatic", + "description": "A static profile photo in the .JPG format.", + "html_description": "

A static profile photo in the .JPG format.

", + "rst_description": "A static profile photo in the .JPG format.", + "annotations": [ + { + "type": "String", + "description": "Type of the profile photo, must be 'static'", + "html_description": "Type of the profile photo, must be “static”", + "rst_description": "Type of the profile photo, must be 'static'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . More information on Sending Files", + "html_description": "The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", + "rst_description": "The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", + "name": "photo", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/InputProfilePhotoStatic/replace.yml b/.butcher/types/InputProfilePhotoStatic/replace.yml new file mode 100644 index 00000000..e622cb80 --- /dev/null +++ b/.butcher/types/InputProfilePhotoStatic/replace.yml @@ -0,0 +1,11 @@ +annotations: + photo: + parsed_type: + type: union + items: + - type: std + name: str + - type: entity + references: + category: types + name: InputFile diff --git a/.butcher/types/InputSticker/entity.json b/.butcher/types/InputSticker/entity.json index 0ec7ae40..e3d58c12 100644 --- a/.butcher/types/InputSticker/entity.json +++ b/.butcher/types/InputSticker/entity.json @@ -12,10 +12,10 @@ "rst_description": "This object describes a sticker to be added to a sticker set.", "annotations": [ { - "type": "InputFile or String", - "description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://' to upload a new one using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files", - "html_description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »", - "rst_description": "The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://' to upload a new one using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » `\n", + "type": "String", + "description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass 'attach://' to upload a new file using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files", + "html_description": "The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new file using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »", + "rst_description": "The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass 'attach://' to upload a new file using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » `\n", "name": "sticker", "required": true }, diff --git a/.butcher/types/InputSticker/replace.yml b/.butcher/types/InputSticker/replace.yml new file mode 100644 index 00000000..ae080950 --- /dev/null +++ b/.butcher/types/InputSticker/replace.yml @@ -0,0 +1,11 @@ +annotations: + sticker: + parsed_type: + type: union + items: + - type: std + name: str + - type: entity + references: + category: types + name: InputFile diff --git a/.butcher/types/InputStoryContent/entity.json b/.butcher/types/InputStoryContent/entity.json new file mode 100644 index 00000000..6869136e --- /dev/null +++ b/.butcher/types/InputStoryContent/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "inputstorycontent", + "name": "InputStoryContent", + "description": "This object describes the content of a story to post. Currently, it can be one of\n - InputStoryContentPhoto\n - InputStoryContentVideo", + "html_description": "

This object describes the content of a story to post. Currently, it can be one of

", + "rst_description": "This object describes the content of a story to post. Currently, it can be one of\n\n - :class:`aiogram.types.input_story_content_photo.InputStoryContentPhoto`\n - :class:`aiogram.types.input_story_content_video.InputStoryContentVideo`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/InputStoryContent/subtypes.yml b/.butcher/types/InputStoryContent/subtypes.yml new file mode 100644 index 00000000..6756ad51 --- /dev/null +++ b/.butcher/types/InputStoryContent/subtypes.yml @@ -0,0 +1 @@ +discriminator: "type" diff --git a/.butcher/types/InputStoryContentPhoto/entity.json b/.butcher/types/InputStoryContentPhoto/entity.json new file mode 100644 index 00000000..e7eccf4e --- /dev/null +++ b/.butcher/types/InputStoryContentPhoto/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "inputstorycontentphoto", + "name": "InputStoryContentPhoto", + "description": "Describes a photo to post as a story.", + "html_description": "

Describes a photo to post as a story.

", + "rst_description": "Describes a photo to post as a story.", + "annotations": [ + { + "type": "String", + "description": "Type of the content, must be 'photo'", + "html_description": "Type of the content, must be “photo”", + "rst_description": "Type of the content, must be 'photo'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . More information on Sending Files", + "html_description": "The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", + "rst_description": "The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", + "name": "photo", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/InputStoryContentVideo/entity.json b/.butcher/types/InputStoryContentVideo/entity.json new file mode 100644 index 00000000..9f4796be --- /dev/null +++ b/.butcher/types/InputStoryContentVideo/entity.json @@ -0,0 +1,57 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "inputstorycontentvideo", + "name": "InputStoryContentVideo", + "description": "Describes a video to post as a story.", + "html_description": "

Describes a video to post as a story.

", + "rst_description": "Describes a video to post as a story.", + "annotations": [ + { + "type": "String", + "description": "Type of the content, must be 'video'", + "html_description": "Type of the content, must be “video”", + "rst_description": "Type of the content, must be 'video'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the video was uploaded using multipart/form-data under . More information on Sending Files", + "html_description": "The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the video was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", + "rst_description": "The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the video was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", + "name": "video", + "required": true + }, + { + "type": "Float", + "description": "Precise duration of the video in seconds; 0-60", + "html_description": "Optional. Precise duration of the video in seconds; 0-60", + "rst_description": "*Optional*. Precise duration of the video in seconds; 0-60\n", + "name": "duration", + "required": false + }, + { + "type": "Float", + "description": "Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.", + "html_description": "Optional. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.", + "rst_description": "*Optional*. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.\n", + "name": "cover_frame_timestamp", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True if the video has no sound", + "html_description": "Optional. Pass True if the video has no sound", + "rst_description": "*Optional*. Pass :code:`True` if the video has no sound\n", + "name": "is_animation", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/LocationAddress/entity.json b/.butcher/types/LocationAddress/entity.json new file mode 100644 index 00000000..dbf523c3 --- /dev/null +++ b/.butcher/types/LocationAddress/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "locationaddress", + "name": "LocationAddress", + "description": "Describes the physical address of a location.", + "html_description": "

Describes the physical address of a location.

", + "rst_description": "Describes the physical address of a location.", + "annotations": [ + { + "type": "String", + "description": "The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located", + "html_description": "The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located", + "rst_description": "The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located\n", + "name": "country_code", + "required": true + }, + { + "type": "String", + "description": "State of the location", + "html_description": "Optional. State of the location", + "rst_description": "*Optional*. State of the location\n", + "name": "state", + "required": false + }, + { + "type": "String", + "description": "City of the location", + "html_description": "Optional. City of the location", + "rst_description": "*Optional*. City of the location\n", + "name": "city", + "required": false + }, + { + "type": "String", + "description": "Street address of the location", + "html_description": "Optional. Street address of the location", + "rst_description": "*Optional*. Street address of the location\n", + "name": "street", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/Message/entity.json b/.butcher/types/Message/entity.json index 86667ca8..82f9186e 100644 --- a/.butcher/types/Message/entity.json +++ b/.butcher/types/Message/entity.json @@ -187,6 +187,14 @@ "name": "author_signature", "required": false }, + { + "type": "Integer", + "description": "The number of Telegram Stars that were paid by the sender of the message to send it", + "html_description": "Optional. The number of Telegram Stars that were paid by the sender of the message to send it", + "rst_description": "*Optional*. The number of Telegram Stars that were paid by the sender of the message to send it\n", + "name": "paid_star_count", + "required": false + }, { "type": "String", "description": "For text messages, the actual UTF-8 text of the message", @@ -515,6 +523,22 @@ "name": "chat_shared", "required": false }, + { + "type": "GiftInfo", + "description": "Service message: a regular gift was sent or received", + "html_description": "Optional. Service message: a regular gift was sent or received", + "rst_description": "*Optional*. Service message: a regular gift was sent or received\n", + "name": "gift", + "required": false + }, + { + "type": "UniqueGiftInfo", + "description": "Service message: a unique gift was sent or received", + "html_description": "Optional. Service message: a unique gift was sent or received", + "rst_description": "*Optional*. Service message: a unique gift was sent or received\n", + "name": "unique_gift", + "required": false + }, { "type": "String", "description": "The domain name of the website on which the user has logged in.", @@ -643,6 +667,14 @@ "name": "giveaway_completed", "required": false }, + { + "type": "PaidMessagePriceChanged", + "description": "Service message: the price for paid messages has changed in the chat", + "html_description": "Optional. Service message: the price for paid messages has changed in the chat", + "rst_description": "*Optional*. Service message: the price for paid messages has changed in the chat\n", + "name": "paid_message_price_changed", + "required": false + }, { "type": "VideoChatScheduled", "description": "Service message: video chat scheduled", diff --git a/.butcher/types/OwnedGift/entity.json b/.butcher/types/OwnedGift/entity.json new file mode 100644 index 00000000..4b68f768 --- /dev/null +++ b/.butcher/types/OwnedGift/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "ownedgift", + "name": "OwnedGift", + "description": "This object describes a gift received and owned by a user or a chat. Currently, it can be one of\n - OwnedGiftRegular\n - OwnedGiftUnique", + "html_description": "

This object describes a gift received and owned by a user or a chat. Currently, it can be one of

", + "rst_description": "This object describes a gift received and owned by a user or a chat. Currently, it can be one of\n\n - :class:`aiogram.types.owned_gift_regular.OwnedGiftRegular`\n - :class:`aiogram.types.owned_gift_unique.OwnedGiftUnique`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/OwnedGift/subtypes.yml b/.butcher/types/OwnedGift/subtypes.yml new file mode 100644 index 00000000..6756ad51 --- /dev/null +++ b/.butcher/types/OwnedGift/subtypes.yml @@ -0,0 +1 @@ +discriminator: "type" diff --git a/.butcher/types/OwnedGiftRegular/entity.json b/.butcher/types/OwnedGiftRegular/entity.json new file mode 100644 index 00000000..5e4e0f81 --- /dev/null +++ b/.butcher/types/OwnedGiftRegular/entity.json @@ -0,0 +1,121 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "ownedgiftregular", + "name": "OwnedGiftRegular", + "description": "Describes a regular gift owned by a user or a chat.", + "html_description": "

Describes a regular gift owned by a user or a chat.

", + "rst_description": "Describes a regular gift owned by a user or a chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the gift, always 'regular'", + "html_description": "Type of the gift, always “regular”", + "rst_description": "Type of the gift, always 'regular'\n", + "name": "type", + "required": true + }, + { + "type": "Gift", + "description": "Information about the regular gift", + "html_description": "Information about the regular gift", + "rst_description": "Information about the regular gift\n", + "name": "gift", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only", + "html_description": "Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only\n", + "name": "owned_gift_id", + "required": false + }, + { + "type": "User", + "description": "Sender of the gift if it is a known user", + "html_description": "Optional. Sender of the gift if it is a known user", + "rst_description": "*Optional*. Sender of the gift if it is a known user\n", + "name": "sender_user", + "required": false + }, + { + "type": "Integer", + "description": "Date the gift was sent in Unix time", + "html_description": "Date the gift was sent in Unix time", + "rst_description": "Date the gift was sent in Unix time\n", + "name": "send_date", + "required": true + }, + { + "type": "String", + "description": "Text of the message that was added to the gift", + "html_description": "Optional. Text of the message that was added to the gift", + "rst_description": "*Optional*. Text of the message that was added to the gift\n", + "name": "text", + "required": false + }, + { + "type": "Array of MessageEntity", + "description": "Special entities that appear in the text", + "html_description": "Optional. Special entities that appear in the text", + "rst_description": "*Optional*. Special entities that appear in the text\n", + "name": "entities", + "required": false + }, + { + "type": "True", + "description": "True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them", + "html_description": "Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them", + "rst_description": "*Optional*. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them\n", + "name": "is_private", + "required": false + }, + { + "type": "True", + "description": "True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only", + "html_description": "Optional. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only\n", + "name": "is_saved", + "required": false + }, + { + "type": "True", + "description": "True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only", + "html_description": "Optional. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only\n", + "name": "can_be_upgraded", + "required": false + }, + { + "type": "True", + "description": "True, if the gift was refunded and isn't available anymore", + "html_description": "Optional. True, if the gift was refunded and isn't available anymore", + "rst_description": "*Optional*. True, if the gift was refunded and isn't available anymore\n", + "name": "was_refunded", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars", + "html_description": "Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars", + "rst_description": "*Optional*. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars\n", + "name": "convert_star_count", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift", + "html_description": "Optional. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift", + "rst_description": "*Optional*. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift\n", + "name": "prepaid_upgrade_star_count", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/OwnedGiftUnique/entity.json b/.butcher/types/OwnedGiftUnique/entity.json new file mode 100644 index 00000000..e4c64ec7 --- /dev/null +++ b/.butcher/types/OwnedGiftUnique/entity.json @@ -0,0 +1,81 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "ownedgiftunique", + "name": "OwnedGiftUnique", + "description": "Describes a unique gift received and owned by a user or a chat.", + "html_description": "

Describes a unique gift received and owned by a user or a chat.

", + "rst_description": "Describes a unique gift received and owned by a user or a chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the gift, always 'unique'", + "html_description": "Type of the gift, always “unique”", + "rst_description": "Type of the gift, always 'unique'\n", + "name": "type", + "required": true + }, + { + "type": "UniqueGift", + "description": "Information about the unique gift", + "html_description": "Information about the unique gift", + "rst_description": "Information about the unique gift\n", + "name": "gift", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only", + "html_description": "Optional. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only\n", + "name": "owned_gift_id", + "required": false + }, + { + "type": "User", + "description": "Sender of the gift if it is a known user", + "html_description": "Optional. Sender of the gift if it is a known user", + "rst_description": "*Optional*. Sender of the gift if it is a known user\n", + "name": "sender_user", + "required": false + }, + { + "type": "Integer", + "description": "Date the gift was sent in Unix time", + "html_description": "Date the gift was sent in Unix time", + "rst_description": "Date the gift was sent in Unix time\n", + "name": "send_date", + "required": true + }, + { + "type": "True", + "description": "True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only", + "html_description": "Optional. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only\n", + "name": "is_saved", + "required": false + }, + { + "type": "True", + "description": "True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only", + "html_description": "Optional. True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only", + "rst_description": "*Optional*. True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only\n", + "name": "can_be_transferred", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift", + "html_description": "Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift", + "rst_description": "*Optional*. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift\n", + "name": "transfer_star_count", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/OwnedGifts/entity.json b/.butcher/types/OwnedGifts/entity.json new file mode 100644 index 00000000..eb6d2e47 --- /dev/null +++ b/.butcher/types/OwnedGifts/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "ownedgifts", + "name": "OwnedGifts", + "description": "Contains the list of gifts received and owned by a user or a chat.", + "html_description": "

Contains the list of gifts received and owned by a user or a chat.

", + "rst_description": "Contains the list of gifts received and owned by a user or a chat.", + "annotations": [ + { + "type": "Integer", + "description": "The total number of gifts owned by the user or the chat", + "html_description": "The total number of gifts owned by the user or the chat", + "rst_description": "The total number of gifts owned by the user or the chat\n", + "name": "total_count", + "required": true + }, + { + "type": "Array of OwnedGift", + "description": "The list of gifts", + "html_description": "The list of gifts", + "rst_description": "The list of gifts\n", + "name": "gifts", + "required": true + }, + { + "type": "String", + "description": "Offset for the next request. If empty, then there are no more results", + "html_description": "Optional. Offset for the next request. If empty, then there are no more results", + "rst_description": "*Optional*. Offset for the next request. If empty, then there are no more results\n", + "name": "next_offset", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/PaidMessagePriceChanged/entity.json b/.butcher/types/PaidMessagePriceChanged/entity.json new file mode 100644 index 00000000..6301d55e --- /dev/null +++ b/.butcher/types/PaidMessagePriceChanged/entity.json @@ -0,0 +1,25 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "paidmessagepricechanged", + "name": "PaidMessagePriceChanged", + "description": "Describes a service message about a change in the price of paid messages within a chat.", + "html_description": "

Describes a service message about a change in the price of paid messages within a chat.

", + "rst_description": "Describes a service message about a change in the price of paid messages within a chat.", + "annotations": [ + { + "type": "Integer", + "description": "The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message", + "html_description": "The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message", + "rst_description": "The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message\n", + "name": "paid_message_star_count", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/StarAmount/entity.json b/.butcher/types/StarAmount/entity.json new file mode 100644 index 00000000..9462a72b --- /dev/null +++ b/.butcher/types/StarAmount/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "staramount", + "name": "StarAmount", + "description": "Describes an amount of Telegram Stars.", + "html_description": "

Describes an amount of Telegram Stars.

", + "rst_description": "Describes an amount of Telegram Stars.", + "annotations": [ + { + "type": "Integer", + "description": "Integer amount of Telegram Stars, rounded to 0; can be negative", + "html_description": "Integer amount of Telegram Stars, rounded to 0; can be negative", + "rst_description": "Integer amount of Telegram Stars, rounded to 0; can be negative\n", + "name": "amount", + "required": true + }, + { + "type": "Integer", + "description": "The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive", + "html_description": "Optional. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive", + "rst_description": "*Optional*. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if *amount* is non-positive\n", + "name": "nanostar_amount", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/StoryArea/entity.json b/.butcher/types/StoryArea/entity.json new file mode 100644 index 00000000..ff040f52 --- /dev/null +++ b/.butcher/types/StoryArea/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "storyarea", + "name": "StoryArea", + "description": "Describes a clickable area on a story media.", + "html_description": "

Describes a clickable area on a story media.

", + "rst_description": "Describes a clickable area on a story media.", + "annotations": [ + { + "type": "StoryAreaPosition", + "description": "Position of the area", + "html_description": "Position of the area", + "rst_description": "Position of the area\n", + "name": "position", + "required": true + }, + { + "type": "StoryAreaType", + "description": "Type of the area", + "html_description": "Type of the area", + "rst_description": "Type of the area\n", + "name": "type", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/StoryAreaPosition/entity.json b/.butcher/types/StoryAreaPosition/entity.json new file mode 100644 index 00000000..53c062b1 --- /dev/null +++ b/.butcher/types/StoryAreaPosition/entity.json @@ -0,0 +1,65 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "storyareaposition", + "name": "StoryAreaPosition", + "description": "Describes the position of a clickable area within a story.", + "html_description": "

Describes the position of a clickable area within a story.

", + "rst_description": "Describes the position of a clickable area within a story.", + "annotations": [ + { + "type": "Float", + "description": "The abscissa of the area's center, as a percentage of the media width", + "html_description": "The abscissa of the area's center, as a percentage of the media width", + "rst_description": "The abscissa of the area's center, as a percentage of the media width\n", + "name": "x_percentage", + "required": true + }, + { + "type": "Float", + "description": "The ordinate of the area's center, as a percentage of the media height", + "html_description": "The ordinate of the area's center, as a percentage of the media height", + "rst_description": "The ordinate of the area's center, as a percentage of the media height\n", + "name": "y_percentage", + "required": true + }, + { + "type": "Float", + "description": "The width of the area's rectangle, as a percentage of the media width", + "html_description": "The width of the area's rectangle, as a percentage of the media width", + "rst_description": "The width of the area's rectangle, as a percentage of the media width\n", + "name": "width_percentage", + "required": true + }, + { + "type": "Float", + "description": "The height of the area's rectangle, as a percentage of the media height", + "html_description": "The height of the area's rectangle, as a percentage of the media height", + "rst_description": "The height of the area's rectangle, as a percentage of the media height\n", + "name": "height_percentage", + "required": true + }, + { + "type": "Float", + "description": "The clockwise rotation angle of the rectangle, in degrees; 0-360", + "html_description": "The clockwise rotation angle of the rectangle, in degrees; 0-360", + "rst_description": "The clockwise rotation angle of the rectangle, in degrees; 0-360\n", + "name": "rotation_angle", + "required": true + }, + { + "type": "Float", + "description": "The radius of the rectangle corner rounding, as a percentage of the media width", + "html_description": "The radius of the rectangle corner rounding, as a percentage of the media width", + "rst_description": "The radius of the rectangle corner rounding, as a percentage of the media width\n", + "name": "corner_radius_percentage", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/StoryAreaType/entity.json b/.butcher/types/StoryAreaType/entity.json new file mode 100644 index 00000000..641fa4df --- /dev/null +++ b/.butcher/types/StoryAreaType/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "storyareatype", + "name": "StoryAreaType", + "description": "Describes the type of a clickable area on a story. Currently, it can be one of\n - StoryAreaTypeLocation\n - StoryAreaTypeSuggestedReaction\n - StoryAreaTypeLink\n - StoryAreaTypeWeather\n - StoryAreaTypeUniqueGift", + "html_description": "

Describes the type of a clickable area on a story. Currently, it can be one of

", + "rst_description": "Describes the type of a clickable area on a story. Currently, it can be one of\n\n - :class:`aiogram.types.story_area_type_location.StoryAreaTypeLocation`\n - :class:`aiogram.types.story_area_type_suggested_reaction.StoryAreaTypeSuggestedReaction`\n - :class:`aiogram.types.story_area_type_link.StoryAreaTypeLink`\n - :class:`aiogram.types.story_area_type_weather.StoryAreaTypeWeather`\n - :class:`aiogram.types.story_area_type_unique_gift.StoryAreaTypeUniqueGift`", + "annotations": [], + "category": "types" + } +} diff --git a/.butcher/types/StoryAreaType/subtypes.yml b/.butcher/types/StoryAreaType/subtypes.yml new file mode 100644 index 00000000..6756ad51 --- /dev/null +++ b/.butcher/types/StoryAreaType/subtypes.yml @@ -0,0 +1 @@ +discriminator: "type" diff --git a/.butcher/types/StoryAreaTypeLink/entity.json b/.butcher/types/StoryAreaTypeLink/entity.json new file mode 100644 index 00000000..b18335d2 --- /dev/null +++ b/.butcher/types/StoryAreaTypeLink/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "storyareatypelink", + "name": "StoryAreaTypeLink", + "description": "Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.", + "html_description": "

Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.

", + "rst_description": "Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'link'", + "html_description": "Type of the area, always “link”", + "rst_description": "Type of the area, always 'link'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "HTTP or tg:// URL to be opened when the area is clicked", + "html_description": "HTTP or tg:// URL to be opened when the area is clicked", + "rst_description": "HTTP or tg:// URL to be opened when the area is clicked\n", + "name": "url", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/StoryAreaTypeLocation/entity.json b/.butcher/types/StoryAreaTypeLocation/entity.json new file mode 100644 index 00000000..86ade963 --- /dev/null +++ b/.butcher/types/StoryAreaTypeLocation/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "storyareatypelocation", + "name": "StoryAreaTypeLocation", + "description": "Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.", + "html_description": "

Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.

", + "rst_description": "Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'location'", + "html_description": "Type of the area, always “location”", + "rst_description": "Type of the area, always 'location'\n", + "name": "type", + "required": true + }, + { + "type": "Float", + "description": "Location latitude in degrees", + "html_description": "Location latitude in degrees", + "rst_description": "Location latitude in degrees\n", + "name": "latitude", + "required": true + }, + { + "type": "Float", + "description": "Location longitude in degrees", + "html_description": "Location longitude in degrees", + "rst_description": "Location longitude in degrees\n", + "name": "longitude", + "required": true + }, + { + "type": "LocationAddress", + "description": "Address of the location", + "html_description": "Optional. Address of the location", + "rst_description": "*Optional*. Address of the location\n", + "name": "address", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/StoryAreaTypeSuggestedReaction/entity.json b/.butcher/types/StoryAreaTypeSuggestedReaction/entity.json new file mode 100644 index 00000000..29eddea3 --- /dev/null +++ b/.butcher/types/StoryAreaTypeSuggestedReaction/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "storyareatypesuggestedreaction", + "name": "StoryAreaTypeSuggestedReaction", + "description": "Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.", + "html_description": "

Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.

", + "rst_description": "Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'suggested_reaction'", + "html_description": "Type of the area, always “suggested_reaction”", + "rst_description": "Type of the area, always 'suggested_reaction'\n", + "name": "type", + "required": true + }, + { + "type": "ReactionType", + "description": "Type of the reaction", + "html_description": "Type of the reaction", + "rst_description": "Type of the reaction\n", + "name": "reaction_type", + "required": true + }, + { + "type": "Boolean", + "description": "Pass True if the reaction area has a dark background", + "html_description": "Optional. Pass True if the reaction area has a dark background", + "rst_description": "*Optional*. Pass :code:`True` if the reaction area has a dark background\n", + "name": "is_dark", + "required": false + }, + { + "type": "Boolean", + "description": "Pass True if reaction area corner is flipped", + "html_description": "Optional. Pass True if reaction area corner is flipped", + "rst_description": "*Optional*. Pass :code:`True` if reaction area corner is flipped\n", + "name": "is_flipped", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/StoryAreaTypeUniqueGift/entity.json b/.butcher/types/StoryAreaTypeUniqueGift/entity.json new file mode 100644 index 00000000..374e4f30 --- /dev/null +++ b/.butcher/types/StoryAreaTypeUniqueGift/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "storyareatypeuniquegift", + "name": "StoryAreaTypeUniqueGift", + "description": "Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.", + "html_description": "

Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.

", + "rst_description": "Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'unique_gift'", + "html_description": "Type of the area, always “unique_gift”", + "rst_description": "Type of the area, always 'unique_gift'\n", + "name": "type", + "required": true + }, + { + "type": "String", + "description": "Unique name of the gift", + "html_description": "Unique name of the gift", + "rst_description": "Unique name of the gift\n", + "name": "name", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/StoryAreaTypeWeather/entity.json b/.butcher/types/StoryAreaTypeWeather/entity.json new file mode 100644 index 00000000..f1b7895d --- /dev/null +++ b/.butcher/types/StoryAreaTypeWeather/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "storyareatypeweather", + "name": "StoryAreaTypeWeather", + "description": "Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.", + "html_description": "

Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.

", + "rst_description": "Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.", + "annotations": [ + { + "type": "String", + "description": "Type of the area, always 'weather'", + "html_description": "Type of the area, always “weather”", + "rst_description": "Type of the area, always 'weather'\n", + "name": "type", + "required": true + }, + { + "type": "Float", + "description": "Temperature, in degree Celsius", + "html_description": "Temperature, in degree Celsius", + "rst_description": "Temperature, in degree Celsius\n", + "name": "temperature", + "required": true + }, + { + "type": "String", + "description": "Emoji representing the weather", + "html_description": "Emoji representing the weather", + "rst_description": "Emoji representing the weather\n", + "name": "emoji", + "required": true + }, + { + "type": "Integer", + "description": "A color of the area background in the ARGB format", + "html_description": "A color of the area background in the ARGB format", + "rst_description": "A color of the area background in the ARGB format\n", + "name": "background_color", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/TransactionPartnerUser/entity.json b/.butcher/types/TransactionPartnerUser/entity.json index b830a190..83ef4671 100644 --- a/.butcher/types/TransactionPartnerUser/entity.json +++ b/.butcher/types/TransactionPartnerUser/entity.json @@ -19,6 +19,14 @@ "name": "type", "required": true }, + { + "type": "String", + "description": "Type of the transaction, currently one of 'invoice_payment' for payments via invoices, 'paid_media_payment' for payments for paid media, 'gift_purchase' for gifts sent by the bot, 'premium_purchase' for Telegram Premium subscriptions gifted by the bot, 'business_account_transfer' for direct transfers from managed business accounts", + "html_description": "Type of the transaction, currently one of “invoice_payment” for payments via invoices, “paid_media_payment” for payments for paid media, “gift_purchase” for gifts sent by the bot, “premium_purchase” for Telegram Premium subscriptions gifted by the bot, “business_account_transfer” for direct transfers from managed business accounts", + "rst_description": "Type of the transaction, currently one of 'invoice_payment' for payments via invoices, 'paid_media_payment' for payments for paid media, 'gift_purchase' for gifts sent by the bot, 'premium_purchase' for Telegram Premium subscriptions gifted by the bot, 'business_account_transfer' for direct transfers from managed business accounts\n", + "name": "transaction_type", + "required": true + }, { "type": "User", "description": "Information about the user", @@ -29,51 +37,59 @@ }, { "type": "AffiliateInfo", - "description": "Information about the affiliate that received a commission via this transaction", - "html_description": "Optional. Information about the affiliate that received a commission via this transaction", - "rst_description": "*Optional*. Information about the affiliate that received a commission via this transaction\n", + "description": "Information about the affiliate that received a commission via this transaction. Can be available only for 'invoice_payment' and 'paid_media_payment' transactions.", + "html_description": "Optional. Information about the affiliate that received a commission via this transaction. Can be available only for “invoice_payment” and “paid_media_payment” transactions.", + "rst_description": "*Optional*. Information about the affiliate that received a commission via this transaction. Can be available only for 'invoice_payment' and 'paid_media_payment' transactions.\n", "name": "affiliate", "required": false }, { "type": "String", - "description": "Bot-specified invoice payload", - "html_description": "Optional. Bot-specified invoice payload", - "rst_description": "*Optional*. Bot-specified invoice payload\n", + "description": "Bot-specified invoice payload. Can be available only for 'invoice_payment' transactions.", + "html_description": "Optional. Bot-specified invoice payload. Can be available only for “invoice_payment” transactions.", + "rst_description": "*Optional*. Bot-specified invoice payload. Can be available only for 'invoice_payment' transactions.\n", "name": "invoice_payload", "required": false }, { "type": "Integer", - "description": "The duration of the paid subscription", - "html_description": "Optional. The duration of the paid subscription", - "rst_description": "*Optional*. The duration of the paid subscription\n", + "description": "The duration of the paid subscription. Can be available only for 'invoice_payment' transactions.", + "html_description": "Optional. The duration of the paid subscription. Can be available only for “invoice_payment” transactions.", + "rst_description": "*Optional*. The duration of the paid subscription. Can be available only for 'invoice_payment' transactions.\n", "name": "subscription_period", "required": false }, { "type": "Array of PaidMedia", - "description": "Information about the paid media bought by the user", - "html_description": "Optional. Information about the paid media bought by the user", - "rst_description": "*Optional*. Information about the paid media bought by the user\n", + "description": "Information about the paid media bought by the user; for 'paid_media_payment' transactions only", + "html_description": "Optional. Information about the paid media bought by the user; for “paid_media_payment” transactions only", + "rst_description": "*Optional*. Information about the paid media bought by the user; for 'paid_media_payment' transactions only\n", "name": "paid_media", "required": false }, { "type": "String", - "description": "Bot-specified paid media payload", - "html_description": "Optional. Bot-specified paid media payload", - "rst_description": "*Optional*. Bot-specified paid media payload\n", + "description": "Bot-specified paid media payload. Can be available only for 'paid_media_payment' transactions.", + "html_description": "Optional. Bot-specified paid media payload. Can be available only for “paid_media_payment” transactions.", + "rst_description": "*Optional*. Bot-specified paid media payload. Can be available only for 'paid_media_payment' transactions.\n", "name": "paid_media_payload", "required": false }, { "type": "Gift", - "description": "The gift sent to the user by the bot", - "html_description": "Optional. The gift sent to the user by the bot", - "rst_description": "*Optional*. The gift sent to the user by the bot\n", + "description": "The gift sent to the user by the bot; for 'gift_purchase' transactions only", + "html_description": "Optional. The gift sent to the user by the bot; for “gift_purchase” transactions only", + "rst_description": "*Optional*. The gift sent to the user by the bot; for 'gift_purchase' transactions only\n", "name": "gift", "required": false + }, + { + "type": "Integer", + "description": "Number of months the gifted Telegram Premium subscription will be active for; for 'premium_purchase' transactions only", + "html_description": "Optional. Number of months the gifted Telegram Premium subscription will be active for; for “premium_purchase” transactions only", + "rst_description": "*Optional*. Number of months the gifted Telegram Premium subscription will be active for; for 'premium_purchase' transactions only\n", + "name": "premium_subscription_duration", + "required": false } ], "category": "types" diff --git a/.butcher/types/UniqueGift/entity.json b/.butcher/types/UniqueGift/entity.json new file mode 100644 index 00000000..bd49f076 --- /dev/null +++ b/.butcher/types/UniqueGift/entity.json @@ -0,0 +1,65 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "uniquegift", + "name": "UniqueGift", + "description": "This object describes a unique gift that was upgraded from a regular gift.", + "html_description": "

This object describes a unique gift that was upgraded from a regular gift.

", + "rst_description": "This object describes a unique gift that was upgraded from a regular gift.", + "annotations": [ + { + "type": "String", + "description": "Human-readable name of the regular gift from which this unique gift was upgraded", + "html_description": "Human-readable name of the regular gift from which this unique gift was upgraded", + "rst_description": "Human-readable name of the regular gift from which this unique gift was upgraded\n", + "name": "base_name", + "required": true + }, + { + "type": "String", + "description": "Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas", + "html_description": "Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas", + "rst_description": "Unique name of the gift. This name can be used in :code:`https://t.me/nft/...` links and story areas\n", + "name": "name", + "required": true + }, + { + "type": "Integer", + "description": "Unique number of the upgraded gift among gifts upgraded from the same regular gift", + "html_description": "Unique number of the upgraded gift among gifts upgraded from the same regular gift", + "rst_description": "Unique number of the upgraded gift among gifts upgraded from the same regular gift\n", + "name": "number", + "required": true + }, + { + "type": "UniqueGiftModel", + "description": "Model of the gift", + "html_description": "Model of the gift", + "rst_description": "Model of the gift\n", + "name": "model", + "required": true + }, + { + "type": "UniqueGiftSymbol", + "description": "Symbol of the gift", + "html_description": "Symbol of the gift", + "rst_description": "Symbol of the gift\n", + "name": "symbol", + "required": true + }, + { + "type": "UniqueGiftBackdrop", + "description": "Backdrop of the gift", + "html_description": "Backdrop of the gift", + "rst_description": "Backdrop of the gift\n", + "name": "backdrop", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/UniqueGiftBackdrop/entity.json b/.butcher/types/UniqueGiftBackdrop/entity.json new file mode 100644 index 00000000..299a9d16 --- /dev/null +++ b/.butcher/types/UniqueGiftBackdrop/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "uniquegiftbackdrop", + "name": "UniqueGiftBackdrop", + "description": "This object describes the backdrop of a unique gift.", + "html_description": "

This object describes the backdrop of a unique gift.

", + "rst_description": "This object describes the backdrop of a unique gift.", + "annotations": [ + { + "type": "String", + "description": "Name of the backdrop", + "html_description": "Name of the backdrop", + "rst_description": "Name of the backdrop\n", + "name": "name", + "required": true + }, + { + "type": "UniqueGiftBackdropColors", + "description": "Colors of the backdrop", + "html_description": "Colors of the backdrop", + "rst_description": "Colors of the backdrop\n", + "name": "colors", + "required": true + }, + { + "type": "Integer", + "description": "The number of unique gifts that receive this backdrop for every 1000 gifts upgraded", + "html_description": "The number of unique gifts that receive this backdrop for every 1000 gifts upgraded", + "rst_description": "The number of unique gifts that receive this backdrop for every 1000 gifts upgraded\n", + "name": "rarity_per_mille", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/UniqueGiftBackdropColors/entity.json b/.butcher/types/UniqueGiftBackdropColors/entity.json new file mode 100644 index 00000000..ae66442d --- /dev/null +++ b/.butcher/types/UniqueGiftBackdropColors/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "uniquegiftbackdropcolors", + "name": "UniqueGiftBackdropColors", + "description": "This object describes the colors of the backdrop of a unique gift.", + "html_description": "

This object describes the colors of the backdrop of a unique gift.

", + "rst_description": "This object describes the colors of the backdrop of a unique gift.", + "annotations": [ + { + "type": "Integer", + "description": "The color in the center of the backdrop in RGB format", + "html_description": "The color in the center of the backdrop in RGB format", + "rst_description": "The color in the center of the backdrop in RGB format\n", + "name": "center_color", + "required": true + }, + { + "type": "Integer", + "description": "The color on the edges of the backdrop in RGB format", + "html_description": "The color on the edges of the backdrop in RGB format", + "rst_description": "The color on the edges of the backdrop in RGB format\n", + "name": "edge_color", + "required": true + }, + { + "type": "Integer", + "description": "The color to be applied to the symbol in RGB format", + "html_description": "The color to be applied to the symbol in RGB format", + "rst_description": "The color to be applied to the symbol in RGB format\n", + "name": "symbol_color", + "required": true + }, + { + "type": "Integer", + "description": "The color for the text on the backdrop in RGB format", + "html_description": "The color for the text on the backdrop in RGB format", + "rst_description": "The color for the text on the backdrop in RGB format\n", + "name": "text_color", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/UniqueGiftInfo/entity.json b/.butcher/types/UniqueGiftInfo/entity.json new file mode 100644 index 00000000..d3ac7ded --- /dev/null +++ b/.butcher/types/UniqueGiftInfo/entity.json @@ -0,0 +1,49 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "uniquegiftinfo", + "name": "UniqueGiftInfo", + "description": "Describes a service message about a unique gift that was sent or received.", + "html_description": "

Describes a service message about a unique gift that was sent or received.

", + "rst_description": "Describes a service message about a unique gift that was sent or received.", + "annotations": [ + { + "type": "UniqueGift", + "description": "Information about the gift", + "html_description": "Information about the gift", + "rst_description": "Information about the gift\n", + "name": "gift", + "required": true + }, + { + "type": "String", + "description": "Origin of the gift. Currently, either 'upgrade' or 'transfer'", + "html_description": "Origin of the gift. Currently, either “upgrade” or “transfer”", + "rst_description": "Origin of the gift. Currently, either 'upgrade' or 'transfer'\n", + "name": "origin", + "required": true + }, + { + "type": "String", + "description": "Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts", + "html_description": "Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts", + "rst_description": "*Optional*. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts\n", + "name": "owned_gift_id", + "required": false + }, + { + "type": "Integer", + "description": "Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift", + "html_description": "Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift", + "rst_description": "*Optional*. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift\n", + "name": "transfer_star_count", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/UniqueGiftModel/entity.json b/.butcher/types/UniqueGiftModel/entity.json new file mode 100644 index 00000000..4ff33770 --- /dev/null +++ b/.butcher/types/UniqueGiftModel/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "uniquegiftmodel", + "name": "UniqueGiftModel", + "description": "This object describes the model of a unique gift.", + "html_description": "

This object describes the model of a unique gift.

", + "rst_description": "This object describes the model of a unique gift.", + "annotations": [ + { + "type": "String", + "description": "Name of the model", + "html_description": "Name of the model", + "rst_description": "Name of the model\n", + "name": "name", + "required": true + }, + { + "type": "Sticker", + "description": "The sticker that represents the unique gift", + "html_description": "The sticker that represents the unique gift", + "rst_description": "The sticker that represents the unique gift\n", + "name": "sticker", + "required": true + }, + { + "type": "Integer", + "description": "The number of unique gifts that receive this model for every 1000 gifts upgraded", + "html_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded", + "rst_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded\n", + "name": "rarity_per_mille", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/UniqueGiftSymbol/entity.json b/.butcher/types/UniqueGiftSymbol/entity.json new file mode 100644 index 00000000..90ed0814 --- /dev/null +++ b/.butcher/types/UniqueGiftSymbol/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "uniquegiftsymbol", + "name": "UniqueGiftSymbol", + "description": "This object describes the symbol shown on the pattern of a unique gift.", + "html_description": "

This object describes the symbol shown on the pattern of a unique gift.

", + "rst_description": "This object describes the symbol shown on the pattern of a unique gift.", + "annotations": [ + { + "type": "String", + "description": "Name of the symbol", + "html_description": "Name of the symbol", + "rst_description": "Name of the symbol\n", + "name": "name", + "required": true + }, + { + "type": "Sticker", + "description": "The sticker that represents the unique gift", + "html_description": "The sticker that represents the unique gift", + "rst_description": "The sticker that represents the unique gift\n", + "name": "sticker", + "required": true + }, + { + "type": "Integer", + "description": "The number of unique gifts that receive this model for every 1000 gifts upgraded", + "html_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded", + "rst_description": "The number of unique gifts that receive this model for every 1000 gifts upgraded\n", + "name": "rarity_per_mille", + "required": true + } + ], + "category": "types" + } +} diff --git a/CHANGES/1671.feature.rst b/CHANGES/1671.feature.rst new file mode 100644 index 00000000..4e480447 --- /dev/null +++ b/CHANGES/1671.feature.rst @@ -0,0 +1,107 @@ +Added full support for the `Bot API 9.0 `_: + +**Business Accounts** + +- Added the class :class:`aiogram.types.business_bot_rights.BusinessBotRights` and replaced + the field :code:`can_reply` with the field :code:`rights` of the type + :class:`aiogram.types.business_bot_rights.BusinessBotRights` in the class + :class:`aiogram.types.business_connection.BusinessConnection`. +- Added the method :class:`aiogram.methods.read_business_message.ReadBusinessMessage`, + allowing bots to mark incoming messages as read on behalf of a business account. +- Added the method :class:`aiogram.methods.delete_business_messages.DeleteBusinessMessages`, + allowing bots to delete messages on behalf of a business account. +- Added the method :class:`aiogram.methods.set_business_account_name.SetBusinessAccountName`, + allowing bots to change the first and last name of a managed business account. +- Added the method :class:`aiogram.methods.set_business_account_username.SetBusinessAccountUsername`, + allowing bots to change the username of a managed business account. +- Added the method :class:`aiogram.methods.set_business_account_bio.SetBusinessAccountBio`, + allowing bots to change the bio of a managed business account. +- Added the class :class:`aiogram.types.input_profile_photo.InputProfilePhoto`, + describing a profile photo to be set. +- Added the methods :class:`aiogram.methods.set_business_account_profile_photo.SetBusinessAccountProfilePhoto` + and :class:`aiogram.methods.remove_business_account_profile_photo.RemoveBusinessAccountProfilePhoto`, + allowing bots to change the profile photo of a managed business account. +- Added the method :class:`aiogram.methods.set_business_account_gift_settings.SetBusinessAccountGiftSettings`, + allowing bots to change the privacy settings pertaining to incoming gifts in a managed business account. +- Added the class :class:`aiogram.types.star_amount.StarAmount` and the method + :class:`aiogram.methods.get_business_account_star_balance.GetBusinessAccountStarBalance`, + allowing bots to check the current Telegram Star balance of a managed business account. +- Added the method :class:`aiogram.methods.transfer_business_account_stars.TransferBusinessAccountStars`, + allowing bots to transfer Telegram Stars from the balance of a managed business account to their own balance + for withdrawal. +- Added the classes :class:`aiogram.types.owned_gift_regular.OwnedGiftRegular`, + :class:`aiogram.types.owned_gift_unique.OwnedGiftUnique`, :class:`aiogram.types.owned_gifts.OwnedGifts` + and the method :class:`aiogram.methods.get_business_account_gifts.GetBusinessAccountGifts`, + allowing bots to fetch the list of gifts owned by a managed business account. +- Added the method :class:`aiogram.methods.convert_gift_to_stars.ConvertGiftToStars`, + allowing bots to convert gifts received by a managed business account to Telegram Stars. +- Added the method :class:`aiogram.methods.upgrade_gift.UpgradeGift`, + allowing bots to upgrade regular gifts received by a managed business account to unique gifts. +- Added the method :class:`aiogram.methods.transfer_gift.TransferGift`, + allowing bots to transfer unique gifts owned by a managed business account. +- Added the classes :class:`aiogram.types.input_story_content_photo.InputStoryContentPhoto` + and :class:`aiogram.types.input_story_content_video.InputStoryContentVideo` + representing the content of a story to post. +- Added the classes :class:`aiogram.types.story_area.StoryArea`, + :class:`aiogram.types.story_area_position.StoryAreaPosition`, + :class:`aiogram.types.location_address.LocationAddress`, + :class:`aiogram.types.story_area_type_location.StoryAreaTypeLocation`, + :class:`aiogram.types.story_area_type_suggested_reaction.StoryAreaTypeSuggestedReaction`, + :class:`aiogram.types.story_area_type_link.StoryAreaTypeLink`, + :class:`aiogram.types.story_area_type_weather.StoryAreaTypeWeather` + and :class:`aiogram.types.story_area_type_unique_gift.StoryAreaTypeUniqueGift`, + describing clickable active areas on stories. +- Added the methods :class:`aiogram.methods.post_story.PostStory`, + :class:`aiogram.methods.edit_story.EditStory` + and :class:`aiogram.methods.delete_story.DeleteStory`, + allowing bots to post, edit and delete stories on behalf of a managed business account. + +**Mini Apps** + +- Added the field :code:`DeviceStorage`, allowing Mini Apps to use persistent + local storage on the user's device. +- Added the field :code:`SecureStorage`, allowing Mini Apps to use a secure local + storage on the user's device for sensitive data. + +**Gifts** + +- Added the classes :class:`aiogram.types.unique_gift_model.UniqueGiftModel`, + :class:`aiogram.types.unique_gift_symbol.UniqueGiftSymbol`, + :class:`aiogram.types.unique_gift_backdrop_colors.UniqueGiftBackdropColors`, + and :class:`aiogram.types.unique_gift_backdrop.UniqueGiftBackdrop` + to describe the properties of a unique gift. +- Added the class :class:`aiogram.types.unique_gift.UniqueGift` describing + a gift that was upgraded to a unique one. +- Added the class :class:`aiogram.types.accepted_gift_types.AcceptedGiftTypes` + describing the types of gifts that are accepted by a user or a chat. +- Replaced the field :code:`can_send_gift` with the field :code:`accepted_gift_types` + of the type :class:`aiogram.types.accepted_gift_types.AcceptedGiftTypes` + in the class :class:`aiogram.types.chat_full_info.ChatFullInfo`. +- Added the class :class:`aiogram.types.gift_info.GiftInfo` and the field :code:`gift` + to the class :class:`aiogram.types.message.Message`, + describing a service message about a regular gift that was sent or received. +- Added the class :class:`aiogram.types.unique_gift_info.UniqueGiftInfo` + and the field :code:`unique_gift` to the class :class:`aiogram.types.message.Message`, + describing a service message about a unique gift that was sent or received. + +**Telegram Premium** + +- Added the method :class:`aiogram.methods.gift_premium_subscription.GiftPremiumSubscription`, + allowing bots to gift a user a Telegram Premium subscription paid in Telegram Stars. +- Added the field :code:`premium_subscription_duration` to the class + :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser` +for transactions involving a Telegram Premium subscription purchased by the bot. +- Added the field :code:`transaction_type` to the class + :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`, + simplifying the differentiation and processing of all transaction types. + +**General** + +- Increased the maximum price for paid media to 10000 Telegram Stars. +- Increased the maximum price for a subscription period to 10000 Telegram Stars. +- Added the class :class:`aiogram.types.paid_message_price_changed.PaidMessagePriceChanged` + and the field :code:`paid_message_price_changed` to the class + :class:`aiogram.types.message.Message`, describing a service message about a price change + for paid messages sent to the chat. +- Added the field :code:`paid_star_count` to the class :class:`aiogram.types.message.Message`, + containing the number of Telegram Stars that were paid to send the message. diff --git a/README.rst b/README.rst index 02ae7877..fe350f6d 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 8.3 `_ and gets fast updates to the latest versions of the Bot API +- Supports `Telegram Bot API 9.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 3e3345d6..d7dc8493 100644 --- a/aiogram/__meta__.py +++ b/aiogram/__meta__.py @@ -1,2 +1,2 @@ __version__ = "3.19.0" -__api_version__ = "8.3" +__api_version__ = "9.0" diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index eb936a4a..255ac861 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -33,6 +33,7 @@ from ..methods import ( Close, CloseForumTopic, CloseGeneralForumTopic, + ConvertGiftToStars, CopyMessage, CopyMessages, CreateChatInviteLink, @@ -41,6 +42,7 @@ from ..methods import ( CreateInvoiceLink, CreateNewStickerSet, DeclineChatJoinRequest, + DeleteBusinessMessages, DeleteChatPhoto, DeleteChatStickerSet, DeleteForumTopic, @@ -49,6 +51,7 @@ from ..methods import ( DeleteMyCommands, DeleteStickerFromSet, DeleteStickerSet, + DeleteStory, DeleteWebhook, EditChatInviteLink, EditChatSubscriptionInviteLink, @@ -59,11 +62,14 @@ from ..methods import ( EditMessageMedia, EditMessageReplyMarkup, EditMessageText, + EditStory, EditUserStarSubscription, ExportChatInviteLink, ForwardMessage, ForwardMessages, GetAvailableGifts, + GetBusinessAccountGifts, + GetBusinessAccountStarBalance, GetBusinessConnection, GetChat, GetChatAdministrators, @@ -86,12 +92,16 @@ from ..methods import ( GetUserChatBoosts, GetUserProfilePhotos, GetWebhookInfo, + GiftPremiumSubscription, HideGeneralForumTopic, LeaveChat, LogOut, PinChatMessage, + PostStory, PromoteChatMember, + ReadBusinessMessage, RefundStarPayment, + RemoveBusinessAccountProfilePhoto, RemoveChatVerification, RemoveUserVerification, ReopenForumTopic, @@ -120,6 +130,11 @@ from ..methods import ( SendVideo, SendVideoNote, SendVoice, + SetBusinessAccountBio, + SetBusinessAccountGiftSettings, + SetBusinessAccountName, + SetBusinessAccountProfilePhoto, + SetBusinessAccountUsername, SetChatAdministratorCustomTitle, SetChatDescription, SetChatMenuButton, @@ -147,6 +162,8 @@ from ..methods import ( StopMessageLiveLocation, StopPoll, TelegramMethod, + TransferBusinessAccountStars, + TransferGift, UnbanChatMember, UnbanChatSenderChat, UnhideGeneralForumTopic, @@ -154,11 +171,13 @@ from ..methods import ( UnpinAllForumTopicMessages, UnpinAllGeneralForumTopicMessages, UnpinChatMessage, + UpgradeGift, UploadStickerFile, VerifyChat, VerifyUser, ) from ..types import ( + AcceptedGiftTypes, BotCommand, BotCommandScopeUnion, BotDescription, @@ -184,7 +203,9 @@ from ..types import ( InputMediaUnion, InputPaidMediaUnion, InputPollOptionUnion, + InputProfilePhotoUnion, InputSticker, + InputStoryContentUnion, LabeledPrice, LinkPreviewOptions, MaskPosition, @@ -193,6 +214,7 @@ from ..types import ( Message, MessageEntity, MessageId, + OwnedGifts, PassportElementErrorUnion, Poll, PreparedInlineMessage, @@ -203,9 +225,12 @@ from ..types import ( ResultMenuButtonUnion, SentWebAppMessage, ShippingOption, + StarAmount, StarTransactions, Sticker, StickerSet, + Story, + StoryArea, Update, User, UserChatBoosts, @@ -932,7 +957,7 @@ class Bot: :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. :param business_connection_id: Unique identifier of the business connection on behalf of which the link will be created. For payments in `Telegram Stars `_ only. :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. - :param subscription_period: The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars. + :param subscription_period: The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars. :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. @@ -4571,7 +4596,7 @@ class Bot: Source: https://core.telegram.org/bots/api#sendpaidmedia :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. - :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-2500 + :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-10000 :param media: A JSON-serialized array describing the media to be sent; up to 10 items :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param payload: Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. @@ -4621,7 +4646,7 @@ class Bot: :param chat_id: Unique identifier for the target channel chat or username of the target channel (in the format :code:`@channelusername`) :param subscription_period: The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). - :param subscription_price: The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 + :param subscription_price: The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000 :param name: Invite link name; 0-32 characters :param request_timeout: Request timeout :return: Returns the new invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object. @@ -4758,7 +4783,7 @@ class Bot: :param user_id: Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift. :param chat_id: Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift. :param pay_for_upgrade: Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver - :param text: Text that will be shown along with the gift; 0-255 characters + :param text: Text that will be shown along with the gift; 0-128 characters :param text_parse_mode: Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored. :param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored. :param request_timeout: Request timeout @@ -4887,3 +4912,507 @@ class Bot: custom_description=custom_description, ) return await self(call, request_timeout=request_timeout) + + async def convert_gift_to_stars( + self, + business_connection_id: str, + owned_gift_id: str, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Converts a given regular gift to Telegram Stars. Requires the *can_convert_gifts_to_stars* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#convertgifttostars + + :param business_connection_id: Unique identifier of the business connection + :param owned_gift_id: Unique identifier of the regular gift that should be converted to Telegram Stars + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = ConvertGiftToStars( + business_connection_id=business_connection_id, + owned_gift_id=owned_gift_id, + ) + return await self(call, request_timeout=request_timeout) + + async def delete_business_messages( + self, + business_connection_id: str, + message_ids: list[int], + request_timeout: Optional[int] = None, + ) -> bool: + """ + Delete messages on behalf of a business account. Requires the *can_delete_outgoing_messages* business bot right to delete messages sent by the bot itself, or the *can_delete_all_messages* business bot right to delete any message. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#deletebusinessmessages + + :param business_connection_id: Unique identifier of the business connection on behalf of which to delete the messages + :param message_ids: A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. 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 = DeleteBusinessMessages( + business_connection_id=business_connection_id, + message_ids=message_ids, + ) + return await self(call, request_timeout=request_timeout) + + async def delete_story( + self, + business_connection_id: str, + story_id: int, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Deletes a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#deletestory + + :param business_connection_id: Unique identifier of the business connection + :param story_id: Unique identifier of the story to delete + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = DeleteStory( + business_connection_id=business_connection_id, + story_id=story_id, + ) + return await self(call, request_timeout=request_timeout) + + async def edit_story( + self, + business_connection_id: str, + story_id: int, + content: InputStoryContentUnion, + caption: Optional[str] = None, + parse_mode: Optional[str] = None, + caption_entities: Optional[list[MessageEntity]] = None, + areas: Optional[list[StoryArea]] = None, + request_timeout: Optional[int] = None, + ) -> Story: + """ + Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success. + + Source: https://core.telegram.org/bots/api#editstory + + :param business_connection_id: Unique identifier of the business connection + :param story_id: Unique identifier of the story to edit + :param content: Content of the story + :param caption: Caption of the story, 0-2048 characters after entities parsing + :param parse_mode: Mode for parsing entities in the story caption. See `formatting options `_ for more details. + :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param areas: A JSON-serialized list of clickable areas to be shown on the story + :param request_timeout: Request timeout + :return: Returns :class:`aiogram.types.story.Story` on success. + """ + + call = EditStory( + business_connection_id=business_connection_id, + story_id=story_id, + content=content, + caption=caption, + parse_mode=parse_mode, + caption_entities=caption_entities, + areas=areas, + ) + return await self(call, request_timeout=request_timeout) + + async def get_business_account_gifts( + self, + business_connection_id: str, + exclude_unsaved: Optional[bool] = None, + exclude_saved: Optional[bool] = None, + exclude_unlimited: Optional[bool] = None, + exclude_limited: Optional[bool] = None, + exclude_unique: Optional[bool] = None, + sort_by_price: Optional[bool] = None, + offset: Optional[str] = None, + limit: Optional[int] = None, + request_timeout: Optional[int] = None, + ) -> OwnedGifts: + """ + Returns the gifts received and owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success. + + Source: https://core.telegram.org/bots/api#getbusinessaccountgifts + + :param business_connection_id: Unique identifier of the business connection + :param exclude_unsaved: Pass True to exclude gifts that aren't saved to the account's profile page + :param exclude_saved: Pass True to exclude gifts that are saved to the account's profile page + :param exclude_unlimited: Pass True to exclude gifts that can be purchased an unlimited number of times + :param exclude_limited: Pass True to exclude gifts that can be purchased a limited number of times + :param exclude_unique: Pass True to exclude unique gifts + :param sort_by_price: Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. + :param offset: Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + :param limit: The maximum number of gifts to be returned; 1-100. Defaults to 100 + :param request_timeout: Request timeout + :return: Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success. + """ + + call = GetBusinessAccountGifts( + business_connection_id=business_connection_id, + exclude_unsaved=exclude_unsaved, + exclude_saved=exclude_saved, + exclude_unlimited=exclude_unlimited, + exclude_limited=exclude_limited, + exclude_unique=exclude_unique, + sort_by_price=sort_by_price, + offset=offset, + limit=limit, + ) + return await self(call, request_timeout=request_timeout) + + async def get_business_account_star_balance( + self, + business_connection_id: str, + request_timeout: Optional[int] = None, + ) -> StarAmount: + """ + Returns the amount of Telegram Stars owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.star_amount.StarAmount` on success. + + Source: https://core.telegram.org/bots/api#getbusinessaccountstarbalance + + :param business_connection_id: Unique identifier of the business connection + :param request_timeout: Request timeout + :return: Returns :class:`aiogram.types.star_amount.StarAmount` on success. + """ + + call = GetBusinessAccountStarBalance( + business_connection_id=business_connection_id, + ) + return await self(call, request_timeout=request_timeout) + + async def gift_premium_subscription( + self, + user_id: int, + month_count: int, + star_count: int, + text: Optional[str] = None, + text_parse_mode: Optional[str] = None, + text_entities: Optional[list[MessageEntity]] = None, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Gifts a Telegram Premium subscription to the given user. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#giftpremiumsubscription + + :param user_id: Unique identifier of the target user who will receive a Telegram Premium subscription + :param month_count: Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12 + :param star_count: Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months + :param text: Text that will be shown along with the service message about the subscription; 0-128 characters + :param text_parse_mode: Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored. + :param text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored. + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = GiftPremiumSubscription( + user_id=user_id, + month_count=month_count, + star_count=star_count, + text=text, + text_parse_mode=text_parse_mode, + text_entities=text_entities, + ) + return await self(call, request_timeout=request_timeout) + + async def post_story( + self, + business_connection_id: str, + content: InputStoryContentUnion, + active_period: int, + caption: Optional[str] = None, + parse_mode: Optional[str] = None, + caption_entities: Optional[list[MessageEntity]] = None, + areas: Optional[list[StoryArea]] = None, + post_to_chat_page: Optional[bool] = None, + protect_content: Optional[bool] = None, + request_timeout: Optional[int] = None, + ) -> Story: + """ + Posts a story on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success. + + Source: https://core.telegram.org/bots/api#poststory + + :param business_connection_id: Unique identifier of the business connection + :param content: Content of the story + :param active_period: Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400` + :param caption: Caption of the story, 0-2048 characters after entities parsing + :param parse_mode: Mode for parsing entities in the story caption. See `formatting options `_ for more details. + :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param areas: A JSON-serialized list of clickable areas to be shown on the story + :param post_to_chat_page: Pass :code:`True` to keep the story accessible after it expires + :param protect_content: Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting + :param request_timeout: Request timeout + :return: Returns :class:`aiogram.types.story.Story` on success. + """ + + call = PostStory( + business_connection_id=business_connection_id, + content=content, + active_period=active_period, + caption=caption, + parse_mode=parse_mode, + caption_entities=caption_entities, + areas=areas, + post_to_chat_page=post_to_chat_page, + protect_content=protect_content, + ) + return await self(call, request_timeout=request_timeout) + + async def read_business_message( + self, + business_connection_id: str, + chat_id: int, + message_id: int, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Marks incoming message as read on behalf of a business account. Requires the *can_read_messages* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#readbusinessmessage + + :param business_connection_id: Unique identifier of the business connection on behalf of which to read the message + :param chat_id: Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. + :param message_id: Unique identifier of the message to mark as read + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = ReadBusinessMessage( + business_connection_id=business_connection_id, + chat_id=chat_id, + message_id=message_id, + ) + return await self(call, request_timeout=request_timeout) + + async def remove_business_account_profile_photo( + self, + business_connection_id: str, + is_public: Optional[bool] = None, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Removes the current profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto + + :param business_connection_id: Unique identifier of the business connection + :param is_public: Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo. + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = RemoveBusinessAccountProfilePhoto( + business_connection_id=business_connection_id, + is_public=is_public, + ) + return await self(call, request_timeout=request_timeout) + + async def set_business_account_bio( + self, + business_connection_id: str, + bio: Optional[str] = None, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Changes the bio of a managed business account. Requires the *can_change_bio* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountbio + + :param business_connection_id: Unique identifier of the business connection + :param bio: The new value of the bio for the business account; 0-140 characters + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = SetBusinessAccountBio( + business_connection_id=business_connection_id, + bio=bio, + ) + return await self(call, request_timeout=request_timeout) + + async def set_business_account_gift_settings( + self, + business_connection_id: str, + show_gift_button: bool, + accepted_gift_types: AcceptedGiftTypes, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can_change_gift_settings* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings + + :param business_connection_id: Unique identifier of the business connection + :param show_gift_button: Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field + :param accepted_gift_types: Types of gifts accepted by the business account + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = SetBusinessAccountGiftSettings( + business_connection_id=business_connection_id, + show_gift_button=show_gift_button, + accepted_gift_types=accepted_gift_types, + ) + return await self(call, request_timeout=request_timeout) + + async def set_business_account_name( + self, + business_connection_id: str, + first_name: str, + last_name: Optional[str] = None, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Changes the first and last name of a managed business account. Requires the *can_change_name* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountname + + :param business_connection_id: Unique identifier of the business connection + :param first_name: The new value of the first name for the business account; 1-64 characters + :param last_name: The new value of the last name for the business account; 0-64 characters + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = SetBusinessAccountName( + business_connection_id=business_connection_id, + first_name=first_name, + last_name=last_name, + ) + return await self(call, request_timeout=request_timeout) + + async def set_business_account_profile_photo( + self, + business_connection_id: str, + photo: InputProfilePhotoUnion, + is_public: Optional[bool] = None, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Changes the profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto + + :param business_connection_id: Unique identifier of the business connection + :param photo: The new profile photo to set + :param is_public: Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo. + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = SetBusinessAccountProfilePhoto( + business_connection_id=business_connection_id, + photo=photo, + is_public=is_public, + ) + return await self(call, request_timeout=request_timeout) + + async def set_business_account_username( + self, + business_connection_id: str, + username: Optional[str] = None, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Changes the username of a managed business account. Requires the *can_change_username* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountusername + + :param business_connection_id: Unique identifier of the business connection + :param username: The new value of the username for the business account; 0-32 characters + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = SetBusinessAccountUsername( + business_connection_id=business_connection_id, + username=username, + ) + return await self(call, request_timeout=request_timeout) + + async def transfer_business_account_stars( + self, + business_connection_id: str, + star_count: int, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Transfers Telegram Stars from the business account balance to the bot's balance. Requires the *can_transfer_stars* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#transferbusinessaccountstars + + :param business_connection_id: Unique identifier of the business connection + :param star_count: Number of Telegram Stars to transfer; 1-10000 + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = TransferBusinessAccountStars( + business_connection_id=business_connection_id, + star_count=star_count, + ) + return await self(call, request_timeout=request_timeout) + + async def transfer_gift( + self, + business_connection_id: str, + owned_gift_id: str, + new_owner_chat_id: int, + star_count: Optional[int] = None, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Transfers an owned unique gift to another user. Requires the *can_transfer_and_upgrade_gifts* business bot right. Requires *can_transfer_stars* business bot right if the transfer is paid. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#transfergift + + :param business_connection_id: Unique identifier of the business connection + :param owned_gift_id: Unique identifier of the regular gift that should be transferred + :param new_owner_chat_id: Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours. + :param star_count: The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the *can_transfer_stars* business bot right is required. + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = TransferGift( + business_connection_id=business_connection_id, + owned_gift_id=owned_gift_id, + new_owner_chat_id=new_owner_chat_id, + star_count=star_count, + ) + return await self(call, request_timeout=request_timeout) + + async def upgrade_gift( + self, + business_connection_id: str, + owned_gift_id: str, + keep_original_details: Optional[bool] = None, + star_count: Optional[int] = None, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Upgrades a given regular gift to a unique gift. Requires the *can_transfer_and_upgrade_gifts* business bot right. Additionally requires the *can_transfer_stars* business bot right if the upgrade is paid. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#upgradegift + + :param business_connection_id: Unique identifier of the business connection + :param owned_gift_id: Unique identifier of the regular gift that should be upgraded to a unique one + :param keep_original_details: Pass True to keep the original gift text, sender and receiver in the upgraded gift + :param star_count: The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If :code:`gift.prepaid_upgrade_star_count > 0`, then pass 0, otherwise, the *can_transfer_stars* business bot right is required and :code:`gift.upgrade_star_count` must be passed. + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = UpgradeGift( + business_connection_id=business_connection_id, + owned_gift_id=owned_gift_id, + keep_original_details=keep_original_details, + star_count=star_count, + ) + return await self(call, request_timeout=request_timeout) diff --git a/aiogram/enums/__init__.py b/aiogram/enums/__init__.py index f8c4532a..aa9d6b4a 100644 --- a/aiogram/enums/__init__.py +++ b/aiogram/enums/__init__.py @@ -10,11 +10,14 @@ from .encrypted_passport_element import EncryptedPassportElement from .inline_query_result_type import InlineQueryResultType from .input_media_type import InputMediaType from .input_paid_media_type import InputPaidMediaType +from .input_profile_photo_type import InputProfilePhotoType +from .input_story_content_type import InputStoryContentType from .keyboard_button_poll_type_type import KeyboardButtonPollTypeType 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 .owned_gift_type import OwnedGiftType from .paid_media_type import PaidMediaType from .parse_mode import ParseMode from .passport_element_error_type import PassportElementErrorType @@ -23,8 +26,12 @@ from .reaction_type_type import ReactionTypeType from .revenue_withdrawal_state_type import RevenueWithdrawalStateType from .sticker_format import StickerFormat from .sticker_type import StickerType +from .story_area_type_type import StoryAreaTypeType from .topic_icon_color import TopicIconColor from .transaction_partner_type import TransactionPartnerType +from .transaction_partner_user_transaction_type_enum import ( + TransactionPartnerUserTransactionTypeEnum, +) from .update_type import UpdateType __all__ = ( @@ -40,11 +47,14 @@ __all__ = ( "InlineQueryResultType", "InputMediaType", "InputPaidMediaType", + "InputProfilePhotoType", + "InputStoryContentType", "KeyboardButtonPollTypeType", "MaskPositionPoint", "MenuButtonType", "MessageEntityType", "MessageOriginType", + "OwnedGiftType", "PaidMediaType", "ParseMode", "PassportElementErrorType", @@ -53,7 +63,9 @@ __all__ = ( "RevenueWithdrawalStateType", "StickerFormat", "StickerType", + "StoryAreaTypeType", "TopicIconColor", "TransactionPartnerType", + "TransactionPartnerUserTransactionTypeEnum", "UpdateType", ) diff --git a/aiogram/enums/content_type.py b/aiogram/enums/content_type.py index 5d64db17..96472c4d 100644 --- a/aiogram/enums/content_type.py +++ b/aiogram/enums/content_type.py @@ -42,6 +42,8 @@ class ContentType(str, Enum): REFUNDED_PAYMENT = "refunded_payment" USERS_SHARED = "users_shared" CHAT_SHARED = "chat_shared" + GIFT = "gift" + UNIQUE_GIFT = "unique_gift" CONNECTED_WEBSITE = "connected_website" WRITE_ACCESS_ALLOWED = "write_access_allowed" PASSPORT_DATA = "passport_data" @@ -58,6 +60,7 @@ class ContentType(str, Enum): GIVEAWAY = "giveaway" GIVEAWAY_WINNERS = "giveaway_winners" GIVEAWAY_COMPLETED = "giveaway_completed" + PAID_MESSAGE_PRICE_CHANGED = "paid_message_price_changed" VIDEO_CHAT_SCHEDULED = "video_chat_scheduled" VIDEO_CHAT_STARTED = "video_chat_started" VIDEO_CHAT_ENDED = "video_chat_ended" diff --git a/aiogram/enums/input_profile_photo_type.py b/aiogram/enums/input_profile_photo_type.py new file mode 100644 index 00000000..08eccbd5 --- /dev/null +++ b/aiogram/enums/input_profile_photo_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class InputProfilePhotoType(str, Enum): + """ + This object represents input profile photo type + + Source: https://core.telegram.org/bots/api#inputprofilephoto + """ + + STATIC = "static" + ANIMATED = "animated" diff --git a/aiogram/enums/input_story_content_type.py b/aiogram/enums/input_story_content_type.py new file mode 100644 index 00000000..78c887ae --- /dev/null +++ b/aiogram/enums/input_story_content_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class InputStoryContentType(str, Enum): + """ + This object represents input story content photo type. + + Source: https://core.telegram.org/bots/api#inputstorycontentphoto + """ + + PHOTO = "photo" + VIDEO = "video" diff --git a/aiogram/enums/owned_gift_type.py b/aiogram/enums/owned_gift_type.py new file mode 100644 index 00000000..ec0545d1 --- /dev/null +++ b/aiogram/enums/owned_gift_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class OwnedGiftType(str, Enum): + """ + This object represents owned gift type + + Source: https://core.telegram.org/bots/api#ownedgift + """ + + REGULAR = "regular" + UNIQUE = "unique" diff --git a/aiogram/enums/story_area_type_type.py b/aiogram/enums/story_area_type_type.py new file mode 100644 index 00000000..8be38365 --- /dev/null +++ b/aiogram/enums/story_area_type_type.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class StoryAreaTypeType(str, Enum): + """ + This object represents input profile photo type + + Source: https://core.telegram.org/bots/api#storyareatype + """ + + LOCATION = "location" + SUGGESTED_REACTION = "suggested_reaction" + LINK = "link" + WEATHER = "weather" + UNIQUE_GIFT = "unique_gift" diff --git a/aiogram/enums/transaction_partner_user_transaction_type_enum.py b/aiogram/enums/transaction_partner_user_transaction_type_enum.py new file mode 100644 index 00000000..02cf2dc7 --- /dev/null +++ b/aiogram/enums/transaction_partner_user_transaction_type_enum.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class TransactionPartnerUserTransactionTypeEnum(str, Enum): + """ + This object represents type of the transaction that were made by partner user. + + Source: https://core.telegram.org/bots/api#transactionpartneruser + """ + + INVOICE_PAYMENT = "invoice_payment" + PAID_MEDIA_PAYMENT = "paid_media_payment" + GIFT_PURCHASE = "gift_purchase" + PREMIUM_PURCHASE = "premium_purchase" + BUSINESS_ACCOUNT_TRANSFER = "business_account_transfer" diff --git a/aiogram/methods/__init__.py b/aiogram/methods/__init__.py index c40461fe..a7d6283c 100644 --- a/aiogram/methods/__init__.py +++ b/aiogram/methods/__init__.py @@ -11,6 +11,7 @@ from .base import Request, Response, TelegramMethod from .close import Close from .close_forum_topic import CloseForumTopic from .close_general_forum_topic import CloseGeneralForumTopic +from .convert_gift_to_stars import ConvertGiftToStars from .copy_message import CopyMessage from .copy_messages import CopyMessages from .create_chat_invite_link import CreateChatInviteLink @@ -19,6 +20,7 @@ from .create_forum_topic import CreateForumTopic from .create_invoice_link import CreateInvoiceLink from .create_new_sticker_set import CreateNewStickerSet from .decline_chat_join_request import DeclineChatJoinRequest +from .delete_business_messages import DeleteBusinessMessages from .delete_chat_photo import DeleteChatPhoto from .delete_chat_sticker_set import DeleteChatStickerSet from .delete_forum_topic import DeleteForumTopic @@ -27,6 +29,7 @@ from .delete_messages import DeleteMessages from .delete_my_commands import DeleteMyCommands from .delete_sticker_from_set import DeleteStickerFromSet from .delete_sticker_set import DeleteStickerSet +from .delete_story import DeleteStory from .delete_webhook import DeleteWebhook from .edit_chat_invite_link import EditChatInviteLink from .edit_chat_subscription_invite_link import EditChatSubscriptionInviteLink @@ -37,11 +40,14 @@ from .edit_message_live_location import EditMessageLiveLocation from .edit_message_media import EditMessageMedia from .edit_message_reply_markup import EditMessageReplyMarkup from .edit_message_text import EditMessageText +from .edit_story import EditStory from .edit_user_star_subscription import EditUserStarSubscription from .export_chat_invite_link import ExportChatInviteLink from .forward_message import ForwardMessage from .forward_messages import ForwardMessages from .get_available_gifts import GetAvailableGifts +from .get_business_account_gifts import GetBusinessAccountGifts +from .get_business_account_star_balance import GetBusinessAccountStarBalance from .get_business_connection import GetBusinessConnection from .get_chat import GetChat from .get_chat_administrators import GetChatAdministrators @@ -64,12 +70,16 @@ 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 .gift_premium_subscription import GiftPremiumSubscription from .hide_general_forum_topic import HideGeneralForumTopic from .leave_chat import LeaveChat from .log_out import LogOut from .pin_chat_message import PinChatMessage +from .post_story import PostStory from .promote_chat_member import PromoteChatMember +from .read_business_message import ReadBusinessMessage from .refund_star_payment import RefundStarPayment +from .remove_business_account_profile_photo import RemoveBusinessAccountProfilePhoto from .remove_chat_verification import RemoveChatVerification from .remove_user_verification import RemoveUserVerification from .reopen_forum_topic import ReopenForumTopic @@ -98,6 +108,11 @@ from .send_venue import SendVenue from .send_video import SendVideo from .send_video_note import SendVideoNote from .send_voice import SendVoice +from .set_business_account_bio import SetBusinessAccountBio +from .set_business_account_gift_settings import SetBusinessAccountGiftSettings +from .set_business_account_name import SetBusinessAccountName +from .set_business_account_profile_photo import SetBusinessAccountProfilePhoto +from .set_business_account_username import SetBusinessAccountUsername from .set_chat_administrator_custom_title import SetChatAdministratorCustomTitle from .set_chat_description import SetChatDescription from .set_chat_menu_button import SetChatMenuButton @@ -124,6 +139,8 @@ from .set_user_emoji_status import SetUserEmojiStatus from .set_webhook import SetWebhook from .stop_message_live_location import StopMessageLiveLocation from .stop_poll import StopPoll +from .transfer_business_account_stars import TransferBusinessAccountStars +from .transfer_gift import TransferGift from .unban_chat_member import UnbanChatMember from .unban_chat_sender_chat import UnbanChatSenderChat from .unhide_general_forum_topic import UnhideGeneralForumTopic @@ -131,6 +148,7 @@ from .unpin_all_chat_messages import UnpinAllChatMessages from .unpin_all_forum_topic_messages import UnpinAllForumTopicMessages from .unpin_all_general_forum_topic_messages import UnpinAllGeneralForumTopicMessages from .unpin_chat_message import UnpinChatMessage +from .upgrade_gift import UpgradeGift from .upload_sticker_file import UploadStickerFile from .verify_chat import VerifyChat from .verify_user import VerifyUser @@ -148,6 +166,7 @@ __all__ = ( "Close", "CloseForumTopic", "CloseGeneralForumTopic", + "ConvertGiftToStars", "CopyMessage", "CopyMessages", "CreateChatInviteLink", @@ -156,6 +175,7 @@ __all__ = ( "CreateInvoiceLink", "CreateNewStickerSet", "DeclineChatJoinRequest", + "DeleteBusinessMessages", "DeleteChatPhoto", "DeleteChatStickerSet", "DeleteForumTopic", @@ -164,6 +184,7 @@ __all__ = ( "DeleteMyCommands", "DeleteStickerFromSet", "DeleteStickerSet", + "DeleteStory", "DeleteWebhook", "EditChatInviteLink", "EditChatSubscriptionInviteLink", @@ -174,11 +195,14 @@ __all__ = ( "EditMessageMedia", "EditMessageReplyMarkup", "EditMessageText", + "EditStory", "EditUserStarSubscription", "ExportChatInviteLink", "ForwardMessage", "ForwardMessages", "GetAvailableGifts", + "GetBusinessAccountGifts", + "GetBusinessAccountStarBalance", "GetBusinessConnection", "GetChat", "GetChatAdministrators", @@ -201,12 +225,16 @@ __all__ = ( "GetUserChatBoosts", "GetUserProfilePhotos", "GetWebhookInfo", + "GiftPremiumSubscription", "HideGeneralForumTopic", "LeaveChat", "LogOut", "PinChatMessage", + "PostStory", "PromoteChatMember", + "ReadBusinessMessage", "RefundStarPayment", + "RemoveBusinessAccountProfilePhoto", "RemoveChatVerification", "RemoveUserVerification", "ReopenForumTopic", @@ -237,6 +265,11 @@ __all__ = ( "SendVideo", "SendVideoNote", "SendVoice", + "SetBusinessAccountBio", + "SetBusinessAccountGiftSettings", + "SetBusinessAccountName", + "SetBusinessAccountProfilePhoto", + "SetBusinessAccountUsername", "SetChatAdministratorCustomTitle", "SetChatDescription", "SetChatMenuButton", @@ -264,6 +297,8 @@ __all__ = ( "StopMessageLiveLocation", "StopPoll", "TelegramMethod", + "TransferBusinessAccountStars", + "TransferGift", "UnbanChatMember", "UnbanChatSenderChat", "UnhideGeneralForumTopic", @@ -271,6 +306,7 @@ __all__ = ( "UnpinAllForumTopicMessages", "UnpinAllGeneralForumTopicMessages", "UnpinChatMessage", + "UpgradeGift", "UploadStickerFile", "VerifyChat", "VerifyUser", diff --git a/aiogram/methods/convert_gift_to_stars.py b/aiogram/methods/convert_gift_to_stars.py new file mode 100644 index 00000000..181bc129 --- /dev/null +++ b/aiogram/methods/convert_gift_to_stars.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramMethod + + +class ConvertGiftToStars(TelegramMethod[bool]): + """ + Converts a given regular gift to Telegram Stars. Requires the *can_convert_gifts_to_stars* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#convertgifttostars + """ + + __returning__ = bool + __api_method__ = "convertGiftToStars" + + business_connection_id: str + """Unique identifier of the business connection""" + owned_gift_id: str + """Unique identifier of the regular gift that should be converted to Telegram Stars""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + owned_gift_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__( + business_connection_id=business_connection_id, + owned_gift_id=owned_gift_id, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/create_chat_subscription_invite_link.py b/aiogram/methods/create_chat_subscription_invite_link.py index c9f8bd99..62327523 100644 --- a/aiogram/methods/create_chat_subscription_invite_link.py +++ b/aiogram/methods/create_chat_subscription_invite_link.py @@ -21,7 +21,7 @@ class CreateChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]): subscription_period: DateTimeUnion """The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).""" subscription_price: int - """The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500""" + """The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000""" name: Optional[str] = None """Invite link name; 0-32 characters""" diff --git a/aiogram/methods/create_invoice_link.py b/aiogram/methods/create_invoice_link.py index 40321bde..93c90a2b 100644 --- a/aiogram/methods/create_invoice_link.py +++ b/aiogram/methods/create_invoice_link.py @@ -31,7 +31,7 @@ class CreateInvoiceLink(TelegramMethod[str]): provider_token: Optional[str] = None """Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.""" subscription_period: Optional[int] = None - """The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.""" + """The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.""" max_tip_amount: Optional[int] = None """The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.""" suggested_tip_amounts: Optional[list[int]] = None diff --git a/aiogram/methods/delete_business_messages.py b/aiogram/methods/delete_business_messages.py new file mode 100644 index 00000000..8301d40c --- /dev/null +++ b/aiogram/methods/delete_business_messages.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramMethod + + +class DeleteBusinessMessages(TelegramMethod[bool]): + """ + Delete messages on behalf of a business account. Requires the *can_delete_outgoing_messages* business bot right to delete messages sent by the bot itself, or the *can_delete_all_messages* business bot right to delete any message. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#deletebusinessmessages + """ + + __returning__ = bool + __api_method__ = "deleteBusinessMessages" + + business_connection_id: str + """Unique identifier of the business connection on behalf of which to delete the messages""" + message_ids: list[int] + """A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. 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__, + *, + business_connection_id: 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__( + business_connection_id=business_connection_id, + message_ids=message_ids, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/delete_story.py b/aiogram/methods/delete_story.py new file mode 100644 index 00000000..42a25ff4 --- /dev/null +++ b/aiogram/methods/delete_story.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramMethod + + +class DeleteStory(TelegramMethod[bool]): + """ + Deletes a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#deletestory + """ + + __returning__ = bool + __api_method__ = "deleteStory" + + business_connection_id: str + """Unique identifier of the business connection""" + story_id: int + """Unique identifier of the story to delete""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + story_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__( + business_connection_id=business_connection_id, + story_id=story_id, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/edit_story.py b/aiogram/methods/edit_story.py new file mode 100644 index 00000000..d425e4d5 --- /dev/null +++ b/aiogram/methods/edit_story.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from ..types import InputStoryContentUnion, MessageEntity, Story, StoryArea +from .base import TelegramMethod + + +class EditStory(TelegramMethod[Story]): + """ + Edits a story previously posted by the bot on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success. + + Source: https://core.telegram.org/bots/api#editstory + """ + + __returning__ = Story + __api_method__ = "editStory" + + business_connection_id: str + """Unique identifier of the business connection""" + story_id: int + """Unique identifier of the story to edit""" + content: InputStoryContentUnion + """Content of the story""" + caption: Optional[str] = None + """Caption of the story, 0-2048 characters after entities parsing""" + parse_mode: Optional[str] = None + """Mode for parsing entities in the story caption. See `formatting options `_ for more details.""" + caption_entities: Optional[list[MessageEntity]] = None + """A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + areas: Optional[list[StoryArea]] = None + """A JSON-serialized list of clickable areas to be shown on the story""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + story_id: int, + content: InputStoryContentUnion, + caption: Optional[str] = None, + parse_mode: Optional[str] = None, + caption_entities: Optional[list[MessageEntity]] = None, + areas: Optional[list[StoryArea]] = 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__( + business_connection_id=business_connection_id, + story_id=story_id, + content=content, + caption=caption, + parse_mode=parse_mode, + caption_entities=caption_entities, + areas=areas, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/get_business_account_gifts.py b/aiogram/methods/get_business_account_gifts.py new file mode 100644 index 00000000..c187c47d --- /dev/null +++ b/aiogram/methods/get_business_account_gifts.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from ..types import OwnedGifts +from .base import TelegramMethod + + +class GetBusinessAccountGifts(TelegramMethod[OwnedGifts]): + """ + Returns the gifts received and owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.owned_gifts.OwnedGifts` on success. + + Source: https://core.telegram.org/bots/api#getbusinessaccountgifts + """ + + __returning__ = OwnedGifts + __api_method__ = "getBusinessAccountGifts" + + business_connection_id: str + """Unique identifier of the business connection""" + exclude_unsaved: Optional[bool] = None + """Pass True to exclude gifts that aren't saved to the account's profile page""" + exclude_saved: Optional[bool] = None + """Pass True to exclude gifts that are saved to the account's profile page""" + exclude_unlimited: Optional[bool] = None + """Pass True to exclude gifts that can be purchased an unlimited number of times""" + exclude_limited: Optional[bool] = None + """Pass True to exclude gifts that can be purchased a limited number of times""" + exclude_unique: Optional[bool] = None + """Pass True to exclude unique gifts""" + sort_by_price: Optional[bool] = None + """Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.""" + offset: Optional[str] = None + """Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results""" + limit: Optional[int] = None + """The maximum number of gifts to be returned; 1-100. Defaults to 100""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + exclude_unsaved: Optional[bool] = None, + exclude_saved: Optional[bool] = None, + exclude_unlimited: Optional[bool] = None, + exclude_limited: Optional[bool] = None, + exclude_unique: Optional[bool] = None, + sort_by_price: Optional[bool] = None, + offset: Optional[str] = None, + limit: 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__( + business_connection_id=business_connection_id, + exclude_unsaved=exclude_unsaved, + exclude_saved=exclude_saved, + exclude_unlimited=exclude_unlimited, + exclude_limited=exclude_limited, + exclude_unique=exclude_unique, + sort_by_price=sort_by_price, + offset=offset, + limit=limit, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/get_business_account_star_balance.py b/aiogram/methods/get_business_account_star_balance.py new file mode 100644 index 00000000..3ced0ec7 --- /dev/null +++ b/aiogram/methods/get_business_account_star_balance.py @@ -0,0 +1,33 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from ..types import StarAmount +from .base import TelegramMethod + + +class GetBusinessAccountStarBalance(TelegramMethod[StarAmount]): + """ + Returns the amount of Telegram Stars owned by a managed business account. Requires the *can_view_gifts_and_stars* business bot right. Returns :class:`aiogram.types.star_amount.StarAmount` on success. + + Source: https://core.telegram.org/bots/api#getbusinessaccountstarbalance + """ + + __returning__ = StarAmount + __api_method__ = "getBusinessAccountStarBalance" + + business_connection_id: str + """Unique identifier of the business connection""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, business_connection_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__(business_connection_id=business_connection_id, **__pydantic_kwargs) diff --git a/aiogram/methods/gift_premium_subscription.py b/aiogram/methods/gift_premium_subscription.py new file mode 100644 index 00000000..54316db9 --- /dev/null +++ b/aiogram/methods/gift_premium_subscription.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from ..types import MessageEntity +from .base import TelegramMethod + + +class GiftPremiumSubscription(TelegramMethod[bool]): + """ + Gifts a Telegram Premium subscription to the given user. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#giftpremiumsubscription + """ + + __returning__ = bool + __api_method__ = "giftPremiumSubscription" + + user_id: int + """Unique identifier of the target user who will receive a Telegram Premium subscription""" + month_count: int + """Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12""" + star_count: int + """Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months""" + text: Optional[str] = None + """Text that will be shown along with the service message about the subscription; 0-128 characters""" + text_parse_mode: Optional[str] = None + """Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.""" + text_entities: Optional[list[MessageEntity]] = None + """A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + user_id: int, + month_count: int, + star_count: int, + text: Optional[str] = None, + text_parse_mode: Optional[str] = None, + text_entities: Optional[list[MessageEntity]] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + user_id=user_id, + month_count=month_count, + star_count=star_count, + text=text, + text_parse_mode=text_parse_mode, + text_entities=text_entities, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/post_story.py b/aiogram/methods/post_story.py new file mode 100644 index 00000000..60402225 --- /dev/null +++ b/aiogram/methods/post_story.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from ..types import InputStoryContentUnion, MessageEntity, Story, StoryArea +from .base import TelegramMethod + + +class PostStory(TelegramMethod[Story]): + """ + Posts a story on behalf of a managed business account. Requires the *can_manage_stories* business bot right. Returns :class:`aiogram.types.story.Story` on success. + + Source: https://core.telegram.org/bots/api#poststory + """ + + __returning__ = Story + __api_method__ = "postStory" + + business_connection_id: str + """Unique identifier of the business connection""" + content: InputStoryContentUnion + """Content of the story""" + active_period: int + """Period after which the story is moved to the archive, in seconds; must be one of :code:`6 * 3600`, :code:`12 * 3600`, :code:`86400`, or :code:`2 * 86400`""" + caption: Optional[str] = None + """Caption of the story, 0-2048 characters after entities parsing""" + parse_mode: Optional[str] = None + """Mode for parsing entities in the story caption. See `formatting options `_ for more details.""" + caption_entities: Optional[list[MessageEntity]] = None + """A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + areas: Optional[list[StoryArea]] = None + """A JSON-serialized list of clickable areas to be shown on the story""" + post_to_chat_page: Optional[bool] = None + """Pass :code:`True` to keep the story accessible after it expires""" + protect_content: Optional[bool] = None + """Pass :code:`True` if the content of the story must be protected from forwarding and screenshotting""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + content: InputStoryContentUnion, + active_period: int, + caption: Optional[str] = None, + parse_mode: Optional[str] = None, + caption_entities: Optional[list[MessageEntity]] = None, + areas: Optional[list[StoryArea]] = None, + post_to_chat_page: 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__( + business_connection_id=business_connection_id, + content=content, + active_period=active_period, + caption=caption, + parse_mode=parse_mode, + caption_entities=caption_entities, + areas=areas, + post_to_chat_page=post_to_chat_page, + protect_content=protect_content, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/read_business_message.py b/aiogram/methods/read_business_message.py new file mode 100644 index 00000000..c1c7a426 --- /dev/null +++ b/aiogram/methods/read_business_message.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramMethod + + +class ReadBusinessMessage(TelegramMethod[bool]): + """ + Marks incoming message as read on behalf of a business account. Requires the *can_read_messages* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#readbusinessmessage + """ + + __returning__ = bool + __api_method__ = "readBusinessMessage" + + business_connection_id: str + """Unique identifier of the business connection on behalf of which to read the message""" + chat_id: int + """Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.""" + message_id: int + """Unique identifier of the message to mark as read""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + chat_id: int, + message_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__( + business_connection_id=business_connection_id, + chat_id=chat_id, + message_id=message_id, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/remove_business_account_profile_photo.py b/aiogram/methods/remove_business_account_profile_photo.py new file mode 100644 index 00000000..17768e39 --- /dev/null +++ b/aiogram/methods/remove_business_account_profile_photo.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramMethod + + +class RemoveBusinessAccountProfilePhoto(TelegramMethod[bool]): + """ + Removes the current profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto + """ + + __returning__ = bool + __api_method__ = "removeBusinessAccountProfilePhoto" + + business_connection_id: str + """Unique identifier of the business connection""" + is_public: Optional[bool] = None + """Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + is_public: 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__( + business_connection_id=business_connection_id, + is_public=is_public, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/send_gift.py b/aiogram/methods/send_gift.py index 082dfae7..4f8b444a 100644 --- a/aiogram/methods/send_gift.py +++ b/aiogram/methods/send_gift.py @@ -26,7 +26,7 @@ class SendGift(TelegramMethod[bool]): pay_for_upgrade: Optional[bool] = None """Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver""" text: Optional[str] = None - """Text that will be shown along with the gift; 0-255 characters""" + """Text that will be shown along with the gift; 0-128 characters""" text_parse_mode: Optional[str] = None """Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.""" text_entities: Optional[list[MessageEntity]] = None diff --git a/aiogram/methods/send_paid_media.py b/aiogram/methods/send_paid_media.py index 10981c57..cf3a8b1b 100644 --- a/aiogram/methods/send_paid_media.py +++ b/aiogram/methods/send_paid_media.py @@ -26,7 +26,7 @@ class SendPaidMedia(TelegramMethod[Message]): chat_id: ChatIdUnion """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.""" star_count: int - """The number of Telegram Stars that must be paid to buy access to the media; 1-2500""" + """The number of Telegram Stars that must be paid to buy access to the media; 1-10000""" media: list[InputPaidMediaUnion] """A JSON-serialized array describing the media to be sent; up to 10 items""" business_connection_id: Optional[str] = None diff --git a/aiogram/methods/set_business_account_bio.py b/aiogram/methods/set_business_account_bio.py new file mode 100644 index 00000000..04bb3f32 --- /dev/null +++ b/aiogram/methods/set_business_account_bio.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramMethod + + +class SetBusinessAccountBio(TelegramMethod[bool]): + """ + Changes the bio of a managed business account. Requires the *can_change_bio* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountbio + """ + + __returning__ = bool + __api_method__ = "setBusinessAccountBio" + + business_connection_id: str + """Unique identifier of the business connection""" + bio: Optional[str] = None + """The new value of the bio for the business account; 0-140 characters""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + bio: 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__( + business_connection_id=business_connection_id, bio=bio, **__pydantic_kwargs + ) diff --git a/aiogram/methods/set_business_account_gift_settings.py b/aiogram/methods/set_business_account_gift_settings.py new file mode 100644 index 00000000..ca6d3ad8 --- /dev/null +++ b/aiogram/methods/set_business_account_gift_settings.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from ..types import AcceptedGiftTypes +from .base import TelegramMethod + + +class SetBusinessAccountGiftSettings(TelegramMethod[bool]): + """ + Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can_change_gift_settings* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings + """ + + __returning__ = bool + __api_method__ = "setBusinessAccountGiftSettings" + + business_connection_id: str + """Unique identifier of the business connection""" + show_gift_button: bool + """Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field""" + accepted_gift_types: AcceptedGiftTypes + """Types of gifts accepted by the business account""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + show_gift_button: bool, + accepted_gift_types: AcceptedGiftTypes, + **__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__( + business_connection_id=business_connection_id, + show_gift_button=show_gift_button, + accepted_gift_types=accepted_gift_types, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/set_business_account_name.py b/aiogram/methods/set_business_account_name.py new file mode 100644 index 00000000..7bb9e69f --- /dev/null +++ b/aiogram/methods/set_business_account_name.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramMethod + + +class SetBusinessAccountName(TelegramMethod[bool]): + """ + Changes the first and last name of a managed business account. Requires the *can_change_name* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountname + """ + + __returning__ = bool + __api_method__ = "setBusinessAccountName" + + business_connection_id: str + """Unique identifier of the business connection""" + first_name: str + """The new value of the first name for the business account; 1-64 characters""" + last_name: Optional[str] = None + """The new value of the last name for the business account; 0-64 characters""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + first_name: str, + last_name: 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__( + business_connection_id=business_connection_id, + first_name=first_name, + last_name=last_name, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/set_business_account_profile_photo.py b/aiogram/methods/set_business_account_profile_photo.py new file mode 100644 index 00000000..f7ea51bc --- /dev/null +++ b/aiogram/methods/set_business_account_profile_photo.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from ..types import InputProfilePhotoUnion +from .base import TelegramMethod + + +class SetBusinessAccountProfilePhoto(TelegramMethod[bool]): + """ + Changes the profile photo of a managed business account. Requires the *can_edit_profile_photo* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto + """ + + __returning__ = bool + __api_method__ = "setBusinessAccountProfilePhoto" + + business_connection_id: str + """Unique identifier of the business connection""" + photo: InputProfilePhotoUnion + """The new profile photo to set""" + is_public: Optional[bool] = None + """Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + photo: InputProfilePhotoUnion, + is_public: 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__( + business_connection_id=business_connection_id, + photo=photo, + is_public=is_public, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/set_business_account_username.py b/aiogram/methods/set_business_account_username.py new file mode 100644 index 00000000..6c67b9b0 --- /dev/null +++ b/aiogram/methods/set_business_account_username.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramMethod + + +class SetBusinessAccountUsername(TelegramMethod[bool]): + """ + Changes the username of a managed business account. Requires the *can_change_username* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setbusinessaccountusername + """ + + __returning__ = bool + __api_method__ = "setBusinessAccountUsername" + + business_connection_id: str + """Unique identifier of the business connection""" + username: Optional[str] = None + """The new value of the username for the business account; 0-32 characters""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + username: 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__( + business_connection_id=business_connection_id, + username=username, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/transfer_business_account_stars.py b/aiogram/methods/transfer_business_account_stars.py new file mode 100644 index 00000000..946f2218 --- /dev/null +++ b/aiogram/methods/transfer_business_account_stars.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramMethod + + +class TransferBusinessAccountStars(TelegramMethod[bool]): + """ + Transfers Telegram Stars from the business account balance to the bot's balance. Requires the *can_transfer_stars* business bot right. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#transferbusinessaccountstars + """ + + __returning__ = bool + __api_method__ = "transferBusinessAccountStars" + + business_connection_id: str + """Unique identifier of the business connection""" + star_count: int + """Number of Telegram Stars to transfer; 1-10000""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + star_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__( + business_connection_id=business_connection_id, + star_count=star_count, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/transfer_gift.py b/aiogram/methods/transfer_gift.py new file mode 100644 index 00000000..3ca0b80c --- /dev/null +++ b/aiogram/methods/transfer_gift.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramMethod + + +class TransferGift(TelegramMethod[bool]): + """ + Transfers an owned unique gift to another user. Requires the *can_transfer_and_upgrade_gifts* business bot right. Requires *can_transfer_stars* business bot right if the transfer is paid. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#transfergift + """ + + __returning__ = bool + __api_method__ = "transferGift" + + business_connection_id: str + """Unique identifier of the business connection""" + owned_gift_id: str + """Unique identifier of the regular gift that should be transferred""" + new_owner_chat_id: int + """Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.""" + star_count: Optional[int] = None + """The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the *can_transfer_stars* business bot right is required.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + owned_gift_id: str, + new_owner_chat_id: int, + star_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__( + business_connection_id=business_connection_id, + owned_gift_id=owned_gift_id, + new_owner_chat_id=new_owner_chat_id, + star_count=star_count, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/upgrade_gift.py b/aiogram/methods/upgrade_gift.py new file mode 100644 index 00000000..15fccb80 --- /dev/null +++ b/aiogram/methods/upgrade_gift.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramMethod + + +class UpgradeGift(TelegramMethod[bool]): + """ + Upgrades a given regular gift to a unique gift. Requires the *can_transfer_and_upgrade_gifts* business bot right. Additionally requires the *can_transfer_stars* business bot right if the upgrade is paid. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#upgradegift + """ + + __returning__ = bool + __api_method__ = "upgradeGift" + + business_connection_id: str + """Unique identifier of the business connection""" + owned_gift_id: str + """Unique identifier of the regular gift that should be upgraded to a unique one""" + keep_original_details: Optional[bool] = None + """Pass True to keep the original gift text, sender and receiver in the upgraded gift""" + star_count: Optional[int] = None + """The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If :code:`gift.prepaid_upgrade_star_count > 0`, then pass 0, otherwise, the *can_transfer_stars* business bot right is required and :code:`gift.upgrade_star_count` must be passed.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + business_connection_id: str, + owned_gift_id: str, + keep_original_details: Optional[bool] = None, + star_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__( + business_connection_id=business_connection_id, + owned_gift_id=owned_gift_id, + keep_original_details=keep_original_details, + star_count=star_count, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index 7b07990d..6ef43dd5 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -1,5 +1,6 @@ from typing import List, Literal, Optional, Union +from .accepted_gift_types import AcceptedGiftTypes from .affiliate_info import AffiliateInfo from .animation import Animation from .audio import Audio @@ -31,6 +32,7 @@ from .bot_command_scope_union import BotCommandScopeUnion from .bot_description import BotDescription from .bot_name import BotName from .bot_short_description import BotShortDescription +from .business_bot_rights import BusinessBotRights from .business_connection import BusinessConnection from .business_intro import BusinessIntro from .business_location import BusinessLocation @@ -92,6 +94,7 @@ from .game_high_score import GameHighScore from .general_forum_topic_hidden import GeneralForumTopicHidden from .general_forum_topic_unhidden import GeneralForumTopicUnhidden from .gift import Gift +from .gift_info import GiftInfo from .gifts import Gifts from .giveaway import Giveaway from .giveaway_completed import GiveawayCompleted @@ -144,7 +147,15 @@ from .input_paid_media_union import InputPaidMediaUnion from .input_paid_media_video import InputPaidMediaVideo from .input_poll_option import InputPollOption from .input_poll_option_union import InputPollOptionUnion +from .input_profile_photo import InputProfilePhoto +from .input_profile_photo_animated import InputProfilePhotoAnimated +from .input_profile_photo_static import InputProfilePhotoStatic +from .input_profile_photo_union import InputProfilePhotoUnion from .input_sticker import InputSticker +from .input_story_content import InputStoryContent +from .input_story_content_photo import InputStoryContentPhoto +from .input_story_content_union import InputStoryContentUnion +from .input_story_content_video import InputStoryContentVideo from .input_text_message_content import InputTextMessageContent from .input_venue_message_content import InputVenueMessageContent from .invoice import Invoice @@ -156,6 +167,7 @@ from .keyboard_button_request_users import KeyboardButtonRequestUsers from .labeled_price import LabeledPrice from .link_preview_options import LinkPreviewOptions from .location import Location +from .location_address import LocationAddress from .login_url import LoginUrl from .mask_position import MaskPosition from .maybe_inaccessible_message import MaybeInaccessibleMessage @@ -179,6 +191,11 @@ 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 .owned_gift import OwnedGift +from .owned_gift_regular import OwnedGiftRegular +from .owned_gift_union import OwnedGiftUnion +from .owned_gift_unique import OwnedGiftUnique +from .owned_gifts import OwnedGifts from .paid_media import PaidMedia from .paid_media_info import PaidMediaInfo from .paid_media_photo import PaidMediaPhoto @@ -186,6 +203,7 @@ from .paid_media_preview import PaidMediaPreview from .paid_media_purchased import PaidMediaPurchased from .paid_media_union import PaidMediaUnion from .paid_media_video import PaidMediaVideo +from .paid_message_price_changed import PaidMessagePriceChanged from .passport_data import PassportData from .passport_element_error import PassportElementError from .passport_element_error_data_field import PassportElementErrorDataField @@ -232,11 +250,21 @@ from .shared_user import SharedUser from .shipping_address import ShippingAddress from .shipping_option import ShippingOption from .shipping_query import ShippingQuery +from .star_amount import StarAmount from .star_transaction import StarTransaction from .star_transactions import StarTransactions from .sticker import Sticker from .sticker_set import StickerSet from .story import Story +from .story_area import StoryArea +from .story_area_position import StoryAreaPosition +from .story_area_type import StoryAreaType +from .story_area_type_link import StoryAreaTypeLink +from .story_area_type_location import StoryAreaTypeLocation +from .story_area_type_suggested_reaction import StoryAreaTypeSuggestedReaction +from .story_area_type_union import StoryAreaTypeUnion +from .story_area_type_unique_gift import StoryAreaTypeUniqueGift +from .story_area_type_weather import StoryAreaTypeWeather from .successful_payment import SuccessfulPayment from .switch_inline_query_chosen_chat import SwitchInlineQueryChosenChat from .text_quote import TextQuote @@ -249,6 +277,12 @@ from .transaction_partner_telegram_ads import TransactionPartnerTelegramAds from .transaction_partner_telegram_api import TransactionPartnerTelegramApi from .transaction_partner_union import TransactionPartnerUnion from .transaction_partner_user import TransactionPartnerUser +from .unique_gift import UniqueGift +from .unique_gift_backdrop import UniqueGiftBackdrop +from .unique_gift_backdrop_colors import UniqueGiftBackdropColors +from .unique_gift_info import UniqueGiftInfo +from .unique_gift_model import UniqueGiftModel +from .unique_gift_symbol import UniqueGiftSymbol from .update import Update from .user import User from .user_chat_boosts import UserChatBoosts @@ -269,6 +303,7 @@ from .webhook_info import WebhookInfo from .write_access_allowed import WriteAccessAllowed __all__ = ( + "AcceptedGiftTypes", "AffiliateInfo", "Animation", "Audio", @@ -298,6 +333,7 @@ __all__ = ( "BotName", "BotShortDescription", "BufferedInputFile", + "BusinessBotRights", "BusinessConnection", "BusinessIntro", "BusinessLocation", @@ -361,6 +397,7 @@ __all__ = ( "GeneralForumTopicHidden", "GeneralForumTopicUnhidden", "Gift", + "GiftInfo", "Gifts", "Giveaway", "GiveawayCompleted", @@ -413,7 +450,15 @@ __all__ = ( "InputPaidMediaVideo", "InputPollOption", "InputPollOptionUnion", + "InputProfilePhoto", + "InputProfilePhotoAnimated", + "InputProfilePhotoStatic", + "InputProfilePhotoUnion", "InputSticker", + "InputStoryContent", + "InputStoryContentPhoto", + "InputStoryContentUnion", + "InputStoryContentVideo", "InputTextMessageContent", "InputVenueMessageContent", "Invoice", @@ -425,6 +470,7 @@ __all__ = ( "LabeledPrice", "LinkPreviewOptions", "Location", + "LocationAddress", "LoginUrl", "MaskPosition", "MaybeInaccessibleMessage", @@ -448,6 +494,11 @@ __all__ = ( "MessageReactionCountUpdated", "MessageReactionUpdated", "OrderInfo", + "OwnedGift", + "OwnedGiftRegular", + "OwnedGiftUnion", + "OwnedGiftUnique", + "OwnedGifts", "PaidMedia", "PaidMediaInfo", "PaidMediaPhoto", @@ -455,6 +506,7 @@ __all__ = ( "PaidMediaPurchased", "PaidMediaUnion", "PaidMediaVideo", + "PaidMessagePriceChanged", "PassportData", "PassportElementError", "PassportElementErrorDataField", @@ -499,11 +551,21 @@ __all__ = ( "ShippingAddress", "ShippingOption", "ShippingQuery", + "StarAmount", "StarTransaction", "StarTransactions", "Sticker", "StickerSet", "Story", + "StoryArea", + "StoryAreaPosition", + "StoryAreaType", + "StoryAreaTypeLink", + "StoryAreaTypeLocation", + "StoryAreaTypeSuggestedReaction", + "StoryAreaTypeUnion", + "StoryAreaTypeUniqueGift", + "StoryAreaTypeWeather", "SuccessfulPayment", "SwitchInlineQueryChosenChat", "TelegramObject", @@ -519,6 +581,12 @@ __all__ = ( "TransactionPartnerUser", "UNSET_PARSE_MODE", "URLInputFile", + "UniqueGift", + "UniqueGiftBackdrop", + "UniqueGiftBackdropColors", + "UniqueGiftInfo", + "UniqueGiftModel", + "UniqueGiftSymbol", "Update", "User", "UserChatBoosts", diff --git a/aiogram/types/accepted_gift_types.py b/aiogram/types/accepted_gift_types.py new file mode 100644 index 00000000..2bf59463 --- /dev/null +++ b/aiogram/types/accepted_gift_types.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + + +class AcceptedGiftTypes(TelegramObject): + """ + This object describes the types of gifts that can be gifted to a user or a chat. + + Source: https://core.telegram.org/bots/api#acceptedgifttypes + """ + + unlimited_gifts: bool + """True, if unlimited regular gifts are accepted""" + limited_gifts: bool + """True, if limited regular gifts are accepted""" + unique_gifts: bool + """True, if unique gifts or gifts that can be upgraded to unique for free are accepted""" + premium_subscription: bool + """True, if a Telegram Premium subscription is accepted""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + unlimited_gifts: bool, + limited_gifts: bool, + unique_gifts: bool, + premium_subscription: bool, + **__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__( + unlimited_gifts=unlimited_gifts, + limited_gifts=limited_gifts, + unique_gifts=unique_gifts, + premium_subscription=premium_subscription, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/business_bot_rights.py b/aiogram/types/business_bot_rights.py new file mode 100644 index 00000000..020a599e --- /dev/null +++ b/aiogram/types/business_bot_rights.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + + +class BusinessBotRights(TelegramObject): + """ + Represents the rights of a business bot. + + Source: https://core.telegram.org/bots/api#businessbotrights + """ + + can_reply: Optional[bool] = None + """*Optional*. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours""" + can_read_messages: Optional[bool] = None + """*Optional*. True, if the bot can mark incoming private messages as read""" + can_delete_outgoing_messages: Optional[bool] = None + """*Optional*. True, if the bot can delete messages sent by the bot""" + can_delete_all_messages: Optional[bool] = None + """*Optional*. True, if the bot can delete all private messages in managed chats""" + can_edit_name: Optional[bool] = None + """*Optional*. True, if the bot can edit the first and last name of the business account""" + can_edit_bio: Optional[bool] = None + """*Optional*. True, if the bot can edit the bio of the business account""" + can_edit_profile_photo: Optional[bool] = None + """*Optional*. True, if the bot can edit the profile photo of the business account""" + can_edit_username: Optional[bool] = None + """*Optional*. True, if the bot can edit the username of the business account""" + can_change_gift_settings: Optional[bool] = None + """*Optional*. True, if the bot can change the privacy settings pertaining to gifts for the business account""" + can_view_gifts_and_stars: Optional[bool] = None + """*Optional*. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account""" + can_convert_gifts_to_stars: Optional[bool] = None + """*Optional*. True, if the bot can convert regular gifts owned by the business account to Telegram Stars""" + can_transfer_and_upgrade_gifts: Optional[bool] = None + """*Optional*. True, if the bot can transfer and upgrade gifts owned by the business account""" + can_transfer_stars: Optional[bool] = None + """*Optional*. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts""" + can_manage_stories: Optional[bool] = None + """*Optional*. True, if the bot can post, edit and delete stories on behalf of the business account""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + can_reply: Optional[bool] = None, + can_read_messages: Optional[bool] = None, + can_delete_outgoing_messages: Optional[bool] = None, + can_delete_all_messages: Optional[bool] = None, + can_edit_name: Optional[bool] = None, + can_edit_bio: Optional[bool] = None, + can_edit_profile_photo: Optional[bool] = None, + can_edit_username: Optional[bool] = None, + can_change_gift_settings: Optional[bool] = None, + can_view_gifts_and_stars: Optional[bool] = None, + can_convert_gifts_to_stars: Optional[bool] = None, + can_transfer_and_upgrade_gifts: Optional[bool] = None, + can_transfer_stars: Optional[bool] = None, + can_manage_stories: 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__( + can_reply=can_reply, + can_read_messages=can_read_messages, + can_delete_outgoing_messages=can_delete_outgoing_messages, + can_delete_all_messages=can_delete_all_messages, + can_edit_name=can_edit_name, + can_edit_bio=can_edit_bio, + can_edit_profile_photo=can_edit_profile_photo, + can_edit_username=can_edit_username, + can_change_gift_settings=can_change_gift_settings, + can_view_gifts_and_stars=can_view_gifts_and_stars, + can_convert_gifts_to_stars=can_convert_gifts_to_stars, + can_transfer_and_upgrade_gifts=can_transfer_and_upgrade_gifts, + can_transfer_stars=can_transfer_stars, + can_manage_stories=can_manage_stories, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/business_connection.py b/aiogram/types/business_connection.py index 80c472a2..d3470bed 100644 --- a/aiogram/types/business_connection.py +++ b/aiogram/types/business_connection.py @@ -1,11 +1,14 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Optional + +from pydantic import Field from .base import TelegramObject from .custom import DateTime if TYPE_CHECKING: + from .business_bot_rights import BusinessBotRights from .user import User @@ -24,10 +27,15 @@ class BusinessConnection(TelegramObject): """Identifier of a private chat with the user who created the business connection. 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.""" date: DateTime """Date the connection was established in Unix time""" - can_reply: bool - """True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours""" is_enabled: bool """True, if the connection is active""" + rights: Optional[BusinessBotRights] = None + """*Optional*. Rights of the business bot""" + can_reply: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours + +.. deprecated:: API:9.0 + https://core.telegram.org/bots/api-changelog#april-11-2025""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -40,8 +48,9 @@ class BusinessConnection(TelegramObject): user: User, user_chat_id: int, date: DateTime, - can_reply: bool, is_enabled: bool, + rights: Optional[BusinessBotRights] = None, + can_reply: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -53,7 +62,8 @@ class BusinessConnection(TelegramObject): user=user, user_chat_id=user_chat_id, date=date, - can_reply=can_reply, is_enabled=is_enabled, + rights=rights, + can_reply=can_reply, **__pydantic_kwargs, ) diff --git a/aiogram/types/chat_full_info.py b/aiogram/types/chat_full_info.py index 6d804313..8c057b1f 100644 --- a/aiogram/types/chat_full_info.py +++ b/aiogram/types/chat_full_info.py @@ -2,10 +2,13 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional +from pydantic import Field + from .chat import Chat from .custom import DateTime if TYPE_CHECKING: + from .accepted_gift_types import AcceptedGiftTypes from .birthdate import Birthdate from .business_intro import BusinessIntro from .business_location import BusinessLocation @@ -32,6 +35,8 @@ class ChatFullInfo(Chat): """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.""" max_reaction_count: int """The maximum number of reactions that can be set on a message in the chat""" + accepted_gift_types: AcceptedGiftTypes + """Information about types of gifts that are accepted by the chat or by the corresponding user for private chats""" title: Optional[str] = None """*Optional*. Title, for supergroups, channels and group chats""" username: Optional[str] = None @@ -86,8 +91,6 @@ class ChatFullInfo(Chat): """*Optional*. The most recent pinned message (by sending date)""" permissions: Optional[ChatPermissions] = None """*Optional*. Default chat member permissions, for groups and supergroups""" - can_send_gift: Optional[bool] = None - """*Optional*. :code:`True`, if gifts can be sent to the chat""" can_send_paid_media: Optional[bool] = None """*Optional*. :code:`True`, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.""" slow_mode_delay: Optional[int] = None @@ -114,6 +117,11 @@ class ChatFullInfo(Chat): """*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.""" location: Optional[ChatLocation] = None """*Optional*. For supergroups, the location to which the supergroup is connected""" + can_send_gift: Optional[bool] = Field(None, json_schema_extra={"deprecated": True}) + """*Optional*. :code:`True`, if gifts can be sent to the chat + +.. deprecated:: API:9.0 + https://core.telegram.org/bots/api-changelog#april-11-2025""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -126,6 +134,7 @@ class ChatFullInfo(Chat): type: str, accent_color_id: int, max_reaction_count: int, + accepted_gift_types: AcceptedGiftTypes, title: Optional[str] = None, username: Optional[str] = None, first_name: Optional[str] = None, @@ -153,7 +162,6 @@ class ChatFullInfo(Chat): invite_link: Optional[str] = None, pinned_message: Optional[Message] = None, permissions: Optional[ChatPermissions] = None, - can_send_gift: Optional[bool] = None, can_send_paid_media: Optional[bool] = None, slow_mode_delay: Optional[int] = None, unrestrict_boost_count: Optional[int] = None, @@ -167,6 +175,7 @@ class ChatFullInfo(Chat): custom_emoji_sticker_set_name: Optional[str] = None, linked_chat_id: Optional[int] = None, location: Optional[ChatLocation] = None, + can_send_gift: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -178,6 +187,7 @@ class ChatFullInfo(Chat): type=type, accent_color_id=accent_color_id, max_reaction_count=max_reaction_count, + accepted_gift_types=accepted_gift_types, title=title, username=username, first_name=first_name, @@ -205,7 +215,6 @@ class ChatFullInfo(Chat): invite_link=invite_link, pinned_message=pinned_message, permissions=permissions, - can_send_gift=can_send_gift, can_send_paid_media=can_send_paid_media, slow_mode_delay=slow_mode_delay, unrestrict_boost_count=unrestrict_boost_count, @@ -219,5 +228,6 @@ class ChatFullInfo(Chat): custom_emoji_sticker_set_name=custom_emoji_sticker_set_name, linked_chat_id=linked_chat_id, location=location, + can_send_gift=can_send_gift, **__pydantic_kwargs, ) diff --git a/aiogram/types/gift_info.py b/aiogram/types/gift_info.py new file mode 100644 index 00000000..ba7d8f40 --- /dev/null +++ b/aiogram/types/gift_info.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .gift import Gift + from .message_entity import MessageEntity + + +class GiftInfo(TelegramObject): + """ + Describes a service message about a regular gift that was sent or received. + + Source: https://core.telegram.org/bots/api#giftinfo + """ + + gift: Gift + """Information about the gift""" + owned_gift_id: Optional[str] = None + """*Optional*. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts""" + convert_star_count: Optional[int] = None + """*Optional*. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible""" + prepaid_upgrade_star_count: Optional[int] = None + """*Optional*. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift""" + can_be_upgraded: Optional[bool] = None + """*Optional*. True, if the gift can be upgraded to a unique gift""" + text: Optional[str] = None + """*Optional*. Text of the message that was added to the gift""" + entities: Optional[list[MessageEntity]] = None + """*Optional*. Special entities that appear in the text""" + is_private: Optional[bool] = None + """*Optional*. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + gift: Gift, + owned_gift_id: Optional[str] = None, + convert_star_count: Optional[int] = None, + prepaid_upgrade_star_count: Optional[int] = None, + can_be_upgraded: Optional[bool] = None, + text: Optional[str] = None, + entities: Optional[list[MessageEntity]] = None, + is_private: 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__( + gift=gift, + owned_gift_id=owned_gift_id, + convert_star_count=convert_star_count, + prepaid_upgrade_star_count=prepaid_upgrade_star_count, + can_be_upgraded=can_be_upgraded, + text=text, + entities=entities, + is_private=is_private, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/inaccessible_message.py b/aiogram/types/inaccessible_message.py index c2cfc53e..8322ad9c 100644 --- a/aiogram/types/inaccessible_message.py +++ b/aiogram/types/inaccessible_message.py @@ -2773,7 +2773,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): Source: https://core.telegram.org/bots/api#sendpaidmedia - :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-2500 + :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-10000 :param media: A JSON-serialized array describing the media to be sent; up to 10 items :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param payload: Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. @@ -2842,7 +2842,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage): Source: https://core.telegram.org/bots/api#sendpaidmedia - :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-2500 + :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-10000 :param media: A JSON-serialized array describing the media to be sent; up to 10 items :param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent :param payload: Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. diff --git a/aiogram/types/input_profile_photo.py b/aiogram/types/input_profile_photo.py new file mode 100644 index 00000000..9fc95596 --- /dev/null +++ b/aiogram/types/input_profile_photo.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from .base import TelegramObject + + +class InputProfilePhoto(TelegramObject): + """ + This object describes a profile photo to set. Currently, it can be one of + + - :class:`aiogram.types.input_profile_photo_static.InputProfilePhotoStatic` + - :class:`aiogram.types.input_profile_photo_animated.InputProfilePhotoAnimated` + + Source: https://core.telegram.org/bots/api#inputprofilephoto + """ diff --git a/aiogram/types/input_profile_photo_animated.py b/aiogram/types/input_profile_photo_animated.py new file mode 100644 index 00000000..985b1e03 --- /dev/null +++ b/aiogram/types/input_profile_photo_animated.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from aiogram.enums import InputProfilePhotoType + +from .input_file_union import InputFileUnion +from .input_profile_photo import InputProfilePhoto + + +class InputProfilePhotoAnimated(InputProfilePhoto): + """ + An animated profile photo in the MPEG4 format. + + Source: https://core.telegram.org/bots/api#inputprofilephotoanimated + """ + + type: Literal[InputProfilePhotoType.ANIMATED] = InputProfilePhotoType.ANIMATED + """Type of the profile photo, must be 'animated'""" + animation: InputFileUnion + """The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `""" + main_frame_timestamp: Optional[float] = None + """*Optional*. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[InputProfilePhotoType.ANIMATED] = InputProfilePhotoType.ANIMATED, + animation: InputFileUnion, + main_frame_timestamp: Optional[float] = 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, + animation=animation, + main_frame_timestamp=main_frame_timestamp, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/input_profile_photo_static.py b/aiogram/types/input_profile_photo_static.py new file mode 100644 index 00000000..710f6b8a --- /dev/null +++ b/aiogram/types/input_profile_photo_static.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from aiogram.enums import InputProfilePhotoType + +from .input_file_union import InputFileUnion +from .input_profile_photo import InputProfilePhoto + + +class InputProfilePhotoStatic(InputProfilePhoto): + """ + A static profile photo in the .JPG format. + + Source: https://core.telegram.org/bots/api#inputprofilephotostatic + """ + + type: Literal[InputProfilePhotoType.STATIC] = InputProfilePhotoType.STATIC + """Type of the profile photo, must be 'static'""" + photo: InputFileUnion + """The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[InputProfilePhotoType.STATIC] = InputProfilePhotoType.STATIC, + photo: InputFileUnion, + **__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, photo=photo, **__pydantic_kwargs) diff --git a/aiogram/types/input_profile_photo_union.py b/aiogram/types/input_profile_photo_union.py new file mode 100644 index 00000000..cd272919 --- /dev/null +++ b/aiogram/types/input_profile_photo_union.py @@ -0,0 +1,6 @@ +from typing import Union + +from .input_profile_photo_animated import InputProfilePhotoAnimated +from .input_profile_photo_static import InputProfilePhotoStatic + +InputProfilePhotoUnion = Union[InputProfilePhotoStatic, InputProfilePhotoAnimated] diff --git a/aiogram/types/input_sticker.py b/aiogram/types/input_sticker.py index 57dccdab..83a2b496 100644 --- a/aiogram/types/input_sticker.py +++ b/aiogram/types/input_sticker.py @@ -17,7 +17,7 @@ class InputSticker(TelegramObject): """ sticker: InputFileUnion - """The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass 'attach://' to upload a new one using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » `""" + """The added sticker. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass 'attach://' to upload a new file using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. :ref:`More information on Sending Files » `""" format: str """Format of the added sticker, must be one of 'static' for a **.WEBP** or **.PNG** image, 'animated' for a **.TGS** animation, 'video' for a **.WEBM** video""" emoji_list: list[str] diff --git a/aiogram/types/input_story_content.py b/aiogram/types/input_story_content.py new file mode 100644 index 00000000..0cd34efe --- /dev/null +++ b/aiogram/types/input_story_content.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from .base import TelegramObject + + +class InputStoryContent(TelegramObject): + """ + This object describes the content of a story to post. Currently, it can be one of + + - :class:`aiogram.types.input_story_content_photo.InputStoryContentPhoto` + - :class:`aiogram.types.input_story_content_video.InputStoryContentVideo` + + Source: https://core.telegram.org/bots/api#inputstorycontent + """ diff --git a/aiogram/types/input_story_content_photo.py b/aiogram/types/input_story_content_photo.py new file mode 100644 index 00000000..5fe4877f --- /dev/null +++ b/aiogram/types/input_story_content_photo.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from aiogram.enums import InputStoryContentType + +from .input_story_content import InputStoryContent + + +class InputStoryContentPhoto(InputStoryContent): + """ + Describes a photo to post as a story. + + Source: https://core.telegram.org/bots/api#inputstorycontentphoto + """ + + type: Literal[InputStoryContentType.PHOTO] = InputStoryContentType.PHOTO + """Type of the content, must be 'photo'""" + photo: str + """The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the photo was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[InputStoryContentType.PHOTO] = InputStoryContentType.PHOTO, + photo: 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, photo=photo, **__pydantic_kwargs) diff --git a/aiogram/types/input_story_content_union.py b/aiogram/types/input_story_content_union.py new file mode 100644 index 00000000..fd3b6717 --- /dev/null +++ b/aiogram/types/input_story_content_union.py @@ -0,0 +1,6 @@ +from typing import Union + +from .input_story_content_photo import InputStoryContentPhoto +from .input_story_content_video import InputStoryContentVideo + +InputStoryContentUnion = Union[InputStoryContentPhoto, InputStoryContentVideo] diff --git a/aiogram/types/input_story_content_video.py b/aiogram/types/input_story_content_video.py new file mode 100644 index 00000000..484f5ad0 --- /dev/null +++ b/aiogram/types/input_story_content_video.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from aiogram.enums import InputStoryContentType + +from .input_story_content import InputStoryContent + + +class InputStoryContentVideo(InputStoryContent): + """ + Describes a video to post as a story. + + Source: https://core.telegram.org/bots/api#inputstorycontentvideo + """ + + type: Literal[InputStoryContentType.VIDEO] = InputStoryContentType.VIDEO + """Type of the content, must be 'video'""" + video: str + """The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass 'attach://' if the video was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `""" + duration: Optional[float] = None + """*Optional*. Precise duration of the video in seconds; 0-60""" + cover_frame_timestamp: Optional[float] = None + """*Optional*. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.""" + is_animation: Optional[bool] = None + """*Optional*. Pass :code:`True` if the video has no sound""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[InputStoryContentType.VIDEO] = InputStoryContentType.VIDEO, + video: str, + duration: Optional[float] = None, + cover_frame_timestamp: Optional[float] = None, + is_animation: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + type=type, + video=video, + duration=duration, + cover_frame_timestamp=cover_frame_timestamp, + is_animation=is_animation, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/location_address.py b/aiogram/types/location_address.py new file mode 100644 index 00000000..ad316bfa --- /dev/null +++ b/aiogram/types/location_address.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + + +class LocationAddress(TelegramObject): + """ + Describes the physical address of a location. + + Source: https://core.telegram.org/bots/api#locationaddress + """ + + country_code: str + """The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located""" + state: Optional[str] = None + """*Optional*. State of the location""" + city: Optional[str] = None + """*Optional*. City of the location""" + street: Optional[str] = None + """*Optional*. Street address of the location""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + country_code: str, + state: Optional[str] = None, + city: Optional[str] = None, + street: 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__( + country_code=country_code, + state=state, + city=city, + street=street, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/message.py b/aiogram/types/message.py index a43f194b..fd9a60f5 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -68,6 +68,7 @@ if TYPE_CHECKING: from .game import Game from .general_forum_topic_hidden import GeneralForumTopicHidden from .general_forum_topic_unhidden import GeneralForumTopicUnhidden + from .gift_info import GiftInfo from .giveaway import Giveaway from .giveaway_completed import GiveawayCompleted from .giveaway_created import GiveawayCreated @@ -77,7 +78,6 @@ if TYPE_CHECKING: from .input_file_union import InputFileUnion from .input_media_union import InputMediaUnion from .input_paid_media_union import InputPaidMediaUnion - from .input_poll_option import InputPollOption from .input_poll_option_union import InputPollOptionUnion from .invoice import Invoice from .labeled_price import LabeledPrice @@ -89,6 +89,7 @@ if TYPE_CHECKING: from .message_entity import MessageEntity from .message_origin_union import MessageOriginUnion from .paid_media_info import PaidMediaInfo + from .paid_message_price_changed import PaidMessagePriceChanged from .passport_data import PassportData from .photo_size import PhotoSize from .poll import Poll @@ -101,6 +102,7 @@ if TYPE_CHECKING: from .story import Story from .successful_payment import SuccessfulPayment from .text_quote import TextQuote + from .unique_gift_info import UniqueGiftInfo from .user import User from .user_shared import UserShared from .users_shared import UsersShared @@ -167,6 +169,8 @@ class Message(MaybeInaccessibleMessage): """*Optional*. The unique identifier of a media message group this message belongs to""" author_signature: Optional[str] = None """*Optional*. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator""" + paid_star_count: Optional[int] = None + """*Optional*. The number of Telegram Stars that were paid by the sender of the message to send it""" text: Optional[str] = None """*Optional*. For text messages, the actual UTF-8 text of the message""" entities: Optional[list[MessageEntity]] = None @@ -249,6 +253,10 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Service message: users were shared with the bot""" chat_shared: Optional[ChatShared] = None """*Optional*. Service message: a chat was shared with the bot""" + gift: Optional[GiftInfo] = None + """*Optional*. Service message: a regular gift was sent or received""" + unique_gift: Optional[UniqueGiftInfo] = None + """*Optional*. Service message: a unique gift was sent or received""" connected_website: Optional[str] = None """*Optional*. The domain name of the website on which the user has logged in. `More about Telegram Login » `_""" write_access_allowed: Optional[WriteAccessAllowed] = None @@ -281,6 +289,8 @@ class Message(MaybeInaccessibleMessage): """*Optional*. A giveaway with public winners was completed""" giveaway_completed: Optional[GiveawayCompleted] = None """*Optional*. Service message: a giveaway without public winners was completed""" + paid_message_price_changed: Optional[PaidMessagePriceChanged] = None + """*Optional*. Service message: the price for paid messages has changed in the chat""" video_chat_scheduled: Optional[VideoChatScheduled] = None """*Optional*. Service message: video chat scheduled""" video_chat_started: Optional[VideoChatStarted] = None @@ -358,6 +368,7 @@ class Message(MaybeInaccessibleMessage): is_from_offline: Optional[bool] = None, media_group_id: Optional[str] = None, author_signature: Optional[str] = None, + paid_star_count: Optional[int] = None, text: Optional[str] = None, entities: Optional[list[MessageEntity]] = None, link_preview_options: Optional[LinkPreviewOptions] = None, @@ -399,6 +410,8 @@ class Message(MaybeInaccessibleMessage): refunded_payment: Optional[RefundedPayment] = None, users_shared: Optional[UsersShared] = None, chat_shared: Optional[ChatShared] = None, + gift: Optional[GiftInfo] = None, + unique_gift: Optional[UniqueGiftInfo] = None, connected_website: Optional[str] = None, write_access_allowed: Optional[WriteAccessAllowed] = None, passport_data: Optional[PassportData] = None, @@ -415,6 +428,7 @@ class Message(MaybeInaccessibleMessage): giveaway: Optional[Giveaway] = None, giveaway_winners: Optional[GiveawayWinners] = None, giveaway_completed: Optional[GiveawayCompleted] = None, + paid_message_price_changed: Optional[PaidMessagePriceChanged] = None, video_chat_scheduled: Optional[VideoChatScheduled] = None, video_chat_started: Optional[VideoChatStarted] = None, video_chat_ended: Optional[VideoChatEnded] = None, @@ -457,6 +471,7 @@ class Message(MaybeInaccessibleMessage): is_from_offline=is_from_offline, media_group_id=media_group_id, author_signature=author_signature, + paid_star_count=paid_star_count, text=text, entities=entities, link_preview_options=link_preview_options, @@ -498,6 +513,8 @@ class Message(MaybeInaccessibleMessage): refunded_payment=refunded_payment, users_shared=users_shared, chat_shared=chat_shared, + gift=gift, + unique_gift=unique_gift, connected_website=connected_website, write_access_allowed=write_access_allowed, passport_data=passport_data, @@ -514,6 +531,7 @@ class Message(MaybeInaccessibleMessage): giveaway=giveaway, giveaway_winners=giveaway_winners, giveaway_completed=giveaway_completed, + paid_message_price_changed=paid_message_price_changed, video_chat_scheduled=video_chat_scheduled, video_chat_started=video_chat_started, video_chat_ended=video_chat_ended, @@ -644,7 +662,12 @@ class Message(MaybeInaccessibleMessage): return ContentType.BOOST_ADDED if self.refunded_payment: return ContentType.REFUNDED_PAYMENT - + if self.gift: + return ContentType.GIFT + if self.unique_gift: + return ContentType.UNIQUE_GIFT + if self.paid_message_price_changed: + return ContentType.PAID_MESSAGE_PRICE_CHANGED return ContentType.UNKNOWN def _unparse_entities(self, text_decoration: TextDecoration) -> str: @@ -4163,7 +4186,7 @@ class Message(MaybeInaccessibleMessage): Source: https://core.telegram.org/bots/api#sendpaidmedia - :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-2500 + :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-10000 :param media: A JSON-serialized array describing the media to be sent; up to 10 items :param payload: Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. :param caption: Media caption, 0-1024 characters after entities parsing @@ -4233,7 +4256,7 @@ class Message(MaybeInaccessibleMessage): Source: https://core.telegram.org/bots/api#sendpaidmedia - :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-2500 + :param star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-10000 :param media: A JSON-serialized array describing the media to be sent; up to 10 items :param payload: Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. :param caption: Media caption, 0-1024 characters after entities parsing diff --git a/aiogram/types/owned_gift.py b/aiogram/types/owned_gift.py new file mode 100644 index 00000000..68686a4a --- /dev/null +++ b/aiogram/types/owned_gift.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from .base import TelegramObject + + +class OwnedGift(TelegramObject): + """ + This object describes a gift received and owned by a user or a chat. Currently, it can be one of + + - :class:`aiogram.types.owned_gift_regular.OwnedGiftRegular` + - :class:`aiogram.types.owned_gift_unique.OwnedGiftUnique` + + Source: https://core.telegram.org/bots/api#ownedgift + """ diff --git a/aiogram/types/owned_gift_regular.py b/aiogram/types/owned_gift_regular.py new file mode 100644 index 00000000..73fd9983 --- /dev/null +++ b/aiogram/types/owned_gift_regular.py @@ -0,0 +1,90 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from aiogram.enums import OwnedGiftType + +from .owned_gift import OwnedGift + +if TYPE_CHECKING: + from .gift import Gift + from .message_entity import MessageEntity + from .user import User + + +class OwnedGiftRegular(OwnedGift): + """ + Describes a regular gift owned by a user or a chat. + + Source: https://core.telegram.org/bots/api#ownedgiftregular + """ + + type: Literal[OwnedGiftType.REGULAR] = OwnedGiftType.REGULAR + """Type of the gift, always 'regular'""" + gift: Gift + """Information about the regular gift""" + send_date: int + """Date the gift was sent in Unix time""" + owned_gift_id: Optional[str] = None + """*Optional*. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only""" + sender_user: Optional[User] = None + """*Optional*. Sender of the gift if it is a known user""" + text: Optional[str] = None + """*Optional*. Text of the message that was added to the gift""" + entities: Optional[list[MessageEntity]] = None + """*Optional*. Special entities that appear in the text""" + is_private: Optional[bool] = None + """*Optional*. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them""" + is_saved: Optional[bool] = None + """*Optional*. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only""" + can_be_upgraded: Optional[bool] = None + """*Optional*. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only""" + was_refunded: Optional[bool] = None + """*Optional*. True, if the gift was refunded and isn't available anymore""" + convert_star_count: Optional[int] = None + """*Optional*. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars""" + prepaid_upgrade_star_count: Optional[int] = None + """*Optional*. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[OwnedGiftType.REGULAR] = OwnedGiftType.REGULAR, + gift: Gift, + send_date: int, + owned_gift_id: Optional[str] = None, + sender_user: Optional[User] = None, + text: Optional[str] = None, + entities: Optional[list[MessageEntity]] = None, + is_private: Optional[bool] = None, + is_saved: Optional[bool] = None, + can_be_upgraded: Optional[bool] = None, + was_refunded: Optional[bool] = None, + convert_star_count: Optional[int] = None, + prepaid_upgrade_star_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__( + type=type, + gift=gift, + send_date=send_date, + owned_gift_id=owned_gift_id, + sender_user=sender_user, + text=text, + entities=entities, + is_private=is_private, + is_saved=is_saved, + can_be_upgraded=can_be_upgraded, + was_refunded=was_refunded, + convert_star_count=convert_star_count, + prepaid_upgrade_star_count=prepaid_upgrade_star_count, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/owned_gift_union.py b/aiogram/types/owned_gift_union.py new file mode 100644 index 00000000..5b4b6dab --- /dev/null +++ b/aiogram/types/owned_gift_union.py @@ -0,0 +1,6 @@ +from typing import Union + +from .owned_gift_regular import OwnedGiftRegular +from .owned_gift_unique import OwnedGiftUnique + +OwnedGiftUnion = Union[OwnedGiftRegular, OwnedGiftUnique] diff --git a/aiogram/types/owned_gift_unique.py b/aiogram/types/owned_gift_unique.py new file mode 100644 index 00000000..98a143c7 --- /dev/null +++ b/aiogram/types/owned_gift_unique.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from aiogram.enums import OwnedGiftType + +from .owned_gift import OwnedGift + +if TYPE_CHECKING: + from .unique_gift import UniqueGift + from .user import User + + +class OwnedGiftUnique(OwnedGift): + """ + Describes a unique gift received and owned by a user or a chat. + + Source: https://core.telegram.org/bots/api#ownedgiftunique + """ + + type: Literal[OwnedGiftType.UNIQUE] = OwnedGiftType.UNIQUE + """Type of the gift, always 'unique'""" + gift: UniqueGift + """Information about the unique gift""" + send_date: int + """Date the gift was sent in Unix time""" + owned_gift_id: Optional[str] = None + """*Optional*. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only""" + sender_user: Optional[User] = None + """*Optional*. Sender of the gift if it is a known user""" + is_saved: Optional[bool] = None + """*Optional*. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only""" + can_be_transferred: Optional[bool] = None + """*Optional*. True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only""" + transfer_star_count: Optional[int] = None + """*Optional*. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[OwnedGiftType.UNIQUE] = OwnedGiftType.UNIQUE, + gift: UniqueGift, + send_date: int, + owned_gift_id: Optional[str] = None, + sender_user: Optional[User] = None, + is_saved: Optional[bool] = None, + can_be_transferred: Optional[bool] = None, + transfer_star_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__( + type=type, + gift=gift, + send_date=send_date, + owned_gift_id=owned_gift_id, + sender_user=sender_user, + is_saved=is_saved, + can_be_transferred=can_be_transferred, + transfer_star_count=transfer_star_count, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/owned_gifts.py b/aiogram/types/owned_gifts.py new file mode 100644 index 00000000..1fc1bbb4 --- /dev/null +++ b/aiogram/types/owned_gifts.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .owned_gift_union import OwnedGiftUnion + + +class OwnedGifts(TelegramObject): + """ + Contains the list of gifts received and owned by a user or a chat. + + Source: https://core.telegram.org/bots/api#ownedgifts + """ + + total_count: int + """The total number of gifts owned by the user or the chat""" + gifts: list[OwnedGiftUnion] + """The list of gifts""" + next_offset: Optional[str] = None + """*Optional*. Offset for the next request. If empty, then there are no more results""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + total_count: int, + gifts: list[OwnedGiftUnion], + next_offset: 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__( + total_count=total_count, gifts=gifts, next_offset=next_offset, **__pydantic_kwargs + ) diff --git a/aiogram/types/paid_message_price_changed.py b/aiogram/types/paid_message_price_changed.py new file mode 100644 index 00000000..228f0ecb --- /dev/null +++ b/aiogram/types/paid_message_price_changed.py @@ -0,0 +1,29 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + + +class PaidMessagePriceChanged(TelegramObject): + """ + Describes a service message about a change in the price of paid messages within a chat. + + Source: https://core.telegram.org/bots/api#paidmessagepricechanged + """ + + paid_message_star_count: int + """The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, paid_message_star_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__(paid_message_star_count=paid_message_star_count, **__pydantic_kwargs) diff --git a/aiogram/types/star_amount.py b/aiogram/types/star_amount.py new file mode 100644 index 00000000..98481198 --- /dev/null +++ b/aiogram/types/star_amount.py @@ -0,0 +1,35 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + + +class StarAmount(TelegramObject): + """ + Describes an amount of Telegram Stars. + + Source: https://core.telegram.org/bots/api#staramount + """ + + amount: int + """Integer amount of Telegram Stars, rounded to 0; can be negative""" + nanostar_amount: Optional[int] = None + """*Optional*. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if *amount* is non-positive""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + amount: int, + nanostar_amount: 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__(amount=amount, nanostar_amount=nanostar_amount, **__pydantic_kwargs) diff --git a/aiogram/types/story_area.py b/aiogram/types/story_area.py new file mode 100644 index 00000000..b992cf23 --- /dev/null +++ b/aiogram/types/story_area.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + +if TYPE_CHECKING: + from .story_area_position import StoryAreaPosition + from .story_area_type_union import StoryAreaTypeUnion + + +class StoryArea(TelegramObject): + """ + Describes a clickable area on a story media. + + Source: https://core.telegram.org/bots/api#storyarea + """ + + position: StoryAreaPosition + """Position of the area""" + type: StoryAreaTypeUnion + """Type of the area""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + position: StoryAreaPosition, + type: StoryAreaTypeUnion, + **__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__(position=position, type=type, **__pydantic_kwargs) diff --git a/aiogram/types/story_area_position.py b/aiogram/types/story_area_position.py new file mode 100644 index 00000000..25647023 --- /dev/null +++ b/aiogram/types/story_area_position.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + + +class StoryAreaPosition(TelegramObject): + """ + Describes the position of a clickable area within a story. + + Source: https://core.telegram.org/bots/api#storyareaposition + """ + + x_percentage: float + """The abscissa of the area's center, as a percentage of the media width""" + y_percentage: float + """The ordinate of the area's center, as a percentage of the media height""" + width_percentage: float + """The width of the area's rectangle, as a percentage of the media width""" + height_percentage: float + """The height of the area's rectangle, as a percentage of the media height""" + rotation_angle: float + """The clockwise rotation angle of the rectangle, in degrees; 0-360""" + corner_radius_percentage: float + """The radius of the rectangle corner rounding, as a percentage of the media width""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + x_percentage: float, + y_percentage: float, + width_percentage: float, + height_percentage: float, + rotation_angle: float, + corner_radius_percentage: float, + **__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__( + x_percentage=x_percentage, + y_percentage=y_percentage, + width_percentage=width_percentage, + height_percentage=height_percentage, + rotation_angle=rotation_angle, + corner_radius_percentage=corner_radius_percentage, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/story_area_type.py b/aiogram/types/story_area_type.py new file mode 100644 index 00000000..6c63bf0a --- /dev/null +++ b/aiogram/types/story_area_type.py @@ -0,0 +1,17 @@ +from __future__ import annotations + +from .base import TelegramObject + + +class StoryAreaType(TelegramObject): + """ + Describes the type of a clickable area on a story. Currently, it can be one of + + - :class:`aiogram.types.story_area_type_location.StoryAreaTypeLocation` + - :class:`aiogram.types.story_area_type_suggested_reaction.StoryAreaTypeSuggestedReaction` + - :class:`aiogram.types.story_area_type_link.StoryAreaTypeLink` + - :class:`aiogram.types.story_area_type_weather.StoryAreaTypeWeather` + - :class:`aiogram.types.story_area_type_unique_gift.StoryAreaTypeUniqueGift` + + Source: https://core.telegram.org/bots/api#storyareatype + """ diff --git a/aiogram/types/story_area_type_link.py b/aiogram/types/story_area_type_link.py new file mode 100644 index 00000000..8cbd9e77 --- /dev/null +++ b/aiogram/types/story_area_type_link.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from aiogram.enums import StoryAreaTypeType + +from .story_area_type import StoryAreaType + + +class StoryAreaTypeLink(StoryAreaType): + """ + Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas. + + Source: https://core.telegram.org/bots/api#storyareatypelink + """ + + type: Literal[StoryAreaTypeType.LINK] = StoryAreaTypeType.LINK + """Type of the area, always 'link'""" + url: str + """HTTP or tg:// URL to be opened when the area is clicked""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[StoryAreaTypeType.LINK] = StoryAreaTypeType.LINK, + url: 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, url=url, **__pydantic_kwargs) diff --git a/aiogram/types/story_area_type_location.py b/aiogram/types/story_area_type_location.py new file mode 100644 index 00000000..c40a0e19 --- /dev/null +++ b/aiogram/types/story_area_type_location.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from aiogram.enums import StoryAreaTypeType + +from .story_area_type import StoryAreaType + +if TYPE_CHECKING: + from .location_address import LocationAddress + + +class StoryAreaTypeLocation(StoryAreaType): + """ + Describes a story area pointing to a location. Currently, a story can have up to 10 location areas. + + Source: https://core.telegram.org/bots/api#storyareatypelocation + """ + + type: Literal[StoryAreaTypeType.LOCATION] = StoryAreaTypeType.LOCATION + """Type of the area, always 'location'""" + latitude: float + """Location latitude in degrees""" + longitude: float + """Location longitude in degrees""" + address: Optional[LocationAddress] = None + """*Optional*. Address of the location""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[StoryAreaTypeType.LOCATION] = StoryAreaTypeType.LOCATION, + latitude: float, + longitude: float, + address: Optional[LocationAddress] = 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, + latitude=latitude, + longitude=longitude, + address=address, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/story_area_type_suggested_reaction.py b/aiogram/types/story_area_type_suggested_reaction.py new file mode 100644 index 00000000..199b2331 --- /dev/null +++ b/aiogram/types/story_area_type_suggested_reaction.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from aiogram.enums import StoryAreaTypeType + +from .story_area_type import StoryAreaType + +if TYPE_CHECKING: + from .reaction_type_union import ReactionTypeUnion + + +class StoryAreaTypeSuggestedReaction(StoryAreaType): + """ + Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas. + + Source: https://core.telegram.org/bots/api#storyareatypesuggestedreaction + """ + + type: Literal[StoryAreaTypeType.SUGGESTED_REACTION] = StoryAreaTypeType.SUGGESTED_REACTION + """Type of the area, always 'suggested_reaction'""" + reaction_type: ReactionTypeUnion + """Type of the reaction""" + is_dark: Optional[bool] = None + """*Optional*. Pass :code:`True` if the reaction area has a dark background""" + is_flipped: Optional[bool] = None + """*Optional*. Pass :code:`True` if reaction area corner is flipped""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[ + StoryAreaTypeType.SUGGESTED_REACTION + ] = StoryAreaTypeType.SUGGESTED_REACTION, + reaction_type: ReactionTypeUnion, + is_dark: Optional[bool] = None, + is_flipped: Optional[bool] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + type=type, + reaction_type=reaction_type, + is_dark=is_dark, + is_flipped=is_flipped, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/story_area_type_union.py b/aiogram/types/story_area_type_union.py new file mode 100644 index 00000000..eae1ac25 --- /dev/null +++ b/aiogram/types/story_area_type_union.py @@ -0,0 +1,15 @@ +from typing import Union + +from .story_area_type_link import StoryAreaTypeLink +from .story_area_type_location import StoryAreaTypeLocation +from .story_area_type_suggested_reaction import StoryAreaTypeSuggestedReaction +from .story_area_type_unique_gift import StoryAreaTypeUniqueGift +from .story_area_type_weather import StoryAreaTypeWeather + +StoryAreaTypeUnion = Union[ + StoryAreaTypeLocation, + StoryAreaTypeSuggestedReaction, + StoryAreaTypeLink, + StoryAreaTypeWeather, + StoryAreaTypeUniqueGift, +] diff --git a/aiogram/types/story_area_type_unique_gift.py b/aiogram/types/story_area_type_unique_gift.py new file mode 100644 index 00000000..65c600f9 --- /dev/null +++ b/aiogram/types/story_area_type_unique_gift.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from aiogram.enums import StoryAreaTypeType + +from .story_area_type import StoryAreaType + + +class StoryAreaTypeUniqueGift(StoryAreaType): + """ + Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area. + + Source: https://core.telegram.org/bots/api#storyareatypeuniquegift + """ + + type: Literal[StoryAreaTypeType.UNIQUE_GIFT] = StoryAreaTypeType.UNIQUE_GIFT + """Type of the area, always 'unique_gift'""" + name: str + """Unique name of the gift""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[StoryAreaTypeType.UNIQUE_GIFT] = StoryAreaTypeType.UNIQUE_GIFT, + 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, name=name, **__pydantic_kwargs) diff --git a/aiogram/types/story_area_type_weather.py b/aiogram/types/story_area_type_weather.py new file mode 100644 index 00000000..1bc82ad2 --- /dev/null +++ b/aiogram/types/story_area_type_weather.py @@ -0,0 +1,49 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +from aiogram.enums import StoryAreaTypeType + +from .story_area_type import StoryAreaType + + +class StoryAreaTypeWeather(StoryAreaType): + """ + Describes a story area containing weather information. Currently, a story can have up to 3 weather areas. + + Source: https://core.telegram.org/bots/api#storyareatypeweather + """ + + type: Literal[StoryAreaTypeType.WEATHER] = StoryAreaTypeType.WEATHER + """Type of the area, always 'weather'""" + temperature: float + """Temperature, in degree Celsius""" + emoji: str + """Emoji representing the weather""" + background_color: int + """A color of the area background in the ARGB format""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[StoryAreaTypeType.WEATHER] = StoryAreaTypeType.WEATHER, + temperature: float, + emoji: str, + background_color: int, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + type=type, + temperature=temperature, + emoji=emoji, + background_color=background_color, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/transaction_partner_user.py b/aiogram/types/transaction_partner_user.py index 610433bb..b6ef45f5 100644 --- a/aiogram/types/transaction_partner_user.py +++ b/aiogram/types/transaction_partner_user.py @@ -21,20 +21,24 @@ class TransactionPartnerUser(TransactionPartner): type: Literal[TransactionPartnerType.USER] = TransactionPartnerType.USER """Type of the transaction partner, always 'user'""" + transaction_type: str + """Type of the transaction, currently one of 'invoice_payment' for payments via invoices, 'paid_media_payment' for payments for paid media, 'gift_purchase' for gifts sent by the bot, 'premium_purchase' for Telegram Premium subscriptions gifted by the bot, 'business_account_transfer' for direct transfers from managed business accounts""" user: User """Information about the user""" affiliate: Optional[AffiliateInfo] = None - """*Optional*. Information about the affiliate that received a commission via this transaction""" + """*Optional*. Information about the affiliate that received a commission via this transaction. Can be available only for 'invoice_payment' and 'paid_media_payment' transactions.""" invoice_payload: Optional[str] = None - """*Optional*. Bot-specified invoice payload""" + """*Optional*. Bot-specified invoice payload. Can be available only for 'invoice_payment' transactions.""" subscription_period: Optional[int] = None - """*Optional*. The duration of the paid subscription""" + """*Optional*. The duration of the paid subscription. Can be available only for 'invoice_payment' transactions.""" paid_media: Optional[list[PaidMediaUnion]] = None - """*Optional*. Information about the paid media bought by the user""" + """*Optional*. Information about the paid media bought by the user; for 'paid_media_payment' transactions only""" paid_media_payload: Optional[str] = None - """*Optional*. Bot-specified paid media payload""" + """*Optional*. Bot-specified paid media payload. Can be available only for 'paid_media_payment' transactions.""" gift: Optional[Gift] = None - """*Optional*. The gift sent to the user by the bot""" + """*Optional*. The gift sent to the user by the bot; for 'gift_purchase' transactions only""" + premium_subscription_duration: Optional[int] = None + """*Optional*. Number of months the gifted Telegram Premium subscription will be active for; for 'premium_purchase' transactions only""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -44,6 +48,7 @@ class TransactionPartnerUser(TransactionPartner): __pydantic__self__, *, type: Literal[TransactionPartnerType.USER] = TransactionPartnerType.USER, + transaction_type: str, user: User, affiliate: Optional[AffiliateInfo] = None, invoice_payload: Optional[str] = None, @@ -51,6 +56,7 @@ class TransactionPartnerUser(TransactionPartner): paid_media: Optional[list[PaidMediaUnion]] = None, paid_media_payload: Optional[str] = None, gift: Optional[Gift] = None, + premium_subscription_duration: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -59,6 +65,7 @@ class TransactionPartnerUser(TransactionPartner): super().__init__( type=type, + transaction_type=transaction_type, user=user, affiliate=affiliate, invoice_payload=invoice_payload, @@ -66,5 +73,6 @@ class TransactionPartnerUser(TransactionPartner): paid_media=paid_media, paid_media_payload=paid_media_payload, gift=gift, + premium_subscription_duration=premium_subscription_duration, **__pydantic_kwargs, ) diff --git a/aiogram/types/unique_gift.py b/aiogram/types/unique_gift.py new file mode 100644 index 00000000..cecfac00 --- /dev/null +++ b/aiogram/types/unique_gift.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + +if TYPE_CHECKING: + from .unique_gift_backdrop import UniqueGiftBackdrop + from .unique_gift_model import UniqueGiftModel + from .unique_gift_symbol import UniqueGiftSymbol + + +class UniqueGift(TelegramObject): + """ + This object describes a unique gift that was upgraded from a regular gift. + + Source: https://core.telegram.org/bots/api#uniquegift + """ + + base_name: str + """Human-readable name of the regular gift from which this unique gift was upgraded""" + name: str + """Unique name of the gift. This name can be used in :code:`https://t.me/nft/...` links and story areas""" + number: int + """Unique number of the upgraded gift among gifts upgraded from the same regular gift""" + model: UniqueGiftModel + """Model of the gift""" + symbol: UniqueGiftSymbol + """Symbol of the gift""" + backdrop: UniqueGiftBackdrop + """Backdrop of the gift""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + base_name: str, + name: str, + number: int, + model: UniqueGiftModel, + symbol: UniqueGiftSymbol, + backdrop: UniqueGiftBackdrop, + **__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__( + base_name=base_name, + name=name, + number=number, + model=model, + symbol=symbol, + backdrop=backdrop, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/unique_gift_backdrop.py b/aiogram/types/unique_gift_backdrop.py new file mode 100644 index 00000000..730a0fe3 --- /dev/null +++ b/aiogram/types/unique_gift_backdrop.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + +if TYPE_CHECKING: + from .unique_gift_backdrop_colors import UniqueGiftBackdropColors + + +class UniqueGiftBackdrop(TelegramObject): + """ + This object describes the backdrop of a unique gift. + + Source: https://core.telegram.org/bots/api#uniquegiftbackdrop + """ + + name: str + """Name of the backdrop""" + colors: UniqueGiftBackdropColors + """Colors of the backdrop""" + rarity_per_mille: int + """The number of unique gifts that receive this backdrop for every 1000 gifts upgraded""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + name: str, + colors: UniqueGiftBackdropColors, + rarity_per_mille: 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__( + name=name, colors=colors, rarity_per_mille=rarity_per_mille, **__pydantic_kwargs + ) diff --git a/aiogram/types/unique_gift_backdrop_colors.py b/aiogram/types/unique_gift_backdrop_colors.py new file mode 100644 index 00000000..7d37cf87 --- /dev/null +++ b/aiogram/types/unique_gift_backdrop_colors.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + + +class UniqueGiftBackdropColors(TelegramObject): + """ + This object describes the colors of the backdrop of a unique gift. + + Source: https://core.telegram.org/bots/api#uniquegiftbackdropcolors + """ + + center_color: int + """The color in the center of the backdrop in RGB format""" + edge_color: int + """The color on the edges of the backdrop in RGB format""" + symbol_color: int + """The color to be applied to the symbol in RGB format""" + text_color: int + """The color for the text on the backdrop in RGB format""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + center_color: int, + edge_color: int, + symbol_color: int, + text_color: int, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + center_color=center_color, + edge_color=edge_color, + symbol_color=symbol_color, + text_color=text_color, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/unique_gift_info.py b/aiogram/types/unique_gift_info.py new file mode 100644 index 00000000..1129936f --- /dev/null +++ b/aiogram/types/unique_gift_info.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Optional + +from .base import TelegramObject + +if TYPE_CHECKING: + from .unique_gift import UniqueGift + + +class UniqueGiftInfo(TelegramObject): + """ + Describes a service message about a unique gift that was sent or received. + + Source: https://core.telegram.org/bots/api#uniquegiftinfo + """ + + gift: UniqueGift + """Information about the gift""" + origin: str + """Origin of the gift. Currently, either 'upgrade' or 'transfer'""" + owned_gift_id: Optional[str] = None + """*Optional*. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts""" + transfer_star_count: Optional[int] = None + """*Optional*. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + gift: UniqueGift, + origin: str, + owned_gift_id: Optional[str] = None, + transfer_star_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__( + gift=gift, + origin=origin, + owned_gift_id=owned_gift_id, + transfer_star_count=transfer_star_count, + **__pydantic_kwargs, + ) diff --git a/aiogram/types/unique_gift_model.py b/aiogram/types/unique_gift_model.py new file mode 100644 index 00000000..7a87f032 --- /dev/null +++ b/aiogram/types/unique_gift_model.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + +if TYPE_CHECKING: + from .sticker import Sticker + + +class UniqueGiftModel(TelegramObject): + """ + This object describes the model of a unique gift. + + Source: https://core.telegram.org/bots/api#uniquegiftmodel + """ + + name: str + """Name of the model""" + sticker: Sticker + """The sticker that represents the unique gift""" + rarity_per_mille: int + """The number of unique gifts that receive this model for every 1000 gifts upgraded""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + name: str, + sticker: Sticker, + rarity_per_mille: 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__( + name=name, sticker=sticker, rarity_per_mille=rarity_per_mille, **__pydantic_kwargs + ) diff --git a/aiogram/types/unique_gift_symbol.py b/aiogram/types/unique_gift_symbol.py new file mode 100644 index 00000000..32f20ab3 --- /dev/null +++ b/aiogram/types/unique_gift_symbol.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + +if TYPE_CHECKING: + from .sticker import Sticker + + +class UniqueGiftSymbol(TelegramObject): + """ + This object describes the symbol shown on the pattern of a unique gift. + + Source: https://core.telegram.org/bots/api#uniquegiftsymbol + """ + + name: str + """Name of the symbol""" + sticker: Sticker + """The sticker that represents the unique gift""" + rarity_per_mille: int + """The number of unique gifts that receive this model for every 1000 gifts upgraded""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + name: str, + sticker: Sticker, + rarity_per_mille: 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__( + name=name, sticker=sticker, rarity_per_mille=rarity_per_mille, **__pydantic_kwargs + ) diff --git a/docs/api/enums/index.rst b/docs/api/enums/index.rst index 08f5457a..be84c782 100644 --- a/docs/api/enums/index.rst +++ b/docs/api/enums/index.rst @@ -22,11 +22,14 @@ Here is list of all available enums: inline_query_result_type input_media_type input_paid_media_type + input_profile_photo_type + input_story_content_type keyboard_button_poll_type_type mask_position_point menu_button_type message_entity_type message_origin_type + owned_gift_type paid_media_type parse_mode passport_element_error_type @@ -35,6 +38,8 @@ Here is list of all available enums: revenue_withdrawal_state_type sticker_format sticker_type + story_area_type_type topic_icon_color transaction_partner_type + transaction_partner_user_transaction_type_enum update_type diff --git a/docs/api/enums/input_profile_photo_type.rst b/docs/api/enums/input_profile_photo_type.rst new file mode 100644 index 00000000..262dc68b --- /dev/null +++ b/docs/api/enums/input_profile_photo_type.rst @@ -0,0 +1,9 @@ +##################### +InputProfilePhotoType +##################### + + +.. automodule:: aiogram.enums.input_profile_photo_type + :members: + :member-order: bysource + :undoc-members: True diff --git a/docs/api/enums/input_story_content_type.rst b/docs/api/enums/input_story_content_type.rst new file mode 100644 index 00000000..fde3a400 --- /dev/null +++ b/docs/api/enums/input_story_content_type.rst @@ -0,0 +1,9 @@ +##################### +InputStoryContentType +##################### + + +.. automodule:: aiogram.enums.input_story_content_type + :members: + :member-order: bysource + :undoc-members: True diff --git a/docs/api/enums/owned_gift_type.rst b/docs/api/enums/owned_gift_type.rst new file mode 100644 index 00000000..cc0a87fe --- /dev/null +++ b/docs/api/enums/owned_gift_type.rst @@ -0,0 +1,9 @@ +############# +OwnedGiftType +############# + + +.. automodule:: aiogram.enums.owned_gift_type + :members: + :member-order: bysource + :undoc-members: True diff --git a/docs/api/enums/story_area_type_type.rst b/docs/api/enums/story_area_type_type.rst new file mode 100644 index 00000000..df0538ee --- /dev/null +++ b/docs/api/enums/story_area_type_type.rst @@ -0,0 +1,9 @@ +################# +StoryAreaTypeType +################# + + +.. automodule:: aiogram.enums.story_area_type_type + :members: + :member-order: bysource + :undoc-members: True diff --git a/docs/api/enums/transaction_partner_user_transaction_type_enum.rst b/docs/api/enums/transaction_partner_user_transaction_type_enum.rst new file mode 100644 index 00000000..7616a8d1 --- /dev/null +++ b/docs/api/enums/transaction_partner_user_transaction_type_enum.rst @@ -0,0 +1,9 @@ +######################################### +TransactionPartnerUserTransactionTypeEnum +######################################### + + +.. automodule:: aiogram.enums.transaction_partner_user_transaction_type_enum + :members: + :member-order: bysource + :undoc-members: True diff --git a/docs/api/methods/convert_gift_to_stars.rst b/docs/api/methods/convert_gift_to_stars.rst new file mode 100644 index 00000000..1e1ad02b --- /dev/null +++ b/docs/api/methods/convert_gift_to_stars.rst @@ -0,0 +1,45 @@ +################## +convertGiftToStars +################## + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.convert_gift_to_stars + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.convert_gift_to_stars(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.convert_gift_to_stars import ConvertGiftToStars` +- alias: :code:`from aiogram.methods import ConvertGiftToStars` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(ConvertGiftToStars(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return ConvertGiftToStars(...) diff --git a/docs/api/methods/delete_business_messages.rst b/docs/api/methods/delete_business_messages.rst new file mode 100644 index 00000000..fafa2725 --- /dev/null +++ b/docs/api/methods/delete_business_messages.rst @@ -0,0 +1,45 @@ +###################### +deleteBusinessMessages +###################### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.delete_business_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_business_messages(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.delete_business_messages import DeleteBusinessMessages` +- alias: :code:`from aiogram.methods import DeleteBusinessMessages` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(DeleteBusinessMessages(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return DeleteBusinessMessages(...) diff --git a/docs/api/methods/delete_story.rst b/docs/api/methods/delete_story.rst new file mode 100644 index 00000000..6a1d1e18 --- /dev/null +++ b/docs/api/methods/delete_story.rst @@ -0,0 +1,45 @@ +########### +deleteStory +########### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.delete_story + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.delete_story(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.delete_story import DeleteStory` +- alias: :code:`from aiogram.methods import DeleteStory` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(DeleteStory(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return DeleteStory(...) diff --git a/docs/api/methods/edit_story.rst b/docs/api/methods/edit_story.rst new file mode 100644 index 00000000..705eee8b --- /dev/null +++ b/docs/api/methods/edit_story.rst @@ -0,0 +1,45 @@ +######### +editStory +######### + +Returns: :obj:`Story` + +.. automodule:: aiogram.methods.edit_story + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: Story = await bot.edit_story(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.edit_story import EditStory` +- alias: :code:`from aiogram.methods import EditStory` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: Story = await bot(EditStory(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return EditStory(...) diff --git a/docs/api/methods/get_business_account_gifts.rst b/docs/api/methods/get_business_account_gifts.rst new file mode 100644 index 00000000..0b9fa427 --- /dev/null +++ b/docs/api/methods/get_business_account_gifts.rst @@ -0,0 +1,38 @@ +####################### +getBusinessAccountGifts +####################### + +Returns: :obj:`OwnedGifts` + +.. automodule:: aiogram.methods.get_business_account_gifts + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: OwnedGifts = await bot.get_business_account_gifts(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.get_business_account_gifts import GetBusinessAccountGifts` +- alias: :code:`from aiogram.methods import GetBusinessAccountGifts` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: OwnedGifts = await bot(GetBusinessAccountGifts(...)) diff --git a/docs/api/methods/get_business_account_star_balance.rst b/docs/api/methods/get_business_account_star_balance.rst new file mode 100644 index 00000000..163dcb84 --- /dev/null +++ b/docs/api/methods/get_business_account_star_balance.rst @@ -0,0 +1,38 @@ +############################# +getBusinessAccountStarBalance +############################# + +Returns: :obj:`StarAmount` + +.. automodule:: aiogram.methods.get_business_account_star_balance + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: StarAmount = await bot.get_business_account_star_balance(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.get_business_account_star_balance import GetBusinessAccountStarBalance` +- alias: :code:`from aiogram.methods import GetBusinessAccountStarBalance` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: StarAmount = await bot(GetBusinessAccountStarBalance(...)) diff --git a/docs/api/methods/gift_premium_subscription.rst b/docs/api/methods/gift_premium_subscription.rst new file mode 100644 index 00000000..031fd33b --- /dev/null +++ b/docs/api/methods/gift_premium_subscription.rst @@ -0,0 +1,45 @@ +####################### +giftPremiumSubscription +####################### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.gift_premium_subscription + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.gift_premium_subscription(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.gift_premium_subscription import GiftPremiumSubscription` +- alias: :code:`from aiogram.methods import GiftPremiumSubscription` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(GiftPremiumSubscription(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return GiftPremiumSubscription(...) diff --git a/docs/api/methods/index.rst b/docs/api/methods/index.rst index b6aadc07..e71cd272 100644 --- a/docs/api/methods/index.rst +++ b/docs/api/methods/index.rst @@ -15,13 +15,9 @@ Stickers create_new_sticker_set delete_sticker_from_set delete_sticker_set - get_available_gifts get_custom_emoji_stickers get_sticker_set - remove_chat_verification - remove_user_verification replace_sticker_in_set - send_gift send_sticker set_custom_emoji_sticker_set_thumbnail set_sticker_emoji_list @@ -31,8 +27,6 @@ Stickers set_sticker_set_thumbnail set_sticker_set_title upload_sticker_file - verify_chat - verify_user Available methods ================= @@ -133,15 +127,39 @@ Updating messages .. toctree:: :maxdepth: 1 + convert_gift_to_stars + delete_business_messages delete_message delete_messages + delete_story edit_message_caption edit_message_live_location edit_message_media edit_message_reply_markup edit_message_text + edit_story + get_available_gifts + get_business_account_gifts + get_business_account_star_balance + gift_premium_subscription + post_story + read_business_message + remove_business_account_profile_photo + remove_chat_verification + remove_user_verification + send_gift + set_business_account_bio + set_business_account_gift_settings + set_business_account_name + set_business_account_profile_photo + set_business_account_username stop_message_live_location stop_poll + transfer_business_account_stars + transfer_gift + upgrade_gift + verify_chat + verify_user Inline mode =========== diff --git a/docs/api/methods/post_story.rst b/docs/api/methods/post_story.rst new file mode 100644 index 00000000..728399b6 --- /dev/null +++ b/docs/api/methods/post_story.rst @@ -0,0 +1,45 @@ +######### +postStory +######### + +Returns: :obj:`Story` + +.. automodule:: aiogram.methods.post_story + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: Story = await bot.post_story(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.post_story import PostStory` +- alias: :code:`from aiogram.methods import PostStory` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: Story = await bot(PostStory(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return PostStory(...) diff --git a/docs/api/methods/read_business_message.rst b/docs/api/methods/read_business_message.rst new file mode 100644 index 00000000..a071a54d --- /dev/null +++ b/docs/api/methods/read_business_message.rst @@ -0,0 +1,45 @@ +################### +readBusinessMessage +################### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.read_business_message + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.read_business_message(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.read_business_message import ReadBusinessMessage` +- alias: :code:`from aiogram.methods import ReadBusinessMessage` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(ReadBusinessMessage(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return ReadBusinessMessage(...) diff --git a/docs/api/methods/remove_business_account_profile_photo.rst b/docs/api/methods/remove_business_account_profile_photo.rst new file mode 100644 index 00000000..426d2cae --- /dev/null +++ b/docs/api/methods/remove_business_account_profile_photo.rst @@ -0,0 +1,45 @@ +################################# +removeBusinessAccountProfilePhoto +################################# + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.remove_business_account_profile_photo + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.remove_business_account_profile_photo(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.remove_business_account_profile_photo import RemoveBusinessAccountProfilePhoto` +- alias: :code:`from aiogram.methods import RemoveBusinessAccountProfilePhoto` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(RemoveBusinessAccountProfilePhoto(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return RemoveBusinessAccountProfilePhoto(...) diff --git a/docs/api/methods/set_business_account_bio.rst b/docs/api/methods/set_business_account_bio.rst new file mode 100644 index 00000000..9628d7c1 --- /dev/null +++ b/docs/api/methods/set_business_account_bio.rst @@ -0,0 +1,45 @@ +##################### +setBusinessAccountBio +##################### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.set_business_account_bio + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.set_business_account_bio(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.set_business_account_bio import SetBusinessAccountBio` +- alias: :code:`from aiogram.methods import SetBusinessAccountBio` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(SetBusinessAccountBio(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return SetBusinessAccountBio(...) diff --git a/docs/api/methods/set_business_account_gift_settings.rst b/docs/api/methods/set_business_account_gift_settings.rst new file mode 100644 index 00000000..b3b3c4b0 --- /dev/null +++ b/docs/api/methods/set_business_account_gift_settings.rst @@ -0,0 +1,45 @@ +############################## +setBusinessAccountGiftSettings +############################## + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.set_business_account_gift_settings + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.set_business_account_gift_settings(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.set_business_account_gift_settings import SetBusinessAccountGiftSettings` +- alias: :code:`from aiogram.methods import SetBusinessAccountGiftSettings` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(SetBusinessAccountGiftSettings(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return SetBusinessAccountGiftSettings(...) diff --git a/docs/api/methods/set_business_account_name.rst b/docs/api/methods/set_business_account_name.rst new file mode 100644 index 00000000..36e2b480 --- /dev/null +++ b/docs/api/methods/set_business_account_name.rst @@ -0,0 +1,45 @@ +###################### +setBusinessAccountName +###################### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.set_business_account_name + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.set_business_account_name(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.set_business_account_name import SetBusinessAccountName` +- alias: :code:`from aiogram.methods import SetBusinessAccountName` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(SetBusinessAccountName(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return SetBusinessAccountName(...) diff --git a/docs/api/methods/set_business_account_profile_photo.rst b/docs/api/methods/set_business_account_profile_photo.rst new file mode 100644 index 00000000..c2671825 --- /dev/null +++ b/docs/api/methods/set_business_account_profile_photo.rst @@ -0,0 +1,45 @@ +############################## +setBusinessAccountProfilePhoto +############################## + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.set_business_account_profile_photo + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.set_business_account_profile_photo(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.set_business_account_profile_photo import SetBusinessAccountProfilePhoto` +- alias: :code:`from aiogram.methods import SetBusinessAccountProfilePhoto` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(SetBusinessAccountProfilePhoto(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return SetBusinessAccountProfilePhoto(...) diff --git a/docs/api/methods/set_business_account_username.rst b/docs/api/methods/set_business_account_username.rst new file mode 100644 index 00000000..ee462f57 --- /dev/null +++ b/docs/api/methods/set_business_account_username.rst @@ -0,0 +1,45 @@ +########################## +setBusinessAccountUsername +########################## + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.set_business_account_username + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.set_business_account_username(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.set_business_account_username import SetBusinessAccountUsername` +- alias: :code:`from aiogram.methods import SetBusinessAccountUsername` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(SetBusinessAccountUsername(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return SetBusinessAccountUsername(...) diff --git a/docs/api/methods/transfer_business_account_stars.rst b/docs/api/methods/transfer_business_account_stars.rst new file mode 100644 index 00000000..99535b67 --- /dev/null +++ b/docs/api/methods/transfer_business_account_stars.rst @@ -0,0 +1,45 @@ +############################ +transferBusinessAccountStars +############################ + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.transfer_business_account_stars + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.transfer_business_account_stars(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.transfer_business_account_stars import TransferBusinessAccountStars` +- alias: :code:`from aiogram.methods import TransferBusinessAccountStars` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(TransferBusinessAccountStars(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return TransferBusinessAccountStars(...) diff --git a/docs/api/methods/transfer_gift.rst b/docs/api/methods/transfer_gift.rst new file mode 100644 index 00000000..31154448 --- /dev/null +++ b/docs/api/methods/transfer_gift.rst @@ -0,0 +1,45 @@ +############ +transferGift +############ + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.transfer_gift + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.transfer_gift(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.transfer_gift import TransferGift` +- alias: :code:`from aiogram.methods import TransferGift` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(TransferGift(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return TransferGift(...) diff --git a/docs/api/methods/upgrade_gift.rst b/docs/api/methods/upgrade_gift.rst new file mode 100644 index 00000000..7749a158 --- /dev/null +++ b/docs/api/methods/upgrade_gift.rst @@ -0,0 +1,45 @@ +########### +upgradeGift +########### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.upgrade_gift + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.upgrade_gift(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.upgrade_gift import UpgradeGift` +- alias: :code:`from aiogram.methods import UpgradeGift` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(UpgradeGift(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return UpgradeGift(...) diff --git a/docs/api/types/accepted_gift_types.rst b/docs/api/types/accepted_gift_types.rst new file mode 100644 index 00000000..67a0b962 --- /dev/null +++ b/docs/api/types/accepted_gift_types.rst @@ -0,0 +1,10 @@ +################# +AcceptedGiftTypes +################# + + +.. automodule:: aiogram.types.accepted_gift_types + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/business_bot_rights.rst b/docs/api/types/business_bot_rights.rst new file mode 100644 index 00000000..c98ef3dd --- /dev/null +++ b/docs/api/types/business_bot_rights.rst @@ -0,0 +1,10 @@ +################# +BusinessBotRights +################# + + +.. automodule:: aiogram.types.business_bot_rights + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/gift_info.rst b/docs/api/types/gift_info.rst new file mode 100644 index 00000000..5c51b8a3 --- /dev/null +++ b/docs/api/types/gift_info.rst @@ -0,0 +1,10 @@ +######## +GiftInfo +######## + + +.. automodule:: aiogram.types.gift_info + :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 c2060ae6..731a321e 100644 --- a/docs/api/types/index.rst +++ b/docs/api/types/index.rst @@ -11,6 +11,7 @@ Available types .. toctree:: :maxdepth: 1 + accepted_gift_types animation audio background_fill @@ -35,6 +36,7 @@ Available types bot_description bot_name bot_short_description + business_bot_rights business_connection business_intro business_location @@ -82,6 +84,9 @@ Available types forum_topic_reopened general_forum_topic_hidden general_forum_topic_unhidden + gift + gift_info + gifts giveaway giveaway_completed giveaway_created @@ -100,6 +105,12 @@ Available types input_paid_media_photo input_paid_media_video input_poll_option + input_profile_photo + input_profile_photo_animated + input_profile_photo_static + input_story_content + input_story_content_photo + input_story_content_video keyboard_button keyboard_button_poll_type keyboard_button_request_chat @@ -107,6 +118,7 @@ Available types keyboard_button_request_users link_preview_options location + location_address login_url maybe_inaccessible_message menu_button @@ -124,11 +136,16 @@ Available types message_origin_user message_reaction_count_updated message_reaction_updated + owned_gift + owned_gift_regular + owned_gift_unique + owned_gifts paid_media paid_media_info paid_media_photo paid_media_preview paid_media_video + paid_message_price_changed photo_size poll poll_answer @@ -144,9 +161,24 @@ Available types reply_parameters response_parameters shared_user + star_amount story + story_area + story_area_position + story_area_type + story_area_type_link + story_area_type_location + story_area_type_suggested_reaction + story_area_type_unique_gift + story_area_type_weather switch_inline_query_chosen_chat text_quote + unique_gift + unique_gift_backdrop + unique_gift_backdrop_colors + unique_gift_info + unique_gift_model + unique_gift_symbol user user_chat_boosts user_profile_photos @@ -241,8 +273,6 @@ Stickers .. toctree:: :maxdepth: 1 - gift - gifts input_sticker mask_position sticker diff --git a/docs/api/types/input_profile_photo.rst b/docs/api/types/input_profile_photo.rst new file mode 100644 index 00000000..4b721710 --- /dev/null +++ b/docs/api/types/input_profile_photo.rst @@ -0,0 +1,10 @@ +################# +InputProfilePhoto +################# + + +.. automodule:: aiogram.types.input_profile_photo + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/input_profile_photo_animated.rst b/docs/api/types/input_profile_photo_animated.rst new file mode 100644 index 00000000..9d436b67 --- /dev/null +++ b/docs/api/types/input_profile_photo_animated.rst @@ -0,0 +1,10 @@ +######################### +InputProfilePhotoAnimated +######################### + + +.. automodule:: aiogram.types.input_profile_photo_animated + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/input_profile_photo_static.rst b/docs/api/types/input_profile_photo_static.rst new file mode 100644 index 00000000..408f4b9d --- /dev/null +++ b/docs/api/types/input_profile_photo_static.rst @@ -0,0 +1,10 @@ +####################### +InputProfilePhotoStatic +####################### + + +.. automodule:: aiogram.types.input_profile_photo_static + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/input_story_content.rst b/docs/api/types/input_story_content.rst new file mode 100644 index 00000000..b625d7b2 --- /dev/null +++ b/docs/api/types/input_story_content.rst @@ -0,0 +1,10 @@ +################# +InputStoryContent +################# + + +.. automodule:: aiogram.types.input_story_content + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/input_story_content_photo.rst b/docs/api/types/input_story_content_photo.rst new file mode 100644 index 00000000..bbdc17f2 --- /dev/null +++ b/docs/api/types/input_story_content_photo.rst @@ -0,0 +1,10 @@ +###################### +InputStoryContentPhoto +###################### + + +.. automodule:: aiogram.types.input_story_content_photo + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/input_story_content_video.rst b/docs/api/types/input_story_content_video.rst new file mode 100644 index 00000000..22fe0739 --- /dev/null +++ b/docs/api/types/input_story_content_video.rst @@ -0,0 +1,10 @@ +###################### +InputStoryContentVideo +###################### + + +.. automodule:: aiogram.types.input_story_content_video + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/location_address.rst b/docs/api/types/location_address.rst new file mode 100644 index 00000000..1bef507f --- /dev/null +++ b/docs/api/types/location_address.rst @@ -0,0 +1,10 @@ +############### +LocationAddress +############### + + +.. automodule:: aiogram.types.location_address + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/owned_gift.rst b/docs/api/types/owned_gift.rst new file mode 100644 index 00000000..27e5d9ea --- /dev/null +++ b/docs/api/types/owned_gift.rst @@ -0,0 +1,10 @@ +######### +OwnedGift +######### + + +.. automodule:: aiogram.types.owned_gift + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/owned_gift_regular.rst b/docs/api/types/owned_gift_regular.rst new file mode 100644 index 00000000..c3b15686 --- /dev/null +++ b/docs/api/types/owned_gift_regular.rst @@ -0,0 +1,10 @@ +################ +OwnedGiftRegular +################ + + +.. automodule:: aiogram.types.owned_gift_regular + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/owned_gift_unique.rst b/docs/api/types/owned_gift_unique.rst new file mode 100644 index 00000000..1c67137c --- /dev/null +++ b/docs/api/types/owned_gift_unique.rst @@ -0,0 +1,10 @@ +############### +OwnedGiftUnique +############### + + +.. automodule:: aiogram.types.owned_gift_unique + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/owned_gifts.rst b/docs/api/types/owned_gifts.rst new file mode 100644 index 00000000..ba852b8e --- /dev/null +++ b/docs/api/types/owned_gifts.rst @@ -0,0 +1,10 @@ +########## +OwnedGifts +########## + + +.. automodule:: aiogram.types.owned_gifts + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/paid_message_price_changed.rst b/docs/api/types/paid_message_price_changed.rst new file mode 100644 index 00000000..31924bc8 --- /dev/null +++ b/docs/api/types/paid_message_price_changed.rst @@ -0,0 +1,10 @@ +####################### +PaidMessagePriceChanged +####################### + + +.. automodule:: aiogram.types.paid_message_price_changed + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/star_amount.rst b/docs/api/types/star_amount.rst new file mode 100644 index 00000000..40a64730 --- /dev/null +++ b/docs/api/types/star_amount.rst @@ -0,0 +1,10 @@ +########## +StarAmount +########## + + +.. automodule:: aiogram.types.star_amount + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/story_area.rst b/docs/api/types/story_area.rst new file mode 100644 index 00000000..fb3df191 --- /dev/null +++ b/docs/api/types/story_area.rst @@ -0,0 +1,10 @@ +######### +StoryArea +######### + + +.. automodule:: aiogram.types.story_area + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/story_area_position.rst b/docs/api/types/story_area_position.rst new file mode 100644 index 00000000..72ac3c0d --- /dev/null +++ b/docs/api/types/story_area_position.rst @@ -0,0 +1,10 @@ +################# +StoryAreaPosition +################# + + +.. automodule:: aiogram.types.story_area_position + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/story_area_type.rst b/docs/api/types/story_area_type.rst new file mode 100644 index 00000000..de72be51 --- /dev/null +++ b/docs/api/types/story_area_type.rst @@ -0,0 +1,10 @@ +############# +StoryAreaType +############# + + +.. automodule:: aiogram.types.story_area_type + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/story_area_type_link.rst b/docs/api/types/story_area_type_link.rst new file mode 100644 index 00000000..03153b08 --- /dev/null +++ b/docs/api/types/story_area_type_link.rst @@ -0,0 +1,10 @@ +################# +StoryAreaTypeLink +################# + + +.. automodule:: aiogram.types.story_area_type_link + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/story_area_type_location.rst b/docs/api/types/story_area_type_location.rst new file mode 100644 index 00000000..98a52fe3 --- /dev/null +++ b/docs/api/types/story_area_type_location.rst @@ -0,0 +1,10 @@ +##################### +StoryAreaTypeLocation +##################### + + +.. automodule:: aiogram.types.story_area_type_location + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/story_area_type_suggested_reaction.rst b/docs/api/types/story_area_type_suggested_reaction.rst new file mode 100644 index 00000000..ad152917 --- /dev/null +++ b/docs/api/types/story_area_type_suggested_reaction.rst @@ -0,0 +1,10 @@ +############################## +StoryAreaTypeSuggestedReaction +############################## + + +.. automodule:: aiogram.types.story_area_type_suggested_reaction + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/story_area_type_unique_gift.rst b/docs/api/types/story_area_type_unique_gift.rst new file mode 100644 index 00000000..0da53467 --- /dev/null +++ b/docs/api/types/story_area_type_unique_gift.rst @@ -0,0 +1,10 @@ +####################### +StoryAreaTypeUniqueGift +####################### + + +.. automodule:: aiogram.types.story_area_type_unique_gift + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/story_area_type_weather.rst b/docs/api/types/story_area_type_weather.rst new file mode 100644 index 00000000..1c1b3ffd --- /dev/null +++ b/docs/api/types/story_area_type_weather.rst @@ -0,0 +1,10 @@ +#################### +StoryAreaTypeWeather +#################### + + +.. automodule:: aiogram.types.story_area_type_weather + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/unique_gift.rst b/docs/api/types/unique_gift.rst new file mode 100644 index 00000000..9891c91a --- /dev/null +++ b/docs/api/types/unique_gift.rst @@ -0,0 +1,10 @@ +########## +UniqueGift +########## + + +.. automodule:: aiogram.types.unique_gift + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/unique_gift_backdrop.rst b/docs/api/types/unique_gift_backdrop.rst new file mode 100644 index 00000000..26b1765c --- /dev/null +++ b/docs/api/types/unique_gift_backdrop.rst @@ -0,0 +1,10 @@ +################## +UniqueGiftBackdrop +################## + + +.. automodule:: aiogram.types.unique_gift_backdrop + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/unique_gift_backdrop_colors.rst b/docs/api/types/unique_gift_backdrop_colors.rst new file mode 100644 index 00000000..031d24bc --- /dev/null +++ b/docs/api/types/unique_gift_backdrop_colors.rst @@ -0,0 +1,10 @@ +######################## +UniqueGiftBackdropColors +######################## + + +.. automodule:: aiogram.types.unique_gift_backdrop_colors + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/unique_gift_info.rst b/docs/api/types/unique_gift_info.rst new file mode 100644 index 00000000..464d57ad --- /dev/null +++ b/docs/api/types/unique_gift_info.rst @@ -0,0 +1,10 @@ +############## +UniqueGiftInfo +############## + + +.. automodule:: aiogram.types.unique_gift_info + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/unique_gift_model.rst b/docs/api/types/unique_gift_model.rst new file mode 100644 index 00000000..37b02e81 --- /dev/null +++ b/docs/api/types/unique_gift_model.rst @@ -0,0 +1,10 @@ +############### +UniqueGiftModel +############### + + +.. automodule:: aiogram.types.unique_gift_model + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/unique_gift_symbol.rst b/docs/api/types/unique_gift_symbol.rst new file mode 100644 index 00000000..fe022740 --- /dev/null +++ b/docs/api/types/unique_gift_symbol.rst @@ -0,0 +1,10 @@ +################ +UniqueGiftSymbol +################ + + +.. automodule:: aiogram.types.unique_gift_symbol + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/tests/test_api/test_methods/test_convert_gift_to_stars.py b/tests/test_api/test_methods/test_convert_gift_to_stars.py new file mode 100644 index 00000000..4d9182b5 --- /dev/null +++ b/tests/test_api/test_methods/test_convert_gift_to_stars.py @@ -0,0 +1,13 @@ +from aiogram.methods import ConvertGiftToStars +from tests.mocked_bot import MockedBot + + +class TestConvertGiftToStars: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(ConvertGiftToStars, ok=True, result=True) + + response: bool = await bot.convert_gift_to_stars( + business_connection_id="test_connection_id", owned_gift_id="test_gift_id" + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_delete_business_messages.py b/tests/test_api/test_methods/test_delete_business_messages.py new file mode 100644 index 00000000..060dcf94 --- /dev/null +++ b/tests/test_api/test_methods/test_delete_business_messages.py @@ -0,0 +1,13 @@ +from aiogram.methods import DeleteBusinessMessages +from tests.mocked_bot import MockedBot + + +class TestDeleteBusinessMessages: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(DeleteBusinessMessages, ok=True, result=True) + + response: bool = await bot.delete_business_messages( + business_connection_id="test_connection_id", message_ids=[1, 2, 3] + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_delete_story.py b/tests/test_api/test_methods/test_delete_story.py new file mode 100644 index 00000000..c205cc20 --- /dev/null +++ b/tests/test_api/test_methods/test_delete_story.py @@ -0,0 +1,13 @@ +from aiogram.methods import DeleteStory +from tests.mocked_bot import MockedBot + + +class TestDeleteStory: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(DeleteStory, ok=True, result=True) + + response: bool = await bot.delete_story( + business_connection_id="test_connection_id", story_id=42 + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_edit_story.py b/tests/test_api/test_methods/test_edit_story.py new file mode 100644 index 00000000..30555974 --- /dev/null +++ b/tests/test_api/test_methods/test_edit_story.py @@ -0,0 +1,26 @@ +import datetime + +from aiogram.methods import EditStory +from aiogram.types import Chat, InputStoryContentPhoto, Story +from tests.mocked_bot import MockedBot + + +class TestEditStory: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + EditStory, + ok=True, + result=Story( + id=42, + chat=Chat(id=42, type="private"), + ), + ) + + response: Story = await bot.edit_story( + business_connection_id="test_connection_id", + story_id=42, + content=InputStoryContentPhoto(type="photo", photo="test_photo"), + caption="Test caption", + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_get_business_account_gifts.py b/tests/test_api/test_methods/test_get_business_account_gifts.py new file mode 100644 index 00000000..697e3b6c --- /dev/null +++ b/tests/test_api/test_methods/test_get_business_account_gifts.py @@ -0,0 +1,41 @@ +import datetime + +from aiogram.methods import GetBusinessAccountGifts +from aiogram.types import Gift, OwnedGiftRegular, OwnedGifts, Sticker +from tests.mocked_bot import MockedBot + + +class TestGetBusinessAccountGifts: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + GetBusinessAccountGifts, + ok=True, + result=OwnedGifts( + total_count=1, + gifts=[ + OwnedGiftRegular( + gift=Gift( + id="test_gift_id", + sticker=Sticker( + file_id="test_file_id", + file_unique_id="test_file_unique_id", + type="regular", + width=512, + height=512, + is_animated=False, + is_video=False, + ), + star_count=100, + ), + send_date=int(datetime.datetime.now().timestamp()), + ) + ], + ), + ) + + response: OwnedGifts = await bot.get_business_account_gifts( + business_connection_id="test_connection_id", + limit=10, + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_get_business_account_star_balance.py b/tests/test_api/test_methods/test_get_business_account_star_balance.py new file mode 100644 index 00000000..5540fa44 --- /dev/null +++ b/tests/test_api/test_methods/test_get_business_account_star_balance.py @@ -0,0 +1,21 @@ +from aiogram.methods import GetBusinessAccountStarBalance +from aiogram.types import StarAmount +from tests.mocked_bot import MockedBot + + +class TestGetBusinessAccountStarBalance: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + GetBusinessAccountStarBalance, + ok=True, + result=StarAmount( + amount=100, + nanostar_amount=500000000, + ), + ) + + response: StarAmount = await bot.get_business_account_star_balance( + business_connection_id="test_connection_id", + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_get_chat.py b/tests/test_api/test_methods/test_get_chat.py index 9f67b0c7..a5cfaf52 100644 --- a/tests/test_api/test_methods/test_get_chat.py +++ b/tests/test_api/test_methods/test_get_chat.py @@ -1,5 +1,5 @@ from aiogram.methods import GetChat -from aiogram.types import ChatFullInfo +from aiogram.types import AcceptedGiftTypes, ChatFullInfo from tests.mocked_bot import MockedBot @@ -14,6 +14,12 @@ class TestGetChat: title="chat", accent_color_id=0, max_reaction_count=0, + accepted_gift_types=AcceptedGiftTypes( + unlimited_gifts=True, + limited_gifts=True, + unique_gifts=True, + premium_subscription=True, + ), ), ) diff --git a/tests/test_api/test_methods/test_get_star_transactions.py b/tests/test_api/test_methods/test_get_star_transactions.py index 5ced0fc6..d7d37374 100644 --- a/tests/test_api/test_methods/test_get_star_transactions.py +++ b/tests/test_api/test_methods/test_get_star_transactions.py @@ -1,5 +1,6 @@ from datetime import datetime +from aiogram.enums import TransactionPartnerUserTransactionTypeEnum from aiogram.methods import GetStarTransactions from aiogram.types import ( File, @@ -26,6 +27,7 @@ class TestGetStarTransactions: date=datetime.now(), source=TransactionPartnerUser( user=user, + transaction_type=TransactionPartnerUserTransactionTypeEnum.GIFT_PURCHASE, ), ), StarTransaction( @@ -35,12 +37,13 @@ class TestGetStarTransactions: date=datetime.now(), receiver=TransactionPartnerUser( user=user, + transaction_type=TransactionPartnerUserTransactionTypeEnum.GIFT_PURCHASE, ), ), ] ), ) - response: File = await bot.get_star_transactions(limit=10, offset=0) + response: StarTransactions = await bot.get_star_transactions(limit=10, offset=0) request = bot.get_request() assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_gift_premium_subscription.py b/tests/test_api/test_methods/test_gift_premium_subscription.py new file mode 100644 index 00000000..c3bcc948 --- /dev/null +++ b/tests/test_api/test_methods/test_gift_premium_subscription.py @@ -0,0 +1,16 @@ +from aiogram.methods import GiftPremiumSubscription +from tests.mocked_bot import MockedBot + + +class TestGiftPremiumSubscription: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(GiftPremiumSubscription, ok=True, result=True) + + response: bool = await bot.gift_premium_subscription( + user_id=123456789, + month_count=3, + star_count=1000, + text="Enjoy your premium subscription!", + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_post_story.py b/tests/test_api/test_methods/test_post_story.py new file mode 100644 index 00000000..0dd74cc4 --- /dev/null +++ b/tests/test_api/test_methods/test_post_story.py @@ -0,0 +1,26 @@ +import datetime + +from aiogram.methods import PostStory +from aiogram.types import Chat, InputStoryContentPhoto, Story +from tests.mocked_bot import MockedBot + + +class TestPostStory: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + PostStory, + ok=True, + result=Story( + id=42, + chat=Chat(id=42, type="private"), + ), + ) + + response: Story = await bot.post_story( + business_connection_id="test_connection_id", + content=InputStoryContentPhoto(type="photo", photo="test_photo"), + active_period=6 * 3600, # 6 hours + caption="Test story caption", + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_read_business_message.py b/tests/test_api/test_methods/test_read_business_message.py new file mode 100644 index 00000000..73db813f --- /dev/null +++ b/tests/test_api/test_methods/test_read_business_message.py @@ -0,0 +1,13 @@ +from aiogram.methods import ReadBusinessMessage +from tests.mocked_bot import MockedBot + + +class TestReadBusinessMessage: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(ReadBusinessMessage, ok=True, result=True) + + response: bool = await bot.read_business_message( + business_connection_id="test_connection_id", chat_id=123456789, message_id=42 + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_remove_business_account_profile_photo.py b/tests/test_api/test_methods/test_remove_business_account_profile_photo.py new file mode 100644 index 00000000..d951f9e5 --- /dev/null +++ b/tests/test_api/test_methods/test_remove_business_account_profile_photo.py @@ -0,0 +1,15 @@ +from aiogram.methods import RemoveBusinessAccountProfilePhoto +from tests.mocked_bot import MockedBot + + +class TestRemoveBusinessAccountProfilePhoto: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for( + RemoveBusinessAccountProfilePhoto, ok=True, result=True + ) + + response: bool = await bot.remove_business_account_profile_photo( + business_connection_id="test_connection_id", is_public=True + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_set_business_account_bio.py b/tests/test_api/test_methods/test_set_business_account_bio.py new file mode 100644 index 00000000..5041122b --- /dev/null +++ b/tests/test_api/test_methods/test_set_business_account_bio.py @@ -0,0 +1,14 @@ +from aiogram.methods import SetBusinessAccountBio +from tests.mocked_bot import MockedBot + + +class TestSetBusinessAccountBio: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(SetBusinessAccountBio, ok=True, result=True) + + response: bool = await bot.set_business_account_bio( + business_connection_id="test_connection_id", + bio="This is a test bio for the business account", + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_set_business_account_gift_settings.py b/tests/test_api/test_methods/test_set_business_account_gift_settings.py new file mode 100644 index 00000000..44b095ef --- /dev/null +++ b/tests/test_api/test_methods/test_set_business_account_gift_settings.py @@ -0,0 +1,21 @@ +from aiogram.methods import SetBusinessAccountGiftSettings +from aiogram.types import AcceptedGiftTypes +from tests.mocked_bot import MockedBot + + +class TestSetBusinessAccountGiftSettings: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(SetBusinessAccountGiftSettings, ok=True, result=True) + + response: bool = await bot.set_business_account_gift_settings( + business_connection_id="test_connection_id", + show_gift_button=True, + accepted_gift_types=AcceptedGiftTypes( + unlimited_gifts=True, + limited_gifts=True, + unique_gifts=True, + premium_subscription=True, + ), + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_set_business_account_name.py b/tests/test_api/test_methods/test_set_business_account_name.py new file mode 100644 index 00000000..5098ad34 --- /dev/null +++ b/tests/test_api/test_methods/test_set_business_account_name.py @@ -0,0 +1,15 @@ +from aiogram.methods import SetBusinessAccountName +from tests.mocked_bot import MockedBot + + +class TestSetBusinessAccountName: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(SetBusinessAccountName, ok=True, result=True) + + response: bool = await bot.set_business_account_name( + business_connection_id="test_connection_id", + first_name="Test Business", + last_name="Account Name", + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_set_business_account_profile_photo.py b/tests/test_api/test_methods/test_set_business_account_profile_photo.py new file mode 100644 index 00000000..99808985 --- /dev/null +++ b/tests/test_api/test_methods/test_set_business_account_profile_photo.py @@ -0,0 +1,16 @@ +from aiogram.methods import SetBusinessAccountProfilePhoto +from aiogram.types import InputProfilePhotoStatic +from tests.mocked_bot import MockedBot + + +class TestSetBusinessAccountProfilePhoto: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(SetBusinessAccountProfilePhoto, ok=True, result=True) + + response: bool = await bot.set_business_account_profile_photo( + business_connection_id="test_connection_id", + photo=InputProfilePhotoStatic(photo="test_photo_file_id"), + is_public=True, + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_set_business_account_username.py b/tests/test_api/test_methods/test_set_business_account_username.py new file mode 100644 index 00000000..db912ca3 --- /dev/null +++ b/tests/test_api/test_methods/test_set_business_account_username.py @@ -0,0 +1,13 @@ +from aiogram.methods import SetBusinessAccountUsername +from tests.mocked_bot import MockedBot + + +class TestSetBusinessAccountUsername: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(SetBusinessAccountUsername, ok=True, result=True) + + response: bool = await bot.set_business_account_username( + business_connection_id="test_connection_id", username="test_business_username" + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_transfer_business_account_stars.py b/tests/test_api/test_methods/test_transfer_business_account_stars.py new file mode 100644 index 00000000..c45b87c6 --- /dev/null +++ b/tests/test_api/test_methods/test_transfer_business_account_stars.py @@ -0,0 +1,13 @@ +from aiogram.methods import TransferBusinessAccountStars +from tests.mocked_bot import MockedBot + + +class TestTransferBusinessAccountStars: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(TransferBusinessAccountStars, ok=True, result=True) + + response: bool = await bot.transfer_business_account_stars( + business_connection_id="test_connection_id", star_count=100 + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_transfer_gift.py b/tests/test_api/test_methods/test_transfer_gift.py new file mode 100644 index 00000000..8d2221d1 --- /dev/null +++ b/tests/test_api/test_methods/test_transfer_gift.py @@ -0,0 +1,16 @@ +from aiogram.methods import TransferGift +from tests.mocked_bot import MockedBot + + +class TestTransferGift: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(TransferGift, ok=True, result=True) + + response: bool = await bot.transfer_gift( + business_connection_id="test_connection_id", + owned_gift_id="test_gift_id", + new_owner_chat_id=123456789, + star_count=50, + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_upgrade_gift.py b/tests/test_api/test_methods/test_upgrade_gift.py new file mode 100644 index 00000000..f88f8dff --- /dev/null +++ b/tests/test_api/test_methods/test_upgrade_gift.py @@ -0,0 +1,16 @@ +from aiogram.methods import UpgradeGift +from tests.mocked_bot import MockedBot + + +class TestUpgradeGift: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(UpgradeGift, ok=True, result=True) + + response: bool = await bot.upgrade_gift( + business_connection_id="test_connection_id", + owned_gift_id="test_gift_id", + keep_original_details=True, + star_count=100, + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_api/test_types/test_message.py b/tests/test_api/test_types/test_message.py index 0b53ce1d..01f56cde 100644 --- a/tests/test_api/test_types/test_message.py +++ b/tests/test_api/test_types/test_message.py @@ -58,6 +58,8 @@ from aiogram.types import ( Game, GeneralForumTopicHidden, GeneralForumTopicUnhidden, + Gift, + GiftInfo, Giveaway, GiveawayCompleted, GiveawayCreated, @@ -71,6 +73,7 @@ from aiogram.types import ( MessageEntity, PaidMediaInfo, PaidMediaPhoto, + PaidMessagePriceChanged, PassportData, PhotoSize, Poll, @@ -82,6 +85,12 @@ from aiogram.types import ( Sticker, Story, SuccessfulPayment, + UniqueGift, + UniqueGiftBackdrop, + UniqueGiftBackdropColors, + UniqueGiftInfo, + UniqueGiftModel, + UniqueGiftSymbol, User, UserShared, UsersShared, @@ -606,6 +615,92 @@ TEST_MESSAGE_UNKNOWN = Message( chat=Chat(id=42, type="private"), from_user=User(id=42, is_bot=False, first_name="Test"), ) +TEST_MESSAGE_GIFT = 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"), + gift=GiftInfo( + gift=Gift( + id="test_gift_id", + sticker=Sticker( + file_id="test_file_id", + file_unique_id="test_file_unique_id", + type="regular", + width=512, + height=512, + is_animated=False, + is_video=False, + ), + star_count=100, + ), + owned_gift_id="test_owned_gift_id", + convert_star_count=50, + prepaid_upgrade_star_count=25, + can_be_upgraded=True, + text="Test gift message", + is_private=False, + ), +) +TEST_MESSAGE_UNIQUE_GIFT = 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"), + unique_gift=UniqueGiftInfo( + gift=UniqueGift( + base_name="test_gift", + name="test_unique_gift", + number=1, + model=UniqueGiftModel( + name="test_model", + sticker=Sticker( + file_id="test_file_id", + file_unique_id="test_file_unique_id", + type="regular", + width=512, + height=512, + is_animated=False, + is_video=False, + ), + rarity_per_mille=100, + ), + symbol=UniqueGiftSymbol( + name="test_symbol", + sticker=Sticker( + file_id="test_file_id", + file_unique_id="test_file_unique_id", + type="regular", + width=512, + height=512, + is_animated=False, + is_video=False, + ), + rarity_per_mille=100, + ), + backdrop=UniqueGiftBackdrop( + name="test_backdrop", + colors=UniqueGiftBackdropColors( + center_color=0xFFFFFF, + edge_color=0x000000, + symbol_color=0xFF0000, + text_color=0x0000FF, + ), + rarity_per_mille=100, + ), + ), + origin="upgrade", + ), +) +TEST_MESSAGE_PAID_MESSAGE_PRICE_CHANGED = 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"), + paid_message_price_changed=PaidMessagePriceChanged( + paid_message_star_count=100, + ), +) MESSAGES_AND_CONTENT_TYPES = [ [TEST_MESSAGE_TEXT, ContentType.TEXT], @@ -670,6 +765,9 @@ MESSAGES_AND_CONTENT_TYPES = [ [TEST_MESSAGE_BOOST_ADDED, ContentType.BOOST_ADDED], [TEST_CHAT_BACKGROUND_SET, ContentType.CHAT_BACKGROUND_SET], [TEST_REFUND_PAYMENT, ContentType.REFUNDED_PAYMENT], + [TEST_MESSAGE_GIFT, ContentType.GIFT], + [TEST_MESSAGE_UNIQUE_GIFT, ContentType.UNIQUE_GIFT], + [TEST_MESSAGE_PAID_MESSAGE_PRICE_CHANGED, ContentType.PAID_MESSAGE_PRICE_CHANGED], [TEST_MESSAGE_UNKNOWN, ContentType.UNKNOWN], ] @@ -731,6 +829,9 @@ MESSAGES_AND_COPY_METHODS = [ [TEST_MESSAGE_BOOST_ADDED, None], [TEST_CHAT_BACKGROUND_SET, None], [TEST_REFUND_PAYMENT, None], + [TEST_MESSAGE_GIFT, None], + [TEST_MESSAGE_UNIQUE_GIFT, None], + [TEST_MESSAGE_PAID_MESSAGE_PRICE_CHANGED, None], [TEST_MESSAGE_UNKNOWN, None], ]