diff --git a/.apiversion b/.apiversion index 2983cad0..cf022018 100644 --- a/.apiversion +++ b/.apiversion @@ -1 +1 @@ -8.2 +8.3 diff --git a/.butcher/enums/TransactionPartnerType.yml b/.butcher/enums/TransactionPartnerType.yml index a633d28a..26250867 100644 --- a/.butcher/enums/TransactionPartnerType.yml +++ b/.butcher/enums/TransactionPartnerType.yml @@ -13,3 +13,4 @@ multi_parse: - TransactionPartnerTelegramAds - TransactionPartnerTelegramApi - TransactionPartnerAffiliateProgram + - TransactionPartnerChat diff --git a/.butcher/methods/answerShippingQuery/entity.json b/.butcher/methods/answerShippingQuery/entity.json index 906f38ab..6320349c 100644 --- a/.butcher/methods/answerShippingQuery/entity.json +++ b/.butcher/methods/answerShippingQuery/entity.json @@ -38,9 +38,9 @@ { "type": "String", "required": false, - "description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. \"Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.", - "html_description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. \"Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.", - "rst_description": "Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. \"Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.\n", + "description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. 'Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.", + "html_description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user.", + "rst_description": "Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. 'Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.\n", "name": "error_message" } ], diff --git a/.butcher/methods/copyMessage/entity.json b/.butcher/methods/copyMessage/entity.json index 2558062e..9a6132e0 100644 --- a/.butcher/methods/copyMessage/entity.json +++ b/.butcher/methods/copyMessage/entity.json @@ -43,6 +43,14 @@ "rst_description": "Message identifier in the chat specified in *from_chat_id*\n", "name": "message_id" }, + { + "type": "Integer", + "required": false, + "description": "New start timestamp for the copied video in the message", + "html_description": "New start timestamp for the copied video in the message", + "rst_description": "New start timestamp for the copied video in the message\n", + "name": "video_start_timestamp" + }, { "type": "String", "required": false, diff --git a/.butcher/methods/copyMessage/replace.yml b/.butcher/methods/copyMessage/replace.yml new file mode 100644 index 00000000..52a3e0be --- /dev/null +++ b/.butcher/methods/copyMessage/replace.yml @@ -0,0 +1,11 @@ +annotations: + video_start_timestamp: + parsed_type: + type: union + items: + - type: std + name: datetime.datetime + - type: std + name: datetime.timedelta + - type: std + name: int diff --git a/.butcher/methods/forwardMessage/entity.json b/.butcher/methods/forwardMessage/entity.json index 2af7b0b4..7c5a688a 100644 --- a/.butcher/methods/forwardMessage/entity.json +++ b/.butcher/methods/forwardMessage/entity.json @@ -35,6 +35,14 @@ "rst_description": "Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)\n", "name": "from_chat_id" }, + { + "type": "Integer", + "required": false, + "description": "New start timestamp for the forwarded video in the message", + "html_description": "New start timestamp for the forwarded video in the message", + "rst_description": "New start timestamp for the forwarded video in the message\n", + "name": "video_start_timestamp" + }, { "type": "Boolean", "required": false, diff --git a/.butcher/methods/forwardMessage/replace.yml b/.butcher/methods/forwardMessage/replace.yml new file mode 100644 index 00000000..52a3e0be --- /dev/null +++ b/.butcher/methods/forwardMessage/replace.yml @@ -0,0 +1,11 @@ +annotations: + video_start_timestamp: + parsed_type: + type: union + items: + - type: std + name: datetime.datetime + - type: std + name: datetime.timedelta + - type: std + name: int diff --git a/.butcher/methods/getAvailableGifts/entity.json b/.butcher/methods/getAvailableGifts/entity.json index aa73b089..6ea51e70 100644 --- a/.butcher/methods/getAvailableGifts/entity.json +++ b/.butcher/methods/getAvailableGifts/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "getavailablegifts", "name": "getAvailableGifts", - "description": "Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object.", - "html_description": "

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

", - "rst_description": "Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object.", + "description": "Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.", + "html_description": "

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

", + "rst_description": "Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object.", "annotations": [], "category": "methods" } diff --git a/.butcher/methods/removeChatVerification/entity.json b/.butcher/methods/removeChatVerification/entity.json index 4828b2ca..907b16da 100644 --- a/.butcher/methods/removeChatVerification/entity.json +++ b/.butcher/methods/removeChatVerification/entity.json @@ -8,8 +8,8 @@ "anchor": "removechatverification", "name": "removeChatVerification", "description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.", - "html_description": "

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

", - "rst_description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.", + "html_description": "

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

", + "rst_description": "Removes verification from a chat that is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success.", "annotations": [ { "type": "Integer or String", diff --git a/.butcher/methods/removeUserVerification/entity.json b/.butcher/methods/removeUserVerification/entity.json index 87de37d8..769267e3 100644 --- a/.butcher/methods/removeUserVerification/entity.json +++ b/.butcher/methods/removeUserVerification/entity.json @@ -8,8 +8,8 @@ "anchor": "removeuserverification", "name": "removeUserVerification", "description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.", - "html_description": "

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

", - "rst_description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.", + "html_description": "

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

", + "rst_description": "Removes verification from a user who is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success.", "annotations": [ { "type": "Integer", diff --git a/.butcher/methods/sendGift/entity.json b/.butcher/methods/sendGift/entity.json index 56797cb4..83050afa 100644 --- a/.butcher/methods/sendGift/entity.json +++ b/.butcher/methods/sendGift/entity.json @@ -7,18 +7,26 @@ "object": { "anchor": "sendgift", "name": "sendGift", - "description": "Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success.", - "html_description": "

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

", - "rst_description": "Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns :code:`True` on success.", + "description": "Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.", + "html_description": "

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

", + "rst_description": "Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns :code:`True` on success.", "annotations": [ { "type": "Integer", - "required": true, - "description": "Unique identifier of the target user that will receive the gift", - "html_description": "Unique identifier of the target user that will receive the gift", - "rst_description": "Unique identifier of the target user that will receive the gift\n", + "required": false, + "description": "Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.", + "html_description": "Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.", + "rst_description": "Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift.\n", "name": "user_id" }, + { + "type": "Integer or String", + "required": false, + "description": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.", + "html_description": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.", + "rst_description": "Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift.\n", + "name": "chat_id" + }, { "type": "String", "required": true, diff --git a/.butcher/methods/sendVideo/entity.json b/.butcher/methods/sendVideo/entity.json index 5d1e021a..991e84e9 100644 --- a/.butcher/methods/sendVideo/entity.json +++ b/.butcher/methods/sendVideo/entity.json @@ -75,6 +75,22 @@ "rst_description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", "name": "thumbnail" }, + { + "type": "InputFile or String", + "required": false, + "description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. More information on Sending Files", + "html_description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »", + "rst_description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `\n", + "name": "cover" + }, + { + "type": "Integer", + "required": false, + "description": "Start timestamp for the video in the message", + "html_description": "Start timestamp for the video in the message", + "rst_description": "Start timestamp for the video in the message\n", + "name": "start_timestamp" + }, { "type": "String", "required": false, diff --git a/.butcher/methods/sendVideo/replace.yml b/.butcher/methods/sendVideo/replace.yml index ef7db8ff..044eceda 100644 --- a/.butcher/methods/sendVideo/replace.yml +++ b/.butcher/methods/sendVideo/replace.yml @@ -5,3 +5,13 @@ annotations: references: category: types name: InputFile + start_timestamp: + parsed_type: + type: union + items: + - type: std + name: datetime.datetime + - type: std + name: datetime.timedelta + - type: std + name: int diff --git a/.butcher/methods/setMessageReaction/entity.json b/.butcher/methods/setMessageReaction/entity.json index b79269da..98c0ebe1 100644 --- a/.butcher/methods/setMessageReaction/entity.json +++ b/.butcher/methods/setMessageReaction/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "setmessagereaction", "name": "setMessageReaction", - "description": "Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.", - "html_description": "

Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.

", - "rst_description": "Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success.", + "description": "Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.", + "html_description": "

Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.

", + "rst_description": "Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success.", "annotations": [ { "type": "Integer or String", diff --git a/.butcher/methods/verifyChat/entity.json b/.butcher/methods/verifyChat/entity.json index ee9bef83..22d4002e 100644 --- a/.butcher/methods/verifyChat/entity.json +++ b/.butcher/methods/verifyChat/entity.json @@ -8,8 +8,8 @@ "anchor": "verifychat", "name": "verifyChat", "description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.", - "html_description": "

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

", - "rst_description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success.", + "html_description": "

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

", + "rst_description": "Verifies a chat `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success.", "annotations": [ { "type": "Integer or String", diff --git a/.butcher/methods/verifyUser/entity.json b/.butcher/methods/verifyUser/entity.json index b95ec764..ab3a9522 100644 --- a/.butcher/methods/verifyUser/entity.json +++ b/.butcher/methods/verifyUser/entity.json @@ -8,8 +8,8 @@ "anchor": "verifyuser", "name": "verifyUser", "description": "Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.", - "html_description": "

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

", - "rst_description": "Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success.", + "html_description": "

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

", + "rst_description": "Verifies a user `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success.", "annotations": [ { "type": "Integer", diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index 4c915617..472e0cab 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -1,7 +1,7 @@ { "api": { - "version": "8.2", - "release_date": "2025-01-01" + "version": "8.3", + "release_date": "2025-02-12" }, "items": [ { @@ -869,6 +869,14 @@ "name": "permissions", "required": false }, + { + "type": "True", + "description": "True, if gifts can be sent to the chat", + "html_description": "Optional. True, if gifts can be sent to the chat", + "rst_description": "*Optional*. :code:`True`, if gifts can be sent to the chat\n", + "name": "can_send_gift", + "required": false + }, { "type": "True", "description": "True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.", @@ -2625,6 +2633,22 @@ "name": "thumbnail", "required": false }, + { + "type": "Array of PhotoSize", + "description": "Available sizes of the cover of the video in the message", + "html_description": "Optional. Available sizes of the cover of the video in the message", + "rst_description": "*Optional*. Available sizes of the cover of the video in the message\n", + "name": "cover", + "required": false + }, + { + "type": "Integer", + "description": "Timestamp in seconds from which the video will play in the message", + "html_description": "Optional. Timestamp in seconds from which the video will play in the message", + "rst_description": "*Optional*. Timestamp in seconds from which the video will play in the message\n", + "name": "start_timestamp", + "required": false + }, { "type": "String", "description": "Original filename as defined by the sender", @@ -7270,13 +7294,29 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", "name": "thumbnail", "required": false }, + { + "type": "String", + "description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. More information on Sending Files", + "html_description": "Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »", + "rst_description": "*Optional*. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `\n", + "name": "cover", + "required": false + }, + { + "type": "Integer", + "description": "Start timestamp for the video in the message", + "html_description": "Optional. Start timestamp for the video in the message", + "rst_description": "*Optional*. Start timestamp for the video in the message\n", + "name": "start_timestamp", + "required": false + }, { "type": "String", "description": "Caption of the video to be sent, 0-1024 characters after entities parsing", @@ -7376,7 +7416,7 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", @@ -7474,7 +7514,7 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", @@ -7556,7 +7596,7 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", @@ -7666,13 +7706,29 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", "name": "thumbnail", "required": false }, + { + "type": "String", + "description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. More information on Sending Files", + "html_description": "Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »", + "rst_description": "*Optional*. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `\n", + "name": "cover", + "required": false + }, + { + "type": "Integer", + "description": "Start timestamp for the video in the message", + "html_description": "Optional. Start timestamp for the video in the message", + "rst_description": "*Optional*. Start timestamp for the video in the message\n", + "name": "start_timestamp", + "required": false + }, { "type": "Integer", "description": "Video width", @@ -7887,6 +7943,14 @@ "rst_description": "Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`)\n", "name": "from_chat_id" }, + { + "type": "Integer", + "required": false, + "description": "New start timestamp for the forwarded video in the message", + "html_description": "New start timestamp for the forwarded video in the message", + "rst_description": "New start timestamp for the forwarded video in the message\n", + "name": "video_start_timestamp" + }, { "type": "Boolean", "required": false, @@ -8011,6 +8075,14 @@ "rst_description": "Message identifier in the chat specified in *from_chat_id*\n", "name": "message_id" }, + { + "type": "Integer", + "required": false, + "description": "New start timestamp for the copied video in the message", + "html_description": "New start timestamp for the copied video in the message", + "rst_description": "New start timestamp for the copied video in the message\n", + "name": "video_start_timestamp" + }, { "type": "String", "required": false, @@ -8629,6 +8701,22 @@ "rst_description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", "name": "thumbnail" }, + { + "type": "InputFile or String", + "required": false, + "description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. More information on Sending Files", + "html_description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »", + "rst_description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `\n", + "name": "cover" + }, + { + "type": "Integer", + "required": false, + "description": "Start timestamp for the video in the message", + "html_description": "Start timestamp for the video in the message", + "rst_description": "Start timestamp for the video in the message\n", + "name": "start_timestamp" + }, { "type": "String", "required": false, @@ -10049,9 +10137,9 @@ { "anchor": "setmessagereaction", "name": "setMessageReaction", - "description": "Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.", - "html_description": "

Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.

", - "rst_description": "Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success.", + "description": "Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.", + "html_description": "

Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.

", + "rst_description": "Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success.", "annotations": [ { "type": "Integer or String", @@ -13306,27 +13394,35 @@ { "anchor": "getavailablegifts", "name": "getAvailableGifts", - "description": "Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object.", - "html_description": "

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

", - "rst_description": "Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object.", + "description": "Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.", + "html_description": "

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

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

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

", - "rst_description": "Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns :code:`True` on success.", + "description": "Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.", + "html_description": "

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

", + "rst_description": "Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns :code:`True` on success.", "annotations": [ { "type": "Integer", - "required": true, - "description": "Unique identifier of the target user that will receive the gift", - "html_description": "Unique identifier of the target user that will receive the gift", - "rst_description": "Unique identifier of the target user that will receive the gift\n", + "required": false, + "description": "Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.", + "html_description": "Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.", + "rst_description": "Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift.\n", "name": "user_id" }, + { + "type": "Integer or String", + "required": false, + "description": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.", + "html_description": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.", + "rst_description": "Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift.\n", + "name": "chat_id" + }, { "type": "String", "required": true, @@ -13374,8 +13470,8 @@ "anchor": "verifyuser", "name": "verifyUser", "description": "Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.", - "html_description": "

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

", - "rst_description": "Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success.", + "html_description": "

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

", + "rst_description": "Verifies a user `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success.", "annotations": [ { "type": "Integer", @@ -13400,8 +13496,8 @@ "anchor": "verifychat", "name": "verifyChat", "description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.", - "html_description": "

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

", - "rst_description": "Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success.", + "html_description": "

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

", + "rst_description": "Verifies a chat `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success.", "annotations": [ { "type": "Integer or String", @@ -13426,8 +13522,8 @@ "anchor": "removeuserverification", "name": "removeUserVerification", "description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.", - "html_description": "

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

", - "rst_description": "Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.", + "html_description": "

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

", + "rst_description": "Removes verification from a user who is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success.", "annotations": [ { "type": "Integer", @@ -13444,8 +13540,8 @@ "anchor": "removechatverification", "name": "removeChatVerification", "description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.", - "html_description": "

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

", - "rst_description": "Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success.", + "html_description": "

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

", + "rst_description": "Removes verification from a chat that is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success.", "annotations": [ { "type": "Integer or String", @@ -16650,9 +16746,9 @@ { "type": "String", "required": false, - "description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. \"Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.", - "html_description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. \"Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.", - "rst_description": "Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. \"Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.\n", + "description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. 'Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.", + "html_description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user.", + "rst_description": "Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. 'Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.\n", "name": "error_message" } ], @@ -16991,9 +17087,9 @@ { "anchor": "successfulpayment", "name": "SuccessfulPayment", - "description": "This object contains basic information about a successful payment.", - "html_description": "

This object contains basic information about a successful payment.

", - "rst_description": "This object contains basic information about a successful payment.", + "description": "This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.", + "html_description": "

This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.

", + "rst_description": "This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.", "annotations": [ { "type": "String", @@ -17394,9 +17490,9 @@ { "anchor": "transactionpartner", "name": "TransactionPartner", - "description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n - TransactionPartnerUser\n - TransactionPartnerAffiliateProgram\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - TransactionPartnerOther", - "html_description": "

This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of

", - "rst_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n\n - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`\n - :class:`aiogram.types.transaction_partner_affiliate_program.TransactionPartnerAffiliateProgram`\n - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment`\n - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds`\n - :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi`\n - :class:`aiogram.types.transaction_partner_other.TransactionPartnerOther`", + "description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n - TransactionPartnerUser\n - TransactionPartnerChat\n - TransactionPartnerAffiliateProgram\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - TransactionPartnerOther", + "html_description": "

This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of

", + "rst_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n\n - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`\n - :class:`aiogram.types.transaction_partner_chat.TransactionPartnerChat`\n - :class:`aiogram.types.transaction_partner_affiliate_program.TransactionPartnerAffiliateProgram`\n - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment`\n - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds`\n - :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi`\n - :class:`aiogram.types.transaction_partner_other.TransactionPartnerOther`", "annotations": [], "category": "types" }, @@ -17474,6 +17570,40 @@ ], "category": "types" }, + { + "anchor": "transactionpartnerchat", + "name": "TransactionPartnerChat", + "description": "Describes a transaction with a chat.", + "html_description": "

Describes a transaction with a chat.

", + "rst_description": "Describes a transaction with a chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the transaction partner, always 'chat'", + "html_description": "Type of the transaction partner, always “chat”", + "rst_description": "Type of the transaction partner, always 'chat'\n", + "name": "type", + "required": true + }, + { + "type": "Chat", + "description": "Information about the chat", + "html_description": "Information about the chat", + "rst_description": "Information about the chat\n", + "name": "chat", + "required": true + }, + { + "type": "Gift", + "description": "The gift sent to the chat by the bot", + "html_description": "Optional. The gift sent to the chat by the bot", + "rst_description": "*Optional*. The gift sent to the chat by the bot\n", + "name": "gift", + "required": false + } + ], + "category": "types" + }, { "anchor": "transactionpartneraffiliateprogram", "name": "TransactionPartnerAffiliateProgram", @@ -17599,9 +17729,9 @@ { "anchor": "startransaction", "name": "StarTransaction", - "description": "Describes a Telegram Star transaction.", - "html_description": "

Describes a Telegram Star transaction.

", - "rst_description": "Describes a Telegram Star transaction.", + "description": "Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.", + "html_description": "

Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.

", + "rst_description": "Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.", "annotations": [ { "type": "String", diff --git a/.butcher/types/ChatFullInfo/entity.json b/.butcher/types/ChatFullInfo/entity.json index 0d7dac49..d95a8c4d 100644 --- a/.butcher/types/ChatFullInfo/entity.json +++ b/.butcher/types/ChatFullInfo/entity.json @@ -259,6 +259,14 @@ "name": "permissions", "required": false }, + { + "type": "True", + "description": "True, if gifts can be sent to the chat", + "html_description": "Optional. True, if gifts can be sent to the chat", + "rst_description": "*Optional*. :code:`True`, if gifts can be sent to the chat\n", + "name": "can_send_gift", + "required": false + }, { "type": "True", "description": "True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.", diff --git a/.butcher/types/InputMediaAnimation/entity.json b/.butcher/types/InputMediaAnimation/entity.json index e311a1ee..f64c7e1e 100644 --- a/.butcher/types/InputMediaAnimation/entity.json +++ b/.butcher/types/InputMediaAnimation/entity.json @@ -28,7 +28,7 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", diff --git a/.butcher/types/InputMediaAudio/entity.json b/.butcher/types/InputMediaAudio/entity.json index 5f10ad67..95af3e81 100644 --- a/.butcher/types/InputMediaAudio/entity.json +++ b/.butcher/types/InputMediaAudio/entity.json @@ -28,7 +28,7 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", diff --git a/.butcher/types/InputMediaDocument/entity.json b/.butcher/types/InputMediaDocument/entity.json index 676d6947..71be2aaa 100644 --- a/.butcher/types/InputMediaDocument/entity.json +++ b/.butcher/types/InputMediaDocument/entity.json @@ -28,7 +28,7 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", diff --git a/.butcher/types/InputMediaVideo/entity.json b/.butcher/types/InputMediaVideo/entity.json index f1dc1989..0dbf3767 100644 --- a/.butcher/types/InputMediaVideo/entity.json +++ b/.butcher/types/InputMediaVideo/entity.json @@ -28,13 +28,29 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", "name": "thumbnail", "required": false }, + { + "type": "String", + "description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. More information on Sending Files", + "html_description": "Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »", + "rst_description": "*Optional*. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `\n", + "name": "cover", + "required": false + }, + { + "type": "Integer", + "description": "Start timestamp for the video in the message", + "html_description": "Optional. Start timestamp for the video in the message", + "rst_description": "*Optional*. Start timestamp for the video in the message\n", + "name": "start_timestamp", + "required": false + }, { "type": "String", "description": "Caption of the video to be sent, 0-1024 characters after entities parsing", diff --git a/.butcher/types/InputMediaVideo/replace.yml b/.butcher/types/InputMediaVideo/replace.yml index efa1d506..c7ee44f0 100644 --- a/.butcher/types/InputMediaVideo/replace.yml +++ b/.butcher/types/InputMediaVideo/replace.yml @@ -9,9 +9,29 @@ annotations: references: category: types name: InputFile + cover: + parsed_type: + type: union + items: + - type: std + name: str + - type: entity + references: + category: types + name: InputFile thumbnail: parsed_type: type: entity references: category: types name: InputFile + start_timestamp: + parsed_type: + type: union + items: + - type: std + name: datetime.datetime + - type: std + name: datetime.timedelta + - type: std + name: int diff --git a/.butcher/types/InputPaidMediaVideo/entity.json b/.butcher/types/InputPaidMediaVideo/entity.json index a04bf3df..9ba408e5 100644 --- a/.butcher/types/InputPaidMediaVideo/entity.json +++ b/.butcher/types/InputPaidMediaVideo/entity.json @@ -28,13 +28,29 @@ "required": true }, { - "type": "InputFile or String", + "type": "String", "description": "Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files", "html_description": "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »", "rst_description": "*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `\n", "name": "thumbnail", "required": false }, + { + "type": "String", + "description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. More information on Sending Files", + "html_description": "Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »", + "rst_description": "*Optional*. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `\n", + "name": "cover", + "required": false + }, + { + "type": "Integer", + "description": "Start timestamp for the video in the message", + "html_description": "Optional. Start timestamp for the video in the message", + "rst_description": "*Optional*. Start timestamp for the video in the message\n", + "name": "start_timestamp", + "required": false + }, { "type": "Integer", "description": "Video width", diff --git a/.butcher/types/InputPaidMediaVideo/replace.yml b/.butcher/types/InputPaidMediaVideo/replace.yml index 17ac606b..c7ee44f0 100644 --- a/.butcher/types/InputPaidMediaVideo/replace.yml +++ b/.butcher/types/InputPaidMediaVideo/replace.yml @@ -9,3 +9,29 @@ annotations: references: category: types name: InputFile + cover: + parsed_type: + type: union + items: + - type: std + name: str + - type: entity + references: + category: types + name: InputFile + thumbnail: + parsed_type: + type: entity + references: + category: types + name: InputFile + start_timestamp: + parsed_type: + type: union + items: + - type: std + name: datetime.datetime + - type: std + name: datetime.timedelta + - type: std + name: int diff --git a/.butcher/types/StarTransaction/entity.json b/.butcher/types/StarTransaction/entity.json index 4186788a..7c4dd49b 100644 --- a/.butcher/types/StarTransaction/entity.json +++ b/.butcher/types/StarTransaction/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "startransaction", "name": "StarTransaction", - "description": "Describes a Telegram Star transaction.", - "html_description": "

Describes a Telegram Star transaction.

", - "rst_description": "Describes a Telegram Star transaction.", + "description": "Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.", + "html_description": "

Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.

", + "rst_description": "Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.", "annotations": [ { "type": "String", diff --git a/.butcher/types/SuccessfulPayment/entity.json b/.butcher/types/SuccessfulPayment/entity.json index bb1fe445..6a680660 100644 --- a/.butcher/types/SuccessfulPayment/entity.json +++ b/.butcher/types/SuccessfulPayment/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "successfulpayment", "name": "SuccessfulPayment", - "description": "This object contains basic information about a successful payment.", - "html_description": "

This object contains basic information about a successful payment.

", - "rst_description": "This object contains basic information about a successful payment.", + "description": "This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.", + "html_description": "

This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.

", + "rst_description": "This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.", "annotations": [ { "type": "String", diff --git a/.butcher/types/TransactionPartner/entity.json b/.butcher/types/TransactionPartner/entity.json index 8c01706b..0216005e 100644 --- a/.butcher/types/TransactionPartner/entity.json +++ b/.butcher/types/TransactionPartner/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "transactionpartner", "name": "TransactionPartner", - "description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n - TransactionPartnerUser\n - TransactionPartnerAffiliateProgram\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - TransactionPartnerOther", - "html_description": "

This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of

", - "rst_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n\n - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`\n - :class:`aiogram.types.transaction_partner_affiliate_program.TransactionPartnerAffiliateProgram`\n - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment`\n - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds`\n - :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi`\n - :class:`aiogram.types.transaction_partner_other.TransactionPartnerOther`", + "description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n - TransactionPartnerUser\n - TransactionPartnerChat\n - TransactionPartnerAffiliateProgram\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - TransactionPartnerOther", + "html_description": "

This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of

", + "rst_description": "This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of\n\n - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`\n - :class:`aiogram.types.transaction_partner_chat.TransactionPartnerChat`\n - :class:`aiogram.types.transaction_partner_affiliate_program.TransactionPartnerAffiliateProgram`\n - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment`\n - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds`\n - :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi`\n - :class:`aiogram.types.transaction_partner_other.TransactionPartnerOther`", "annotations": [], "category": "types" } diff --git a/.butcher/types/TransactionPartnerChat/entity.json b/.butcher/types/TransactionPartnerChat/entity.json new file mode 100644 index 00000000..be4e3bc4 --- /dev/null +++ b/.butcher/types/TransactionPartnerChat/entity.json @@ -0,0 +1,41 @@ +{ + "meta": {}, + "group": { + "title": "Payments", + "anchor": "payments" + }, + "object": { + "anchor": "transactionpartnerchat", + "name": "TransactionPartnerChat", + "description": "Describes a transaction with a chat.", + "html_description": "

Describes a transaction with a chat.

", + "rst_description": "Describes a transaction with a chat.", + "annotations": [ + { + "type": "String", + "description": "Type of the transaction partner, always 'chat'", + "html_description": "Type of the transaction partner, always “chat”", + "rst_description": "Type of the transaction partner, always 'chat'\n", + "name": "type", + "required": true + }, + { + "type": "Chat", + "description": "Information about the chat", + "html_description": "Information about the chat", + "rst_description": "Information about the chat\n", + "name": "chat", + "required": true + }, + { + "type": "Gift", + "description": "The gift sent to the chat by the bot", + "html_description": "Optional. The gift sent to the chat by the bot", + "rst_description": "*Optional*. The gift sent to the chat by the bot\n", + "name": "gift", + "required": false + } + ], + "category": "types" + } +} diff --git a/.butcher/types/Video/entity.json b/.butcher/types/Video/entity.json index b025a605..d62323ee 100644 --- a/.butcher/types/Video/entity.json +++ b/.butcher/types/Video/entity.json @@ -59,6 +59,22 @@ "name": "thumbnail", "required": false }, + { + "type": "Array of PhotoSize", + "description": "Available sizes of the cover of the video in the message", + "html_description": "Optional. Available sizes of the cover of the video in the message", + "rst_description": "*Optional*. Available sizes of the cover of the video in the message\n", + "name": "cover", + "required": false + }, + { + "type": "Integer", + "description": "Timestamp in seconds from which the video will play in the message", + "html_description": "Optional. Timestamp in seconds from which the video will play in the message", + "rst_description": "*Optional*. Timestamp in seconds from which the video will play in the message\n", + "name": "start_timestamp", + "required": false + }, { "type": "String", "description": "Original filename as defined by the sender", diff --git a/.butcher/types/Video/replace.yml b/.butcher/types/Video/replace.yml new file mode 100644 index 00000000..21adcdaa --- /dev/null +++ b/.butcher/types/Video/replace.yml @@ -0,0 +1,5 @@ +annotations: + start_timestamp: + parsed_type: + type: std + name: datetime.datetime diff --git a/CHANGES/1638.feature.rst b/CHANGES/1638.feature.rst new file mode 100644 index 00000000..b36a4f6a --- /dev/null +++ b/CHANGES/1638.feature.rst @@ -0,0 +1,10 @@ +Added full support for the `Bot API 8.3 `_: + +- Added the parameter :code:`chat_id` to the method :class:`aiogram.methods.send_gift.SendGift`, allowing bots to send gifts to channel chats. +- Added the field :code:`can_send_gift` to the class :class:`aiogram.types.chat_full_info.ChatFullInfo`. +- Added the class :class:`aiogram.types.transaction_partner_chat.TransactionPartnerChat` describing transactions with chats. +- Added the fields :code:`cover` and :code:`start_timestamp` to the class :class:`aiogram.types.video.Video`, containing a message-specific cover and a start timestamp for the video. +- Added the parameters :code:`cover` and :code:`start_timestamp` to the method :class:`aiogram.methods.send_video.SendVideo`, allowing bots to specify a cover and a start timestamp for the videos they send. +- Added the fields :code:`cover` and :code:`start_timestamp` to the classes :class:`aiogram.types.input_media_video.InputMediaVideo` and :class:`aiogram.types.input_paid_media_video.InputPaidMediaVideo`, allowing bots to edit video covers and start timestamps, and specify them for videos in albums and paid media. +- Added the parameter :code:`video_start_timestamp` to the methods :class:`aiogram.methods.forward_message.ForwardMessage` and :class:`aiogram.methods.copy_message.CopyMessage`, allowing bots to change the start timestamp for forwarded and copied videos. +- Allowed adding reactions to most types of service messages. diff --git a/README.rst b/README.rst index af938312..02ae7877 100644 --- a/README.rst +++ b/README.rst @@ -52,7 +52,7 @@ Features - Asynchronous (`asyncio docs `_, :pep:`492`) - Has type hints (:pep:`484`) and can be used with `mypy `_ - Supports `PyPy `_ -- Supports `Telegram Bot API 8.2 `_ and gets fast updates to the latest versions of the Bot API +- Supports `Telegram Bot API 8.3 `_ and gets fast updates to the latest versions of the Bot API - Telegram Bot API integration code was `autogenerated `_ and can be easily re-generated when API gets updated - Updates router (Blueprints) - Has Finite State Machine diff --git a/aiogram/__meta__.py b/aiogram/__meta__.py index b04fd4ce..ecd2ca4d 100644 --- a/aiogram/__meta__.py +++ b/aiogram/__meta__.py @@ -1,2 +1,2 @@ -__version__ = "3.17.0" -__api_version__ = "8.2" +__version__ = "3.18.0" +__api_version__ = "8.3" diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index 9848d7bb..f3e859f5 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -684,7 +684,7 @@ class Bot: :param shipping_query_id: Unique identifier for the query to be answered :param ok: Pass :code:`True` if delivery to the specified address is possible and :code:`False` if there are any problems (for example, if delivery to the specified address is not possible) :param shipping_options: Required if *ok* is :code:`True`. A JSON-serialized array of available shipping options. - :param error_message: Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. + :param error_message: Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. 'Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. :param request_timeout: Request timeout :return: On success, :code:`True` is returned. """ @@ -861,6 +861,7 @@ class Bot: from_chat_id: Union[int, str], message_id: int, message_thread_id: Optional[int] = None, + video_start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -887,6 +888,7 @@ class Bot: :param from_chat_id: Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`) :param message_id: Message identifier in the chat specified in *from_chat_id* :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param video_start_timestamp: New start timestamp for the copied video in the message :param caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept :param parse_mode: Mode for parsing entities in the new caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode* @@ -907,6 +909,7 @@ class Bot: from_chat_id=from_chat_id, message_id=message_id, message_thread_id=message_thread_id, + video_start_timestamp=video_start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, @@ -1615,6 +1618,7 @@ class Bot: from_chat_id: Union[int, str], message_id: int, message_thread_id: Optional[int] = None, + video_start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), request_timeout: Optional[int] = None, @@ -1628,6 +1632,7 @@ class Bot: :param from_chat_id: Unique identifier for the chat where the original message was sent (or channel username in the format :code:`@channelusername`) :param message_id: Message identifier in the chat specified in *from_chat_id* :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param video_start_timestamp: New start timestamp for the forwarded video in the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the forwarded message from forwarding and saving :param request_timeout: Request timeout @@ -1639,6 +1644,7 @@ class Bot: from_chat_id=from_chat_id, message_id=message_id, message_thread_id=message_thread_id, + video_start_timestamp=video_start_timestamp, disable_notification=disable_notification, protect_content=protect_content, ) @@ -3275,6 +3281,8 @@ class Bot: width: Optional[int] = None, height: Optional[int] = None, thumbnail: Optional[InputFile] = None, + cover: Optional[Union[InputFile, str]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -3308,6 +3316,8 @@ class Bot: :param width: Video width :param height: Video height :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` + :param cover: Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » ` + :param start_timestamp: Start timestamp for the video in the message :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* @@ -3335,6 +3345,8 @@ class Bot: width=width, height=height, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, @@ -4607,7 +4619,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success. + Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setmessagereaction @@ -4869,7 +4881,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> Gifts: """ - Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object. + Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object. Source: https://core.telegram.org/bots/api#getavailablegifts @@ -4938,8 +4950,9 @@ class Bot: async def send_gift( self, - user_id: int, gift_id: str, + user_id: Optional[int] = None, + chat_id: Optional[Union[int, str]] = None, pay_for_upgrade: Optional[bool] = None, text: Optional[str] = None, text_parse_mode: Optional[str] = None, @@ -4947,12 +4960,13 @@ class Bot: request_timeout: Optional[int] = None, ) -> bool: """ - Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns :code:`True` on success. + Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#sendgift - :param user_id: Unique identifier of the target user that will receive the gift :param gift_id: Identifier of the gift + :param user_id: Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift. + :param chat_id: Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift. :param pay_for_upgrade: Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver :param text: Text that will be shown along with the gift; 0-255 characters :param text_parse_mode: Mode for parsing entities in the text. See `formatting options `_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored. @@ -4962,8 +4976,9 @@ class Bot: """ call = SendGift( - user_id=user_id, gift_id=gift_id, + user_id=user_id, + chat_id=chat_id, pay_for_upgrade=pay_for_upgrade, text=text, text_parse_mode=text_parse_mode, @@ -5005,7 +5020,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> bool: """ - Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success. + Removes verification from a chat that is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#removechatverification @@ -5025,7 +5040,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> bool: """ - Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success. + Removes verification from a user who is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#removeuserverification @@ -5046,7 +5061,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> bool: """ - Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success. + Verifies a chat `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#verifychat @@ -5069,7 +5084,7 @@ class Bot: request_timeout: Optional[int] = None, ) -> bool: """ - Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success. + Verifies a user `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#verifyuser diff --git a/aiogram/client/session/aiohttp.py b/aiogram/client/session/aiohttp.py index 69f36bf1..b832af62 100644 --- a/aiogram/client/session/aiohttp.py +++ b/aiogram/client/session/aiohttp.py @@ -38,7 +38,7 @@ _ProxyType = Union[_ProxyChain, _ProxyBasic] def _retrieve_basic(basic: _ProxyBasic) -> Dict[str, Any]: - from aiohttp_socks.utils import parse_proxy_url # type: ignore + from aiohttp_socks.utils import parse_proxy_url proxy_auth: Optional[BasicAuth] = None @@ -63,11 +63,7 @@ def _retrieve_basic(basic: _ProxyBasic) -> Dict[str, Any]: def _prepare_connector(chain_or_plain: _ProxyType) -> Tuple[Type["TCPConnector"], Dict[str, Any]]: - from aiohttp_socks import ( # type: ignore - ChainProxyConnector, - ProxyConnector, - ProxyInfo, - ) + from aiohttp_socks import ChainProxyConnector, ProxyConnector, ProxyInfo # since tuple is Iterable(compatible with _ProxyChain) object, we assume that # user wants chained proxies if tuple is a pair of string(url) and BasicAuth diff --git a/aiogram/enums/transaction_partner_type.py b/aiogram/enums/transaction_partner_type.py index ec84318a..4f683e2e 100644 --- a/aiogram/enums/transaction_partner_type.py +++ b/aiogram/enums/transaction_partner_type.py @@ -14,3 +14,4 @@ class TransactionPartnerType(str, Enum): TELEGRAM_ADS = "telegram_ads" TELEGRAM_API = "telegram_api" AFFILIATE_PROGRAM = "affiliate_program" + CHAT = "chat" diff --git a/aiogram/methods/answer_shipping_query.py b/aiogram/methods/answer_shipping_query.py index 48febb01..eec59864 100644 --- a/aiogram/methods/answer_shipping_query.py +++ b/aiogram/methods/answer_shipping_query.py @@ -23,7 +23,7 @@ class AnswerShippingQuery(TelegramMethod[bool]): shipping_options: Optional[list[ShippingOption]] = None """Required if *ok* is :code:`True`. A JSON-serialized array of available shipping options.""" error_message: Optional[str] = None - """Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.""" + """Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. 'Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/methods/copy_message.py b/aiogram/methods/copy_message.py index 11b931fa..562c99c0 100644 --- a/aiogram/methods/copy_message.py +++ b/aiogram/methods/copy_message.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime from typing import TYPE_CHECKING, Any, Optional, Union from pydantic import Field @@ -35,6 +36,8 @@ class CopyMessage(TelegramMethod[MessageId]): """Message identifier in the chat specified in *from_chat_id*""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" + video_start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None + """New start timestamp for the copied video in the message""" caption: Optional[str] = None """New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") @@ -79,6 +82,9 @@ class CopyMessage(TelegramMethod[MessageId]): from_chat_id: Union[int, str], message_id: int, message_thread_id: Optional[int] = None, + video_start_timestamp: Optional[ + Union[datetime.datetime, datetime.timedelta, int] + ] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -105,6 +111,7 @@ class CopyMessage(TelegramMethod[MessageId]): from_chat_id=from_chat_id, message_id=message_id, message_thread_id=message_thread_id, + video_start_timestamp=video_start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, diff --git a/aiogram/methods/forward_message.py b/aiogram/methods/forward_message.py index f82ace02..0d35e2b3 100644 --- a/aiogram/methods/forward_message.py +++ b/aiogram/methods/forward_message.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime from typing import TYPE_CHECKING, Any, Optional, Union from ..client.default import Default @@ -25,6 +26,8 @@ class ForwardMessage(TelegramMethod[Message]): """Message identifier in the chat specified in *from_chat_id*""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" + video_start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None + """New start timestamp for the forwarded video in the message""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") @@ -41,6 +44,9 @@ class ForwardMessage(TelegramMethod[Message]): from_chat_id: Union[int, str], message_id: int, message_thread_id: Optional[int] = None, + video_start_timestamp: Optional[ + Union[datetime.datetime, datetime.timedelta, int] + ] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), **__pydantic_kwargs: Any, @@ -54,6 +60,7 @@ class ForwardMessage(TelegramMethod[Message]): from_chat_id=from_chat_id, message_id=message_id, message_thread_id=message_thread_id, + video_start_timestamp=video_start_timestamp, disable_notification=disable_notification, protect_content=protect_content, **__pydantic_kwargs, diff --git a/aiogram/methods/get_available_gifts.py b/aiogram/methods/get_available_gifts.py index 91290140..464eefc9 100644 --- a/aiogram/methods/get_available_gifts.py +++ b/aiogram/methods/get_available_gifts.py @@ -6,7 +6,7 @@ from .base import TelegramMethod class GetAvailableGifts(TelegramMethod[Gifts]): """ - Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object. + Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a :class:`aiogram.types.gifts.Gifts` object. Source: https://core.telegram.org/bots/api#getavailablegifts """ diff --git a/aiogram/methods/remove_chat_verification.py b/aiogram/methods/remove_chat_verification.py index ff242c48..1cd2cc81 100644 --- a/aiogram/methods/remove_chat_verification.py +++ b/aiogram/methods/remove_chat_verification.py @@ -7,7 +7,7 @@ from .base import TelegramMethod class RemoveChatVerification(TelegramMethod[bool]): """ - Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success. + Removes verification from a chat that is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#removechatverification """ diff --git a/aiogram/methods/remove_user_verification.py b/aiogram/methods/remove_user_verification.py index 0cd4b4c8..91b3b536 100644 --- a/aiogram/methods/remove_user_verification.py +++ b/aiogram/methods/remove_user_verification.py @@ -7,7 +7,7 @@ from .base import TelegramMethod class RemoveUserVerification(TelegramMethod[bool]): """ - Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns :code:`True` on success. + Removes verification from a user who is currently verified `on behalf of the organization `_ represented by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#removeuserverification """ diff --git a/aiogram/methods/send_gift.py b/aiogram/methods/send_gift.py index 73b6ab60..e666c75f 100644 --- a/aiogram/methods/send_gift.py +++ b/aiogram/methods/send_gift.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Optional +from typing import TYPE_CHECKING, Any, Optional, Union from ..types.message_entity import MessageEntity from .base import TelegramMethod @@ -8,7 +8,7 @@ from .base import TelegramMethod class SendGift(TelegramMethod[bool]): """ - Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns :code:`True` on success. + Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#sendgift """ @@ -16,10 +16,12 @@ class SendGift(TelegramMethod[bool]): __returning__ = bool __api_method__ = "sendGift" - user_id: int - """Unique identifier of the target user that will receive the gift""" gift_id: str """Identifier of the gift""" + user_id: Optional[int] = None + """Required if *chat_id* is not specified. Unique identifier of the target user who will receive the gift.""" + chat_id: Optional[Union[int, str]] = None + """Required if *user_id* is not specified. Unique identifier for the chat or username of the channel (in the format :code:`@channelusername`) that will receive the gift.""" pay_for_upgrade: Optional[bool] = None """Pass :code:`True` to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver""" text: Optional[str] = None @@ -36,8 +38,9 @@ class SendGift(TelegramMethod[bool]): def __init__( __pydantic__self__, *, - user_id: int, gift_id: str, + user_id: Optional[int] = None, + chat_id: Optional[Union[int, str]] = None, pay_for_upgrade: Optional[bool] = None, text: Optional[str] = None, text_parse_mode: Optional[str] = None, @@ -49,8 +52,9 @@ class SendGift(TelegramMethod[bool]): # Is needed only for type checking and IDE support without any additional plugins super().__init__( - user_id=user_id, gift_id=gift_id, + user_id=user_id, + chat_id=chat_id, pay_for_upgrade=pay_for_upgrade, text=text, text_parse_mode=text_parse_mode, diff --git a/aiogram/methods/send_video.py b/aiogram/methods/send_video.py index a7486511..b3e7271c 100644 --- a/aiogram/methods/send_video.py +++ b/aiogram/methods/send_video.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime from typing import TYPE_CHECKING, Any, Optional, Union from pydantic import Field @@ -44,6 +45,10 @@ class SendVideo(TelegramMethod[Message]): """Video height""" thumbnail: Optional[InputFile] = None """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `""" + cover: Optional[Union[InputFile, str]] = None + """Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `""" + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None + """Start timestamp for the video in the message""" caption: Optional[str] = None """Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") @@ -98,6 +103,8 @@ class SendVideo(TelegramMethod[Message]): width: Optional[int] = None, height: Optional[int] = None, thumbnail: Optional[InputFile] = None, + cover: Optional[Union[InputFile, str]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -131,6 +138,8 @@ class SendVideo(TelegramMethod[Message]): width=width, height=height, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, diff --git a/aiogram/methods/set_message_reaction.py b/aiogram/methods/set_message_reaction.py index 90fd71f4..923edaa8 100644 --- a/aiogram/methods/set_message_reaction.py +++ b/aiogram/methods/set_message_reaction.py @@ -6,7 +6,7 @@ from .base import TelegramMethod class SetMessageReaction(TelegramMethod[bool]): """ - Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success. + Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setmessagereaction """ diff --git a/aiogram/methods/verify_chat.py b/aiogram/methods/verify_chat.py index 9f1c36e4..4154219f 100644 --- a/aiogram/methods/verify_chat.py +++ b/aiogram/methods/verify_chat.py @@ -7,7 +7,7 @@ from .base import TelegramMethod class VerifyChat(TelegramMethod[bool]): """ - Verifies a chat on behalf of the organization which is represented by the bot. Returns :code:`True` on success. + Verifies a chat `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#verifychat """ diff --git a/aiogram/methods/verify_user.py b/aiogram/methods/verify_user.py index 3518dfaf..449081ba 100644 --- a/aiogram/methods/verify_user.py +++ b/aiogram/methods/verify_user.py @@ -7,7 +7,7 @@ from .base import TelegramMethod class VerifyUser(TelegramMethod[bool]): """ - Verifies a user on behalf of the organization which is represented by the bot. Returns :code:`True` on success. + Verifies a user `on behalf of the organization `_ which is represented by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#verifyuser """ diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index 8f695d23..8966b4db 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -218,6 +218,7 @@ from .switch_inline_query_chosen_chat import SwitchInlineQueryChosenChat from .text_quote import TextQuote from .transaction_partner import TransactionPartner from .transaction_partner_affiliate_program import TransactionPartnerAffiliateProgram +from .transaction_partner_chat import TransactionPartnerChat from .transaction_partner_fragment import TransactionPartnerFragment from .transaction_partner_other import TransactionPartnerOther from .transaction_partner_telegram_ads import TransactionPartnerTelegramAds @@ -460,6 +461,7 @@ __all__ = ( "TextQuote", "TransactionPartner", "TransactionPartnerAffiliateProgram", + "TransactionPartnerChat", "TransactionPartnerFragment", "TransactionPartnerOther", "TransactionPartnerTelegramAds", diff --git a/aiogram/types/chat_full_info.py b/aiogram/types/chat_full_info.py index c73e4506..85f11060 100644 --- a/aiogram/types/chat_full_info.py +++ b/aiogram/types/chat_full_info.py @@ -90,6 +90,8 @@ class ChatFullInfo(Chat): """*Optional*. The most recent pinned message (by sending date)""" permissions: Optional[ChatPermissions] = None """*Optional*. Default chat member permissions, for groups and supergroups""" + can_send_gift: Optional[bool] = None + """*Optional*. :code:`True`, if gifts can be sent to the chat""" can_send_paid_media: Optional[bool] = None """*Optional*. :code:`True`, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.""" slow_mode_delay: Optional[int] = None @@ -157,6 +159,7 @@ class ChatFullInfo(Chat): invite_link: Optional[str] = None, pinned_message: Optional[Message] = None, permissions: Optional[ChatPermissions] = None, + can_send_gift: Optional[bool] = None, can_send_paid_media: Optional[bool] = None, slow_mode_delay: Optional[int] = None, unrestrict_boost_count: Optional[int] = None, @@ -208,6 +211,7 @@ class ChatFullInfo(Chat): invite_link=invite_link, pinned_message=pinned_message, permissions=permissions, + can_send_gift=can_send_gift, can_send_paid_media=can_send_paid_media, slow_mode_delay=slow_mode_delay, unrestrict_boost_count=unrestrict_boost_count, diff --git a/aiogram/types/chat_join_request.py b/aiogram/types/chat_join_request.py index 36bc67fc..65753890 100644 --- a/aiogram/types/chat_join_request.py +++ b/aiogram/types/chat_join_request.py @@ -2340,6 +2340,8 @@ class ChatJoinRequest(TelegramObject): width: Optional[int] = None, height: Optional[int] = None, thumbnail: Optional[InputFile] = None, + cover: Optional[Union[InputFile, str]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -2377,6 +2379,8 @@ class ChatJoinRequest(TelegramObject): :param width: Video width :param height: Video height :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` + :param cover: Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » ` + :param start_timestamp: Start timestamp for the video in the message :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* @@ -2407,6 +2411,8 @@ class ChatJoinRequest(TelegramObject): width=width, height=height, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, @@ -2433,6 +2439,8 @@ class ChatJoinRequest(TelegramObject): width: Optional[int] = None, height: Optional[int] = None, thumbnail: Optional[InputFile] = None, + cover: Optional[Union[InputFile, str]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -2470,6 +2478,8 @@ class ChatJoinRequest(TelegramObject): :param width: Video width :param height: Video height :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` + :param cover: Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » ` + :param start_timestamp: Start timestamp for the video in the message :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* @@ -2500,6 +2510,8 @@ class ChatJoinRequest(TelegramObject): width=width, height=height, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, diff --git a/aiogram/types/chat_member_updated.py b/aiogram/types/chat_member_updated.py index a418fdd6..297fbf74 100644 --- a/aiogram/types/chat_member_updated.py +++ b/aiogram/types/chat_member_updated.py @@ -1236,6 +1236,8 @@ class ChatMemberUpdated(TelegramObject): width: Optional[int] = None, height: Optional[int] = None, thumbnail: Optional[InputFile] = None, + cover: Optional[Union[InputFile, str]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -1273,6 +1275,8 @@ class ChatMemberUpdated(TelegramObject): :param width: Video width :param height: Video height :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` + :param cover: Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » ` + :param start_timestamp: Start timestamp for the video in the message :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* @@ -1303,6 +1307,8 @@ class ChatMemberUpdated(TelegramObject): width=width, height=height, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, diff --git a/aiogram/types/inaccessible_message.py b/aiogram/types/inaccessible_message.py index c4d48265..a4c38aac 100644 --- a/aiogram/types/inaccessible_message.py +++ b/aiogram/types/inaccessible_message.py @@ -2320,6 +2320,8 @@ class InaccessibleMessage(MaybeInaccessibleMessage): width: Optional[int] = None, height: Optional[int] = None, thumbnail: Optional[InputFile] = None, + cover: Optional[Union[InputFile, str]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -2357,6 +2359,8 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :param width: Video width :param height: Video height :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` + :param cover: Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » ` + :param start_timestamp: Start timestamp for the video in the message :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* @@ -2391,6 +2395,8 @@ class InaccessibleMessage(MaybeInaccessibleMessage): width=width, height=height, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, @@ -2417,6 +2423,8 @@ class InaccessibleMessage(MaybeInaccessibleMessage): width: Optional[int] = None, height: Optional[int] = None, thumbnail: Optional[InputFile] = None, + cover: Optional[Union[InputFile, str]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -2453,6 +2461,8 @@ class InaccessibleMessage(MaybeInaccessibleMessage): :param width: Video width :param height: Video height :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` + :param cover: Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » ` + :param start_timestamp: Start timestamp for the video in the message :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* @@ -2486,6 +2496,8 @@ class InaccessibleMessage(MaybeInaccessibleMessage): width=width, height=height, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, diff --git a/aiogram/types/input_media_video.py b/aiogram/types/input_media_video.py index 611556a9..f0fc47ee 100644 --- a/aiogram/types/input_media_video.py +++ b/aiogram/types/input_media_video.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..client.default import Default @@ -24,6 +25,10 @@ class InputMediaVideo(InputMedia): """File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `""" thumbnail: Optional[InputFile] = None """*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `""" + cover: Optional[Union[str, InputFile]] = None + """*Optional*. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `""" + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None + """*Optional*. Start timestamp for the video in the message""" caption: Optional[str] = None """*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[Union[str, Default]] = Default("parse_mode") @@ -53,6 +58,8 @@ class InputMediaVideo(InputMedia): type: Literal[InputMediaType.VIDEO] = InputMediaType.VIDEO, media: Union[str, InputFile], thumbnail: Optional[InputFile] = None, + cover: Optional[Union[str, InputFile]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -74,6 +81,8 @@ class InputMediaVideo(InputMedia): type=type, media=media, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, diff --git a/aiogram/types/input_paid_media_video.py b/aiogram/types/input_paid_media_video.py index 4511afbb..1d24dfda 100644 --- a/aiogram/types/input_paid_media_video.py +++ b/aiogram/types/input_paid_media_video.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime from typing import TYPE_CHECKING, Any, Literal, Optional, Union from ..enums import InputPaidMediaType @@ -18,8 +19,12 @@ class InputPaidMediaVideo(InputPaidMedia): """Type of the media, must be *video*""" media: Union[str, InputFile] """File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `""" - thumbnail: Optional[Union[InputFile, str]] = None + thumbnail: Optional[InputFile] = None """*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » `""" + cover: Optional[Union[str, InputFile]] = None + """*Optional*. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » `""" + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None + """*Optional*. Start timestamp for the video in the message""" width: Optional[int] = None """*Optional*. Video width""" height: Optional[int] = None @@ -38,7 +43,9 @@ class InputPaidMediaVideo(InputPaidMedia): *, type: Literal[InputPaidMediaType.VIDEO] = InputPaidMediaType.VIDEO, media: Union[str, InputFile], - thumbnail: Optional[Union[InputFile, str]] = None, + thumbnail: Optional[InputFile] = None, + cover: Optional[Union[str, InputFile]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, width: Optional[int] = None, height: Optional[int] = None, duration: Optional[int] = None, @@ -53,6 +60,8 @@ class InputPaidMediaVideo(InputPaidMedia): type=type, media=media, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, width=width, height=height, duration=duration, diff --git a/aiogram/types/message.py b/aiogram/types/message.py index 90045263..27664c5a 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -2885,6 +2885,8 @@ class Message(MaybeInaccessibleMessage): width: Optional[int] = None, height: Optional[int] = None, thumbnail: Optional[InputFile] = None, + cover: Optional[Union[InputFile, str]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -2921,6 +2923,8 @@ class Message(MaybeInaccessibleMessage): :param width: Video width :param height: Video height :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` + :param cover: Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » ` + :param start_timestamp: Start timestamp for the video in the message :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* @@ -2954,6 +2958,8 @@ class Message(MaybeInaccessibleMessage): width=width, height=height, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, @@ -2976,6 +2982,8 @@ class Message(MaybeInaccessibleMessage): width: Optional[int] = None, height: Optional[int] = None, thumbnail: Optional[InputFile] = None, + cover: Optional[Union[InputFile, str]] = None, + start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -3013,6 +3021,8 @@ class Message(MaybeInaccessibleMessage): :param width: Video width :param height: Video height :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` + :param cover: Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More information on Sending Files » ` + :param start_timestamp: Start timestamp for the video in the message :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* @@ -3047,6 +3057,8 @@ class Message(MaybeInaccessibleMessage): width=width, height=height, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, @@ -3551,6 +3563,7 @@ class Message(MaybeInaccessibleMessage): self, chat_id: Union[int, str], message_thread_id: Optional[int] = None, + video_start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[list[MessageEntity]] = None, @@ -3581,6 +3594,7 @@ class Message(MaybeInaccessibleMessage): :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param video_start_timestamp: New start timestamp for the copied video in the message :param caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept :param parse_mode: Mode for parsing entities in the new caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode* @@ -3608,6 +3622,7 @@ class Message(MaybeInaccessibleMessage): message_id=self.message_id, chat_id=chat_id, message_thread_id=message_thread_id, + video_start_timestamp=video_start_timestamp, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, @@ -3685,6 +3700,7 @@ class Message(MaybeInaccessibleMessage): self, chat_id: Union[int, str], message_thread_id: Optional[int] = None, + video_start_timestamp: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), **kwargs: Any, @@ -3702,6 +3718,7 @@ class Message(MaybeInaccessibleMessage): :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + :param video_start_timestamp: New start timestamp for the forwarded video in the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the forwarded message from forwarding and saving :return: instance of method :class:`aiogram.methods.forward_message.ForwardMessage` @@ -3720,6 +3737,7 @@ class Message(MaybeInaccessibleMessage): message_id=self.message_id, chat_id=chat_id, message_thread_id=message_thread_id, + video_start_timestamp=video_start_timestamp, disable_notification=disable_notification, protect_content=protect_content, **kwargs, @@ -4173,7 +4191,7 @@ class Message(MaybeInaccessibleMessage): - :code:`message_id` - :code:`business_connection_id` - Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success. + Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setmessagereaction diff --git a/aiogram/types/shipping_query.py b/aiogram/types/shipping_query.py index 4d5af605..f98be47f 100644 --- a/aiogram/types/shipping_query.py +++ b/aiogram/types/shipping_query.py @@ -73,7 +73,7 @@ class ShippingQuery(TelegramObject): :param ok: Pass :code:`True` if delivery to the specified address is possible and :code:`False` if there are any problems (for example, if delivery to the specified address is not possible) :param shipping_options: Required if *ok* is :code:`True`. A JSON-serialized array of available shipping options. - :param error_message: Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. + :param error_message: Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. 'Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. :return: instance of method :class:`aiogram.methods.answer_shipping_query.AnswerShippingQuery` """ # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/star_transaction.py b/aiogram/types/star_transaction.py index 1ef2856f..5f91c59a 100644 --- a/aiogram/types/star_transaction.py +++ b/aiogram/types/star_transaction.py @@ -9,6 +9,7 @@ if TYPE_CHECKING: from .transaction_partner_affiliate_program import ( TransactionPartnerAffiliateProgram, ) + from .transaction_partner_chat import TransactionPartnerChat from .transaction_partner_fragment import TransactionPartnerFragment from .transaction_partner_other import TransactionPartnerOther from .transaction_partner_telegram_ads import TransactionPartnerTelegramAds @@ -18,7 +19,7 @@ if TYPE_CHECKING: class StarTransaction(TelegramObject): """ - Describes a Telegram Star transaction. + Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control. Source: https://core.telegram.org/bots/api#startransaction """ @@ -34,6 +35,7 @@ class StarTransaction(TelegramObject): source: Optional[ Union[ TransactionPartnerUser, + TransactionPartnerChat, TransactionPartnerAffiliateProgram, TransactionPartnerFragment, TransactionPartnerTelegramAds, @@ -45,6 +47,7 @@ class StarTransaction(TelegramObject): receiver: Optional[ Union[ TransactionPartnerUser, + TransactionPartnerChat, TransactionPartnerAffiliateProgram, TransactionPartnerFragment, TransactionPartnerTelegramAds, @@ -68,6 +71,7 @@ class StarTransaction(TelegramObject): source: Optional[ Union[ TransactionPartnerUser, + TransactionPartnerChat, TransactionPartnerAffiliateProgram, TransactionPartnerFragment, TransactionPartnerTelegramAds, @@ -78,6 +82,7 @@ class StarTransaction(TelegramObject): receiver: Optional[ Union[ TransactionPartnerUser, + TransactionPartnerChat, TransactionPartnerAffiliateProgram, TransactionPartnerFragment, TransactionPartnerTelegramAds, diff --git a/aiogram/types/successful_payment.py b/aiogram/types/successful_payment.py index c66f01df..de2a9518 100644 --- a/aiogram/types/successful_payment.py +++ b/aiogram/types/successful_payment.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: class SuccessfulPayment(TelegramObject): """ - This object contains basic information about a successful payment. + This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control. Source: https://core.telegram.org/bots/api#successfulpayment """ diff --git a/aiogram/types/transaction_partner.py b/aiogram/types/transaction_partner.py index fa2ca902..b7516dec 100644 --- a/aiogram/types/transaction_partner.py +++ b/aiogram/types/transaction_partner.py @@ -6,6 +6,7 @@ class TransactionPartner(TelegramObject): This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser` + - :class:`aiogram.types.transaction_partner_chat.TransactionPartnerChat` - :class:`aiogram.types.transaction_partner_affiliate_program.TransactionPartnerAffiliateProgram` - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment` - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds` diff --git a/aiogram/types/transaction_partner_chat.py b/aiogram/types/transaction_partner_chat.py new file mode 100644 index 00000000..0bac5d37 --- /dev/null +++ b/aiogram/types/transaction_partner_chat.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal, Optional + +from ..enums import TransactionPartnerType +from .transaction_partner import TransactionPartner + +if TYPE_CHECKING: + from .chat import Chat + from .gift import Gift + + +class TransactionPartnerChat(TransactionPartner): + """ + Describes a transaction with a chat. + + Source: https://core.telegram.org/bots/api#transactionpartnerchat + """ + + type: Literal[TransactionPartnerType.CHAT] = TransactionPartnerType.CHAT + """Type of the transaction partner, always 'chat'""" + chat: Chat + """Information about the chat""" + gift: Optional[Gift] = None + """*Optional*. The gift sent to the chat by the bot""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + type: Literal[TransactionPartnerType.CHAT] = TransactionPartnerType.CHAT, + chat: Chat, + gift: Optional[Gift] = None, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__(type=type, chat=chat, gift=gift, **__pydantic_kwargs) diff --git a/aiogram/types/video.py b/aiogram/types/video.py index e8ecf1f4..de97c7fe 100644 --- a/aiogram/types/video.py +++ b/aiogram/types/video.py @@ -1,5 +1,6 @@ from __future__ import annotations +import datetime from typing import TYPE_CHECKING, Any, Optional from .base import TelegramObject @@ -27,6 +28,10 @@ class Video(TelegramObject): """Duration of the video in seconds as defined by the sender""" thumbnail: Optional[PhotoSize] = None """*Optional*. Video thumbnail""" + cover: Optional[list[PhotoSize]] = None + """*Optional*. Available sizes of the cover of the video in the message""" + start_timestamp: Optional[datetime.datetime] = None + """*Optional*. Timestamp in seconds from which the video will play in the message""" file_name: Optional[str] = None """*Optional*. Original filename as defined by the sender""" mime_type: Optional[str] = None @@ -47,6 +52,8 @@ class Video(TelegramObject): height: int, duration: int, thumbnail: Optional[PhotoSize] = None, + cover: Optional[list[PhotoSize]] = None, + start_timestamp: Optional[datetime.datetime] = None, file_name: Optional[str] = None, mime_type: Optional[str] = None, file_size: Optional[int] = None, @@ -63,6 +70,8 @@ class Video(TelegramObject): height=height, duration=duration, thumbnail=thumbnail, + cover=cover, + start_timestamp=start_timestamp, file_name=file_name, mime_type=mime_type, file_size=file_size, diff --git a/docs/api/types/index.rst b/docs/api/types/index.rst index 446e0459..c2060ae6 100644 --- a/docs/api/types/index.rst +++ b/docs/api/types/index.rst @@ -228,6 +228,7 @@ Payments successful_payment transaction_partner transaction_partner_affiliate_program + transaction_partner_chat transaction_partner_fragment transaction_partner_other transaction_partner_telegram_ads diff --git a/docs/api/types/transaction_partner_chat.rst b/docs/api/types/transaction_partner_chat.rst new file mode 100644 index 00000000..5558cb1c --- /dev/null +++ b/docs/api/types/transaction_partner_chat.rst @@ -0,0 +1,10 @@ +###################### +TransactionPartnerChat +###################### + + +.. automodule:: aiogram.types.transaction_partner_chat + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields diff --git a/pyproject.toml b/pyproject.toml index a5b7cd8d..6cf4a060 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -303,6 +303,7 @@ module = [ "uvloop", "redis.*", "babel.*", + "aiohttp_socks.*", ] ignore_missing_imports = true disallow_untyped_defs = true