Skip to content

Commit 7e485eb

Browse files
committed
feat: add support for Bot API v9.5
1 parent 079fc93 commit 7e485eb

3 files changed

Lines changed: 174 additions & 13 deletions

File tree

scripts/generate.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,8 @@ export const OVERRIDES: OverridesConfig = {
562562
description: { markdown: 'An object for description of the message to reply to' },
563563
},
564564
reply_markup: {
565-
hash: '4c4ef597',
566-
description: { markdown: 'An object for an inline keyboard' },
565+
hash: '8e7e33f9',
566+
description: { markdown: 'An object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards)' },
567567
},
568568
},
569569
},
@@ -586,7 +586,7 @@ export const OVERRIDES: OverridesConfig = {
586586
},
587587
},
588588
sendMessageDraft: {
589-
hash: '6c498693',
589+
hash: 'ad63e96c',
590590
returnType: T_bool(true),
591591
parameters: {
592592
parse_mode: {
@@ -673,6 +673,10 @@ export const OVERRIDES: OverridesConfig = {
673673
hash: '9cfe82c8',
674674
returnType: T_bool(true),
675675
},
676+
setChatMemberTag: {
677+
hash: 'e6c47c61',
678+
returnType: T_bool(true),
679+
},
676680
banChatSenderChat: {
677681
hash: '177eedad',
678682
returnType: T_bool(true),
@@ -1208,8 +1212,8 @@ export const OVERRIDES: OverridesConfig = {
12081212
description: { markdown: 'An object for the new checklist' },
12091213
},
12101214
reply_markup: {
1211-
hash: '267f4d12',
1212-
description: { markdown: 'An object for the new inline keyboard for the message' },
1215+
hash: '3a38effd',
1216+
description: { markdown: 'An object for the new [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) for the message' },
12131217
},
12141218
},
12151219
},
@@ -1937,7 +1941,7 @@ export const OVERRIDES: OverridesConfig = {
19371941
hash: '',
19381942
fields: {
19391943
type: {
1940-
hash: 'd0f5832e',
1944+
hash: '717c0bdd',
19411945
type: T_strUnion(
19421946
'mention',
19431947
'hashtag',
@@ -1958,6 +1962,7 @@ export const OVERRIDES: OverridesConfig = {
19581962
'text_link',
19591963
'text_mention',
19601964
'custom_emoji',
1965+
'date_time',
19611966
),
19621967
},
19631968
},

src/methods.gen.ts

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4225,7 +4225,7 @@ const sendChecklist: ApiMethod = {
42254225
name: 'InlineKeyboardMarkup',
42264226
},
42274227
description: {
4228-
markdown: 'An object for an inline keyboard',
4228+
markdown: 'An object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards)',
42294229
},
42304230
required: false,
42314231
},
@@ -4426,7 +4426,7 @@ const sendDice: ApiMethod = {
44264426
const sendMessageDraft: ApiMethod = {
44274427
name: 'sendMessageDraft',
44284428
description: {
4429-
markdown: 'Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns _True_ on success.',
4429+
markdown: 'Use this method to stream a partial message to a user while the message is being generated. Returns _True_ on success.',
44304430
},
44314431
parameters: [
44324432
{
@@ -5216,6 +5216,16 @@ const promoteChatMember: ApiMethod = {
52165216
},
52175217
required: false,
52185218
},
5219+
{
5220+
name: 'can_manage_tags',
5221+
type: {
5222+
type: 'bool',
5223+
},
5224+
description: {
5225+
markdown: 'Pass _True_ if the administrator can edit the tags of regular members; for groups and supergroups only',
5226+
},
5227+
required: false,
5228+
},
52195229
],
52205230
returnType: {
52215231
type: 'bool',
@@ -5274,6 +5284,57 @@ const setChatAdministratorCustomTitle: ApiMethod = {
52745284
},
52755285
}
52765286

5287+
const setChatMemberTag: ApiMethod = {
5288+
name: 'setChatMemberTag',
5289+
description: {
5290+
markdown: 'Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the _can\\_manage\\_tags_ administrator right. Returns _True_ on success.',
5291+
},
5292+
parameters: [
5293+
{
5294+
name: 'chat_id',
5295+
type: {
5296+
type: 'union',
5297+
types: [
5298+
{
5299+
type: 'int32',
5300+
},
5301+
{
5302+
type: 'str',
5303+
},
5304+
],
5305+
},
5306+
description: {
5307+
markdown: 'Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`)',
5308+
},
5309+
required: true,
5310+
},
5311+
{
5312+
name: 'user_id',
5313+
type: {
5314+
type: 'int32',
5315+
},
5316+
description: {
5317+
markdown: 'Unique identifier of the target user',
5318+
},
5319+
required: true,
5320+
},
5321+
{
5322+
name: 'tag',
5323+
type: {
5324+
type: 'str',
5325+
},
5326+
description: {
5327+
markdown: 'New tag for the member; 0-16 characters, emoji are not allowed',
5328+
},
5329+
required: false,
5330+
},
5331+
],
5332+
returnType: {
5333+
type: 'bool',
5334+
literal: true,
5335+
},
5336+
}
5337+
52775338
const banChatSenderChat: ApiMethod = {
52785339
name: 'banChatSenderChat',
52795340
description: {
@@ -9699,7 +9760,7 @@ const editMessageChecklist: ApiMethod = {
96999760
name: 'InlineKeyboardMarkup',
97009761
},
97019762
description: {
9702-
markdown: 'An object for the new inline keyboard for the message',
9763+
markdown: 'An object for the new [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) for the message',
97039764
},
97049765
required: false,
97059766
},
@@ -12161,6 +12222,7 @@ export const methods = {
1216112222
restrictChatMember,
1216212223
promoteChatMember,
1216312224
setChatAdministratorCustomTitle,
12225+
setChatMemberTag,
1216412226
banChatSenderChat,
1216512227
unbanChatSenderChat,
1216612228
setChatPermissions,

src/types.gen.ts

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,16 @@ const Message = t({
13041304
},
13051305
required: false,
13061306
},
1307+
{
1308+
name: 'sender_tag',
1309+
type: {
1310+
type: 'str',
1311+
},
1312+
description: {
1313+
markdown: 'Tag or custom title of the sender of the message; for supergroups only',
1314+
},
1315+
required: false,
1316+
},
13071317
{
13081318
name: 'date',
13091319
type: {
@@ -1482,7 +1492,7 @@ const Message = t({
14821492
type: 'str',
14831493
},
14841494
description: {
1485-
markdown: 'The unique identifier of a media message group this message belongs to',
1495+
markdown: 'The unique identifier inside this chat of a media message group this message belongs to',
14861496
},
14871497
required: false,
14881498
},
@@ -2379,7 +2389,7 @@ const Message = t({
23792389
name: 'InlineKeyboardMarkup',
23802390
},
23812391
description: {
2382-
markdown: 'Inline keyboard attached to the message. `login_url` buttons are represented as ordinary `url` buttons.',
2392+
markdown: '[Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message. `login_url` buttons are represented as ordinary `url` buttons.',
23832393
},
23842394
required: false,
23852395
},
@@ -2550,10 +2560,14 @@ const MessageEntity = t({
25502560
type: 'str',
25512561
literal: 'custom_emoji',
25522562
},
2563+
{
2564+
type: 'str',
2565+
literal: 'date_time',
2566+
},
25532567
],
25542568
},
25552569
description: {
2556-
markdown: 'Type of the entity. Currently, can be “mention” (`@username`), “hashtag” (`#hashtag` or `#hashtag@chatusername`), “cashtag” (`$USD` or `$USD@chatusername`), “bot\\_command” (`/start@jobs_bot`), “url” (`https://telegram.org`), “email” (`do-not-reply@telegram.org`), “phone\\_number” (`+1-212-555-0123`), “bold” (**bold text**), “italic” (_italic text_), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable\\_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text\\_link” (for clickable text URLs), “text\\_mention” (for users [without usernames](https://telegram.org/blog/edit#new-mentions)), “custom\\_emoji” (for inline custom emoji stickers)',
2570+
markdown: 'Type of the entity. Currently, can be “mention” (`@username`), “hashtag” (`#hashtag` or `#hashtag@chatusername`), “cashtag” (`$USD` or `$USD@chatusername`), “bot\\_command” (`/start@jobs_bot`), “url” (`https://telegram.org`), “email” (`do-not-reply@telegram.org`), “phone\\_number” (`+1-212-555-0123`), “bold” (**bold text**), “italic” (_italic text_), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable\\_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text\\_link” (for clickable text URLs), “text\\_mention” (for users [without usernames](https://telegram.org/blog/edit#new-mentions)), “custom\\_emoji” (for inline custom emoji stickers), or “date\\_time” (for formatted date and time)',
25572571
},
25582572
required: true,
25592573
},
@@ -2618,6 +2632,26 @@ const MessageEntity = t({
26182632
},
26192633
required: false,
26202634
},
2635+
{
2636+
name: 'unix_time',
2637+
type: {
2638+
type: 'int32',
2639+
},
2640+
description: {
2641+
markdown: 'For “date\\_time” only, the Unix time associated with the entity',
2642+
},
2643+
required: false,
2644+
},
2645+
{
2646+
name: 'date_time_format',
2647+
type: {
2648+
type: 'str',
2649+
},
2650+
description: {
2651+
markdown: 'For “date\\_time” only, the string that defines the formatting of the date and time. See [date-time entity formatting](https://core.telegram.org/bots/api#date-time-entity-formatting) for more details.',
2652+
},
2653+
required: false,
2654+
},
26212655
],
26222656
})
26232657

@@ -8156,6 +8190,16 @@ const ChatAdministratorRights = t({
81568190
},
81578191
required: false,
81588192
},
8193+
{
8194+
name: 'can_manage_tags',
8195+
type: {
8196+
type: 'bool',
8197+
},
8198+
description: {
8199+
markdown: '_True_, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can\\_pin\\_messages.',
8200+
},
8201+
required: false,
8202+
},
81598203
],
81608204
})
81618205

@@ -8535,6 +8579,16 @@ const ChatMemberAdministrator = t({
85358579
},
85368580
required: false,
85378581
},
8582+
{
8583+
name: 'can_manage_tags',
8584+
type: {
8585+
type: 'bool',
8586+
},
8587+
description: {
8588+
markdown: '_True_, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can\\_pin\\_messages.',
8589+
},
8590+
required: false,
8591+
},
85388592
{
85398593
name: 'custom_title',
85408594
type: {
@@ -8565,6 +8619,16 @@ const ChatMemberMember = t({
85658619
},
85668620
required: true,
85678621
},
8622+
{
8623+
name: 'tag',
8624+
type: {
8625+
type: 'str',
8626+
},
8627+
description: {
8628+
markdown: 'Tag of the member',
8629+
},
8630+
required: false,
8631+
},
85688632
{
85698633
name: 'user',
85708634
type: {
@@ -8606,6 +8670,16 @@ const ChatMemberRestricted = t({
86068670
},
86078671
required: true,
86088672
},
8673+
{
8674+
name: 'tag',
8675+
type: {
8676+
type: 'str',
8677+
},
8678+
description: {
8679+
markdown: 'Tag of the member',
8680+
},
8681+
required: false,
8682+
},
86098683
{
86108684
name: 'user',
86118685
type: {
@@ -8727,6 +8801,16 @@ const ChatMemberRestricted = t({
87278801
},
87288802
required: true,
87298803
},
8804+
{
8805+
name: 'can_edit_tag',
8806+
type: {
8807+
type: 'bool',
8808+
},
8809+
description: {
8810+
markdown: '_True_, if the user is allowed to edit their own tag',
8811+
},
8812+
required: true,
8813+
},
87308814
{
87318815
name: 'can_change_info',
87328816
type: {
@@ -9030,6 +9114,16 @@ const ChatPermissions = t({
90309114
},
90319115
required: false,
90329116
},
9117+
{
9118+
name: 'can_edit_tag',
9119+
type: {
9120+
type: 'bool',
9121+
},
9122+
description: {
9123+
markdown: '_True_, if the user is allowed to edit their own tag',
9124+
},
9125+
required: false,
9126+
},
90339127
{
90349128
name: 'can_change_info',
90359129
type: {
@@ -15276,7 +15370,7 @@ const InlineQueryResultDocument = t({
1527615370
name: 'InlineKeyboardMarkup',
1527715371
},
1527815372
description: {
15279-
markdown: 'Inline keyboard attached to the message',
15373+
markdown: '[Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message',
1528015374
},
1528115375
required: false,
1528215376
},

0 commit comments

Comments
 (0)