From 85ce6bc2a9d4b3c80a0f1a67750f87a786b47efd Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Fri, 18 Aug 2023 20:08:37 +0300 Subject: [PATCH] Bump after public release --- .../entity.json | 4 +- .butcher/schema/schema.json | 112 +++++++++--------- .butcher/types/Chat/entity.json | 16 +-- .butcher/types/Chat/replace.yml | 5 + .butcher/types/Message/entity.json | 16 +-- .butcher/types/PollAnswer/entity.json | 16 +-- .butcher/types/Story/entity.json | 4 +- aiogram/enums/content_type.py | 2 +- aiogram/types/chat.py | 8 +- aiogram/types/message.py | 8 +- aiogram/types/poll_answer.py | 8 +- docs/api/methods/index.rst | 9 +- docs/api/types/index.rst | 9 +- 13 files changed, 101 insertions(+), 116 deletions(-) create mode 100644 .butcher/types/Chat/replace.yml diff --git a/.butcher/methods/unpinAllGeneralForumTopicMessages/entity.json b/.butcher/methods/unpinAllGeneralForumTopicMessages/entity.json index 6dd2f5a3..c6130087 100644 --- a/.butcher/methods/unpinAllGeneralForumTopicMessages/entity.json +++ b/.butcher/methods/unpinAllGeneralForumTopicMessages/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Upcoming update", - "anchor": "upcoming-update" + "title": "Available methods", + "anchor": "available-methods" }, "object": { "anchor": "unpinallgeneralforumtopicmessages", diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index 621e98c0..d4ec9ad1 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -1,7 +1,7 @@ { "api": { - "version": "6.7", - "release_date": "2023-04-21" + "version": "6.8", + "release_date": "2023-08-18" }, "items": [ { @@ -547,6 +547,14 @@ "name": "emoji_status_custom_emoji_id", "required": false }, + { + "type": "Integer", + "description": "Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", + "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", + "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "emoji_status_expiration_date", + "required": false + }, { "type": "String", "description": "Bio of the other party in a private chat. Returned only in getChat.", @@ -690,14 +698,6 @@ "rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "location", "required": false - }, - { - "type": "Integer", - "description": "Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", - "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", - "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "emoji_status_expiration_date", - "required": false } ], "category": "types" @@ -925,6 +925,14 @@ "name": "sticker", "required": false }, + { + "type": "Story", + "description": "Message is a forwarded story", + "html_description": "Optional. Message is a forwarded story", + "rst_description": "*Optional*. Message is a forwarded story\n", + "name": "story", + "required": false + }, { "type": "Video", "description": "Message is a video, information about the video", @@ -1276,14 +1284,6 @@ "rst_description": "*Optional*. Inline keyboard attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons.\n", "name": "reply_markup", "required": false - }, - { - "type": "Story", - "description": "Message is a forwarded story", - "html_description": "Optional. Message is a forwarded story", - "rst_description": "*Optional*. Message is a forwarded story\n", - "name": "story", - "required": false } ], "category": "types" @@ -1644,6 +1644,15 @@ ], "category": "types" }, + { + "anchor": "story", + "name": "Story", + "description": "This object represents a message about a forwarded story in the chat. Currently holds no information.", + "html_description": "

This object represents a message about a forwarded story in the chat. Currently holds no information.

", + "rst_description": "This object represents a message about a forwarded story in the chat. Currently holds no information.", + "annotations": [], + "category": "types" + }, { "anchor": "video", "name": "Video", @@ -1951,6 +1960,14 @@ "name": "poll_id", "required": true }, + { + "type": "Chat", + "description": "The chat that changed the answer to the poll, if the voter is anonymous", + "html_description": "Optional. The chat that changed the answer to the poll, if the voter is anonymous", + "rst_description": "*Optional*. The chat that changed the answer to the poll, if the voter is anonymous\n", + "name": "voter_chat", + "required": false + }, { "type": "User", "description": "The user that changed the answer to the poll, if the voter isn't anonymous", @@ -1966,14 +1983,6 @@ "rst_description": "0-based identifiers of chosen answer options. May be empty if the vote was retracted.\n", "name": "option_ids", "required": true - }, - { - "type": "Chat", - "description": "The chat that changed the answer to the poll, if the voter is anonymous", - "html_description": "Optional. The chat that changed the answer to the poll, if the voter is anonymous", - "rst_description": "*Optional*. The chat that changed the answer to the poll, if the voter is anonymous\n", - "name": "voter_chat", - "required": false } ], "category": "types" @@ -7969,6 +7978,24 @@ ], "category": "methods" }, + { + "anchor": "unpinallgeneralforumtopicmessages", + "name": "unpinAllGeneralForumTopicMessages", + "description": "Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.", + "html_description": "

Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.

", + "rst_description": "Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer or String", + "required": true, + "description": "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)", + "html_description": "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)", + "rst_description": "Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)\n", + "name": "chat_id" + } + ], + "category": "methods" + }, { "anchor": "answercallbackquery", "name": "answerCallbackQuery", @@ -13879,39 +13906,6 @@ } ], "description": "Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.\n - Games are a new type of content on Telegram, represented by the Game and InlineQueryResultGame objects.\n - Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame.\n - If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.\n - You can manually add multiple buttons to your game message. Please note that the first button in the first row must always launch the game, using the field callback_game in InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.\n - To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via BotFather (see Lumberjack for example).\n - A game message will also display high scores for the current chat. Use setGameScore to post high scores to the chat with the game, add the edit_message parameter to automatically update the message with the current scoreboard.\n - Use getGameHighScores to get data for in-game high score tables.\n - You can also add an extra sharing button for users to share their best score to different chats.\n - For examples of what can be done using this new stuff, check the @gamebot and @gamee bots." - }, - { - "title": "Upcoming update", - "anchor": "upcoming-update", - "children": [ - { - "anchor": "story", - "name": "Story", - "description": "This object represents a message about a forwarded story in the chat. Currently holds no information.", - "html_description": "

This object represents a message about a forwarded story in the chat. Currently holds no information.

", - "rst_description": "This object represents a message about a forwarded story in the chat. Currently holds no information.", - "annotations": [], - "category": "types" - }, - { - "anchor": "unpinallgeneralforumtopicmessages", - "name": "unpinAllGeneralForumTopicMessages", - "description": "Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.", - "html_description": "

Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.

", - "rst_description": "Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns :code:`True` on success.", - "annotations": [ - { - "type": "Integer or String", - "required": true, - "description": "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)", - "html_description": "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)", - "rst_description": "Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)\n", - "name": "chat_id" - } - ], - "category": "methods" - } - ] } ] } diff --git a/.butcher/types/Chat/entity.json b/.butcher/types/Chat/entity.json index 362e827a..4bc1fb60 100644 --- a/.butcher/types/Chat/entity.json +++ b/.butcher/types/Chat/entity.json @@ -91,6 +91,14 @@ "name": "emoji_status_custom_emoji_id", "required": false }, + { + "type": "Integer", + "description": "Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", + "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", + "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", + "name": "emoji_status_expiration_date", + "required": false + }, { "type": "String", "description": "Bio of the other party in a private chat. Returned only in getChat.", @@ -234,14 +242,6 @@ "rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", "name": "location", "required": false - }, - { - "type": "Integer", - "description": "Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", - "html_description": "Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.", - "rst_description": "*Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n", - "name": "emoji_status_expiration_date", - "required": false } ], "category": "types" diff --git a/.butcher/types/Chat/replace.yml b/.butcher/types/Chat/replace.yml new file mode 100644 index 00000000..93d76533 --- /dev/null +++ b/.butcher/types/Chat/replace.yml @@ -0,0 +1,5 @@ +annotations: + emoji_status_expiration_date: + parsed_type: + type: std + name: datetime.datetime diff --git a/.butcher/types/Message/entity.json b/.butcher/types/Message/entity.json index 47116105..ef639796 100644 --- a/.butcher/types/Message/entity.json +++ b/.butcher/types/Message/entity.json @@ -227,6 +227,14 @@ "name": "sticker", "required": false }, + { + "type": "Story", + "description": "Message is a forwarded story", + "html_description": "Optional. Message is a forwarded story", + "rst_description": "*Optional*. Message is a forwarded story\n", + "name": "story", + "required": false + }, { "type": "Video", "description": "Message is a video, information about the video", @@ -578,14 +586,6 @@ "rst_description": "*Optional*. Inline keyboard attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons.\n", "name": "reply_markup", "required": false - }, - { - "type": "Story", - "description": "Message is a forwarded story", - "html_description": "Optional. Message is a forwarded story", - "rst_description": "*Optional*. Message is a forwarded story\n", - "name": "story", - "required": false } ], "category": "types" diff --git a/.butcher/types/PollAnswer/entity.json b/.butcher/types/PollAnswer/entity.json index 5cf20ed7..3b14d6dc 100644 --- a/.butcher/types/PollAnswer/entity.json +++ b/.butcher/types/PollAnswer/entity.json @@ -19,6 +19,14 @@ "name": "poll_id", "required": true }, + { + "type": "Chat", + "description": "The chat that changed the answer to the poll, if the voter is anonymous", + "html_description": "Optional. The chat that changed the answer to the poll, if the voter is anonymous", + "rst_description": "*Optional*. The chat that changed the answer to the poll, if the voter is anonymous\n", + "name": "voter_chat", + "required": false + }, { "type": "User", "description": "The user that changed the answer to the poll, if the voter isn't anonymous", @@ -34,14 +42,6 @@ "rst_description": "0-based identifiers of chosen answer options. May be empty if the vote was retracted.\n", "name": "option_ids", "required": true - }, - { - "type": "Chat", - "description": "The chat that changed the answer to the poll, if the voter is anonymous", - "html_description": "Optional. The chat that changed the answer to the poll, if the voter is anonymous", - "rst_description": "*Optional*. The chat that changed the answer to the poll, if the voter is anonymous\n", - "name": "voter_chat", - "required": false } ], "category": "types" diff --git a/.butcher/types/Story/entity.json b/.butcher/types/Story/entity.json index 50407967..77ab9bea 100644 --- a/.butcher/types/Story/entity.json +++ b/.butcher/types/Story/entity.json @@ -1,8 +1,8 @@ { "meta": {}, "group": { - "title": "Upcoming update", - "anchor": "upcoming-update" + "title": "Available types", + "anchor": "available-types" }, "object": { "anchor": "story", diff --git a/aiogram/enums/content_type.py b/aiogram/enums/content_type.py index 41ae59c1..d34d878e 100644 --- a/aiogram/enums/content_type.py +++ b/aiogram/enums/content_type.py @@ -14,6 +14,7 @@ class ContentType(str, Enum): DOCUMENT = "document" PHOTO = "photo" STICKER = "sticker" + STORY = "story" VIDEO = "video" VIDEO_NOTE = "video_note" VOICE = "voice" @@ -55,4 +56,3 @@ class ContentType(str, Enum): VIDEO_CHAT_ENDED = "video_chat_ended" VIDEO_CHAT_PARTICIPANTS_INVITED = "video_chat_participants_invited" WEB_APP_DATA = "web_app_data" - STORY = "story" diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index 8045354b..2046eca8 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -70,6 +70,8 @@ class Chat(TelegramObject): """*Optional*. If non-empty, the list of all `active chat usernames `_; for private chats, supergroups and channels. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" emoji_status_custom_emoji_id: Optional[str] = None """*Optional*. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" + emoji_status_expiration_date: Optional[datetime.datetime] = None + """*Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" bio: Optional[str] = None """*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" has_private_forwards: Optional[bool] = None @@ -106,8 +108,6 @@ class Chat(TelegramObject): """*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" location: Optional[ChatLocation] = None """*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" - emoji_status_expiration_date: Optional[int] = None - """*Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -126,6 +126,7 @@ class Chat(TelegramObject): photo: Optional[ChatPhoto] = None, active_usernames: Optional[List[str]] = None, emoji_status_custom_emoji_id: Optional[str] = None, + emoji_status_expiration_date: Optional[datetime.datetime] = None, bio: Optional[str] = None, has_private_forwards: Optional[bool] = None, has_restricted_voice_and_video_messages: Optional[bool] = None, @@ -144,7 +145,6 @@ class Chat(TelegramObject): can_set_sticker_set: Optional[bool] = None, linked_chat_id: Optional[int] = None, location: Optional[ChatLocation] = None, - emoji_status_expiration_date: Optional[int] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -162,6 +162,7 @@ class Chat(TelegramObject): photo=photo, active_usernames=active_usernames, emoji_status_custom_emoji_id=emoji_status_custom_emoji_id, + emoji_status_expiration_date=emoji_status_expiration_date, bio=bio, has_private_forwards=has_private_forwards, has_restricted_voice_and_video_messages=has_restricted_voice_and_video_messages, @@ -180,7 +181,6 @@ class Chat(TelegramObject): can_set_sticker_set=can_set_sticker_set, linked_chat_id=linked_chat_id, location=location, - emoji_status_expiration_date=emoji_status_expiration_date, **__pydantic_kwargs, ) diff --git a/aiogram/types/message.py b/aiogram/types/message.py index 052bd3af..7e9c282a 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -161,6 +161,8 @@ class Message(TelegramObject): """*Optional*. Message is a photo, available sizes of the photo""" sticker: Optional[Sticker] = None """*Optional*. Message is a sticker, information about the sticker""" + story: Optional[Story] = None + """*Optional*. Message is a forwarded story""" video: Optional[Video] = None """*Optional*. Message is a video, information about the video""" video_note: Optional[VideoNote] = None @@ -249,8 +251,6 @@ class Message(TelegramObject): """*Optional*. Service message: data sent by a Web App""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. Inline keyboard attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons.""" - story: Optional[Story] = None - """*Optional*. Message is a forwarded story""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -286,6 +286,7 @@ class Message(TelegramObject): document: Optional[Document] = None, photo: Optional[List[PhotoSize]] = None, sticker: Optional[Sticker] = None, + story: Optional[Story] = None, video: Optional[Video] = None, video_note: Optional[VideoNote] = None, voice: Optional[Voice] = None, @@ -330,7 +331,6 @@ class Message(TelegramObject): video_chat_participants_invited: Optional[VideoChatParticipantsInvited] = None, web_app_data: Optional[WebAppData] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, - story: Optional[Story] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -365,6 +365,7 @@ class Message(TelegramObject): document=document, photo=photo, sticker=sticker, + story=story, video=video, video_note=video_note, voice=voice, @@ -409,7 +410,6 @@ class Message(TelegramObject): video_chat_participants_invited=video_chat_participants_invited, web_app_data=web_app_data, reply_markup=reply_markup, - story=story, **__pydantic_kwargs, ) diff --git a/aiogram/types/poll_answer.py b/aiogram/types/poll_answer.py index f9ed18e1..c12be34f 100644 --- a/aiogram/types/poll_answer.py +++ b/aiogram/types/poll_answer.py @@ -20,10 +20,10 @@ class PollAnswer(TelegramObject): """Unique poll identifier""" option_ids: List[int] """0-based identifiers of chosen answer options. May be empty if the vote was retracted.""" - user: Optional[User] = None - """*Optional*. The user that changed the answer to the poll, if the voter isn't anonymous""" voter_chat: Optional[Chat] = None """*Optional*. The chat that changed the answer to the poll, if the voter is anonymous""" + user: Optional[User] = None + """*Optional*. The user that changed the answer to the poll, if the voter isn't anonymous""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -34,8 +34,8 @@ class PollAnswer(TelegramObject): *, poll_id: str, option_ids: List[int], - user: Optional[User] = None, voter_chat: Optional[Chat] = None, + user: Optional[User] = None, **__pydantic_kwargs: Any, ) -> None: # DO NOT EDIT MANUALLY!!! @@ -45,7 +45,7 @@ class PollAnswer(TelegramObject): super().__init__( poll_id=poll_id, option_ids=option_ids, - user=user, voter_chat=voter_chat, + user=user, **__pydantic_kwargs, ) diff --git a/docs/api/methods/index.rst b/docs/api/methods/index.rst index 7ac61f6c..e63e35b7 100644 --- a/docs/api/methods/index.rst +++ b/docs/api/methods/index.rst @@ -86,6 +86,7 @@ Available methods unhide_general_forum_topic unpin_all_chat_messages unpin_all_forum_topic_messages + unpin_all_general_forum_topic_messages unpin_chat_message Payments @@ -165,14 +166,6 @@ Updating messages stop_message_live_location stop_poll -Upcoming update -=============== - -.. toctree:: - :maxdepth: 1 - - unpin_all_general_forum_topic_messages - Inline mode =========== diff --git a/docs/api/types/index.rst b/docs/api/types/index.rst index 7ff71075..20d71e22 100644 --- a/docs/api/types/index.rst +++ b/docs/api/types/index.rst @@ -123,6 +123,7 @@ Available types reply_keyboard_markup reply_keyboard_remove response_parameters + story switch_inline_query_chosen_chat user user_profile_photos @@ -204,11 +205,3 @@ Games callback_game game game_high_score - -Upcoming update -=============== - -.. toctree:: - :maxdepth: 1 - - story