Added full support of Bot API 8.1 (#1617)

* Added full support of Bot API 8.1

* Remove  artifacts from types and methods (model_* methods)
This commit is contained in:
Alex Root Junior 2024-12-14 19:30:12 +02:00 committed by GitHub
parent 6520b9fba2
commit 782796c217
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 433 additions and 51 deletions

View file

@ -1 +1 @@
8.0 8.1

View file

@ -12,3 +12,4 @@ multi_parse:
- TransactionPartnerUser - TransactionPartnerUser
- TransactionPartnerTelegramAds - TransactionPartnerTelegramAds
- TransactionPartnerTelegramApi - TransactionPartnerTelegramApi
- TransactionPartnerAffiliateProgram

View file

@ -14,9 +14,9 @@
{ {
"type": "String", "type": "String",
"required": false, "required": false,
"description": "Unique identifier of the business connection on behalf of which the link will be created", "description": "Unique identifier of the business connection on behalf of which the link will be created. For payments in Telegram Stars only.",
"html_description": "<td>Unique identifier of the business connection on behalf of which the link will be created</td>", "html_description": "<td>Unique identifier of the business connection on behalf of which the link will be created. For payments in <a href=\"https://t.me/BotNews/90\">Telegram Stars</a> only.</td>",
"rst_description": "Unique identifier of the business connection on behalf of which the link will be created\n", "rst_description": "Unique identifier of the business connection on behalf of which the link will be created. For payments in `Telegram Stars <https://t.me/BotNews/90>`_ only.\n",
"name": "business_connection_id" "name": "business_connection_id"
}, },
{ {
@ -70,9 +70,9 @@
{ {
"type": "Integer", "type": "Integer",
"required": false, "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.", "description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.",
"html_description": "<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>", "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. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.</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", "rst_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.\n",
"name": "subscription_period" "name": "subscription_period"
}, },
{ {

View file

@ -1,7 +1,7 @@
{ {
"api": { "api": {
"version": "8.0", "version": "8.1",
"release_date": "2024-11-17" "release_date": "2024-12-04"
}, },
"items": [ "items": [
{ {
@ -16344,9 +16344,9 @@
{ {
"type": "String", "type": "String",
"required": false, "required": false,
"description": "Unique identifier of the business connection on behalf of which the link will be created", "description": "Unique identifier of the business connection on behalf of which the link will be created. For payments in Telegram Stars only.",
"html_description": "<td>Unique identifier of the business connection on behalf of which the link will be created</td>", "html_description": "<td>Unique identifier of the business connection on behalf of which the link will be created. For payments in <a href=\"https://t.me/BotNews/90\">Telegram Stars</a> only.</td>",
"rst_description": "Unique identifier of the business connection on behalf of which the link will be created\n", "rst_description": "Unique identifier of the business connection on behalf of which the link will be created. For payments in `Telegram Stars <https://t.me/BotNews/90>`_ only.\n",
"name": "business_connection_id" "name": "business_connection_id"
}, },
{ {
@ -16400,9 +16400,9 @@
{ {
"type": "Integer", "type": "Integer",
"required": false, "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.", "description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.",
"html_description": "<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>", "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. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.</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", "rst_description": "The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.\n",
"name": "subscription_period" "name": "subscription_period"
}, },
{ {
@ -17245,12 +17245,62 @@
], ],
"category": "types" "category": "types"
}, },
{
"anchor": "affiliateinfo",
"name": "AffiliateInfo",
"description": "Contains information about the affiliate that received a commission via this transaction.",
"html_description": "<p>Contains information about the affiliate that received a commission via this transaction.</p>",
"rst_description": "Contains information about the affiliate that received a commission via this transaction.",
"annotations": [
{
"type": "User",
"description": "The bot or the user that received an affiliate commission if it was received by a bot or a user",
"html_description": "<td><em>Optional</em>. The bot or the user that received an affiliate commission if it was received by a bot or a user</td>",
"rst_description": "*Optional*. The bot or the user that received an affiliate commission if it was received by a bot or a user\n",
"name": "affiliate_user",
"required": false
},
{
"type": "Chat",
"description": "The chat that received an affiliate commission if it was received by a chat",
"html_description": "<td><em>Optional</em>. The chat that received an affiliate commission if it was received by a chat</td>",
"rst_description": "*Optional*. The chat that received an affiliate commission if it was received by a chat\n",
"name": "affiliate_chat",
"required": false
},
{
"type": "Integer",
"description": "The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users",
"html_description": "<td>The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users</td>",
"rst_description": "The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users\n",
"name": "commission_per_mille",
"required": true
},
{
"type": "Integer",
"description": "Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds",
"html_description": "<td>Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds</td>",
"rst_description": "Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds\n",
"name": "amount",
"required": true
},
{
"type": "Integer",
"description": "The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds",
"html_description": "<td><em>Optional</em>. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds</td>",
"rst_description": "*Optional*. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds\n",
"name": "nanostar_amount",
"required": false
}
],
"category": "types"
},
{ {
"anchor": "transactionpartner", "anchor": "transactionpartner",
"name": "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 - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - 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 - TransactionPartnerAffiliateProgram\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - TransactionPartnerOther",
"html_description": "<p>This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of</p><ul>\n<li><a href=\"#transactionpartneruser\">TransactionPartnerUser</a></li>\n<li><a href=\"#transactionpartnerfragment\">TransactionPartnerFragment</a></li>\n<li><a href=\"#transactionpartnertelegramads\">TransactionPartnerTelegramAds</a></li>\n<li><a href=\"#transactionpartnertelegramapi\">TransactionPartnerTelegramApi</a></li>\n<li><a href=\"#transactionpartnerother\">TransactionPartnerOther</a></li>\n</ul>", "html_description": "<p>This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of</p><ul>\n<li><a href=\"#transactionpartneruser\">TransactionPartnerUser</a></li>\n<li><a href=\"#transactionpartneraffiliateprogram\">TransactionPartnerAffiliateProgram</a></li>\n<li><a href=\"#transactionpartnerfragment\">TransactionPartnerFragment</a></li>\n<li><a href=\"#transactionpartnertelegramads\">TransactionPartnerTelegramAds</a></li>\n<li><a href=\"#transactionpartnertelegramapi\">TransactionPartnerTelegramApi</a></li>\n<li><a href=\"#transactionpartnerother\">TransactionPartnerOther</a></li>\n</ul>",
"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_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`", "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`",
"annotations": [], "annotations": [],
"category": "types" "category": "types"
}, },
@ -17277,6 +17327,14 @@
"name": "user", "name": "user",
"required": true "required": true
}, },
{
"type": "AffiliateInfo",
"description": "Information about the affiliate that received a commission via this transaction",
"html_description": "<td><em>Optional</em>. Information about the affiliate that received a commission via this transaction</td>",
"rst_description": "*Optional*. Information about the affiliate that received a commission via this transaction\n",
"name": "affiliate",
"required": false
},
{ {
"type": "String", "type": "String",
"description": "Bot-specified invoice payload", "description": "Bot-specified invoice payload",
@ -17310,7 +17368,7 @@
"required": false "required": false
}, },
{ {
"type": "String", "type": "Gift",
"description": "The gift sent to the user by the bot", "description": "The gift sent to the user by the bot",
"html_description": "<td><em>Optional</em>. The gift sent to the user by the bot</td>", "html_description": "<td><em>Optional</em>. The gift sent to the user by the bot</td>",
"rst_description": "*Optional*. The gift sent to the user by the bot\n", "rst_description": "*Optional*. The gift sent to the user by the bot\n",
@ -17320,6 +17378,40 @@
], ],
"category": "types" "category": "types"
}, },
{
"anchor": "transactionpartneraffiliateprogram",
"name": "TransactionPartnerAffiliateProgram",
"description": "Describes the affiliate program that issued the affiliate commission received via this transaction.",
"html_description": "<p>Describes the affiliate program that issued the affiliate commission received via this transaction.</p>",
"rst_description": "Describes the affiliate program that issued the affiliate commission received via this transaction.",
"annotations": [
{
"type": "String",
"description": "Type of the transaction partner, always 'affiliate_program'",
"html_description": "<td>Type of the transaction partner, always &#8220;affiliate_program&#8221;</td>",
"rst_description": "Type of the transaction partner, always 'affiliate_program'\n",
"name": "type",
"required": true
},
{
"type": "User",
"description": "Information about the bot that sponsored the affiliate program",
"html_description": "<td><em>Optional</em>. Information about the bot that sponsored the affiliate program</td>",
"rst_description": "*Optional*. Information about the bot that sponsored the affiliate program\n",
"name": "sponsor_user",
"required": false
},
{
"type": "Integer",
"description": "The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users",
"html_description": "<td>The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users</td>",
"rst_description": "The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users\n",
"name": "commission_per_mille",
"required": true
}
],
"category": "types"
},
{ {
"anchor": "transactionpartnerfragment", "anchor": "transactionpartnerfragment",
"name": "TransactionPartnerFragment", "name": "TransactionPartnerFragment",
@ -17425,12 +17517,20 @@
}, },
{ {
"type": "Integer", "type": "Integer",
"description": "Number of Telegram Stars transferred by the transaction", "description": "Integer amount of Telegram Stars transferred by the transaction",
"html_description": "<td>Number of Telegram Stars transferred by the transaction</td>", "html_description": "<td>Integer amount of Telegram Stars transferred by the transaction</td>",
"rst_description": "Number of Telegram Stars transferred by the transaction\n", "rst_description": "Integer amount of Telegram Stars transferred by the transaction\n",
"name": "amount", "name": "amount",
"required": true "required": true
}, },
{
"type": "Integer",
"description": "The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999",
"html_description": "<td><em>Optional</em>. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999</td>",
"rst_description": "*Optional*. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999\n",
"name": "nanostar_amount",
"required": false
},
{ {
"type": "Integer", "type": "Integer",
"description": "Date the transaction was created in Unix time", "description": "Date the transaction was created in Unix time",

View file

@ -0,0 +1,57 @@
{
"meta": {},
"group": {
"title": "Payments",
"anchor": "payments"
},
"object": {
"anchor": "affiliateinfo",
"name": "AffiliateInfo",
"description": "Contains information about the affiliate that received a commission via this transaction.",
"html_description": "<p>Contains information about the affiliate that received a commission via this transaction.</p>",
"rst_description": "Contains information about the affiliate that received a commission via this transaction.",
"annotations": [
{
"type": "User",
"description": "The bot or the user that received an affiliate commission if it was received by a bot or a user",
"html_description": "<td><em>Optional</em>. The bot or the user that received an affiliate commission if it was received by a bot or a user</td>",
"rst_description": "*Optional*. The bot or the user that received an affiliate commission if it was received by a bot or a user\n",
"name": "affiliate_user",
"required": false
},
{
"type": "Chat",
"description": "The chat that received an affiliate commission if it was received by a chat",
"html_description": "<td><em>Optional</em>. The chat that received an affiliate commission if it was received by a chat</td>",
"rst_description": "*Optional*. The chat that received an affiliate commission if it was received by a chat\n",
"name": "affiliate_chat",
"required": false
},
{
"type": "Integer",
"description": "The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users",
"html_description": "<td>The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users</td>",
"rst_description": "The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users\n",
"name": "commission_per_mille",
"required": true
},
{
"type": "Integer",
"description": "Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds",
"html_description": "<td>Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds</td>",
"rst_description": "Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds\n",
"name": "amount",
"required": true
},
{
"type": "Integer",
"description": "The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds",
"html_description": "<td><em>Optional</em>. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds</td>",
"rst_description": "*Optional*. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds\n",
"name": "nanostar_amount",
"required": false
}
],
"category": "types"
}
}

View file

@ -21,12 +21,20 @@
}, },
{ {
"type": "Integer", "type": "Integer",
"description": "Number of Telegram Stars transferred by the transaction", "description": "Integer amount of Telegram Stars transferred by the transaction",
"html_description": "<td>Number of Telegram Stars transferred by the transaction</td>", "html_description": "<td>Integer amount of Telegram Stars transferred by the transaction</td>",
"rst_description": "Number of Telegram Stars transferred by the transaction\n", "rst_description": "Integer amount of Telegram Stars transferred by the transaction\n",
"name": "amount", "name": "amount",
"required": true "required": true
}, },
{
"type": "Integer",
"description": "The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999",
"html_description": "<td><em>Optional</em>. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999</td>",
"rst_description": "*Optional*. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999\n",
"name": "nanostar_amount",
"required": false
},
{ {
"type": "Integer", "type": "Integer",
"description": "Date the transaction was created in Unix time", "description": "Date the transaction was created in Unix time",

View file

@ -7,9 +7,9 @@
"object": { "object": {
"anchor": "transactionpartner", "anchor": "transactionpartner",
"name": "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 - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - 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 - TransactionPartnerAffiliateProgram\n - TransactionPartnerFragment\n - TransactionPartnerTelegramAds\n - TransactionPartnerTelegramApi\n - TransactionPartnerOther",
"html_description": "<p>This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of</p><ul>\n<li><a href=\"#transactionpartneruser\">TransactionPartnerUser</a></li>\n<li><a href=\"#transactionpartnerfragment\">TransactionPartnerFragment</a></li>\n<li><a href=\"#transactionpartnertelegramads\">TransactionPartnerTelegramAds</a></li>\n<li><a href=\"#transactionpartnertelegramapi\">TransactionPartnerTelegramApi</a></li>\n<li><a href=\"#transactionpartnerother\">TransactionPartnerOther</a></li>\n</ul>", "html_description": "<p>This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of</p><ul>\n<li><a href=\"#transactionpartneruser\">TransactionPartnerUser</a></li>\n<li><a href=\"#transactionpartneraffiliateprogram\">TransactionPartnerAffiliateProgram</a></li>\n<li><a href=\"#transactionpartnerfragment\">TransactionPartnerFragment</a></li>\n<li><a href=\"#transactionpartnertelegramads\">TransactionPartnerTelegramAds</a></li>\n<li><a href=\"#transactionpartnertelegramapi\">TransactionPartnerTelegramApi</a></li>\n<li><a href=\"#transactionpartnerother\">TransactionPartnerOther</a></li>\n</ul>",
"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_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`", "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`",
"annotations": [], "annotations": [],
"category": "types" "category": "types"
} }

View file

@ -0,0 +1,41 @@
{
"meta": {},
"group": {
"title": "Payments",
"anchor": "payments"
},
"object": {
"anchor": "transactionpartneraffiliateprogram",
"name": "TransactionPartnerAffiliateProgram",
"description": "Describes the affiliate program that issued the affiliate commission received via this transaction.",
"html_description": "<p>Describes the affiliate program that issued the affiliate commission received via this transaction.</p>",
"rst_description": "Describes the affiliate program that issued the affiliate commission received via this transaction.",
"annotations": [
{
"type": "String",
"description": "Type of the transaction partner, always 'affiliate_program'",
"html_description": "<td>Type of the transaction partner, always &#8220;affiliate_program&#8221;</td>",
"rst_description": "Type of the transaction partner, always 'affiliate_program'\n",
"name": "type",
"required": true
},
{
"type": "User",
"description": "Information about the bot that sponsored the affiliate program",
"html_description": "<td><em>Optional</em>. Information about the bot that sponsored the affiliate program</td>",
"rst_description": "*Optional*. Information about the bot that sponsored the affiliate program\n",
"name": "sponsor_user",
"required": false
},
{
"type": "Integer",
"description": "The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users",
"html_description": "<td>The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users</td>",
"rst_description": "The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users\n",
"name": "commission_per_mille",
"required": true
}
],
"category": "types"
}
}

View file

@ -27,6 +27,14 @@
"name": "user", "name": "user",
"required": true "required": true
}, },
{
"type": "AffiliateInfo",
"description": "Information about the affiliate that received a commission via this transaction",
"html_description": "<td><em>Optional</em>. Information about the affiliate that received a commission via this transaction</td>",
"rst_description": "*Optional*. Information about the affiliate that received a commission via this transaction\n",
"name": "affiliate",
"required": false
},
{ {
"type": "String", "type": "String",
"description": "Bot-specified invoice payload", "description": "Bot-specified invoice payload",
@ -60,7 +68,7 @@
"required": false "required": false
}, },
{ {
"type": "String", "type": "Gift",
"description": "The gift sent to the user by the bot", "description": "The gift sent to the user by the bot",
"html_description": "<td><em>Optional</em>. The gift sent to the user by the bot</td>", "html_description": "<td><em>Optional</em>. The gift sent to the user by the bot</td>",
"rst_description": "*Optional*. The gift sent to the user by the bot\n", "rst_description": "*Optional*. The gift sent to the user by the bot\n",

5
CHANGES/1617.feature.rst Normal file
View file

@ -0,0 +1,5 @@
Added full support of `Bot API 8.1<https://core.telegram.org/bots/api-changelog#december-4-2024>`_:
- Added the field :code:`nanostar_amount` to the class :class:`aiogram.types.star_transaction.StarTransaction`.
- Added the class :class:`aiogram.types.transaction_partner_affiliate_program.TransactionPartnerAffiliateProgram` for transactions pertaining to incoming affiliate commissions.
- Added the class :class:`aiogram.types.affiliate_info.AffiliateInfo` and the field :code:`affiliate` to the class :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`, allowing bots to identify the relevant affiliate in transactions with an affiliate commission.

View file

@ -52,7 +52,7 @@ Features
- Asynchronous (`asyncio docs <https://docs.python.org/3/library/asyncio.html>`_, :pep:`492`) - Asynchronous (`asyncio docs <https://docs.python.org/3/library/asyncio.html>`_, :pep:`492`)
- Has type hints (:pep:`484`) and can be used with `mypy <http://mypy-lang.org/>`_ - Has type hints (:pep:`484`) and can be used with `mypy <http://mypy-lang.org/>`_
- Supports `PyPy <https://www.pypy.org/>`_ - Supports `PyPy <https://www.pypy.org/>`_
- Supports `Telegram Bot API 8.0 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API - Supports `Telegram Bot API 8.1 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API
- Telegram Bot API integration code was `autogenerated <https://github.com/aiogram/tg-codegen>`_ and can be easily re-generated when API gets updated - Telegram Bot API integration code was `autogenerated <https://github.com/aiogram/tg-codegen>`_ and can be easily re-generated when API gets updated
- Updates router (Blueprints) - Updates router (Blueprints)
- Has Finite State Machine - Has Finite State Machine

View file

@ -1,2 +1,2 @@
__version__ = "3.15.0" __version__ = "3.15.0"
__api_version__ = "8.0" __api_version__ = "8.1"

View file

@ -1014,9 +1014,9 @@ class Bot:
:param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.
:param currency: Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_. Pass 'XTR' for payments in `Telegram Stars <https://t.me/BotNews/90>`_. :param currency: Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_. Pass 'XTR' for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
:param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars <https://t.me/BotNews/90>`_. :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
:param business_connection_id: Unique identifier of the business connection on behalf of which the link will be created :param business_connection_id: Unique identifier of the business connection on behalf of which the link will be created. For payments in `Telegram Stars <https://t.me/BotNews/90>`_ only.
:param provider_token: Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_. Pass an empty string for payments in `Telegram Stars <https://t.me/BotNews/90>`_. :param provider_token: Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_. Pass an empty string for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
:param subscription_period: The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. :param subscription_period: The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.
:param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars <https://t.me/BotNews/90>`_. :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars <https://t.me/BotNews/90>`_.
:param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*.
:param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

View file

@ -13,3 +13,4 @@ class TransactionPartnerType(str, Enum):
USER = "user" USER = "user"
TELEGRAM_ADS = "telegram_ads" TELEGRAM_ADS = "telegram_ads"
TELEGRAM_API = "telegram_api" TELEGRAM_API = "telegram_api"
AFFILIATE_PROGRAM = "affiliate_program"

View file

@ -27,11 +27,11 @@ class CreateInvoiceLink(TelegramMethod[str]):
prices: list[LabeledPrice] prices: list[LabeledPrice]
"""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>`_.""" """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>`_."""
business_connection_id: Optional[str] = None business_connection_id: Optional[str] = None
"""Unique identifier of the business connection on behalf of which the link will be created""" """Unique identifier of the business connection on behalf of which the link will be created. For payments in `Telegram Stars <https://t.me/BotNews/90>`_ only."""
provider_token: Optional[str] = None provider_token: Optional[str] = None
"""Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_. Pass an empty string for payments in `Telegram Stars <https://t.me/BotNews/90>`_.""" """Payment provider token, obtained via `@BotFather <https://t.me/botfather>`_. Pass an empty string for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
subscription_period: Optional[int] = None subscription_period: Optional[int] = None
"""The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified.""" """The number of seconds the subscription will be active for before the next payment. The currency must be set to 'XTR' (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars."""
max_tip_amount: Optional[int] = None max_tip_amount: Optional[int] = None
"""The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars <https://t.me/BotNews/90>`_.""" """The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
suggested_tip_amounts: Optional[list[int]] = None suggested_tip_amounts: Optional[list[int]] = None

View file

@ -1,5 +1,6 @@
from typing import List, Literal, Optional, Union from typing import List, Literal, Optional, Union
from .affiliate_info import AffiliateInfo
from .animation import Animation from .animation import Animation
from .audio import Audio from .audio import Audio
from .background_fill import BackgroundFill from .background_fill import BackgroundFill
@ -216,6 +217,7 @@ from .successful_payment import SuccessfulPayment
from .switch_inline_query_chosen_chat import SwitchInlineQueryChosenChat from .switch_inline_query_chosen_chat import SwitchInlineQueryChosenChat
from .text_quote import TextQuote from .text_quote import TextQuote
from .transaction_partner import TransactionPartner from .transaction_partner import TransactionPartner
from .transaction_partner_affiliate_program import TransactionPartnerAffiliateProgram
from .transaction_partner_fragment import TransactionPartnerFragment from .transaction_partner_fragment import TransactionPartnerFragment
from .transaction_partner_other import TransactionPartnerOther from .transaction_partner_other import TransactionPartnerOther
from .transaction_partner_telegram_ads import TransactionPartnerTelegramAds from .transaction_partner_telegram_ads import TransactionPartnerTelegramAds
@ -241,6 +243,7 @@ from .webhook_info import WebhookInfo
from .write_access_allowed import WriteAccessAllowed from .write_access_allowed import WriteAccessAllowed
__all__ = ( __all__ = (
"AffiliateInfo",
"Animation", "Animation",
"Audio", "Audio",
"BackgroundFill", "BackgroundFill",
@ -456,6 +459,7 @@ __all__ = (
"TelegramObject", "TelegramObject",
"TextQuote", "TextQuote",
"TransactionPartner", "TransactionPartner",
"TransactionPartnerAffiliateProgram",
"TransactionPartnerFragment", "TransactionPartnerFragment",
"TransactionPartnerOther", "TransactionPartnerOther",
"TransactionPartnerTelegramAds", "TransactionPartnerTelegramAds",

View file

@ -0,0 +1,55 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from .base import TelegramObject
if TYPE_CHECKING:
from .chat import Chat
from .user import User
class AffiliateInfo(TelegramObject):
"""
Contains information about the affiliate that received a commission via this transaction.
Source: https://core.telegram.org/bots/api#affiliateinfo
"""
commission_per_mille: int
"""The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users"""
amount: int
"""Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds"""
affiliate_user: Optional[User] = None
"""*Optional*. The bot or the user that received an affiliate commission if it was received by a bot or a user"""
affiliate_chat: Optional[Chat] = None
"""*Optional*. The chat that received an affiliate commission if it was received by a chat"""
nanostar_amount: Optional[int] = None
"""*Optional*. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
commission_per_mille: int,
amount: int,
affiliate_user: Optional[User] = None,
affiliate_chat: Optional[Chat] = None,
nanostar_amount: Optional[int] = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super().__init__(
commission_per_mille=commission_per_mille,
amount=amount,
affiliate_user=affiliate_user,
affiliate_chat=affiliate_chat,
nanostar_amount=nanostar_amount,
**__pydantic_kwargs,
)

View file

@ -6,6 +6,9 @@ from .base import TelegramObject
from .custom import DateTime from .custom import DateTime
if TYPE_CHECKING: if TYPE_CHECKING:
from .transaction_partner_affiliate_program import (
TransactionPartnerAffiliateProgram,
)
from .transaction_partner_fragment import TransactionPartnerFragment from .transaction_partner_fragment import TransactionPartnerFragment
from .transaction_partner_other import TransactionPartnerOther from .transaction_partner_other import TransactionPartnerOther
from .transaction_partner_telegram_ads import TransactionPartnerTelegramAds from .transaction_partner_telegram_ads import TransactionPartnerTelegramAds
@ -23,12 +26,15 @@ class StarTransaction(TelegramObject):
id: str id: str
"""Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with *SuccessfulPayment.telegram_payment_charge_id* for successful incoming payments from users.""" """Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with *SuccessfulPayment.telegram_payment_charge_id* for successful incoming payments from users."""
amount: int amount: int
"""Number of Telegram Stars transferred by the transaction""" """Integer amount of Telegram Stars transferred by the transaction"""
date: DateTime date: DateTime
"""Date the transaction was created in Unix time""" """Date the transaction was created in Unix time"""
nanostar_amount: Optional[int] = None
"""*Optional*. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999"""
source: Optional[ source: Optional[
Union[ Union[
TransactionPartnerUser, TransactionPartnerUser,
TransactionPartnerAffiliateProgram,
TransactionPartnerFragment, TransactionPartnerFragment,
TransactionPartnerTelegramAds, TransactionPartnerTelegramAds,
TransactionPartnerTelegramApi, TransactionPartnerTelegramApi,
@ -39,6 +45,7 @@ class StarTransaction(TelegramObject):
receiver: Optional[ receiver: Optional[
Union[ Union[
TransactionPartnerUser, TransactionPartnerUser,
TransactionPartnerAffiliateProgram,
TransactionPartnerFragment, TransactionPartnerFragment,
TransactionPartnerTelegramAds, TransactionPartnerTelegramAds,
TransactionPartnerTelegramApi, TransactionPartnerTelegramApi,
@ -57,9 +64,11 @@ class StarTransaction(TelegramObject):
id: str, id: str,
amount: int, amount: int,
date: DateTime, date: DateTime,
nanostar_amount: Optional[int] = None,
source: Optional[ source: Optional[
Union[ Union[
TransactionPartnerUser, TransactionPartnerUser,
TransactionPartnerAffiliateProgram,
TransactionPartnerFragment, TransactionPartnerFragment,
TransactionPartnerTelegramAds, TransactionPartnerTelegramAds,
TransactionPartnerTelegramApi, TransactionPartnerTelegramApi,
@ -69,6 +78,7 @@ class StarTransaction(TelegramObject):
receiver: Optional[ receiver: Optional[
Union[ Union[
TransactionPartnerUser, TransactionPartnerUser,
TransactionPartnerAffiliateProgram,
TransactionPartnerFragment, TransactionPartnerFragment,
TransactionPartnerTelegramAds, TransactionPartnerTelegramAds,
TransactionPartnerTelegramApi, TransactionPartnerTelegramApi,
@ -85,6 +95,7 @@ class StarTransaction(TelegramObject):
id=id, id=id,
amount=amount, amount=amount,
date=date, date=date,
nanostar_amount=nanostar_amount,
source=source, source=source,
receiver=receiver, receiver=receiver,
**__pydantic_kwargs, **__pydantic_kwargs,

View file

@ -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 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_user.TransactionPartnerUser`
- :class:`aiogram.types.transaction_partner_affiliate_program.TransactionPartnerAffiliateProgram`
- :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment` - :class:`aiogram.types.transaction_partner_fragment.TransactionPartnerFragment`
- :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds` - :class:`aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds`
- :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi` - :class:`aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi`

View file

@ -0,0 +1,51 @@
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 .user import User
class TransactionPartnerAffiliateProgram(TransactionPartner):
"""
Describes the affiliate program that issued the affiliate commission received via this transaction.
Source: https://core.telegram.org/bots/api#transactionpartneraffiliateprogram
"""
type: Literal[TransactionPartnerType.AFFILIATE_PROGRAM] = (
TransactionPartnerType.AFFILIATE_PROGRAM
)
"""Type of the transaction partner, always 'affiliate_program'"""
commission_per_mille: int
"""The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users"""
sponsor_user: Optional[User] = None
"""*Optional*. Information about the bot that sponsored the affiliate program"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
type: Literal[
TransactionPartnerType.AFFILIATE_PROGRAM
] = TransactionPartnerType.AFFILIATE_PROGRAM,
commission_per_mille: int,
sponsor_user: Optional[User] = 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,
commission_per_mille=commission_per_mille,
sponsor_user=sponsor_user,
**__pydantic_kwargs,
)

View file

@ -6,6 +6,8 @@ from ..enums import TransactionPartnerType
from .transaction_partner import TransactionPartner from .transaction_partner import TransactionPartner
if TYPE_CHECKING: if TYPE_CHECKING:
from .affiliate_info import AffiliateInfo
from .gift import Gift
from .paid_media_photo import PaidMediaPhoto from .paid_media_photo import PaidMediaPhoto
from .paid_media_preview import PaidMediaPreview from .paid_media_preview import PaidMediaPreview
from .paid_media_video import PaidMediaVideo from .paid_media_video import PaidMediaVideo
@ -23,6 +25,8 @@ class TransactionPartnerUser(TransactionPartner):
"""Type of the transaction partner, always 'user'""" """Type of the transaction partner, always 'user'"""
user: User user: User
"""Information about the user""" """Information about the user"""
affiliate: Optional[AffiliateInfo] = None
"""*Optional*. Information about the affiliate that received a commission via this transaction"""
invoice_payload: Optional[str] = None invoice_payload: Optional[str] = None
"""*Optional*. Bot-specified invoice payload""" """*Optional*. Bot-specified invoice payload"""
subscription_period: Optional[int] = None subscription_period: Optional[int] = None
@ -31,7 +35,7 @@ class TransactionPartnerUser(TransactionPartner):
"""*Optional*. Information about the paid media bought by the user""" """*Optional*. Information about the paid media bought by the user"""
paid_media_payload: Optional[str] = None paid_media_payload: Optional[str] = None
"""*Optional*. Bot-specified paid media payload""" """*Optional*. Bot-specified paid media payload"""
gift: Optional[str] = None gift: Optional[Gift] = None
"""*Optional*. The gift sent to the user by the bot""" """*Optional*. The gift sent to the user by the bot"""
if TYPE_CHECKING: if TYPE_CHECKING:
@ -43,13 +47,14 @@ class TransactionPartnerUser(TransactionPartner):
*, *,
type: Literal[TransactionPartnerType.USER] = TransactionPartnerType.USER, type: Literal[TransactionPartnerType.USER] = TransactionPartnerType.USER,
user: User, user: User,
affiliate: Optional[AffiliateInfo] = None,
invoice_payload: Optional[str] = None, invoice_payload: Optional[str] = None,
subscription_period: Optional[int] = None, subscription_period: Optional[int] = None,
paid_media: Optional[ paid_media: Optional[
list[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]] list[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]]
] = None, ] = None,
paid_media_payload: Optional[str] = None, paid_media_payload: Optional[str] = None,
gift: Optional[str] = None, gift: Optional[Gift] = None,
**__pydantic_kwargs: Any, **__pydantic_kwargs: Any,
) -> None: ) -> None:
# DO NOT EDIT MANUALLY!!! # DO NOT EDIT MANUALLY!!!
@ -59,6 +64,7 @@ class TransactionPartnerUser(TransactionPartner):
super().__init__( super().__init__(
type=type, type=type,
user=user, user=user,
affiliate=affiliate,
invoice_payload=invoice_payload, invoice_payload=invoice_payload,
subscription_period=subscription_period, subscription_period=subscription_period,
paid_media=paid_media, paid_media=paid_media,

View file

@ -0,0 +1,10 @@
#############
AffiliateInfo
#############
.. automodule:: aiogram.types.affiliate_info
:members:
:member-order: bysource
:undoc-members: True
:exclude-members: model_config,model_fields

View file

@ -203,25 +203,13 @@ Inline mode
prepared_inline_message prepared_inline_message
sent_web_app_message sent_web_app_message
Stickers
========
.. toctree::
:maxdepth: 1
gift
gifts
input_sticker
mask_position
sticker
sticker_set
Payments Payments
======== ========
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
affiliate_info
invoice invoice
labeled_price labeled_price
order_info order_info
@ -239,12 +227,26 @@ Payments
star_transactions star_transactions
successful_payment successful_payment
transaction_partner transaction_partner
transaction_partner_affiliate_program
transaction_partner_fragment transaction_partner_fragment
transaction_partner_other transaction_partner_other
transaction_partner_telegram_ads transaction_partner_telegram_ads
transaction_partner_telegram_api transaction_partner_telegram_api
transaction_partner_user transaction_partner_user
Stickers
========
.. toctree::
:maxdepth: 1
gift
gifts
input_sticker
mask_position
sticker
sticker_set
Telegram Passport Telegram Passport
================= =================

View file

@ -0,0 +1,10 @@
##################################
TransactionPartnerAffiliateProgram
##################################
.. automodule:: aiogram.types.transaction_partner_affiliate_program
:members:
:member-order: bysource
:undoc-members: True
:exclude-members: model_config,model_fields

View file

@ -69,3 +69,14 @@ texinfo_documents = [
towncrier_draft_autoversion_mode = "draft" towncrier_draft_autoversion_mode = "draft"
towncrier_draft_include_empty = False towncrier_draft_include_empty = False
towncrier_draft_working_directory = Path(__file__).parent.parent towncrier_draft_working_directory = Path(__file__).parent.parent
def skip_model_prefixed_members(app, what, name, obj, skip, options):
# Skip any member whose name starts with "model_"
if name.startswith("model_"):
return True
return skip
def setup(app):
app.connect("autodoc-skip-member", skip_model_prefixed_members)