From 7bf08af977d47aa2dde1645c47ecf8230313f719 Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Mon, 9 Feb 2026 19:54:32 +0200 Subject: [PATCH] Bump API schema to version 9.4, add new object types, methods, and properties. --- .butcher/methods/createForumTopic/entity.json | 6 +- .../methods/getUserProfileAudios/entity.json | 41 +++ .../methods/removeMyProfilePhoto/entity.json | 16 + .../methods/setMyProfilePhoto/entity.json | 25 ++ .butcher/schema/schema.json | 309 ++++++++++++++++-- .butcher/types/ChatFullInfo/entity.json | 8 + .butcher/types/ChatOwnerChanged/entity.json | 25 ++ .butcher/types/ChatOwnerLeft/entity.json | 25 ++ .butcher/types/GameHighScore/entity.json | 6 +- .../types/InlineKeyboardButton/entity.json | 22 +- .butcher/types/KeyboardButton/entity.json | 28 +- .butcher/types/Message/entity.json | 16 + .butcher/types/UniqueGift/entity.json | 8 + .butcher/types/UniqueGiftModel/entity.json | 14 +- .butcher/types/User/entity.json | 8 + .butcher/types/UserProfileAudios/entity.json | 33 ++ .butcher/types/Video/entity.json | 8 + .butcher/types/VideoQuality/entity.json | 65 ++++ aiogram/client/bot.py | 68 +++- aiogram/enums/content_type.py | 2 + aiogram/methods/__init__.py | 6 + aiogram/methods/create_forum_topic.py | 2 +- aiogram/methods/get_user_profile_audios.py | 42 +++ aiogram/methods/remove_my_profile_photo.py | 14 + aiogram/methods/set_my_profile_photo.py | 33 ++ aiogram/types/__init__.py | 8 + aiogram/types/chat_full_info.py | 5 + aiogram/types/chat_owner_changed.py | 30 ++ aiogram/types/chat_owner_left.py | 32 ++ aiogram/types/game_high_score.py | 2 + aiogram/types/inline_keyboard_button.py | 10 +- aiogram/types/keyboard_button.py | 13 +- aiogram/types/message.py | 14 + aiogram/types/unique_gift.py | 4 + aiogram/types/unique_gift_model.py | 11 +- aiogram/types/user.py | 4 + aiogram/types/user_profile_audios.py | 34 ++ aiogram/types/video.py | 5 + aiogram/types/video_quality.py | 55 ++++ docs/api/methods/get_user_profile_audios.rst | 38 +++ docs/api/methods/index.rst | 3 + docs/api/methods/remove_my_profile_photo.rst | 45 +++ docs/api/methods/set_my_profile_photo.rst | 45 +++ docs/api/types/chat_owner_changed.rst | 10 + docs/api/types/chat_owner_left.rst | 10 + docs/api/types/index.rst | 4 + docs/api/types/user_profile_audios.rst | 10 + docs/api/types/video_quality.rst | 10 + 48 files changed, 1186 insertions(+), 46 deletions(-) create mode 100644 .butcher/methods/getUserProfileAudios/entity.json create mode 100644 .butcher/methods/removeMyProfilePhoto/entity.json create mode 100644 .butcher/methods/setMyProfilePhoto/entity.json create mode 100644 .butcher/types/ChatOwnerChanged/entity.json create mode 100644 .butcher/types/ChatOwnerLeft/entity.json create mode 100644 .butcher/types/UserProfileAudios/entity.json create mode 100644 .butcher/types/VideoQuality/entity.json create mode 100644 aiogram/methods/get_user_profile_audios.py create mode 100644 aiogram/methods/remove_my_profile_photo.py create mode 100644 aiogram/methods/set_my_profile_photo.py create mode 100644 aiogram/types/chat_owner_changed.py create mode 100644 aiogram/types/chat_owner_left.py create mode 100644 aiogram/types/user_profile_audios.py create mode 100644 aiogram/types/video_quality.py create mode 100644 docs/api/methods/get_user_profile_audios.rst create mode 100644 docs/api/methods/remove_my_profile_photo.rst create mode 100644 docs/api/methods/set_my_profile_photo.rst create mode 100644 docs/api/types/chat_owner_changed.rst create mode 100644 docs/api/types/chat_owner_left.rst create mode 100644 docs/api/types/user_profile_audios.rst create mode 100644 docs/api/types/video_quality.rst diff --git a/.butcher/methods/createForumTopic/entity.json b/.butcher/methods/createForumTopic/entity.json index c10317c1..e3f744b3 100644 --- a/.butcher/methods/createForumTopic/entity.json +++ b/.butcher/methods/createForumTopic/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "createforumtopic", "name": "createForumTopic", - "description": "Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.", - "html_description": "

Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.

", - "rst_description": "Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object.", + "description": "Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object.", + "html_description": "

Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object.

", + "rst_description": "Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator right. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object.", "annotations": [ { "type": "Integer or String", diff --git a/.butcher/methods/getUserProfileAudios/entity.json b/.butcher/methods/getUserProfileAudios/entity.json new file mode 100644 index 00000000..89fa4466 --- /dev/null +++ b/.butcher/methods/getUserProfileAudios/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Available methods", + "anchor": "available-methods" + }, + "object": { + "anchor": "getuserprofileaudios", + "name": "getUserProfileAudios", + "description": "Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.", + "html_description": "

Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.

", + "rst_description": "Use this method to get a list of profile audios for a user. Returns a :class:`aiogram.types.user_profile_audios.UserProfileAudios` object.", + "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": "Integer", + "required": false, + "description": "Sequential number of the first audio to be returned. By default, all audios are returned.", + "html_description": "Sequential number of the first audio to be returned. By default, all audios are returned.", + "rst_description": "Sequential number of the first audio to be returned. By default, all audios are returned.\n", + "name": "offset" + }, + { + "type": "Integer", + "required": false, + "description": "Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.", + "html_description": "Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.", + "rst_description": "Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.\n", + "name": "limit" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/removeMyProfilePhoto/entity.json b/.butcher/methods/removeMyProfilePhoto/entity.json new file mode 100644 index 00000000..e24d04bc --- /dev/null +++ b/.butcher/methods/removeMyProfilePhoto/entity.json @@ -0,0 +1,16 @@ +{ + "meta": {}, + "group": { + "title": "Available methods", + "anchor": "available-methods" + }, + "object": { + "anchor": "removemyprofilephoto", + "name": "removeMyProfilePhoto", + "description": "Removes the profile photo of the bot. Requires no parameters. Returns True on success.", + "html_description": "

Removes the profile photo of the bot. Requires no parameters. Returns True on success.

", + "rst_description": "Removes the profile photo of the bot. Requires no parameters. Returns :code:`True` on success.", + "annotations": [], + "category": "methods" + } +} diff --git a/.butcher/methods/setMyProfilePhoto/entity.json b/.butcher/methods/setMyProfilePhoto/entity.json new file mode 100644 index 00000000..53f4ab44 --- /dev/null +++ b/.butcher/methods/setMyProfilePhoto/entity.json @@ -0,0 +1,25 @@ +{ + "meta": {}, + "group": { + "title": "Available methods", + "anchor": "available-methods" + }, + "object": { + "anchor": "setmyprofilephoto", + "name": "setMyProfilePhoto", + "description": "Changes the profile photo of the bot. Returns True on success.", + "html_description": "

Changes the profile photo of the bot. Returns True on success.

", + "rst_description": "Changes the profile photo of the bot. Returns :code:`True` on success.", + "annotations": [ + { + "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" + } + ], + "category": "methods" + } +} diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index d492782d..0fca3099 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -1,7 +1,7 @@ { "api": { - "version": "9.3", - "release_date": "2025-12-31" + "version": "9.4", + "release_date": "2026-02-09" }, "items": [ { @@ -552,6 +552,14 @@ "rst_description": "*Optional*. :code:`True`, if the bot has forum topic mode enabled in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n", "name": "has_topics_enabled", "required": false + }, + { + "type": "Boolean", + "description": "True, if the bot allows users to create and delete topics in private chats. Returned only in getMe.", + "html_description": "Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe.", + "rst_description": "*Optional*. :code:`True`, if the bot allows users to create and delete topics in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n", + "name": "allows_users_to_create_topics", + "required": false } ], "category": "types" @@ -1021,6 +1029,14 @@ "name": "rating", "required": false }, + { + "type": "Audio", + "description": "For private chats, the first audio added to the profile of the user", + "html_description": "Optional. For private chats, the first audio added to the profile of the user", + "rst_description": "*Optional*. For private chats, the first audio added to the profile of the user\n", + "name": "first_profile_audio", + "required": false + }, { "type": "UniqueGiftColors", "description": "The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews", @@ -1479,6 +1495,22 @@ "name": "left_chat_member", "required": false }, + { + "type": "ChatOwnerLeft", + "description": "Service message: chat owner has left", + "html_description": "Optional. Service message: chat owner has left", + "rst_description": "*Optional*. Service message: chat owner has left\n", + "name": "chat_owner_left", + "required": false + }, + { + "type": "ChatOwnerChanged", + "description": "Service message: chat owner has changed", + "html_description": "Optional. Service message: chat owner has changed", + "rst_description": "*Optional*. Service message: chat owner has changed\n", + "name": "chat_owner_changed", + "required": false + }, { "type": "String", "description": "A chat title was changed to this value", @@ -2794,6 +2826,64 @@ ], "category": "types" }, + { + "anchor": "videoquality", + "name": "VideoQuality", + "description": "This object represents a video file of a specific quality.", + "html_description": "

This object represents a video file of a specific quality.

", + "rst_description": "This object represents a video file of a specific quality.", + "annotations": [ + { + "type": "String", + "description": "Identifier for this file, which can be used to download or reuse the file", + "html_description": "Identifier for this file, which can be used to download or reuse the file", + "rst_description": "Identifier for this file, which can be used to download or reuse the file\n", + "name": "file_id", + "required": true + }, + { + "type": "String", + "description": "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.", + "html_description": "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.", + "rst_description": "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.\n", + "name": "file_unique_id", + "required": true + }, + { + "type": "Integer", + "description": "Video width", + "html_description": "Video width", + "rst_description": "Video width\n", + "name": "width", + "required": true + }, + { + "type": "Integer", + "description": "Video height", + "html_description": "Video height", + "rst_description": "Video height\n", + "name": "height", + "required": true + }, + { + "type": "String", + "description": "Codec that was used to encode the video, for example, 'h264', 'h265', or 'av01'", + "html_description": "Codec that was used to encode the video, for example, “h264”, “h265”, or “av01”", + "rst_description": "Codec that was used to encode the video, for example, 'h264', 'h265', or 'av01'\n", + "name": "codec", + "required": true + }, + { + "type": "Integer", + "description": "File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.", + "html_description": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.", + "rst_description": "*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.\n", + "name": "file_size", + "required": false + } + ], + "category": "types" + }, { "anchor": "video", "name": "Video", @@ -2865,6 +2955,14 @@ "name": "start_timestamp", "required": false }, + { + "type": "Array of VideoQuality", + "description": "List of available qualities of the video", + "html_description": "Optional. List of available qualities of the video", + "rst_description": "*Optional*. List of available qualities of the video\n", + "name": "qualities", + "required": false + }, { "type": "String", "description": "Original filename as defined by the sender", @@ -5184,6 +5282,32 @@ ], "category": "types" }, + { + "anchor": "userprofileaudios", + "name": "UserProfileAudios", + "description": "This object represents the audios displayed on a user's profile.", + "html_description": "

This object represents the audios displayed on a user's profile.

", + "rst_description": "This object represents the audios displayed on a user's profile.", + "annotations": [ + { + "type": "Integer", + "description": "Total number of profile audios for the target user", + "html_description": "Total number of profile audios for the target user", + "rst_description": "Total number of profile audios for the target user\n", + "name": "total_count", + "required": true + }, + { + "type": "Array of Audio", + "description": "Requested profile audios", + "html_description": "Requested profile audios", + "rst_description": "Requested profile audios\n", + "name": "audios", + "required": true + } + ], + "category": "types" + }, { "anchor": "file", "name": "File", @@ -5305,18 +5429,34 @@ { "anchor": "keyboardbutton", "name": "KeyboardButton", - "description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", - "html_description": "

This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", - "rst_description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", + "description": "This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text.", + "html_description": "

This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

", + "rst_description": "This object represents one button of the reply keyboard. At most one of the fields other than *text*, *icon_custom_emoji_id*, and *style* must be used to specify the type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text.", "annotations": [ { "type": "String", - "description": "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed", - "html_description": "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed", - "rst_description": "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed\n", + "description": "Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed", + "html_description": "Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed", + "rst_description": "Text of the button. If none of the fields other than *text*, *icon_custom_emoji_id*, and *style* are used, it will be sent as a message when the button is pressed\n", "name": "text", "required": true }, + { + "type": "String", + "description": "Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.", + "html_description": "Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.", + "rst_description": "*Optional*. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on `Fragment `_ or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.\n", + "name": "icon_custom_emoji_id", + "required": false + }, + { + "type": "String", + "description": "Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.", + "html_description": "Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.", + "rst_description": "*Optional*. Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.\n", + "name": "style", + "required": false + }, { "type": "KeyboardButtonRequestUsers", "description": "If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.", @@ -5597,9 +5737,9 @@ { "anchor": "inlinekeyboardbutton", "name": "InlineKeyboardButton", - "description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", - "html_description": "

This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.

", - "rst_description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", + "description": "This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button.", + "html_description": "

This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button.

", + "rst_description": "This object represents one button of an inline keyboard. Exactly one of the fields other than *text*, *icon_custom_emoji_id*, and *style* must be used to specify the type of the button.", "annotations": [ { "type": "String", @@ -5609,6 +5749,22 @@ "name": "text", "required": true }, + { + "type": "String", + "description": "Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.", + "html_description": "Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.", + "rst_description": "*Optional*. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on `Fragment `_ or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.\n", + "name": "icon_custom_emoji_id", + "required": false + }, + { + "type": "String", + "description": "Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.", + "html_description": "Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.", + "rst_description": "*Optional*. Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.\n", + "name": "style", + "required": false + }, { "type": "String", "description": "HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id= can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.", @@ -7884,11 +8040,19 @@ }, { "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", + "description": "The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.", + "html_description": "The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.", + "rst_description": "The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.\n", "name": "rarity_per_mille", "required": true + }, + { + "type": "String", + "description": "Rarity of the model if it is a crafted model. Currently, can be 'uncommon', 'rare', 'epic', or 'legendary'.", + "html_description": "Optional. Rarity of the model if it is a crafted model. Currently, can be “uncommon”, “rare”, “epic”, or “legendary”.", + "rst_description": "*Optional*. Rarity of the model if it is a crafted model. Currently, can be 'uncommon', 'rare', 'epic', or 'legendary'.\n", + "name": "rarity", + "required": false } ], "category": "types" @@ -8132,6 +8296,14 @@ "name": "is_premium", "required": false }, + { + "type": "True", + "description": "True, if the gift was used to craft another gift and isn't available anymore", + "html_description": "Optional. True, if the gift was used to craft another gift and isn't available anymore", + "rst_description": "*Optional*. :code:`True`, if the gift was used to craft another gift and isn't available anymore\n", + "name": "is_burned", + "required": false + }, { "type": "True", "description": "True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram", @@ -9193,6 +9365,42 @@ ], "category": "types" }, + { + "anchor": "chatownerleft", + "name": "ChatOwnerLeft", + "description": "Describes a service message about the chat owner leaving the chat.", + "html_description": "

Describes a service message about the chat owner leaving the chat.

", + "rst_description": "Describes a service message about the chat owner leaving the chat.", + "annotations": [ + { + "type": "User", + "description": "The user which will be the new owner of the chat if the previous owner does not return to the chat", + "html_description": "Optional. The user which will be the new owner of the chat if the previous owner does not return to the chat", + "rst_description": "*Optional*. The user which will be the new owner of the chat if the previous owner does not return to the chat\n", + "name": "new_owner", + "required": false + } + ], + "category": "types" + }, + { + "anchor": "chatownerchanged", + "name": "ChatOwnerChanged", + "description": "Describes a service message about an ownership change in the chat.", + "html_description": "

Describes a service message about an ownership change in the chat.

", + "rst_description": "Describes a service message about an ownership change in the chat.", + "annotations": [ + { + "type": "User", + "description": "The new owner of the chat", + "html_description": "The new owner of the chat", + "rst_description": "The new owner of the chat\n", + "name": "new_owner", + "required": true + } + ], + "category": "types" + }, { "anchor": "userchatboosts", "name": "UserChatBoosts", @@ -13040,6 +13248,40 @@ ], "category": "methods" }, + { + "anchor": "getuserprofileaudios", + "name": "getUserProfileAudios", + "description": "Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.", + "html_description": "

Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.

", + "rst_description": "Use this method to get a list of profile audios for a user. Returns a :class:`aiogram.types.user_profile_audios.UserProfileAudios` object.", + "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": "Integer", + "required": false, + "description": "Sequential number of the first audio to be returned. By default, all audios are returned.", + "html_description": "Sequential number of the first audio to be returned. By default, all audios are returned.", + "rst_description": "Sequential number of the first audio to be returned. By default, all audios are returned.\n", + "name": "offset" + }, + { + "type": "Integer", + "required": false, + "description": "Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.", + "html_description": "Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.", + "rst_description": "Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.\n", + "name": "limit" + } + ], + "category": "methods" + }, { "anchor": "setuseremojistatus", "name": "setUserEmojiStatus", @@ -14116,9 +14358,9 @@ { "anchor": "createforumtopic", "name": "createForumTopic", - "description": "Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.", - "html_description": "

Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.

", - "rst_description": "Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object.", + "description": "Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object.", + "html_description": "

Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object.

", + "rst_description": "Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator right. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object.", "annotations": [ { "type": "Integer or String", @@ -14729,6 +14971,33 @@ ], "category": "methods" }, + { + "anchor": "setmyprofilephoto", + "name": "setMyProfilePhoto", + "description": "Changes the profile photo of the bot. Returns True on success.", + "html_description": "

Changes the profile photo of the bot. Returns True on success.

", + "rst_description": "Changes the profile photo of the bot. Returns :code:`True` on success.", + "annotations": [ + { + "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" + } + ], + "category": "methods" + }, + { + "anchor": "removemyprofilephoto", + "name": "removeMyProfilePhoto", + "description": "Removes the profile photo of the bot. Requires no parameters. Returns True on success.", + "html_description": "

Removes the profile photo of the bot. Requires no parameters. Returns True on success.

", + "rst_description": "Removes the profile photo of the bot. Requires no parameters. Returns :code:`True` on success.", + "annotations": [], + "category": "methods" + }, { "anchor": "setchatmenubutton", "name": "setChatMenuButton", @@ -22596,9 +22865,9 @@ { "anchor": "gamehighscore", "name": "GameHighScore", - "description": "This object represents one row of the high scores table for a game.\nAnd that's about all we've got for now.\nIf you've got any questions, please check out our Bot FAQ", - "html_description": "

This object represents one row of the high scores table for a game.

And that's about all we've got for now.
\nIf you've got any questions, please check out our Bot FAQ »

", - "rst_description": "This object represents one row of the high scores table for a game.\nAnd that's about all we've got for now.\n\nIf you've got any questions, please check out our `https://core.telegram.org/bots/faq `_ **Bot FAQ »**", + "description": "This object represents one row of the high scores table for a game.\nAnd that's about all we've got for now.\nIf you've got any questions, please check out our Bot FAQ\n-", + "html_description": "

This object represents one row of the high scores table for a game.

And that's about all we've got for now.
\nIf you've got any questions, please check out our Bot FAQ »
\n-

", + "rst_description": "This object represents one row of the high scores table for a game.\nAnd that's about all we've got for now.\n\nIf you've got any questions, please check out our `https://core.telegram.org/bots/faq `_ **Bot FAQ »**\n\n-", "annotations": [ { "type": "Integer", diff --git a/.butcher/types/ChatFullInfo/entity.json b/.butcher/types/ChatFullInfo/entity.json index 937ed037..3627d65d 100644 --- a/.butcher/types/ChatFullInfo/entity.json +++ b/.butcher/types/ChatFullInfo/entity.json @@ -395,6 +395,14 @@ "name": "rating", "required": false }, + { + "type": "Audio", + "description": "For private chats, the first audio added to the profile of the user", + "html_description": "Optional. For private chats, the first audio added to the profile of the user", + "rst_description": "*Optional*. For private chats, the first audio added to the profile of the user\n", + "name": "first_profile_audio", + "required": false + }, { "type": "UniqueGiftColors", "description": "The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews", diff --git a/.butcher/types/ChatOwnerChanged/entity.json b/.butcher/types/ChatOwnerChanged/entity.json new file mode 100644 index 00000000..083be3fa --- /dev/null +++ b/.butcher/types/ChatOwnerChanged/entity.json @@ -0,0 +1,25 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatownerchanged", + "name": "ChatOwnerChanged", + "description": "Describes a service message about an ownership change in the chat.", + "html_description": "

Describes a service message about an ownership change in the chat.

", + "rst_description": "Describes a service message about an ownership change in the chat.", + "annotations": [ + { + "type": "User", + "description": "The new owner of the chat", + "html_description": "The new owner of the chat", + "rst_description": "The new owner of the chat\n", + "name": "new_owner", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/ChatOwnerLeft/entity.json b/.butcher/types/ChatOwnerLeft/entity.json new file mode 100644 index 00000000..bbeac660 --- /dev/null +++ b/.butcher/types/ChatOwnerLeft/entity.json @@ -0,0 +1,25 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "chatownerleft", + "name": "ChatOwnerLeft", + "description": "Describes a service message about the chat owner leaving the chat.", + "html_description": "

Describes a service message about the chat owner leaving the chat.

", + "rst_description": "Describes a service message about the chat owner leaving the chat.", + "annotations": [ + { + "type": "User", + "description": "The user which will be the new owner of the chat if the previous owner does not return to the chat", + "html_description": "Optional. The user which will be the new owner of the chat if the previous owner does not return to the chat", + "rst_description": "*Optional*. The user which will be the new owner of the chat if the previous owner does not return to the chat\n", + "name": "new_owner", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/GameHighScore/entity.json b/.butcher/types/GameHighScore/entity.json index ce3f52d2..21a8a5e7 100644 --- a/.butcher/types/GameHighScore/entity.json +++ b/.butcher/types/GameHighScore/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "gamehighscore", "name": "GameHighScore", - "description": "This object represents one row of the high scores table for a game.\nAnd that's about all we've got for now.\nIf you've got any questions, please check out our Bot FAQ", - "html_description": "

This object represents one row of the high scores table for a game.

And that's about all we've got for now.
\nIf you've got any questions, please check out our Bot FAQ »

", - "rst_description": "This object represents one row of the high scores table for a game.\nAnd that's about all we've got for now.\n\nIf you've got any questions, please check out our `https://core.telegram.org/bots/faq `_ **Bot FAQ »**", + "description": "This object represents one row of the high scores table for a game.\nAnd that's about all we've got for now.\nIf you've got any questions, please check out our Bot FAQ\n-", + "html_description": "

This object represents one row of the high scores table for a game.

And that's about all we've got for now.
\nIf you've got any questions, please check out our Bot FAQ »
\n-

", + "rst_description": "This object represents one row of the high scores table for a game.\nAnd that's about all we've got for now.\n\nIf you've got any questions, please check out our `https://core.telegram.org/bots/faq `_ **Bot FAQ »**\n\n-", "annotations": [ { "type": "Integer", diff --git a/.butcher/types/InlineKeyboardButton/entity.json b/.butcher/types/InlineKeyboardButton/entity.json index 6279c8e6..15e52808 100644 --- a/.butcher/types/InlineKeyboardButton/entity.json +++ b/.butcher/types/InlineKeyboardButton/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "inlinekeyboardbutton", "name": "InlineKeyboardButton", - "description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", - "html_description": "

This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.

", - "rst_description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", + "description": "This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button.", + "html_description": "

This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button.

", + "rst_description": "This object represents one button of an inline keyboard. Exactly one of the fields other than *text*, *icon_custom_emoji_id*, and *style* must be used to specify the type of the button.", "annotations": [ { "type": "String", @@ -19,6 +19,22 @@ "name": "text", "required": true }, + { + "type": "String", + "description": "Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.", + "html_description": "Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.", + "rst_description": "*Optional*. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on `Fragment `_ or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.\n", + "name": "icon_custom_emoji_id", + "required": false + }, + { + "type": "String", + "description": "Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.", + "html_description": "Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.", + "rst_description": "*Optional*. Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.\n", + "name": "style", + "required": false + }, { "type": "String", "description": "HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id= can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.", diff --git a/.butcher/types/KeyboardButton/entity.json b/.butcher/types/KeyboardButton/entity.json index d0eff8d0..16771a3b 100644 --- a/.butcher/types/KeyboardButton/entity.json +++ b/.butcher/types/KeyboardButton/entity.json @@ -7,18 +7,34 @@ "object": { "anchor": "keyboardbutton", "name": "KeyboardButton", - "description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", - "html_description": "

This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", - "rst_description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", + "description": "This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text.", + "html_description": "

This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

", + "rst_description": "This object represents one button of the reply keyboard. At most one of the fields other than *text*, *icon_custom_emoji_id*, and *style* must be used to specify the type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text.", "annotations": [ { "type": "String", - "description": "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed", - "html_description": "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed", - "rst_description": "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed\n", + "description": "Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed", + "html_description": "Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed", + "rst_description": "Text of the button. If none of the fields other than *text*, *icon_custom_emoji_id*, and *style* are used, it will be sent as a message when the button is pressed\n", "name": "text", "required": true }, + { + "type": "String", + "description": "Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.", + "html_description": "Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.", + "rst_description": "*Optional*. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on `Fragment `_ or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.\n", + "name": "icon_custom_emoji_id", + "required": false + }, + { + "type": "String", + "description": "Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.", + "html_description": "Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.", + "rst_description": "*Optional*. Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.\n", + "name": "style", + "required": false + }, { "type": "KeyboardButtonRequestUsers", "description": "If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.", diff --git a/.butcher/types/Message/entity.json b/.butcher/types/Message/entity.json index d4dd8bc0..594442fc 100644 --- a/.butcher/types/Message/entity.json +++ b/.butcher/types/Message/entity.json @@ -443,6 +443,22 @@ "name": "left_chat_member", "required": false }, + { + "type": "ChatOwnerLeft", + "description": "Service message: chat owner has left", + "html_description": "Optional. Service message: chat owner has left", + "rst_description": "*Optional*. Service message: chat owner has left\n", + "name": "chat_owner_left", + "required": false + }, + { + "type": "ChatOwnerChanged", + "description": "Service message: chat owner has changed", + "html_description": "Optional. Service message: chat owner has changed", + "rst_description": "*Optional*. Service message: chat owner has changed\n", + "name": "chat_owner_changed", + "required": false + }, { "type": "String", "description": "A chat title was changed to this value", diff --git a/.butcher/types/UniqueGift/entity.json b/.butcher/types/UniqueGift/entity.json index 9d5f4a50..4b4427ae 100644 --- a/.butcher/types/UniqueGift/entity.json +++ b/.butcher/types/UniqueGift/entity.json @@ -75,6 +75,14 @@ "name": "is_premium", "required": false }, + { + "type": "True", + "description": "True, if the gift was used to craft another gift and isn't available anymore", + "html_description": "Optional. True, if the gift was used to craft another gift and isn't available anymore", + "rst_description": "*Optional*. :code:`True`, if the gift was used to craft another gift and isn't available anymore\n", + "name": "is_burned", + "required": false + }, { "type": "True", "description": "True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram", diff --git a/.butcher/types/UniqueGiftModel/entity.json b/.butcher/types/UniqueGiftModel/entity.json index 4ff33770..6573026a 100644 --- a/.butcher/types/UniqueGiftModel/entity.json +++ b/.butcher/types/UniqueGiftModel/entity.json @@ -29,11 +29,19 @@ }, { "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", + "description": "The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.", + "html_description": "The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.", + "rst_description": "The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.\n", "name": "rarity_per_mille", "required": true + }, + { + "type": "String", + "description": "Rarity of the model if it is a crafted model. Currently, can be 'uncommon', 'rare', 'epic', or 'legendary'.", + "html_description": "Optional. Rarity of the model if it is a crafted model. Currently, can be “uncommon”, “rare”, “epic”, or “legendary”.", + "rst_description": "*Optional*. Rarity of the model if it is a crafted model. Currently, can be 'uncommon', 'rare', 'epic', or 'legendary'.\n", + "name": "rarity", + "required": false } ], "category": "types" diff --git a/.butcher/types/User/entity.json b/.butcher/types/User/entity.json index b444dbb3..cead909a 100644 --- a/.butcher/types/User/entity.json +++ b/.butcher/types/User/entity.json @@ -122,6 +122,14 @@ "rst_description": "*Optional*. :code:`True`, if the bot has forum topic mode enabled in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n", "name": "has_topics_enabled", "required": false + }, + { + "type": "Boolean", + "description": "True, if the bot allows users to create and delete topics in private chats. Returned only in getMe.", + "html_description": "Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe.", + "rst_description": "*Optional*. :code:`True`, if the bot allows users to create and delete topics in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`.\n", + "name": "allows_users_to_create_topics", + "required": false } ], "category": "types" diff --git a/.butcher/types/UserProfileAudios/entity.json b/.butcher/types/UserProfileAudios/entity.json new file mode 100644 index 00000000..77e373ce --- /dev/null +++ b/.butcher/types/UserProfileAudios/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "userprofileaudios", + "name": "UserProfileAudios", + "description": "This object represents the audios displayed on a user's profile.", + "html_description": "

This object represents the audios displayed on a user's profile.

", + "rst_description": "This object represents the audios displayed on a user's profile.", + "annotations": [ + { + "type": "Integer", + "description": "Total number of profile audios for the target user", + "html_description": "Total number of profile audios for the target user", + "rst_description": "Total number of profile audios for the target user\n", + "name": "total_count", + "required": true + }, + { + "type": "Array of Audio", + "description": "Requested profile audios", + "html_description": "Requested profile audios", + "rst_description": "Requested profile audios\n", + "name": "audios", + "required": true + } + ], + "category": "types" + } +} diff --git a/.butcher/types/Video/entity.json b/.butcher/types/Video/entity.json index d62323ee..41ec3bb6 100644 --- a/.butcher/types/Video/entity.json +++ b/.butcher/types/Video/entity.json @@ -75,6 +75,14 @@ "name": "start_timestamp", "required": false }, + { + "type": "Array of VideoQuality", + "description": "List of available qualities of the video", + "html_description": "Optional. List of available qualities of the video", + "rst_description": "*Optional*. List of available qualities of the video\n", + "name": "qualities", + "required": false + }, { "type": "String", "description": "Original filename as defined by the sender", diff --git a/.butcher/types/VideoQuality/entity.json b/.butcher/types/VideoQuality/entity.json new file mode 100644 index 00000000..0ba0b78a --- /dev/null +++ b/.butcher/types/VideoQuality/entity.json @@ -0,0 +1,65 @@ +{ + "meta": {}, + "group": { + "title": "Available types", + "anchor": "available-types" + }, + "object": { + "anchor": "videoquality", + "name": "VideoQuality", + "description": "This object represents a video file of a specific quality.", + "html_description": "

This object represents a video file of a specific quality.

", + "rst_description": "This object represents a video file of a specific quality.", + "annotations": [ + { + "type": "String", + "description": "Identifier for this file, which can be used to download or reuse the file", + "html_description": "Identifier for this file, which can be used to download or reuse the file", + "rst_description": "Identifier for this file, which can be used to download or reuse the file\n", + "name": "file_id", + "required": true + }, + { + "type": "String", + "description": "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.", + "html_description": "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.", + "rst_description": "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.\n", + "name": "file_unique_id", + "required": true + }, + { + "type": "Integer", + "description": "Video width", + "html_description": "Video width", + "rst_description": "Video width\n", + "name": "width", + "required": true + }, + { + "type": "Integer", + "description": "Video height", + "html_description": "Video height", + "rst_description": "Video height\n", + "name": "height", + "required": true + }, + { + "type": "String", + "description": "Codec that was used to encode the video, for example, 'h264', 'h265', or 'av01'", + "html_description": "Codec that was used to encode the video, for example, “h264”, “h265”, or “av01”", + "rst_description": "Codec that was used to encode the video, for example, 'h264', 'h265', or 'av01'\n", + "name": "codec", + "required": true + }, + { + "type": "Integer", + "description": "File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.", + "html_description": "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.", + "rst_description": "*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.\n", + "name": "file_size", + "required": false + } + ], + "category": "types" + } +} diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index 289994dd..d10429f6 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -92,6 +92,7 @@ from ..methods import ( GetUpdates, GetUserChatBoosts, GetUserGifts, + GetUserProfileAudios, GetUserProfilePhotos, GetWebhookInfo, GiftPremiumSubscription, @@ -105,6 +106,7 @@ from ..methods import ( RefundStarPayment, RemoveBusinessAccountProfilePhoto, RemoveChatVerification, + RemoveMyProfilePhoto, RemoveUserVerification, ReopenForumTopic, ReopenGeneralForumTopic, @@ -154,6 +156,7 @@ from ..methods import ( SetMyDefaultAdministratorRights, SetMyDescription, SetMyName, + SetMyProfilePhoto, SetMyShortDescription, SetPassportDataErrors, SetStickerEmojiList, @@ -241,6 +244,7 @@ from ..types import ( Update, User, UserChatBoosts, + UserProfileAudios, UserProfilePhotos, WebhookInfo, ) @@ -911,7 +915,7 @@ class Bot: request_timeout: int | None = None, ) -> ForumTopic: """ - Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object. + Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator right. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object. Source: https://core.telegram.org/bots/api#createforumtopic @@ -5842,3 +5846,65 @@ class Bot: entities=entities, ) return await self(call, request_timeout=request_timeout) + + async def get_user_profile_audios( + self, + user_id: int, + offset: int | None = None, + limit: int | None = None, + request_timeout: int | None = None, + ) -> UserProfileAudios: + """ + Use this method to get a list of profile audios for a user. Returns a :class:`aiogram.types.user_profile_audios.UserProfileAudios` object. + + Source: https://core.telegram.org/bots/api#getuserprofileaudios + + :param user_id: Unique identifier of the target user + :param offset: Sequential number of the first audio to be returned. By default, all audios are returned. + :param limit: Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100. + :param request_timeout: Request timeout + :return: Returns a :class:`aiogram.types.user_profile_audios.UserProfileAudios` object. + """ + + call = GetUserProfileAudios( + user_id=user_id, + offset=offset, + limit=limit, + ) + return await self(call, request_timeout=request_timeout) + + async def remove_my_profile_photo( + self, + request_timeout: int | None = None, + ) -> bool: + """ + Removes the profile photo of the bot. Requires no parameters. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#removemyprofilephoto + + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = RemoveMyProfilePhoto() + return await self(call, request_timeout=request_timeout) + + async def set_my_profile_photo( + self, + photo: InputProfilePhotoUnion, + request_timeout: int | None = None, + ) -> bool: + """ + Changes the profile photo of the bot. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setmyprofilephoto + + :param photo: The new profile photo to set + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = SetMyProfilePhoto( + photo=photo, + ) + return await self(call, request_timeout=request_timeout) diff --git a/aiogram/enums/content_type.py b/aiogram/enums/content_type.py index 0c1c4b29..b2a555d4 100644 --- a/aiogram/enums/content_type.py +++ b/aiogram/enums/content_type.py @@ -28,6 +28,8 @@ class ContentType(str, Enum): LOCATION = "location" NEW_CHAT_MEMBERS = "new_chat_members" LEFT_CHAT_MEMBER = "left_chat_member" + CHAT_OWNER_LEFT = "chat_owner_left" + CHAT_OWNER_CHANGED = "chat_owner_changed" NEW_CHAT_TITLE = "new_chat_title" NEW_CHAT_PHOTO = "new_chat_photo" DELETE_CHAT_PHOTO = "delete_chat_photo" diff --git a/aiogram/methods/__init__.py b/aiogram/methods/__init__.py index 9c1ebccd..786e53e5 100644 --- a/aiogram/methods/__init__.py +++ b/aiogram/methods/__init__.py @@ -74,6 +74,7 @@ from .get_sticker_set import GetStickerSet from .get_updates import GetUpdates from .get_user_chat_boosts import GetUserChatBoosts from .get_user_gifts import GetUserGifts +from .get_user_profile_audios import GetUserProfileAudios from .get_user_profile_photos import GetUserProfilePhotos from .get_webhook_info import GetWebhookInfo from .gift_premium_subscription import GiftPremiumSubscription @@ -87,6 +88,7 @@ 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_my_profile_photo import RemoveMyProfilePhoto from .remove_user_verification import RemoveUserVerification from .reopen_forum_topic import ReopenForumTopic from .reopen_general_forum_topic import ReopenGeneralForumTopic @@ -136,6 +138,7 @@ from .set_my_commands import SetMyCommands from .set_my_default_administrator_rights import SetMyDefaultAdministratorRights from .set_my_description import SetMyDescription from .set_my_name import SetMyName +from .set_my_profile_photo import SetMyProfilePhoto from .set_my_short_description import SetMyShortDescription from .set_passport_data_errors import SetPassportDataErrors from .set_sticker_emoji_list import SetStickerEmojiList @@ -238,6 +241,7 @@ __all__ = ( "GetUpdates", "GetUserChatBoosts", "GetUserGifts", + "GetUserProfileAudios", "GetUserProfilePhotos", "GetWebhookInfo", "GiftPremiumSubscription", @@ -251,6 +255,7 @@ __all__ = ( "RefundStarPayment", "RemoveBusinessAccountProfilePhoto", "RemoveChatVerification", + "RemoveMyProfilePhoto", "RemoveUserVerification", "ReopenForumTopic", "ReopenGeneralForumTopic", @@ -302,6 +307,7 @@ __all__ = ( "SetMyDefaultAdministratorRights", "SetMyDescription", "SetMyName", + "SetMyProfilePhoto", "SetMyShortDescription", "SetPassportDataErrors", "SetStickerEmojiList", diff --git a/aiogram/methods/create_forum_topic.py b/aiogram/methods/create_forum_topic.py index 0d7940a3..242b67cb 100644 --- a/aiogram/methods/create_forum_topic.py +++ b/aiogram/methods/create_forum_topic.py @@ -8,7 +8,7 @@ from .base import TelegramMethod class CreateForumTopic(TelegramMethod[ForumTopic]): """ - Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object. + Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator right. Returns information about the created topic as a :class:`aiogram.types.forum_topic.ForumTopic` object. Source: https://core.telegram.org/bots/api#createforumtopic """ diff --git a/aiogram/methods/get_user_profile_audios.py b/aiogram/methods/get_user_profile_audios.py new file mode 100644 index 00000000..ce77de40 --- /dev/null +++ b/aiogram/methods/get_user_profile_audios.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from ..types import UserProfileAudios +from .base import TelegramMethod + + +class GetUserProfileAudios(TelegramMethod[UserProfileAudios]): + """ + Use this method to get a list of profile audios for a user. Returns a :class:`aiogram.types.user_profile_audios.UserProfileAudios` object. + + Source: https://core.telegram.org/bots/api#getuserprofileaudios + """ + + __returning__ = UserProfileAudios + __api_method__ = "getUserProfileAudios" + + user_id: int + """Unique identifier of the target user""" + offset: int | None = None + """Sequential number of the first audio to be returned. By default, all audios are returned.""" + limit: int | None = None + """Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + user_id: int, + offset: int | None = None, + limit: int | None = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(user_id=user_id, offset=offset, limit=limit, **__pydantic_kwargs) diff --git a/aiogram/methods/remove_my_profile_photo.py b/aiogram/methods/remove_my_profile_photo.py new file mode 100644 index 00000000..c59dca32 --- /dev/null +++ b/aiogram/methods/remove_my_profile_photo.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from .base import TelegramMethod + + +class RemoveMyProfilePhoto(TelegramMethod[bool]): + """ + Removes the profile photo of the bot. Requires no parameters. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#removemyprofilephoto + """ + + __returning__ = bool + __api_method__ = "removeMyProfilePhoto" diff --git a/aiogram/methods/set_my_profile_photo.py b/aiogram/methods/set_my_profile_photo.py new file mode 100644 index 00000000..4f72ec61 --- /dev/null +++ b/aiogram/methods/set_my_profile_photo.py @@ -0,0 +1,33 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from ..types import InputProfilePhotoUnion +from .base import TelegramMethod + + +class SetMyProfilePhoto(TelegramMethod[bool]): + """ + Changes the profile photo of the bot. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#setmyprofilephoto + """ + + __returning__ = bool + __api_method__ = "setMyProfilePhoto" + + photo: InputProfilePhotoUnion + """The new profile photo to set""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, photo: InputProfilePhotoUnion, **__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__(photo=photo, **__pydantic_kwargs) diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index 915e15a7..90e59515 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -387,6 +387,8 @@ __all__ = ( "ChatMemberRestricted", "ChatMemberUnion", "ChatMemberUpdated", + "ChatOwnerChanged", + "ChatOwnerLeft", "ChatPermissions", "ChatPhoto", "ChatShared", @@ -627,6 +629,7 @@ __all__ = ( "Update", "User", "UserChatBoosts", + "UserProfileAudios", "UserProfilePhotos", "UserRating", "UserShared", @@ -638,6 +641,7 @@ __all__ = ( "VideoChatScheduled", "VideoChatStarted", "VideoNote", + "VideoQuality", "Voice", "WebAppData", "WebAppInfo", @@ -646,6 +650,10 @@ __all__ = ( ) from ..client.default import Default as _Default +from .chat_owner_changed import ChatOwnerChanged +from .chat_owner_left import ChatOwnerLeft +from .user_profile_audios import UserProfileAudios +from .video_quality import VideoQuality # Load typing forward refs for every TelegramObject for _entity_name in __all__: diff --git a/aiogram/types/chat_full_info.py b/aiogram/types/chat_full_info.py index 9505aebf..93fb0a00 100644 --- a/aiogram/types/chat_full_info.py +++ b/aiogram/types/chat_full_info.py @@ -9,6 +9,7 @@ from .custom import DateTime if TYPE_CHECKING: from .accepted_gift_types import AcceptedGiftTypes + from .audio import Audio from .birthdate import Birthdate from .business_intro import BusinessIntro from .business_location import BusinessLocation @@ -125,6 +126,8 @@ class ChatFullInfo(Chat): """*Optional*. For supergroups, the location to which the supergroup is connected""" rating: UserRating | None = None """*Optional*. For private chats, the rating of the user if any""" + first_profile_audio: Audio | None = None + """*Optional*. For private chats, the first audio added to the profile of the user""" unique_gift_colors: UniqueGiftColors | None = None """*Optional*. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews""" paid_message_star_count: int | None = None @@ -190,6 +193,7 @@ class ChatFullInfo(Chat): linked_chat_id: int | None = None, location: ChatLocation | None = None, rating: UserRating | None = None, + first_profile_audio: Audio | None = None, unique_gift_colors: UniqueGiftColors | None = None, paid_message_star_count: int | None = None, can_send_gift: bool | None = None, @@ -248,6 +252,7 @@ class ChatFullInfo(Chat): linked_chat_id=linked_chat_id, location=location, rating=rating, + first_profile_audio=first_profile_audio, unique_gift_colors=unique_gift_colors, paid_message_star_count=paid_message_star_count, can_send_gift=can_send_gift, diff --git a/aiogram/types/chat_owner_changed.py b/aiogram/types/chat_owner_changed.py new file mode 100644 index 00000000..1b9bc00f --- /dev/null +++ b/aiogram/types/chat_owner_changed.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + +if TYPE_CHECKING: + from .user import User + + +class ChatOwnerChanged(TelegramObject): + """ + Describes a service message about an ownership change in the chat. + + Source: https://core.telegram.org/bots/api#chatownerchanged + """ + + new_owner: User + """The new owner of the chat""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__(__pydantic__self__, *, new_owner: User, **__pydantic_kwargs: Any) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(new_owner=new_owner, **__pydantic_kwargs) diff --git a/aiogram/types/chat_owner_left.py b/aiogram/types/chat_owner_left.py new file mode 100644 index 00000000..8c9af97d --- /dev/null +++ b/aiogram/types/chat_owner_left.py @@ -0,0 +1,32 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + +if TYPE_CHECKING: + from .user import User + + +class ChatOwnerLeft(TelegramObject): + """ + Describes a service message about the chat owner leaving the chat. + + Source: https://core.telegram.org/bots/api#chatownerleft + """ + + new_owner: User | None = None + """*Optional*. The user which will be the new owner of the chat if the previous owner does not return to the chat""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, new_owner: User | None = None, **__pydantic_kwargs: Any + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(new_owner=new_owner, **__pydantic_kwargs) diff --git a/aiogram/types/game_high_score.py b/aiogram/types/game_high_score.py index 5364be6e..e8fdcf40 100644 --- a/aiogram/types/game_high_score.py +++ b/aiogram/types/game_high_score.py @@ -15,6 +15,8 @@ class GameHighScore(TelegramObject): If you've got any questions, please check out our `https://core.telegram.org/bots/faq `_ **Bot FAQ »** + - + Source: https://core.telegram.org/bots/api#gamehighscore """ diff --git a/aiogram/types/inline_keyboard_button.py b/aiogram/types/inline_keyboard_button.py index bc4e934f..f85418cd 100644 --- a/aiogram/types/inline_keyboard_button.py +++ b/aiogram/types/inline_keyboard_button.py @@ -14,13 +14,17 @@ if TYPE_CHECKING: class InlineKeyboardButton(MutableTelegramObject): """ - This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. + This object represents one button of an inline keyboard. Exactly one of the fields other than *text*, *icon_custom_emoji_id*, and *style* must be used to specify the type of the button. Source: https://core.telegram.org/bots/api#inlinekeyboardbutton """ text: str """Label text on the button""" + icon_custom_emoji_id: str | None = None + """*Optional*. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on `Fragment `_ or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.""" + style: str | None = None + """*Optional*. Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.""" url: str | None = None """*Optional*. HTTP or tg:// URL to be opened when the button is pressed. Links :code:`tg://user?id=` can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.""" callback_data: str | None = None @@ -50,6 +54,8 @@ class InlineKeyboardButton(MutableTelegramObject): __pydantic__self__, *, text: str, + icon_custom_emoji_id: str | None = None, + style: str | None = None, url: str | None = None, callback_data: str | None = None, web_app: WebAppInfo | None = None, @@ -68,6 +74,8 @@ class InlineKeyboardButton(MutableTelegramObject): super().__init__( text=text, + icon_custom_emoji_id=icon_custom_emoji_id, + style=style, url=url, callback_data=callback_data, web_app=web_app, diff --git a/aiogram/types/keyboard_button.py b/aiogram/types/keyboard_button.py index 0635476e..f0c4af22 100644 --- a/aiogram/types/keyboard_button.py +++ b/aiogram/types/keyboard_button.py @@ -16,14 +16,17 @@ if TYPE_CHECKING: class KeyboardButton(MutableTelegramObject): """ - This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text. - **Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*. + This object represents one button of the reply keyboard. At most one of the fields other than *text*, *icon_custom_emoji_id*, and *style* must be used to specify the type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text. Source: https://core.telegram.org/bots/api#keyboardbutton """ text: str - """Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed""" + """Text of the button. If none of the fields other than *text*, *icon_custom_emoji_id*, and *style* are used, it will be sent as a message when the button is pressed""" + icon_custom_emoji_id: str | None = None + """*Optional*. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on `Fragment `_ or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.""" + style: str | None = None + """*Optional*. Style of the button. Must be one of 'danger' (red), 'success' (green) or 'primary' (blue). If omitted, then an app-specific style is used.""" request_users: KeyboardButtonRequestUsers | None = None """*Optional*. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a 'users_shared' service message. Available in private chats only.""" request_chat: KeyboardButtonRequestChat | None = None @@ -52,6 +55,8 @@ class KeyboardButton(MutableTelegramObject): __pydantic__self__, *, text: str, + icon_custom_emoji_id: str | None = None, + style: str | None = None, request_users: KeyboardButtonRequestUsers | None = None, request_chat: KeyboardButtonRequestChat | None = None, request_contact: bool | None = None, @@ -67,6 +72,8 @@ class KeyboardButton(MutableTelegramObject): super().__init__( text=text, + icon_custom_emoji_id=icon_custom_emoji_id, + style=style, request_users=request_users, request_chat=request_chat, request_contact=request_contact, diff --git a/aiogram/types/message.py b/aiogram/types/message.py index 91434ee7..b35fe0fb 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -55,6 +55,8 @@ if TYPE_CHECKING: from .chat_background import ChatBackground from .chat_boost_added import ChatBoostAdded from .chat_id_union import ChatIdUnion + from .chat_owner_changed import ChatOwnerChanged + from .chat_owner_left import ChatOwnerLeft from .chat_shared import ChatShared from .checklist import Checklist from .checklist_tasks_added import ChecklistTasksAdded @@ -245,6 +247,10 @@ class Message(MaybeInaccessibleMessage): """*Optional*. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)""" left_chat_member: User | None = None """*Optional*. A member was removed from the group, information about them (this member may be the bot itself)""" + chat_owner_left: ChatOwnerLeft | None = None + """*Optional*. Service message: chat owner has left""" + chat_owner_changed: ChatOwnerChanged | None = None + """*Optional*. Service message: chat owner has changed""" new_chat_title: str | None = None """*Optional*. A chat title was changed to this value""" new_chat_photo: list[PhotoSize] | None = None @@ -440,6 +446,8 @@ class Message(MaybeInaccessibleMessage): location: Location | None = None, new_chat_members: list[User] | None = None, left_chat_member: User | None = None, + chat_owner_left: ChatOwnerLeft | None = None, + chat_owner_changed: ChatOwnerChanged | None = None, new_chat_title: str | None = None, new_chat_photo: list[PhotoSize] | None = None, delete_chat_photo: bool | None = None, @@ -557,6 +565,8 @@ class Message(MaybeInaccessibleMessage): location=location, new_chat_members=new_chat_members, left_chat_member=left_chat_member, + chat_owner_left=chat_owner_left, + chat_owner_changed=chat_owner_changed, new_chat_title=new_chat_title, new_chat_photo=new_chat_photo, delete_chat_photo=delete_chat_photo, @@ -650,6 +660,10 @@ class Message(MaybeInaccessibleMessage): return ContentType.NEW_CHAT_MEMBERS if self.left_chat_member: return ContentType.LEFT_CHAT_MEMBER + if self.chat_owner_left: + return ContentType.CHAT_OWNER_LEFT + if self.chat_owner_changed: + return ContentType.CHAT_OWNER_CHANGED if self.invoice: return ContentType.INVOICE if self.successful_payment: diff --git a/aiogram/types/unique_gift.py b/aiogram/types/unique_gift.py index 586e79a6..1b23337c 100644 --- a/aiogram/types/unique_gift.py +++ b/aiogram/types/unique_gift.py @@ -35,6 +35,8 @@ class UniqueGift(TelegramObject): """Backdrop of the gift""" is_premium: bool | None = None """*Optional*. :code:`True`, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers""" + is_burned: bool | None = None + """*Optional*. :code:`True`, if the gift was used to craft another gift and isn't available anymore""" is_from_blockchain: bool | None = None """*Optional*. :code:`True`, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram""" colors: UniqueGiftColors | None = None @@ -57,6 +59,7 @@ class UniqueGift(TelegramObject): symbol: UniqueGiftSymbol, backdrop: UniqueGiftBackdrop, is_premium: bool | None = None, + is_burned: bool | None = None, is_from_blockchain: bool | None = None, colors: UniqueGiftColors | None = None, publisher_chat: Chat | None = None, @@ -75,6 +78,7 @@ class UniqueGift(TelegramObject): symbol=symbol, backdrop=backdrop, is_premium=is_premium, + is_burned=is_burned, is_from_blockchain=is_from_blockchain, colors=colors, publisher_chat=publisher_chat, diff --git a/aiogram/types/unique_gift_model.py b/aiogram/types/unique_gift_model.py index 7a87f032..17faedfd 100644 --- a/aiogram/types/unique_gift_model.py +++ b/aiogram/types/unique_gift_model.py @@ -20,7 +20,9 @@ class UniqueGiftModel(TelegramObject): 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""" + """The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.""" + rarity: str | None = None + """*Optional*. Rarity of the model if it is a crafted model. Currently, can be 'uncommon', 'rare', 'epic', or 'legendary'.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -32,6 +34,7 @@ class UniqueGiftModel(TelegramObject): name: str, sticker: Sticker, rarity_per_mille: int, + rarity: str | None = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -39,5 +42,9 @@ class UniqueGiftModel(TelegramObject): # 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 + name=name, + sticker=sticker, + rarity_per_mille=rarity_per_mille, + rarity=rarity, + **__pydantic_kwargs, ) diff --git a/aiogram/types/user.py b/aiogram/types/user.py index 0dfb7ee2..00da8e5c 100644 --- a/aiogram/types/user.py +++ b/aiogram/types/user.py @@ -45,6 +45,8 @@ class User(TelegramObject): """*Optional*. :code:`True`, if the bot has a main Web App. Returned only in :class:`aiogram.methods.get_me.GetMe`.""" has_topics_enabled: bool | None = None """*Optional*. :code:`True`, if the bot has forum topic mode enabled in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`.""" + allows_users_to_create_topics: bool | None = None + """*Optional*. :code:`True`, if the bot allows users to create and delete topics in private chats. Returned only in :class:`aiogram.methods.get_me.GetMe`.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -67,6 +69,7 @@ class User(TelegramObject): can_connect_to_business: bool | None = None, has_main_web_app: bool | None = None, has_topics_enabled: bool | None = None, + allows_users_to_create_topics: bool | None = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -88,6 +91,7 @@ class User(TelegramObject): can_connect_to_business=can_connect_to_business, has_main_web_app=has_main_web_app, has_topics_enabled=has_topics_enabled, + allows_users_to_create_topics=allows_users_to_create_topics, **__pydantic_kwargs, ) diff --git a/aiogram/types/user_profile_audios.py b/aiogram/types/user_profile_audios.py new file mode 100644 index 00000000..a8f7eb9a --- /dev/null +++ b/aiogram/types/user_profile_audios.py @@ -0,0 +1,34 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + +if TYPE_CHECKING: + from .audio import Audio + + +class UserProfileAudios(TelegramObject): + """ + This object represents the audios displayed on a user's profile. + + Source: https://core.telegram.org/bots/api#userprofileaudios + """ + + total_count: int + """Total number of profile audios for the target user""" + audios: list[Audio] + """Requested profile audios""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, *, total_count: int, audios: list[Audio], **__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, audios=audios, **__pydantic_kwargs) diff --git a/aiogram/types/video.py b/aiogram/types/video.py index a13c9c96..1674f6c2 100644 --- a/aiogram/types/video.py +++ b/aiogram/types/video.py @@ -7,6 +7,7 @@ from .base import TelegramObject if TYPE_CHECKING: from .photo_size import PhotoSize + from .video_quality import VideoQuality class Video(TelegramObject): @@ -32,6 +33,8 @@ class Video(TelegramObject): """*Optional*. Available sizes of the cover of the video in the message""" start_timestamp: datetime.datetime | None = None """*Optional*. Timestamp in seconds from which the video will play in the message""" + qualities: list[VideoQuality] | None = None + """*Optional*. List of available qualities of the video""" file_name: str | None = None """*Optional*. Original filename as defined by the sender""" mime_type: str | None = None @@ -54,6 +57,7 @@ class Video(TelegramObject): thumbnail: PhotoSize | None = None, cover: list[PhotoSize] | None = None, start_timestamp: datetime.datetime | None = None, + qualities: list[VideoQuality] | None = None, file_name: str | None = None, mime_type: str | None = None, file_size: int | None = None, @@ -72,6 +76,7 @@ class Video(TelegramObject): thumbnail=thumbnail, cover=cover, start_timestamp=start_timestamp, + qualities=qualities, file_name=file_name, mime_type=mime_type, file_size=file_size, diff --git a/aiogram/types/video_quality.py b/aiogram/types/video_quality.py new file mode 100644 index 00000000..9b17e79c --- /dev/null +++ b/aiogram/types/video_quality.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramObject + + +class VideoQuality(TelegramObject): + """ + This object represents a video file of a specific quality. + + Source: https://core.telegram.org/bots/api#videoquality + """ + + file_id: str + """Identifier for this file, which can be used to download or reuse the file""" + file_unique_id: str + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" + width: int + """Video width""" + height: int + """Video height""" + codec: str + """Codec that was used to encode the video, for example, 'h264', 'h265', or 'av01'""" + file_size: int | None = None + """*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + file_id: str, + file_unique_id: str, + width: int, + height: int, + codec: str, + file_size: int | None = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + file_id=file_id, + file_unique_id=file_unique_id, + width=width, + height=height, + codec=codec, + file_size=file_size, + **__pydantic_kwargs, + ) diff --git a/docs/api/methods/get_user_profile_audios.rst b/docs/api/methods/get_user_profile_audios.rst new file mode 100644 index 00000000..f9567228 --- /dev/null +++ b/docs/api/methods/get_user_profile_audios.rst @@ -0,0 +1,38 @@ +#################### +getUserProfileAudios +#################### + +Returns: :obj:`UserProfileAudios` + +.. automodule:: aiogram.methods.get_user_profile_audios + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: UserProfileAudios = await bot.get_user_profile_audios(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.get_user_profile_audios import GetUserProfileAudios` +- alias: :code:`from aiogram.methods import GetUserProfileAudios` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: UserProfileAudios = await bot(GetUserProfileAudios(...)) diff --git a/docs/api/methods/index.rst b/docs/api/methods/index.rst index a93ed67d..bbd6303a 100644 --- a/docs/api/methods/index.rst +++ b/docs/api/methods/index.rst @@ -82,6 +82,7 @@ Available methods get_my_short_description get_user_chat_boosts get_user_gifts + get_user_profile_audios get_user_profile_photos gift_premium_subscription hide_general_forum_topic @@ -93,6 +94,7 @@ Available methods read_business_message remove_business_account_profile_photo remove_chat_verification + remove_my_profile_photo remove_user_verification reopen_forum_topic reopen_general_forum_topic @@ -135,6 +137,7 @@ Available methods set_my_default_administrator_rights set_my_description set_my_name + set_my_profile_photo set_my_short_description set_user_emoji_status transfer_business_account_stars diff --git a/docs/api/methods/remove_my_profile_photo.rst b/docs/api/methods/remove_my_profile_photo.rst new file mode 100644 index 00000000..19d0d251 --- /dev/null +++ b/docs/api/methods/remove_my_profile_photo.rst @@ -0,0 +1,45 @@ +#################### +removeMyProfilePhoto +#################### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.remove_my_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_my_profile_photo(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.remove_my_profile_photo import RemoveMyProfilePhoto` +- alias: :code:`from aiogram.methods import RemoveMyProfilePhoto` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(RemoveMyProfilePhoto(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return RemoveMyProfilePhoto(...) diff --git a/docs/api/methods/set_my_profile_photo.rst b/docs/api/methods/set_my_profile_photo.rst new file mode 100644 index 00000000..c2290414 --- /dev/null +++ b/docs/api/methods/set_my_profile_photo.rst @@ -0,0 +1,45 @@ +################# +setMyProfilePhoto +################# + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.set_my_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_my_profile_photo(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.set_my_profile_photo import SetMyProfilePhoto` +- alias: :code:`from aiogram.methods import SetMyProfilePhoto` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(SetMyProfilePhoto(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return SetMyProfilePhoto(...) diff --git a/docs/api/types/chat_owner_changed.rst b/docs/api/types/chat_owner_changed.rst new file mode 100644 index 00000000..b87b0f84 --- /dev/null +++ b/docs/api/types/chat_owner_changed.rst @@ -0,0 +1,10 @@ +################ +ChatOwnerChanged +################ + + +.. automodule:: aiogram.types.chat_owner_changed + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/chat_owner_left.rst b/docs/api/types/chat_owner_left.rst new file mode 100644 index 00000000..1cca68c3 --- /dev/null +++ b/docs/api/types/chat_owner_left.rst @@ -0,0 +1,10 @@ +############# +ChatOwnerLeft +############# + + +.. automodule:: aiogram.types.chat_owner_left + :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 e48d11b5..8cfa8a45 100644 --- a/docs/api/types/index.rst +++ b/docs/api/types/index.rst @@ -67,6 +67,8 @@ Available types chat_member_owner chat_member_restricted chat_member_updated + chat_owner_changed + chat_owner_left chat_permissions chat_photo chat_shared @@ -199,6 +201,7 @@ Available types unique_gift_symbol user user_chat_boosts + user_profile_audios user_profile_photos user_rating user_shared @@ -210,6 +213,7 @@ Available types video_chat_scheduled video_chat_started video_note + video_quality voice web_app_data web_app_info diff --git a/docs/api/types/user_profile_audios.rst b/docs/api/types/user_profile_audios.rst new file mode 100644 index 00000000..2c4b12e0 --- /dev/null +++ b/docs/api/types/user_profile_audios.rst @@ -0,0 +1,10 @@ +################# +UserProfileAudios +################# + + +.. automodule:: aiogram.types.user_profile_audios + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/docs/api/types/video_quality.rst b/docs/api/types/video_quality.rst new file mode 100644 index 00000000..a77a9cf3 --- /dev/null +++ b/docs/api/types/video_quality.rst @@ -0,0 +1,10 @@ +############ +VideoQuality +############ + + +.. automodule:: aiogram.types.video_quality + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields