mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-14 19:00:23 +00:00
Adding new code-generator (Butcher) (#1069)
* Re-generate types * Re-generate methods (only attributes) * Added enums * Base init generator * Added butcher configs * Fixed tests, bump butcher * Added changelog * Added enum docs * Added templates for docs index * Re-generate bot class, remove deprecated methods
This commit is contained in:
parent
c7779abc50
commit
d034c1ba9f
387 changed files with 32036 additions and 3144 deletions
108
.butcher/types/Chat/aliases.yml
Normal file
108
.butcher/types/Chat/aliases.yml
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
#ban_sender_chat:
|
||||
# method: banChatSenderChat
|
||||
# fill: &self
|
||||
# chat_id: self.id
|
||||
#
|
||||
#unban_sender_chat:
|
||||
# method: unbanChatSenderChat
|
||||
# fill: *self
|
||||
#
|
||||
#get_administrators:
|
||||
# method: getChatAdministrators
|
||||
# fill: *self
|
||||
#
|
||||
#delete_message:
|
||||
# method: deleteMessage
|
||||
# fill: *self
|
||||
#
|
||||
#revoke_invite_link:
|
||||
# method: revokeChatInviteLink
|
||||
# fill: *self
|
||||
#
|
||||
#edit_invite_link:
|
||||
# method: editChatInviteLink
|
||||
# fill: *self
|
||||
#
|
||||
#create_invite_link:
|
||||
# method: createChatInviteLink
|
||||
# fill: *self
|
||||
#
|
||||
#export_invite_link:
|
||||
# method: exportChatInviteLink
|
||||
# fill: *self
|
||||
#
|
||||
#do:
|
||||
# method: sendChatAction
|
||||
# fill: *self
|
||||
#
|
||||
#delete_sticker_set:
|
||||
# method: deleteChatStickerSet
|
||||
# fill: *self
|
||||
#
|
||||
#set_sticker_set:
|
||||
# method: setChatStickerSet
|
||||
# fill: *self
|
||||
#
|
||||
#get_member:
|
||||
# method: getChatMember
|
||||
# fill: *self
|
||||
#
|
||||
#get_member_count:
|
||||
# method: getChatMemberCount
|
||||
# fill: *self
|
||||
#
|
||||
#leave:
|
||||
# method: leaveChat
|
||||
# fill: *self
|
||||
#
|
||||
#unpin_all_messages:
|
||||
# method: unpinAllChatMessages
|
||||
# fill: *self
|
||||
#
|
||||
#unpin_message:
|
||||
# method: unpinChatMessage
|
||||
# fill: *self
|
||||
#
|
||||
#pin_message:
|
||||
# method: pinChatMessage
|
||||
# fill: *self
|
||||
#
|
||||
#set_administrator_custom_title:
|
||||
# method: setChatAdministratorCustomTitle
|
||||
# fill: *self
|
||||
#
|
||||
#set_permissions:
|
||||
# method: setChatPermissions
|
||||
# fill: *self
|
||||
#
|
||||
#promote:
|
||||
# method: promoteChatMember
|
||||
# fill: *self
|
||||
#
|
||||
#restrict:
|
||||
# method: restrictChatMember
|
||||
# fill: *self
|
||||
#
|
||||
#unban:
|
||||
# method: unbanChatMember
|
||||
# fill: *self
|
||||
#
|
||||
#ban:
|
||||
# method: banChatMember
|
||||
# fill: *self
|
||||
#
|
||||
#set_description:
|
||||
# method: setChatDescription
|
||||
# fill: *self
|
||||
#
|
||||
#set_title:
|
||||
# method: setChatTitle
|
||||
# fill: *self
|
||||
#
|
||||
#delete_photo:
|
||||
# method: deleteChatPhoto
|
||||
# fill: *self
|
||||
#
|
||||
#set_photo:
|
||||
# method: setChatPhoto
|
||||
# fill: *self
|
||||
227
.butcher/types/Chat/entity.json
Normal file
227
.butcher/types/Chat/entity.json
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
{
|
||||
"meta": {
|
||||
"deprecated": false
|
||||
},
|
||||
"group": {
|
||||
"title": "Available types",
|
||||
"anchor": "available-types"
|
||||
},
|
||||
"object": {
|
||||
"anchor": "chat",
|
||||
"name": "Chat",
|
||||
"description": "This object represents a chat.",
|
||||
"html_description": "<p>This object represents a chat.</p>",
|
||||
"rst_description": "This object represents a chat.",
|
||||
"annotations": [
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.",
|
||||
"html_description": "<td>Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.</td>",
|
||||
"rst_description": "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.\n",
|
||||
"name": "id",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'",
|
||||
"html_description": "<td>Type of chat, can be either “private”, “group”, “supergroup” or “channel”</td>",
|
||||
"rst_description": "Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'\n",
|
||||
"name": "type",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Title, for supergroups, channels and group chats",
|
||||
"html_description": "<td><em>Optional</em>. Title, for supergroups, channels and group chats</td>",
|
||||
"rst_description": "*Optional*. Title, for supergroups, channels and group chats\n",
|
||||
"name": "title",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Username, for private chats, supergroups and channels if available",
|
||||
"html_description": "<td><em>Optional</em>. Username, for private chats, supergroups and channels if available</td>",
|
||||
"rst_description": "*Optional*. Username, for private chats, supergroups and channels if available\n",
|
||||
"name": "username",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "First name of the other party in a private chat",
|
||||
"html_description": "<td><em>Optional</em>. First name of the other party in a private chat</td>",
|
||||
"rst_description": "*Optional*. First name of the other party in a private chat\n",
|
||||
"name": "first_name",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Last name of the other party in a private chat",
|
||||
"html_description": "<td><em>Optional</em>. Last name of the other party in a private chat</td>",
|
||||
"rst_description": "*Optional*. Last name of the other party in a private chat\n",
|
||||
"name": "last_name",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "True",
|
||||
"description": "True, if the supergroup chat is a forum (has topics enabled)",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the supergroup chat is a forum (has <a href=\"https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups\">topics</a> enabled)</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the supergroup chat is a forum (has `topics <https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups>`_ enabled)\n",
|
||||
"name": "is_forum",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "ChatPhoto",
|
||||
"description": "Chat photo. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. Chat photo. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "photo",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Array of String",
|
||||
"description": "If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. If non-empty, the list of all <a href=\"https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames\">active chat usernames</a>; for private chats, supergroups and channels. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. If non-empty, the list of all `active chat usernames <https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames>`_; for private chats, supergroups and channels. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "active_usernames",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "emoji_status_custom_emoji_id",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Bio of the other party in a private chat. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. Bio of the other party in a private chat. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "bio",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "True",
|
||||
"description": "True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if privacy settings of the other party in the private chat allows to use <code>tg://user?id=<user_id></code> links only in chats with the user. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if privacy settings of the other party in the private chat allows to use :code:`tg://user?id=<user_id>` links only in chats with the user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "has_private_forwards",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "True",
|
||||
"description": "True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "has_restricted_voice_and_video_messages",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "True",
|
||||
"description": "True, if users need to join the supergroup before they can send messages. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if users need to join the supergroup before they can send messages. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if users need to join the supergroup before they can send messages. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "join_to_send_messages",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "True",
|
||||
"description": "True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "join_by_request",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Description, for groups, supergroups and channel chats. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. Description, for groups, supergroups and channel chats. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "description",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. Primary invite link, for groups, supergroups and channel chats. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. Primary invite link, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "invite_link",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Message",
|
||||
"description": "The most recent pinned message (by sending date). Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. The most recent pinned message (by sending date). Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. The most recent pinned message (by sending date). Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "pinned_message",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "ChatPermissions",
|
||||
"description": "Default chat member permissions, for groups and supergroups. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. Default chat member permissions, for groups and supergroups. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. Default chat member permissions, for groups and supergroups. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "permissions",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "slow_mode_delay",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "message_auto_delete_time",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "True",
|
||||
"description": "True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if messages from the chat can't be forwarded to other chats. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if messages from the chat can't be forwarded to other chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "has_protected_content",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "String",
|
||||
"description": "For supergroups, name of group sticker set. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. For supergroups, name of group sticker set. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "sticker_set_name",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "True",
|
||||
"description": "True, if the bot can change the group sticker set. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. <em>True</em>, if the bot can change the group sticker set. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. :code:`True`, if the bot can change the group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "can_set_sticker_set",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "Integer",
|
||||
"description": "Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "linked_chat_id",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"type": "ChatLocation",
|
||||
"description": "For supergroups, the location to which the supergroup is connected. Returned only in getChat.",
|
||||
"html_description": "<td><em>Optional</em>. For supergroups, the location to which the supergroup is connected. Returned only in <a href=\"#getchat\">getChat</a>.</td>",
|
||||
"rst_description": "*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`.\n",
|
||||
"name": "location",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"category": "types"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue