Added full support for Bot API 8.0 (#1606)

* Added full support of Bot API 8.0

* Added tests

* Reformat code

* Added changelog

* Bump API version
This commit is contained in:
Alex Root Junior 2024-11-17 23:18:42 +02:00 committed by GitHub
parent f2916ca03f
commit dfc88fc907
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
169 changed files with 1890 additions and 162 deletions

View file

@ -11,6 +11,14 @@
"html_description": "<p>Use this method to create a link for an invoice. Returns the created invoice link as <em>String</em> on success.</p>",
"rst_description": "Use this method to create a link for an invoice. Returns the created invoice link as *String* on success.",
"annotations": [
{
"type": "String",
"required": false,
"description": "Unique identifier of the business connection on behalf of which the link will be created",
"html_description": "<td>Unique identifier of the business connection on behalf of which the link will be created</td>",
"rst_description": "Unique identifier of the business connection on behalf of which the link will be created\n",
"name": "business_connection_id"
},
{
"type": "String",
"required": true,
@ -59,6 +67,14 @@
"rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars <https://t.me/BotNews/90>`_.\n",
"name": "prices"
},
{
"type": "Integer",
"required": false,
"description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified.",
"html_description": "<td>The number of seconds the subscription will be active for before the next payment. The currency must be set to &#8220;XTR&#8221; (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified.</td>",
"rst_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified.\n",
"name": "subscription_period"
},
{
"type": "Integer",
"required": false,

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Payments",
"anchor": "payments"
},
"object": {
"anchor": "edituserstarsubscription",
"name": "editUserStarSubscription",
"description": "Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.",
"html_description": "<p>Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns <em>True</em> on success.</p>",
"rst_description": "Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Identifier of the user whose subscription will be edited",
"html_description": "<td>Identifier of the user whose subscription will be edited</td>",
"rst_description": "Identifier of the user whose subscription will be edited\n",
"name": "user_id"
},
{
"type": "String",
"required": true,
"description": "Telegram payment identifier for the subscription",
"html_description": "<td>Telegram payment identifier for the subscription</td>",
"rst_description": "Telegram payment identifier for the subscription\n",
"name": "telegram_payment_charge_id"
},
{
"type": "Boolean",
"required": true,
"description": "Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.",
"html_description": "<td>Pass <em>True</em> to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass <em>False</em> to allow the user to re-enable a subscription that was previously canceled by the bot.</td>",
"rst_description": "Pass :code:`True` to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass :code:`False` to allow the user to re-enable a subscription that was previously canceled by the bot.\n",
"name": "is_canceled"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,16 @@
{
"meta": {},
"group": {
"title": "Stickers",
"anchor": "stickers"
},
"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": "<p>Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a <a href=\"#gifts\">Gifts</a> object.</p>",
"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.",
"annotations": [],
"category": "methods"
}
}

View file

@ -0,0 +1,65 @@
{
"meta": {},
"group": {
"title": "Inline mode",
"anchor": "inline-mode"
},
"object": {
"anchor": "savepreparedinlinemessage",
"name": "savePreparedInlineMessage",
"description": "Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.",
"html_description": "<p>Stores a message that can be sent by a user of a Mini App. Returns a <a href=\"#preparedinlinemessage\">PreparedInlineMessage</a> object.</p>",
"rst_description": "Stores a message that can be sent by a user of a Mini App. Returns a :class:`aiogram.types.prepared_inline_message.PreparedInlineMessage` object.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the target user that can use the prepared message",
"html_description": "<td>Unique identifier of the target user that can use the prepared message</td>",
"rst_description": "Unique identifier of the target user that can use the prepared message\n",
"name": "user_id"
},
{
"type": "InlineQueryResult",
"required": true,
"description": "A JSON-serialized object describing the message to be sent",
"html_description": "<td>A JSON-serialized object describing the message to be sent</td>",
"rst_description": "A JSON-serialized object describing the message to be sent\n",
"name": "result"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True if the message can be sent to private chats with users",
"html_description": "<td>Pass <em>True</em> if the message can be sent to private chats with users</td>",
"rst_description": "Pass :code:`True` if the message can be sent to private chats with users\n",
"name": "allow_user_chats"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True if the message can be sent to private chats with bots",
"html_description": "<td>Pass <em>True</em> if the message can be sent to private chats with bots</td>",
"rst_description": "Pass :code:`True` if the message can be sent to private chats with bots\n",
"name": "allow_bot_chats"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True if the message can be sent to group and supergroup chats",
"html_description": "<td>Pass <em>True</em> if the message can be sent to group and supergroup chats</td>",
"rst_description": "Pass :code:`True` if the message can be sent to group and supergroup chats\n",
"name": "allow_group_chats"
},
{
"type": "Boolean",
"required": false,
"description": "Pass True if the message can be sent to channel chats",
"html_description": "<td>Pass <em>True</em> if the message can be sent to channel chats</td>",
"rst_description": "Pass :code:`True` if the message can be sent to channel chats\n",
"name": "allow_channel_chats"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,57 @@
{
"meta": {},
"group": {
"title": "Stickers",
"anchor": "stickers"
},
"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": "<p>Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns <em>True</em> on success.</p>",
"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.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the target user that will receive the gift",
"html_description": "<td>Unique identifier of the target user that will receive the gift</td>",
"rst_description": "Unique identifier of the target user that will receive the gift\n",
"name": "user_id"
},
{
"type": "String",
"required": true,
"description": "Identifier of the gift",
"html_description": "<td>Identifier of the gift</td>",
"rst_description": "Identifier of the gift\n",
"name": "gift_id"
},
{
"type": "String",
"required": false,
"description": "Text that will be shown along with the gift; 0-255 characters",
"html_description": "<td>Text that will be shown along with the gift; 0-255 characters</td>",
"rst_description": "Text that will be shown along with the gift; 0-255 characters\n",
"name": "text"
},
{
"type": "String",
"required": false,
"description": "Mode for parsing entities in the text. See formatting options for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.",
"html_description": "<td>Mode for parsing entities in the text. See <a href=\"#formatting-options\">formatting options</a> for more details. Entities other than &#8220;bold&#8221;, &#8220;italic&#8221;, &#8220;underline&#8221;, &#8220;strikethrough&#8221;, &#8220;spoiler&#8221;, and &#8220;custom_emoji&#8221; are ignored.</td>",
"rst_description": "Mode for parsing entities in the text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n",
"name": "text_parse_mode"
},
{
"type": "Array of MessageEntity",
"required": false,
"description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.",
"html_description": "<td>A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of <em>text_parse_mode</em>. Entities other than &#8220;bold&#8221;, &#8220;italic&#8221;, &#8220;underline&#8221;, &#8220;strikethrough&#8221;, &#8220;spoiler&#8221;, and &#8220;custom_emoji&#8221; are ignored.</td>",
"rst_description": "A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of *text_parse_mode*. Entities other than 'bold', 'italic', 'underline', 'strikethrough', 'spoiler', and 'custom_emoji' are ignored.\n",
"name": "text_entities"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Available methods",
"anchor": "available-methods"
},
"object": {
"anchor": "setuseremojistatus",
"name": "setUserEmojiStatus",
"description": "Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.",
"html_description": "<p>Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method <a href=\"/bots/webapps#initializing-mini-apps\">requestEmojiStatusAccess</a>. Returns <em>True</em> on success.</p>",
"rst_description": "Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method `requestEmojiStatusAccess <https://core.telegram.org/bots/webapps#initializing-mini-apps>`_. Returns :code:`True` on success.",
"annotations": [
{
"type": "Integer",
"required": true,
"description": "Unique identifier of the target user",
"html_description": "<td>Unique identifier of the target user</td>",
"rst_description": "Unique identifier of the target user\n",
"name": "user_id"
},
{
"type": "String",
"required": false,
"description": "Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status.",
"html_description": "<td>Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status.</td>",
"rst_description": "Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status.\n",
"name": "emoji_status_custom_emoji_id"
},
{
"type": "Integer",
"required": false,
"description": "Expiration date of the emoji status, if any",
"html_description": "<td>Expiration date of the emoji status, if any</td>",
"rst_description": "Expiration date of the emoji status, if any\n",
"name": "emoji_status_expiration_date"
}
],
"category": "methods"
}
}

View file

@ -0,0 +1,11 @@
annotations:
emoji_status_expiration_date:
parsed_type:
type: union
items:
- type: std
name: datetime.datetime
- type: std
name: datetime.timedelta
- type: std
name: int