mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-05 23:34:42 +00:00
Added full support of Bot API 7.9 (#1560)
* Added full support of Bot API 7.9 * Added changelog * Try to fix towncrier * Fixed towncrier check
This commit is contained in:
parent
1c323ecc97
commit
c3a08664d3
48 changed files with 817 additions and 114 deletions
|
|
@ -1 +1 @@
|
|||
7.8
|
||||
7.9
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"meta": {},
|
||||
"group": {
|
||||
"title": "Available methods",
|
||||
"anchor": "available-methods"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "createchatsubscriptioninvitelink",
|
||||
"name": "createChatSubscriptionInviteLink",
|
||||
"description": "Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.",
|
||||
"html_description": "<p>Use this method to create a <a href=\"https://telegram.org/blog/superchannels-star-reactions-subscriptions#star-subscriptions\">subscription invite link</a> for a channel chat. The bot must have the <em>can_invite_users</em> administrator rights. The link can be edited using the method <a href=\"#editchatsubscriptioninvitelink\">editChatSubscriptionInviteLink</a> or revoked using the method <a href=\"#revokechatinvitelink\">revokeChatInviteLink</a>. Returns the new invite link as a <a href=\"#chatinvitelink\">ChatInviteLink</a> object.</p>",
|
||||
"rst_description": "Use this method to create a `subscription invite link <https://telegram.org/blog/superchannels-star-reactions-subscriptions#star-subscriptions>`_ for a channel chat. The bot must have the *can_invite_users* administrator rights. The link can be edited using the method :class:`aiogram.methods.edit_chat_subscription_invite_link.EditChatSubscriptionInviteLink` or revoked using the method :class:`aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink`. Returns the new invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
"required": true,
|
||||
"description": "Unique identifier for the target channel chat or username of the target channel (in the format @channelusername)",
|
||||
"html_description": "<td>Unique identifier for the target channel chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
|
||||
"rst_description": "Unique identifier for the target channel chat or username of the target channel (in the format :code:`@channelusername`)\n",
|
||||
"name": "chat_id"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "Invite link name; 0-32 characters",
|
||||
"html_description": "<td>Invite link name; 0-32 characters</td>",
|
||||
"rst_description": "Invite link name; 0-32 characters\n",
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"required": true,
|
||||
"description": "The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).",
|
||||
"html_description": "<td>The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).</td>",
|
||||
"rst_description": "The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).\n",
|
||||
"name": "subscription_period"
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"required": true,
|
||||
"description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500",
|
||||
"html_description": "<td>The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500</td>",
|
||||
"rst_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500\n",
|
||||
"name": "subscription_price"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
annotations:
|
||||
subscription_period:
|
||||
parsed_type:
|
||||
type: union
|
||||
items:
|
||||
- type: std
|
||||
name: datetime.datetime
|
||||
- type: std
|
||||
name: datetime.timedelta
|
||||
- type: std
|
||||
name: int
|
||||
41
.butcher/methods/editChatSubscriptionInviteLink/entity.json
Normal file
41
.butcher/methods/editChatSubscriptionInviteLink/entity.json
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"meta": {},
|
||||
"group": {
|
||||
"title": "Available methods",
|
||||
"anchor": "available-methods"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "editchatsubscriptioninvitelink",
|
||||
"name": "editChatSubscriptionInviteLink",
|
||||
"description": "Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object.",
|
||||
"html_description": "<p>Use this method to edit a subscription invite link created by the bot. The bot must have the <em>can_invite_users</em> administrator rights. Returns the edited invite link as a <a href=\"#chatinvitelink\">ChatInviteLink</a> object.</p>",
|
||||
"rst_description": "Use this method to edit a subscription invite link created by the bot. The bot must have the *can_invite_users* administrator rights. Returns the edited invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
"required": true,
|
||||
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
|
||||
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
|
||||
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
|
||||
"name": "chat_id"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "The invite link to edit",
|
||||
"html_description": "<td>The invite link to edit</td>",
|
||||
"rst_description": "The invite link to edit\n",
|
||||
"name": "invite_link"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "Invite link name; 0-32 characters",
|
||||
"html_description": "<td>Invite link name; 0-32 characters</td>",
|
||||
"rst_description": "Invite link name; 0-32 characters\n",
|
||||
"name": "name"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
}
|
||||
}
|
||||
|
|
@ -7,9 +7,9 @@
|
|||
"object": {
|
||||
"anchor": "editforumtopic",
|
||||
"name": "editForumTopic",
|
||||
"description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
|
||||
"html_description": "<p>Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
|
||||
"description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
|
||||
"html_description": "<p>Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
"object": {
|
||||
"anchor": "editgeneralforumtopic",
|
||||
"name": "editGeneralForumTopic",
|
||||
"description": "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.",
|
||||
"html_description": "<p>Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights. Returns :code:`True` on success.",
|
||||
"description": "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.",
|
||||
"html_description": "<p>Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
|
|
|
|||
|
|
@ -7,16 +7,24 @@
|
|||
"object": {
|
||||
"anchor": "sendpaidmedia",
|
||||
"name": "sendPaidMedia",
|
||||
"description": "Use this method to send paid media to channel chats. On success, the sent Message is returned.",
|
||||
"html_description": "<p>Use this method to send paid media to channel chats. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
|
||||
"rst_description": "Use this method to send paid media to channel chats. On success, the sent :class:`aiogram.types.message.Message` is returned.",
|
||||
"description": "Use this method to send paid media. On success, the sent Message is returned.",
|
||||
"html_description": "<p>Use this method to send paid media. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
|
||||
"rst_description": "Use this method to send paid media. On success, the sent :class:`aiogram.types.message.Message` is returned.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
|
||||
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
|
||||
"rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n",
|
||||
"name": "business_connection_id"
|
||||
},
|
||||
{
|
||||
"type": "Integer or String",
|
||||
"required": true,
|
||||
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
|
||||
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
|
||||
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
|
||||
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.",
|
||||
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.</td>",
|
||||
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.\n",
|
||||
"name": "chat_id"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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. Returns True on success.",
|
||||
"html_description": "<p>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. Returns <em>True</em> on success.</p>",
|
||||
"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. Returns :code:`True` on success.",
|
||||
"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": "<p>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 <em>True</em> on success.</p>",
|
||||
"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.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
|
|
@ -30,9 +30,9 @@
|
|||
{
|
||||
"type": "Array of ReactionType",
|
||||
"required": false,
|
||||
"description": "A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.",
|
||||
"html_description": "<td>A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.</td>",
|
||||
"rst_description": "A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.\n",
|
||||
"description": "A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.",
|
||||
"html_description": "<td>A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.</td>",
|
||||
"rst_description": "A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.\n",
|
||||
"name": "reaction"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"api": {
|
||||
"version": "7.8",
|
||||
"release_date": "2024-07-31"
|
||||
"version": "7.9",
|
||||
"release_date": "2024-08-14"
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
|
|
@ -993,17 +993,17 @@
|
|||
},
|
||||
{
|
||||
"type": "User",
|
||||
"description": "Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.",
|
||||
"html_description": "<td><em>Optional</em>. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.</td>",
|
||||
"rst_description": "*Optional*. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.\n",
|
||||
"description": "Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats",
|
||||
"html_description": "<td><em>Optional</em>. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats</td>",
|
||||
"rst_description": "*Optional*. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats\n",
|
||||
"name": "from",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Chat",
|
||||
"description": "Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.",
|
||||
"html_description": "<td><em>Optional</em>. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field <em>from</em> contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.</td>",
|
||||
"rst_description": "*Optional*. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field *from* contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.\n",
|
||||
"description": "Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.",
|
||||
"html_description": "<td><em>Optional</em>. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field <em>from</em> contains a fake sender user in non-channel chats.</td>",
|
||||
"rst_description": "*Optional*. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field *from* contains a fake sender user in non-channel chats.\n",
|
||||
"name": "sender_chat",
|
||||
"required": false
|
||||
},
|
||||
|
|
@ -5572,6 +5572,14 @@
|
|||
"rst_description": "Information about the user\n",
|
||||
"name": "user",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Date when the user's subscription will expire; Unix time",
|
||||
"html_description": "<td><em>Optional</em>. Date when the user's subscription will expire; Unix time</td>",
|
||||
"rst_description": "*Optional*. Date when the user's subscription will expire; Unix time\n",
|
||||
"name": "until_date",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
|
|
@ -6145,9 +6153,9 @@
|
|||
{
|
||||
"anchor": "reactiontype",
|
||||
"name": "ReactionType",
|
||||
"description": "This object describes the type of a reaction. Currently, it can be one of\n - ReactionTypeEmoji\n - ReactionTypeCustomEmoji",
|
||||
"html_description": "<p>This object describes the type of a reaction. Currently, it can be one of</p><ul>\n<li><a href=\"#reactiontypeemoji\">ReactionTypeEmoji</a></li>\n<li><a href=\"#reactiontypecustomemoji\">ReactionTypeCustomEmoji</a></li>\n</ul>",
|
||||
"rst_description": "This object describes the type of a reaction. Currently, it can be one of\n\n - :class:`aiogram.types.reaction_type_emoji.ReactionTypeEmoji`\n - :class:`aiogram.types.reaction_type_custom_emoji.ReactionTypeCustomEmoji`",
|
||||
"description": "This object describes the type of a reaction. Currently, it can be one of\n - ReactionTypeEmoji\n - ReactionTypeCustomEmoji\n - ReactionTypePaid",
|
||||
"html_description": "<p>This object describes the type of a reaction. Currently, it can be one of</p><ul>\n<li><a href=\"#reactiontypeemoji\">ReactionTypeEmoji</a></li>\n<li><a href=\"#reactiontypecustomemoji\">ReactionTypeCustomEmoji</a></li>\n<li><a href=\"#reactiontypepaid\">ReactionTypePaid</a></li>\n</ul>",
|
||||
"rst_description": "This object describes the type of a reaction. Currently, it can be one of\n\n - :class:`aiogram.types.reaction_type_emoji.ReactionTypeEmoji`\n - :class:`aiogram.types.reaction_type_custom_emoji.ReactionTypeCustomEmoji`\n - :class:`aiogram.types.reaction_type_paid.ReactionTypePaid`",
|
||||
"annotations": [],
|
||||
"category": "types"
|
||||
},
|
||||
|
|
@ -6203,6 +6211,24 @@
|
|||
],
|
||||
"category": "types"
|
||||
},
|
||||
{
|
||||
"anchor": "reactiontypepaid",
|
||||
"name": "ReactionTypePaid",
|
||||
"description": "The reaction is paid.",
|
||||
"html_description": "<p>The reaction is paid.</p>",
|
||||
"rst_description": "The reaction is paid.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Type of the reaction, always 'paid'",
|
||||
"html_description": "<td>Type of the reaction, always “paid”</td>",
|
||||
"rst_description": "Type of the reaction, always 'paid'\n",
|
||||
"name": "type",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
},
|
||||
{
|
||||
"anchor": "reactioncount",
|
||||
"name": "ReactionCount",
|
||||
|
|
@ -8940,16 +8966,24 @@
|
|||
{
|
||||
"anchor": "sendpaidmedia",
|
||||
"name": "sendPaidMedia",
|
||||
"description": "Use this method to send paid media to channel chats. On success, the sent Message is returned.",
|
||||
"html_description": "<p>Use this method to send paid media to channel chats. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
|
||||
"rst_description": "Use this method to send paid media to channel chats. On success, the sent :class:`aiogram.types.message.Message` is returned.",
|
||||
"description": "Use this method to send paid media. On success, the sent Message is returned.",
|
||||
"html_description": "<p>Use this method to send paid media. On success, the sent <a href=\"#message\">Message</a> is returned.</p>",
|
||||
"rst_description": "Use this method to send paid media. On success, the sent :class:`aiogram.types.message.Message` is returned.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "Unique identifier of the business connection on behalf of which the message will be sent",
|
||||
"html_description": "<td>Unique identifier of the business connection on behalf of which the message will be sent</td>",
|
||||
"rst_description": "Unique identifier of the business connection on behalf of which the message will be sent\n",
|
||||
"name": "business_connection_id"
|
||||
},
|
||||
{
|
||||
"type": "Integer or String",
|
||||
"required": true,
|
||||
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
|
||||
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
|
||||
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
|
||||
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.",
|
||||
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.</td>",
|
||||
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.\n",
|
||||
"name": "chat_id"
|
||||
},
|
||||
{
|
||||
|
|
@ -9788,9 +9822,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. Returns True on success.",
|
||||
"html_description": "<p>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. Returns <em>True</em> on success.</p>",
|
||||
"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. Returns :code:`True` on success.",
|
||||
"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": "<p>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 <em>True</em> on success.</p>",
|
||||
"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.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
|
|
@ -9811,9 +9845,9 @@
|
|||
{
|
||||
"type": "Array of ReactionType",
|
||||
"required": false,
|
||||
"description": "A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.",
|
||||
"html_description": "<td>A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.</td>",
|
||||
"rst_description": "A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.\n",
|
||||
"description": "A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.",
|
||||
"html_description": "<td>A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.</td>",
|
||||
"rst_description": "A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.\n",
|
||||
"name": "reaction"
|
||||
},
|
||||
{
|
||||
|
|
@ -10397,6 +10431,82 @@
|
|||
],
|
||||
"category": "methods"
|
||||
},
|
||||
{
|
||||
"anchor": "createchatsubscriptioninvitelink",
|
||||
"name": "createChatSubscriptionInviteLink",
|
||||
"description": "Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.",
|
||||
"html_description": "<p>Use this method to create a <a href=\"https://telegram.org/blog/superchannels-star-reactions-subscriptions#star-subscriptions\">subscription invite link</a> for a channel chat. The bot must have the <em>can_invite_users</em> administrator rights. The link can be edited using the method <a href=\"#editchatsubscriptioninvitelink\">editChatSubscriptionInviteLink</a> or revoked using the method <a href=\"#revokechatinvitelink\">revokeChatInviteLink</a>. Returns the new invite link as a <a href=\"#chatinvitelink\">ChatInviteLink</a> object.</p>",
|
||||
"rst_description": "Use this method to create a `subscription invite link <https://telegram.org/blog/superchannels-star-reactions-subscriptions#star-subscriptions>`_ for a channel chat. The bot must have the *can_invite_users* administrator rights. The link can be edited using the method :class:`aiogram.methods.edit_chat_subscription_invite_link.EditChatSubscriptionInviteLink` or revoked using the method :class:`aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink`. Returns the new invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
"required": true,
|
||||
"description": "Unique identifier for the target channel chat or username of the target channel (in the format @channelusername)",
|
||||
"html_description": "<td>Unique identifier for the target channel chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
|
||||
"rst_description": "Unique identifier for the target channel chat or username of the target channel (in the format :code:`@channelusername`)\n",
|
||||
"name": "chat_id"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "Invite link name; 0-32 characters",
|
||||
"html_description": "<td>Invite link name; 0-32 characters</td>",
|
||||
"rst_description": "Invite link name; 0-32 characters\n",
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"required": true,
|
||||
"description": "The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).",
|
||||
"html_description": "<td>The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).</td>",
|
||||
"rst_description": "The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).\n",
|
||||
"name": "subscription_period"
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"required": true,
|
||||
"description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500",
|
||||
"html_description": "<td>The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500</td>",
|
||||
"rst_description": "The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500\n",
|
||||
"name": "subscription_price"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
},
|
||||
{
|
||||
"anchor": "editchatsubscriptioninvitelink",
|
||||
"name": "editChatSubscriptionInviteLink",
|
||||
"description": "Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object.",
|
||||
"html_description": "<p>Use this method to edit a subscription invite link created by the bot. The bot must have the <em>can_invite_users</em> administrator rights. Returns the edited invite link as a <a href=\"#chatinvitelink\">ChatInviteLink</a> object.</p>",
|
||||
"rst_description": "Use this method to edit a subscription invite link created by the bot. The bot must have the *can_invite_users* administrator rights. Returns the edited invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
"required": true,
|
||||
"description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)",
|
||||
"html_description": "<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>",
|
||||
"rst_description": "Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)\n",
|
||||
"name": "chat_id"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": true,
|
||||
"description": "The invite link to edit",
|
||||
"html_description": "<td>The invite link to edit</td>",
|
||||
"rst_description": "The invite link to edit\n",
|
||||
"name": "invite_link"
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"required": false,
|
||||
"description": "Invite link name; 0-32 characters",
|
||||
"html_description": "<td>Invite link name; 0-32 characters</td>",
|
||||
"rst_description": "Invite link name; 0-32 characters\n",
|
||||
"name": "name"
|
||||
}
|
||||
],
|
||||
"category": "methods"
|
||||
},
|
||||
{
|
||||
"anchor": "revokechatinvitelink",
|
||||
"name": "revokeChatInviteLink",
|
||||
|
|
@ -10861,9 +10971,9 @@
|
|||
{
|
||||
"anchor": "editforumtopic",
|
||||
"name": "editForumTopic",
|
||||
"description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
|
||||
"html_description": "<p>Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
|
||||
"description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.",
|
||||
"html_description": "<p>Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
|
|
@ -11007,9 +11117,9 @@
|
|||
{
|
||||
"anchor": "editgeneralforumtopic",
|
||||
"name": "editGeneralForumTopic",
|
||||
"description": "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.",
|
||||
"html_description": "<p>Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights. Returns :code:`True` on success.",
|
||||
"description": "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.",
|
||||
"html_description": "<p>Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p>",
|
||||
"rst_description": "Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns :code:`True` on success.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer or String",
|
||||
|
|
@ -16586,6 +16696,14 @@
|
|||
"rst_description": "*Optional*. Bot-specified invoice payload\n",
|
||||
"name": "invoice_payload",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Array of PaidMedia",
|
||||
"description": "Information about the paid media bought by the user",
|
||||
"html_description": "<td><em>Optional</em>. Information about the paid media bought by the user</td>",
|
||||
"rst_description": "*Optional*. Information about the paid media bought by the user\n",
|
||||
"name": "paid_media",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
|
|
|
|||
|
|
@ -26,6 +26,14 @@
|
|||
"rst_description": "Information about the user\n",
|
||||
"name": "user",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Date when the user's subscription will expire; Unix time",
|
||||
"html_description": "<td><em>Optional</em>. Date when the user's subscription will expire; Unix time</td>",
|
||||
"rst_description": "*Optional*. Date when the user's subscription will expire; Unix time\n",
|
||||
"name": "until_date",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
|
|
|
|||
5
.butcher/types/ChatMemberMember/replace.yml
Normal file
5
.butcher/types/ChatMemberMember/replace.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
annotations:
|
||||
until_date:
|
||||
parsed_type:
|
||||
type: std
|
||||
name: DateTime
|
||||
|
|
@ -29,17 +29,17 @@
|
|||
},
|
||||
{
|
||||
"type": "User",
|
||||
"description": "Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.",
|
||||
"html_description": "<td><em>Optional</em>. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.</td>",
|
||||
"rst_description": "*Optional*. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.\n",
|
||||
"description": "Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats",
|
||||
"html_description": "<td><em>Optional</em>. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats</td>",
|
||||
"rst_description": "*Optional*. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats\n",
|
||||
"name": "from",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Chat",
|
||||
"description": "Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.",
|
||||
"html_description": "<td><em>Optional</em>. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field <em>from</em> contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.</td>",
|
||||
"rst_description": "*Optional*. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field *from* contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.\n",
|
||||
"description": "Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.",
|
||||
"html_description": "<td><em>Optional</em>. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field <em>from</em> contains a fake sender user in non-channel chats.</td>",
|
||||
"rst_description": "*Optional*. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field *from* contains a fake sender user in non-channel chats.\n",
|
||||
"name": "sender_chat",
|
||||
"required": false
|
||||
},
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
"object": {
|
||||
"anchor": "reactiontype",
|
||||
"name": "ReactionType",
|
||||
"description": "This object describes the type of a reaction. Currently, it can be one of\n - ReactionTypeEmoji\n - ReactionTypeCustomEmoji",
|
||||
"html_description": "<p>This object describes the type of a reaction. Currently, it can be one of</p><ul>\n<li><a href=\"#reactiontypeemoji\">ReactionTypeEmoji</a></li>\n<li><a href=\"#reactiontypecustomemoji\">ReactionTypeCustomEmoji</a></li>\n</ul>",
|
||||
"rst_description": "This object describes the type of a reaction. Currently, it can be one of\n\n - :class:`aiogram.types.reaction_type_emoji.ReactionTypeEmoji`\n - :class:`aiogram.types.reaction_type_custom_emoji.ReactionTypeCustomEmoji`",
|
||||
"description": "This object describes the type of a reaction. Currently, it can be one of\n - ReactionTypeEmoji\n - ReactionTypeCustomEmoji\n - ReactionTypePaid",
|
||||
"html_description": "<p>This object describes the type of a reaction. Currently, it can be one of</p><ul>\n<li><a href=\"#reactiontypeemoji\">ReactionTypeEmoji</a></li>\n<li><a href=\"#reactiontypecustomemoji\">ReactionTypeCustomEmoji</a></li>\n<li><a href=\"#reactiontypepaid\">ReactionTypePaid</a></li>\n</ul>",
|
||||
"rst_description": "This object describes the type of a reaction. Currently, it can be one of\n\n - :class:`aiogram.types.reaction_type_emoji.ReactionTypeEmoji`\n - :class:`aiogram.types.reaction_type_custom_emoji.ReactionTypeCustomEmoji`\n - :class:`aiogram.types.reaction_type_paid.ReactionTypePaid`",
|
||||
"annotations": [],
|
||||
"category": "types"
|
||||
}
|
||||
|
|
|
|||
25
.butcher/types/ReactionTypePaid/entity.json
Normal file
25
.butcher/types/ReactionTypePaid/entity.json
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"meta": {},
|
||||
"group": {
|
||||
"title": "Available types",
|
||||
"anchor": "available-types"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "reactiontypepaid",
|
||||
"name": "ReactionTypePaid",
|
||||
"description": "The reaction is paid.",
|
||||
"html_description": "<p>The reaction is paid.</p>",
|
||||
"rst_description": "The reaction is paid.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Type of the reaction, always 'paid'",
|
||||
"html_description": "<td>Type of the reaction, always “paid”</td>",
|
||||
"rst_description": "Type of the reaction, always 'paid'\n",
|
||||
"name": "type",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
}
|
||||
}
|
||||
|
|
@ -34,6 +34,14 @@
|
|||
"rst_description": "*Optional*. Bot-specified invoice payload\n",
|
||||
"name": "invoice_payload",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Array of PaidMedia",
|
||||
"description": "Information about the paid media bought by the user",
|
||||
"html_description": "<td><em>Optional</em>. Information about the paid media bought by the user</td>",
|
||||
"rst_description": "*Optional*. Information about the paid media bought by the user\n",
|
||||
"name": "paid_media",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
|
|
|
|||
14
.github/workflows/pull_request_changelog.yml
vendored
14
.github/workflows/pull_request_changelog.yml
vendored
|
|
@ -22,10 +22,10 @@ jobs:
|
|||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.10"
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install towncrier
|
||||
run: pip install towncrier
|
||||
run: pip install -U towncrier
|
||||
|
||||
- name: Check changelog
|
||||
env:
|
||||
|
|
@ -36,7 +36,7 @@ jobs:
|
|||
|
||||
- name: Find bot comment
|
||||
if: "always()"
|
||||
uses: peter-evans/find-comment@v2
|
||||
uses: peter-evans/find-comment@v3
|
||||
id: fc
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
|
|
@ -45,7 +45,7 @@ jobs:
|
|||
|
||||
- name: Ask for changelog
|
||||
if: "failure()"
|
||||
uses: peter-evans/create-or-update-comment@v2
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
edit-mode: replace
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
|
|
@ -65,7 +65,7 @@ jobs:
|
|||
|
||||
- name: Changelog found
|
||||
if: "success()"
|
||||
uses: peter-evans/create-or-update-comment@v2
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
edit-mode: replace
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
|
|
@ -80,7 +80,7 @@ jobs:
|
|||
if: "contains(github.event.pull_request.labels.*.name, 'skip news')"
|
||||
steps:
|
||||
- name: Find bot comment
|
||||
uses: peter-evans/find-comment@v2
|
||||
uses: peter-evans/find-comment@v3
|
||||
id: fc
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
|
|
@ -88,7 +88,7 @@ jobs:
|
|||
body-includes: Changelog
|
||||
|
||||
- name: Comment when docs is not needed
|
||||
uses: peter-evans/create-or-update-comment@v2
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
edit-mode: replace
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
|
|
|
|||
19
CHANGES/1560.feature.rst
Normal file
19
CHANGES/1560.feature.rst
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Added full support of `Bot API 7.8 <https://core.telegram.org/bots/api-changelog#august-14-2024>`_
|
||||
|
||||
- Added the ability to send paid media to any chat.
|
||||
- Added the parameter :code:`business_connection_id` to the method
|
||||
:class:`aiogram.methods.send_paid_media.SendPaidMedia`,
|
||||
allowing bots to send paid media on behalf of a business account.
|
||||
- Added the field :code:`paid_media` to the class
|
||||
:class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`
|
||||
for transactions involving paid media.
|
||||
- Added the method
|
||||
:class:`aiogram.methods.create_chat_subscription_invite_link.CreateChatSubscriptionInviteLink`,
|
||||
allowing bots to create subscription invite links.
|
||||
- Added the method
|
||||
:class:`aiogram.methods.edit_chat_subscription_invite_link.EditChatSubscriptionInviteLink`,
|
||||
allowing bots to edit the name of subscription invite links.
|
||||
- Added the field :code:`until_date` to the class
|
||||
:class:`aiogram.types.chat_member_member.ChatMemberMember` for members with an active subscription.
|
||||
- Added support for paid reactions and the class
|
||||
:class:`aiogram.types.reaction_type_paid.ReactionTypePaid`.
|
||||
7
Makefile
7
Makefile
|
|
@ -102,9 +102,14 @@ build: clean
|
|||
.PHONY: bump
|
||||
bump:
|
||||
hatch version $(args)
|
||||
cat .butcher/schema/schema.json | jq '.api.version' -r > .apiversion
|
||||
python scripts/bump_versions.py
|
||||
|
||||
update-api:
|
||||
butcher parse
|
||||
butcher refresh
|
||||
butcher apply all
|
||||
@$(MAKE) bump
|
||||
|
||||
.PHONY: towncrier-build
|
||||
towncrier-build:
|
||||
hatch run docs:towncrier build --yes
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ Features
|
|||
- 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/>`_
|
||||
- Supports `PyPy <https://www.pypy.org/>`_
|
||||
- Supports `Telegram Bot API 7.8 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API
|
||||
- Supports `Telegram Bot API 7.9 <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
|
||||
- Updates router (Blueprints)
|
||||
- Has Finite State Machine
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
__version__ = "3.11.0"
|
||||
__api_version__ = "7.8"
|
||||
__api_version__ = "7.9"
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ from ..methods import (
|
|||
CopyMessage,
|
||||
CopyMessages,
|
||||
CreateChatInviteLink,
|
||||
CreateChatSubscriptionInviteLink,
|
||||
CreateForumTopic,
|
||||
CreateInvoiceLink,
|
||||
CreateNewStickerSet,
|
||||
|
|
@ -52,6 +53,7 @@ from ..methods import (
|
|||
DeleteStickerSet,
|
||||
DeleteWebhook,
|
||||
EditChatInviteLink,
|
||||
EditChatSubscriptionInviteLink,
|
||||
EditForumTopic,
|
||||
EditGeneralForumTopic,
|
||||
EditMessageCaption,
|
||||
|
|
@ -230,6 +232,7 @@ from ..types import (
|
|||
Poll,
|
||||
ReactionTypeCustomEmoji,
|
||||
ReactionTypeEmoji,
|
||||
ReactionTypePaid,
|
||||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
|
|
@ -1325,7 +1328,7 @@ class Bot:
|
|||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editforumtopic
|
||||
|
||||
|
|
@ -4013,7 +4016,7 @@ class Bot:
|
|||
request_timeout: Optional[int] = None,
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights. Returns :code:`True` on success.
|
||||
Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editgeneralforumtopic
|
||||
|
||||
|
|
@ -4525,18 +4528,20 @@ class Bot:
|
|||
self,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
reaction: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None,
|
||||
reaction: Optional[
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
] = None,
|
||||
is_big: Optional[bool] = None,
|
||||
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. Returns :code:`True` on success.
|
||||
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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmessagereaction
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param message_id: Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.
|
||||
:param reaction: A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.
|
||||
:param reaction: A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.
|
||||
:param is_big: Pass :code:`True` to set the reaction with a big animation
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns :code:`True` on success.
|
||||
|
|
@ -4650,6 +4655,7 @@ class Bot:
|
|||
chat_id: Union[int, str],
|
||||
star_count: int,
|
||||
media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]],
|
||||
business_connection_id: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = None,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -4663,13 +4669,14 @@ class Bot:
|
|||
request_timeout: Optional[int] = None,
|
||||
) -> Message:
|
||||
"""
|
||||
Use this method to send paid media to channel chats. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
Use this method to send paid media. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendpaidmedia
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.
|
||||
:param star_count: The number of Telegram Stars that must be paid to buy access to the media
|
||||
:param media: A JSON-serialized array describing the media to be sent; up to 10 items
|
||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
|
||||
:param caption: Media caption, 0-1024 characters after entities parsing
|
||||
:param parse_mode: Mode for parsing entities in the media caption. See `formatting options <https://core.telegram.org/bots/api#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*
|
||||
|
|
@ -4686,6 +4693,7 @@ class Bot:
|
|||
chat_id=chat_id,
|
||||
star_count=star_count,
|
||||
media=media,
|
||||
business_connection_id=business_connection_id,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
@ -4696,3 +4704,58 @@ class Bot:
|
|||
reply_markup=reply_markup,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def create_chat_subscription_invite_link(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
subscription_period: Union[datetime.datetime, datetime.timedelta, int],
|
||||
subscription_price: int,
|
||||
name: Optional[str] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> ChatInviteLink:
|
||||
"""
|
||||
Use this method to create a `subscription invite link <https://telegram.org/blog/superchannels-star-reactions-subscriptions#star-subscriptions>`_ for a channel chat. The bot must have the *can_invite_users* administrator rights. The link can be edited using the method :class:`aiogram.methods.edit_chat_subscription_invite_link.EditChatSubscriptionInviteLink` or revoked using the method :class:`aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink`. Returns the new invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
|
||||
|
||||
:param chat_id: Unique identifier for the target channel chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param subscription_period: The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).
|
||||
:param subscription_price: The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500
|
||||
:param name: Invite link name; 0-32 characters
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns the new invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
|
||||
"""
|
||||
|
||||
call = CreateChatSubscriptionInviteLink(
|
||||
chat_id=chat_id,
|
||||
subscription_period=subscription_period,
|
||||
subscription_price=subscription_price,
|
||||
name=name,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
||||
async def edit_chat_subscription_invite_link(
|
||||
self,
|
||||
chat_id: Union[int, str],
|
||||
invite_link: str,
|
||||
name: Optional[str] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> ChatInviteLink:
|
||||
"""
|
||||
Use this method to edit a subscription invite link created by the bot. The bot must have the *can_invite_users* administrator rights. Returns the edited invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
|
||||
|
||||
:param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)
|
||||
:param invite_link: The invite link to edit
|
||||
:param name: Invite link name; 0-32 characters
|
||||
:param request_timeout: Request timeout
|
||||
:return: Returns the edited invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
|
||||
"""
|
||||
|
||||
call = EditChatSubscriptionInviteLink(
|
||||
chat_id=chat_id,
|
||||
invite_link=invite_link,
|
||||
name=name,
|
||||
)
|
||||
return await self(call, request_timeout=request_timeout)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ from .close_general_forum_topic import CloseGeneralForumTopic
|
|||
from .copy_message import CopyMessage
|
||||
from .copy_messages import CopyMessages
|
||||
from .create_chat_invite_link import CreateChatInviteLink
|
||||
from .create_chat_subscription_invite_link import CreateChatSubscriptionInviteLink
|
||||
from .create_forum_topic import CreateForumTopic
|
||||
from .create_invoice_link import CreateInvoiceLink
|
||||
from .create_new_sticker_set import CreateNewStickerSet
|
||||
|
|
@ -28,6 +29,7 @@ from .delete_sticker_from_set import DeleteStickerFromSet
|
|||
from .delete_sticker_set import DeleteStickerSet
|
||||
from .delete_webhook import DeleteWebhook
|
||||
from .edit_chat_invite_link import EditChatInviteLink
|
||||
from .edit_chat_subscription_invite_link import EditChatSubscriptionInviteLink
|
||||
from .edit_forum_topic import EditForumTopic
|
||||
from .edit_general_forum_topic import EditGeneralForumTopic
|
||||
from .edit_message_caption import EditMessageCaption
|
||||
|
|
@ -140,6 +142,7 @@ __all__ = (
|
|||
"CopyMessage",
|
||||
"CopyMessages",
|
||||
"CreateChatInviteLink",
|
||||
"CreateChatSubscriptionInviteLink",
|
||||
"CreateForumTopic",
|
||||
"CreateInvoiceLink",
|
||||
"CreateNewStickerSet",
|
||||
|
|
@ -154,6 +157,7 @@ __all__ = (
|
|||
"DeleteStickerSet",
|
||||
"DeleteWebhook",
|
||||
"EditChatInviteLink",
|
||||
"EditChatSubscriptionInviteLink",
|
||||
"EditForumTopic",
|
||||
"EditGeneralForumTopic",
|
||||
"EditMessageCaption",
|
||||
|
|
|
|||
52
aiogram/methods/create_chat_subscription_invite_link.py
Normal file
52
aiogram/methods/create_chat_subscription_invite_link.py
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
from typing import TYPE_CHECKING, Any, Optional, Union
|
||||
|
||||
from ..types import ChatInviteLink
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
class CreateChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
|
||||
"""
|
||||
Use this method to create a `subscription invite link <https://telegram.org/blog/superchannels-star-reactions-subscriptions#star-subscriptions>`_ for a channel chat. The bot must have the *can_invite_users* administrator rights. The link can be edited using the method :class:`aiogram.methods.edit_chat_subscription_invite_link.EditChatSubscriptionInviteLink` or revoked using the method :class:`aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink`. Returns the new invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
|
||||
"""
|
||||
|
||||
__returning__ = ChatInviteLink
|
||||
__api_method__ = "createChatSubscriptionInviteLink"
|
||||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target channel chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
subscription_period: Union[datetime.datetime, datetime.timedelta, int]
|
||||
"""The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days)."""
|
||||
subscription_price: int
|
||||
"""The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500"""
|
||||
name: Optional[str] = None
|
||||
"""Invite link name; 0-32 characters"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
chat_id: Union[int, str],
|
||||
subscription_period: Union[datetime.datetime, datetime.timedelta, int],
|
||||
subscription_price: int,
|
||||
name: Optional[str] = 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__(
|
||||
chat_id=chat_id,
|
||||
subscription_period=subscription_period,
|
||||
subscription_price=subscription_price,
|
||||
name=name,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
44
aiogram/methods/edit_chat_subscription_invite_link.py
Normal file
44
aiogram/methods/edit_chat_subscription_invite_link.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Optional, Union
|
||||
|
||||
from ..types import ChatInviteLink
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
class EditChatSubscriptionInviteLink(TelegramMethod[ChatInviteLink]):
|
||||
"""
|
||||
Use this method to edit a subscription invite link created by the bot. The bot must have the *can_invite_users* administrator rights. Returns the edited invite link as a :class:`aiogram.types.chat_invite_link.ChatInviteLink` object.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
|
||||
"""
|
||||
|
||||
__returning__ = ChatInviteLink
|
||||
__api_method__ = "editChatSubscriptionInviteLink"
|
||||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
invite_link: str
|
||||
"""The invite link to edit"""
|
||||
name: Optional[str] = None
|
||||
"""Invite link name; 0-32 characters"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
chat_id: Union[int, str],
|
||||
invite_link: str,
|
||||
name: Optional[str] = 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__(
|
||||
chat_id=chat_id, invite_link=invite_link, name=name, **__pydantic_kwargs
|
||||
)
|
||||
|
|
@ -7,7 +7,7 @@ from .base import TelegramMethod
|
|||
|
||||
class EditForumTopic(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights, unless it is the creator of the topic. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editforumtopic
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from .base import TelegramMethod
|
|||
|
||||
class EditGeneralForumTopic(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have *can_manage_topics* administrator rights. Returns :code:`True` on success.
|
||||
Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the *can_manage_topics* administrator rights. Returns :code:`True` on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#editgeneralforumtopic
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from .base import TelegramMethod
|
|||
|
||||
class SendPaidMedia(TelegramMethod[Message]):
|
||||
"""
|
||||
Use this method to send paid media to channel chats. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
Use this method to send paid media. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendpaidmedia
|
||||
"""
|
||||
|
|
@ -27,11 +27,13 @@ class SendPaidMedia(TelegramMethod[Message]):
|
|||
__api_method__ = "sendPaidMedia"
|
||||
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance."""
|
||||
star_count: int
|
||||
"""The number of Telegram Stars that must be paid to buy access to the media"""
|
||||
media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]]
|
||||
"""A JSON-serialized array describing the media to be sent; up to 10 items"""
|
||||
business_connection_id: Optional[str] = None
|
||||
"""Unique identifier of the business connection on behalf of which the message will be sent"""
|
||||
caption: Optional[str] = None
|
||||
"""Media caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = None
|
||||
|
|
@ -61,6 +63,7 @@ class SendPaidMedia(TelegramMethod[Message]):
|
|||
chat_id: Union[int, str],
|
||||
star_count: int,
|
||||
media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]],
|
||||
business_connection_id: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = None,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -81,6 +84,7 @@ class SendPaidMedia(TelegramMethod[Message]):
|
|||
chat_id=chat_id,
|
||||
star_count=star_count,
|
||||
media=media,
|
||||
business_connection_id=business_connection_id,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
||||
|
||||
from ..types import ReactionTypeCustomEmoji, ReactionTypeEmoji
|
||||
from ..types import ReactionTypeCustomEmoji, ReactionTypeEmoji, ReactionTypePaid
|
||||
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. Returns :code:`True` on success.
|
||||
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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmessagereaction
|
||||
"""
|
||||
|
|
@ -18,8 +18,10 @@ class SetMessageReaction(TelegramMethod[bool]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)"""
|
||||
message_id: int
|
||||
"""Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead."""
|
||||
reaction: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None
|
||||
"""A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators."""
|
||||
reaction: Optional[
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
] = None
|
||||
"""A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots."""
|
||||
is_big: Optional[bool] = None
|
||||
"""Pass :code:`True` to set the reaction with a big animation"""
|
||||
|
||||
|
|
@ -32,7 +34,9 @@ class SetMessageReaction(TelegramMethod[bool]):
|
|||
*,
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
reaction: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None,
|
||||
reaction: Optional[
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
] = None,
|
||||
is_big: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@ from .reaction_count import ReactionCount
|
|||
from .reaction_type import ReactionType
|
||||
from .reaction_type_custom_emoji import ReactionTypeCustomEmoji
|
||||
from .reaction_type_emoji import ReactionTypeEmoji
|
||||
from .reaction_type_paid import ReactionTypePaid
|
||||
from .refunded_payment import RefundedPayment
|
||||
from .reply_keyboard_markup import ReplyKeyboardMarkup
|
||||
from .reply_keyboard_remove import ReplyKeyboardRemove
|
||||
|
|
@ -419,6 +420,7 @@ __all__ = (
|
|||
"ReactionType",
|
||||
"ReactionTypeCustomEmoji",
|
||||
"ReactionTypeEmoji",
|
||||
"ReactionTypePaid",
|
||||
"RefundedPayment",
|
||||
"ReplyKeyboardMarkup",
|
||||
"ReplyKeyboardRemove",
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ if TYPE_CHECKING:
|
|||
from .message import Message
|
||||
from .reaction_type_custom_emoji import ReactionTypeCustomEmoji
|
||||
from .reaction_type_emoji import ReactionTypeEmoji
|
||||
from .reaction_type_paid import ReactionTypePaid
|
||||
|
||||
|
||||
class Chat(TelegramObject):
|
||||
|
|
@ -83,9 +84,9 @@ class Chat(TelegramObject):
|
|||
|
||||
.. deprecated:: API:7.3
|
||||
https://core.telegram.org/bots/api-changelog#may-6-2024"""
|
||||
available_reactions: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = Field(
|
||||
None, json_schema_extra={"deprecated": True}
|
||||
)
|
||||
available_reactions: Optional[
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
] = Field(None, json_schema_extra={"deprecated": True})
|
||||
"""*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions <https://core.telegram.org/bots/api#reactiontypeemoji>`_ are allowed. Returned only in :class:`aiogram.methods.get_chat.GetChat`.
|
||||
|
||||
.. deprecated:: API:7.3
|
||||
|
|
@ -284,7 +285,7 @@ class Chat(TelegramObject):
|
|||
accent_color_id: Optional[int] = None,
|
||||
active_usernames: Optional[List[str]] = None,
|
||||
available_reactions: Optional[
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
] = None,
|
||||
background_custom_emoji_id: Optional[str] = None,
|
||||
bio: Optional[str] = None,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ if TYPE_CHECKING:
|
|||
from .message import Message
|
||||
from .reaction_type_custom_emoji import ReactionTypeCustomEmoji
|
||||
from .reaction_type_emoji import ReactionTypeEmoji
|
||||
from .reaction_type_paid import ReactionTypePaid
|
||||
|
||||
|
||||
class ChatFullInfo(Chat):
|
||||
|
|
@ -57,7 +58,9 @@ class ChatFullInfo(Chat):
|
|||
"""*Optional*. For private chats with business accounts, the opening hours of the business"""
|
||||
personal_chat: Optional[Chat] = None
|
||||
"""*Optional*. For private chats, the personal channel of the user"""
|
||||
available_reactions: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None
|
||||
available_reactions: Optional[
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
] = None
|
||||
"""*Optional*. List of available reactions allowed in the chat. If omitted, then all `emoji reactions <https://core.telegram.org/bots/api#reactiontypeemoji>`_ are allowed."""
|
||||
background_custom_emoji_id: Optional[str] = None
|
||||
"""*Optional*. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background"""
|
||||
|
|
@ -138,7 +141,7 @@ class ChatFullInfo(Chat):
|
|||
business_opening_hours: Optional[BusinessOpeningHours] = None,
|
||||
personal_chat: Optional[Chat] = None,
|
||||
available_reactions: Optional[
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
] = None,
|
||||
background_custom_emoji_id: Optional[str] = None,
|
||||
profile_accent_color_id: Optional[int] = None,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional
|
||||
|
||||
from ..enums import ChatMemberStatus
|
||||
from .chat_member import ChatMember
|
||||
from .custom import DateTime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .user import User
|
||||
|
|
@ -20,6 +21,8 @@ class ChatMemberMember(ChatMember):
|
|||
"""The member's status in the chat, always 'member'"""
|
||||
user: User
|
||||
"""Information about the user"""
|
||||
until_date: Optional[DateTime] = None
|
||||
"""*Optional*. Date when the user's subscription will expire; Unix time"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -30,10 +33,11 @@ class ChatMemberMember(ChatMember):
|
|||
*,
|
||||
status: Literal[ChatMemberStatus.MEMBER] = ChatMemberStatus.MEMBER,
|
||||
user: User,
|
||||
until_date: Optional[DateTime] = 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__(status=status, user=user, **__pydantic_kwargs)
|
||||
super().__init__(status=status, user=user, until_date=until_date, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ if TYPE_CHECKING:
|
|||
from .proximity_alert_triggered import ProximityAlertTriggered
|
||||
from .reaction_type_custom_emoji import ReactionTypeCustomEmoji
|
||||
from .reaction_type_emoji import ReactionTypeEmoji
|
||||
from .reaction_type_paid import ReactionTypePaid
|
||||
from .refunded_payment import RefundedPayment
|
||||
from .reply_keyboard_markup import ReplyKeyboardMarkup
|
||||
from .reply_keyboard_remove import ReplyKeyboardRemove
|
||||
|
|
@ -138,9 +139,9 @@ class Message(MaybeInaccessibleMessage):
|
|||
message_thread_id: Optional[int] = None
|
||||
"""*Optional*. Unique identifier of a message thread to which the message belongs; for supergroups only"""
|
||||
from_user: Optional[User] = Field(None, alias="from")
|
||||
"""*Optional*. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."""
|
||||
"""*Optional*. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats"""
|
||||
sender_chat: Optional[Chat] = None
|
||||
"""*Optional*. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field *from* contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."""
|
||||
"""*Optional*. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field *from* contains a fake sender user in non-channel chats."""
|
||||
sender_boost_count: Optional[int] = None
|
||||
"""*Optional*. If the sender of the message boosted the chat, the number of boosts added by the user"""
|
||||
sender_business_bot: Optional[User] = None
|
||||
|
|
@ -4058,7 +4059,9 @@ class Message(MaybeInaccessibleMessage):
|
|||
|
||||
def react(
|
||||
self,
|
||||
reaction: Optional[List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]] = None,
|
||||
reaction: Optional[
|
||||
List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
] = None,
|
||||
is_big: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
) -> SetMessageReaction:
|
||||
|
|
@ -4069,11 +4072,11 @@ class Message(MaybeInaccessibleMessage):
|
|||
- :code:`chat_id`
|
||||
- :code:`message_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. Returns :code:`True` on success.
|
||||
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.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmessagereaction
|
||||
|
||||
:param reaction: A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.
|
||||
:param reaction: A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.
|
||||
:param is_big: Pass :code:`True` to set the reaction with a big animation
|
||||
:return: instance of method :class:`aiogram.methods.set_message_reaction.SetMessageReaction`
|
||||
"""
|
||||
|
|
@ -4118,7 +4121,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
- :code:`message_thread_id`
|
||||
- :code:`business_connection_id`
|
||||
|
||||
Use this method to send paid media to channel chats. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
Use this method to send paid media. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendpaidmedia
|
||||
|
||||
|
|
@ -4184,7 +4187,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
- :code:`business_connection_id`
|
||||
- :code:`reply_parameters`
|
||||
|
||||
Use this method to send paid media to channel chats. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
Use this method to send paid media. On success, the sent :class:`aiogram.types.message.Message` is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#sendpaidmedia
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ if TYPE_CHECKING:
|
|||
from .custom import DateTime
|
||||
from .reaction_type_custom_emoji import ReactionTypeCustomEmoji
|
||||
from .reaction_type_emoji import ReactionTypeEmoji
|
||||
from .reaction_type_paid import ReactionTypePaid
|
||||
from .user import User
|
||||
|
||||
|
||||
|
|
@ -25,9 +26,9 @@ class MessageReactionUpdated(TelegramObject):
|
|||
"""Unique identifier of the message inside the chat"""
|
||||
date: DateTime
|
||||
"""Date of the change in Unix time"""
|
||||
old_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]
|
||||
old_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
"""Previous list of reaction types that were set by the user"""
|
||||
new_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]]
|
||||
new_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
|
||||
"""New list of reaction types that have been set by the user"""
|
||||
user: Optional[User] = None
|
||||
"""*Optional*. The user that changed the reaction, if the user isn't anonymous"""
|
||||
|
|
@ -44,8 +45,12 @@ class MessageReactionUpdated(TelegramObject):
|
|||
chat: Chat,
|
||||
message_id: int,
|
||||
date: DateTime,
|
||||
old_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]],
|
||||
new_reaction: List[Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]],
|
||||
old_reaction: List[
|
||||
Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]
|
||||
],
|
||||
new_reaction: List[
|
||||
Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]
|
||||
],
|
||||
user: Optional[User] = None,
|
||||
actor_chat: Optional[Chat] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from .base import TelegramObject
|
|||
if TYPE_CHECKING:
|
||||
from .reaction_type_custom_emoji import ReactionTypeCustomEmoji
|
||||
from .reaction_type_emoji import ReactionTypeEmoji
|
||||
from .reaction_type_paid import ReactionTypePaid
|
||||
|
||||
|
||||
class ReactionCount(TelegramObject):
|
||||
|
|
@ -16,7 +17,7 @@ class ReactionCount(TelegramObject):
|
|||
Source: https://core.telegram.org/bots/api#reactioncount
|
||||
"""
|
||||
|
||||
type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji]
|
||||
type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]
|
||||
"""Type of the reaction"""
|
||||
total_count: int
|
||||
"""Number of times the reaction was added"""
|
||||
|
|
@ -28,7 +29,7 @@ class ReactionCount(TelegramObject):
|
|||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji],
|
||||
type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid],
|
||||
total_count: int,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class ReactionType(TelegramObject):
|
|||
|
||||
- :class:`aiogram.types.reaction_type_emoji.ReactionTypeEmoji`
|
||||
- :class:`aiogram.types.reaction_type_custom_emoji.ReactionTypeCustomEmoji`
|
||||
- :class:`aiogram.types.reaction_type_paid.ReactionTypePaid`
|
||||
|
||||
Source: https://core.telegram.org/bots/api#reactiontype
|
||||
"""
|
||||
|
|
|
|||
28
aiogram/types/reaction_type_paid.py
Normal file
28
aiogram/types/reaction_type_paid.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import ReactionTypeType
|
||||
from .reaction_type import ReactionType
|
||||
|
||||
|
||||
class ReactionTypePaid(ReactionType):
|
||||
"""
|
||||
The reaction is paid.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#reactiontypepaid
|
||||
"""
|
||||
|
||||
type: Literal["paid"] = "paid"
|
||||
"""Type of the reaction, always 'paid'"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, type: Literal["paid"] = "paid", **__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, **__pydantic_kwargs)
|
||||
|
|
@ -1,11 +1,14 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import TransactionPartnerType
|
||||
from .transaction_partner import TransactionPartner
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .paid_media_photo import PaidMediaPhoto
|
||||
from .paid_media_preview import PaidMediaPreview
|
||||
from .paid_media_video import PaidMediaVideo
|
||||
from .user import User
|
||||
|
||||
|
||||
|
|
@ -22,6 +25,8 @@ class TransactionPartnerUser(TransactionPartner):
|
|||
"""Information about the user"""
|
||||
invoice_payload: Optional[str] = None
|
||||
"""*Optional*. Bot-specified invoice payload"""
|
||||
paid_media: Optional[List[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]]] = None
|
||||
"""*Optional*. Information about the paid media bought by the user"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -33,6 +38,9 @@ class TransactionPartnerUser(TransactionPartner):
|
|||
type: Literal[TransactionPartnerType.USER] = TransactionPartnerType.USER,
|
||||
user: User,
|
||||
invoice_payload: Optional[str] = None,
|
||||
paid_media: Optional[
|
||||
List[Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
@ -40,5 +48,9 @@ class TransactionPartnerUser(TransactionPartner):
|
|||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type, user=user, invoice_payload=invoice_payload, **__pydantic_kwargs
|
||||
type=type,
|
||||
user=user,
|
||||
invoice_payload=invoice_payload,
|
||||
paid_media=paid_media,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
45
docs/api/methods/create_chat_subscription_invite_link.rst
Normal file
45
docs/api/methods/create_chat_subscription_invite_link.rst
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
################################
|
||||
createChatSubscriptionInviteLink
|
||||
################################
|
||||
|
||||
Returns: :obj:`ChatInviteLink`
|
||||
|
||||
.. automodule:: aiogram.methods.create_chat_subscription_invite_link
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
:exclude-members: model_config,model_fields
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
As bot method
|
||||
-------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: ChatInviteLink = await bot.create_chat_subscription_invite_link(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
Imports:
|
||||
|
||||
- :code:`from aiogram.methods.create_chat_subscription_invite_link import CreateChatSubscriptionInviteLink`
|
||||
- alias: :code:`from aiogram.methods import CreateChatSubscriptionInviteLink`
|
||||
|
||||
With specific bot
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result: ChatInviteLink = await bot(CreateChatSubscriptionInviteLink(...))
|
||||
|
||||
As reply into Webhook in handler
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
return CreateChatSubscriptionInviteLink(...)
|
||||
45
docs/api/methods/edit_chat_subscription_invite_link.rst
Normal file
45
docs/api/methods/edit_chat_subscription_invite_link.rst
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
##############################
|
||||
editChatSubscriptionInviteLink
|
||||
##############################
|
||||
|
||||
Returns: :obj:`ChatInviteLink`
|
||||
|
||||
.. automodule:: aiogram.methods.edit_chat_subscription_invite_link
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
:exclude-members: model_config,model_fields
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
As bot method
|
||||
-------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: ChatInviteLink = await bot.edit_chat_subscription_invite_link(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
Imports:
|
||||
|
||||
- :code:`from aiogram.methods.edit_chat_subscription_invite_link import EditChatSubscriptionInviteLink`
|
||||
- alias: :code:`from aiogram.methods import EditChatSubscriptionInviteLink`
|
||||
|
||||
With specific bot
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result: ChatInviteLink = await bot(EditChatSubscriptionInviteLink(...))
|
||||
|
||||
As reply into Webhook in handler
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
return EditChatSubscriptionInviteLink(...)
|
||||
|
|
@ -44,6 +44,7 @@ Available methods
|
|||
copy_message
|
||||
copy_messages
|
||||
create_chat_invite_link
|
||||
create_chat_subscription_invite_link
|
||||
create_forum_topic
|
||||
decline_chat_join_request
|
||||
delete_chat_photo
|
||||
|
|
@ -51,6 +52,7 @@ Available methods
|
|||
delete_forum_topic
|
||||
delete_my_commands
|
||||
edit_chat_invite_link
|
||||
edit_chat_subscription_invite_link
|
||||
edit_forum_topic
|
||||
edit_general_forum_topic
|
||||
export_chat_invite_link
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ Available types
|
|||
reaction_type
|
||||
reaction_type_custom_emoji
|
||||
reaction_type_emoji
|
||||
reaction_type_paid
|
||||
reply_keyboard_markup
|
||||
reply_keyboard_remove
|
||||
reply_parameters
|
||||
|
|
|
|||
10
docs/api/types/reaction_type_paid.rst
Normal file
10
docs/api/types/reaction_type_paid.rst
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
################
|
||||
ReactionTypePaid
|
||||
################
|
||||
|
||||
|
||||
.. automodule:: aiogram.types.reaction_type_paid
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
:exclude-members: model_config,model_fields
|
||||
|
|
@ -93,12 +93,12 @@ docs = [
|
|||
"sphinx-copybutton~=0.5.2",
|
||||
"furo~=2023.9.10",
|
||||
"Sphinx-Substitution-Extensions~=2022.2.16",
|
||||
"towncrier~=23.6.0",
|
||||
"towncrier~=24.7.1",
|
||||
"pygments~=2.16.1",
|
||||
"pymdown-extensions~=10.3",
|
||||
"markdown-include~=0.8.1",
|
||||
"Pygments~=2.16.1",
|
||||
"sphinxcontrib-towncrier~=0.3.2a0",
|
||||
"sphinxcontrib-towncrier~=0.4.0a0",
|
||||
]
|
||||
dev = [
|
||||
"black~=24.4.2",
|
||||
|
|
@ -331,6 +331,9 @@ filename = "CHANGES.rst"
|
|||
directory = "CHANGES/"
|
||||
template = "CHANGES/.template.rst.jinja2"
|
||||
issue_format = "`#{issue} <https://github.com/aiogram/aiogram/issues/{issue}>`_"
|
||||
ignore = [
|
||||
".template.rst.jinja2",
|
||||
]
|
||||
|
||||
[[tool.towncrier.section]]
|
||||
path = ""
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import json
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
|
|
@ -35,8 +36,11 @@ def get_package_version() -> str:
|
|||
|
||||
|
||||
def get_telegram_api_version() -> str:
|
||||
path = Path.cwd() / ".butcher" / "schema" / "schema.json"
|
||||
schema = json.loads(path.read_text())
|
||||
version = schema["api"]["version"]
|
||||
path = Path.cwd() / ".apiversion"
|
||||
version = path.read_text().strip()
|
||||
path.write_text(version + "\n")
|
||||
return version
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
from datetime import timedelta
|
||||
|
||||
from aiogram.methods import (
|
||||
CreateChatInviteLink,
|
||||
CreateChatSubscriptionInviteLink,
|
||||
Request,
|
||||
)
|
||||
from aiogram.types import ChatInviteLink, User
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestCreateChatSubscriptionInviteLink:
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(
|
||||
CreateChatSubscriptionInviteLink,
|
||||
ok=True,
|
||||
result=ChatInviteLink(
|
||||
invite_link="https://t.me/username",
|
||||
creator=User(id=42, is_bot=False, first_name="User"),
|
||||
is_primary=False,
|
||||
is_revoked=False,
|
||||
creates_join_request=False,
|
||||
),
|
||||
)
|
||||
|
||||
response: ChatInviteLink = await bot.create_chat_subscription_invite_link(
|
||||
chat_id=-42,
|
||||
subscription_period=timedelta(days=30),
|
||||
subscription_price=42,
|
||||
)
|
||||
request = bot.get_request()
|
||||
assert response == prepare_result.result
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
from datetime import timedelta
|
||||
|
||||
from aiogram.methods import (
|
||||
CreateChatInviteLink,
|
||||
CreateChatSubscriptionInviteLink,
|
||||
EditChatSubscriptionInviteLink,
|
||||
Request,
|
||||
)
|
||||
from aiogram.types import ChatInviteLink, User
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestEditChatSubscriptionInviteLink:
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(
|
||||
EditChatSubscriptionInviteLink,
|
||||
ok=True,
|
||||
result=ChatInviteLink(
|
||||
invite_link="https://t.me/username",
|
||||
creator=User(id=42, is_bot=False, first_name="User"),
|
||||
is_primary=False,
|
||||
is_revoked=False,
|
||||
creates_join_request=False,
|
||||
),
|
||||
)
|
||||
|
||||
response: ChatInviteLink = await bot.edit_chat_subscription_invite_link(
|
||||
chat_id=-42,
|
||||
invite_link="https://t.me/username/test",
|
||||
name="test",
|
||||
)
|
||||
request = bot.get_request()
|
||||
assert response == prepare_result.result
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
from unittest.mock import patch
|
||||
from datetime import datetime
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
@ -9,13 +9,13 @@ from aiogram.dispatcher.middlewares.user_context import (
|
|||
)
|
||||
from aiogram.types import (
|
||||
Chat,
|
||||
Update,
|
||||
User,
|
||||
ChatBoostUpdated,
|
||||
ChatBoost,
|
||||
ChatBoostSourcePremium,
|
||||
ChatBoostSourceGiftCode,
|
||||
ChatBoostSourceGiveaway,
|
||||
ChatBoostSourcePremium,
|
||||
ChatBoostUpdated,
|
||||
Update,
|
||||
User,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue