@grom.js/bot-api-spec 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.gen.ts CHANGED
@@ -279,6 +279,17 @@ const Update = t({
279
279
  },
280
280
  required: false,
281
281
  },
282
+ {
283
+ name: 'managed_bot',
284
+ type: {
285
+ type: 'api-type',
286
+ name: 'ManagedBotUpdated',
287
+ },
288
+ description: {
289
+ markdown: 'A new bot was created to be managed by the bot or token of a bot was changed',
290
+ },
291
+ required: false,
292
+ },
282
293
  ],
283
294
  })
284
295
 
@@ -542,6 +553,16 @@ const User = t({
542
553
  },
543
554
  required: false,
544
555
  },
556
+ {
557
+ name: 'can_manage_bots',
558
+ type: {
559
+ type: 'bool',
560
+ },
561
+ description: {
562
+ markdown: '_True_, if other bots can be created to be controlled by the bot. Returned only in [getMe](https://core.telegram.org/bots/api#getme).',
563
+ },
564
+ required: false,
565
+ },
545
566
  ],
546
567
  })
547
568
 
@@ -1432,6 +1453,16 @@ const Message = t({
1432
1453
  },
1433
1454
  required: false,
1434
1455
  },
1456
+ {
1457
+ name: 'reply_to_poll_option_id',
1458
+ type: {
1459
+ type: 'str',
1460
+ },
1461
+ description: {
1462
+ markdown: 'Persistent identifier of the specific poll option that is being replied to',
1463
+ },
1464
+ required: false,
1465
+ },
1435
1466
  {
1436
1467
  name: 'via_bot',
1437
1468
  type: {
@@ -2261,6 +2292,17 @@ const Message = t({
2261
2292
  },
2262
2293
  required: false,
2263
2294
  },
2295
+ {
2296
+ name: 'managed_bot_created',
2297
+ type: {
2298
+ type: 'api-type',
2299
+ name: 'ManagedBotCreated',
2300
+ },
2301
+ description: {
2302
+ markdown: 'Service message: user created a bot that will be managed by the current bot',
2303
+ },
2304
+ required: false,
2305
+ },
2264
2306
  {
2265
2307
  name: 'paid_message_price_changed',
2266
2308
  type: {
@@ -2272,6 +2314,28 @@ const Message = t({
2272
2314
  },
2273
2315
  required: false,
2274
2316
  },
2317
+ {
2318
+ name: 'poll_option_added',
2319
+ type: {
2320
+ type: 'api-type',
2321
+ name: 'PollOptionAdded',
2322
+ },
2323
+ description: {
2324
+ markdown: 'Service message: answer option was added to a poll',
2325
+ },
2326
+ required: false,
2327
+ },
2328
+ {
2329
+ name: 'poll_option_deleted',
2330
+ type: {
2331
+ type: 'api-type',
2332
+ name: 'PollOptionDeleted',
2333
+ },
2334
+ description: {
2335
+ markdown: 'Service message: answer option was deleted from a poll',
2336
+ },
2337
+ required: false,
2338
+ },
2275
2339
  {
2276
2340
  name: 'suggested_post_approved',
2277
2341
  type: {
@@ -2681,7 +2745,7 @@ const TextQuote = t({
2681
2745
  },
2682
2746
  },
2683
2747
  description: {
2684
- markdown: 'Special entities that appear in the quote. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\\_emoji_ entities are kept in quotes.',
2748
+ markdown: 'Special entities that appear in the quote. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, _custom\\_emoji_, and _date\\_time_ entities are kept in quotes.',
2685
2749
  },
2686
2750
  required: false,
2687
2751
  },
@@ -3045,7 +3109,7 @@ const ReplyParameters = t({
3045
3109
  type: 'str',
3046
3110
  },
3047
3111
  description: {
3048
- markdown: 'Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\\_emoji_ entities. The message will fail to send if the quote isn\'t found in the original message.',
3112
+ markdown: 'Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, _custom\\_emoji_, and _date\\_time_ entities. The message will fail to send if the quote isn\'t found in the original message.',
3049
3113
  },
3050
3114
  required: false,
3051
3115
  },
@@ -3107,6 +3171,16 @@ const ReplyParameters = t({
3107
3171
  },
3108
3172
  required: false,
3109
3173
  },
3174
+ {
3175
+ name: 'poll_option_id',
3176
+ type: {
3177
+ type: 'str',
3178
+ },
3179
+ description: {
3180
+ markdown: 'Persistent identifier of the specific poll option to be replied to',
3181
+ },
3182
+ required: false,
3183
+ },
3110
3184
  ],
3111
3185
  })
3112
3186
 
@@ -4326,6 +4400,16 @@ const PollOption = t({
4326
4400
  markdown: 'This object contains information about one answer option in a poll.',
4327
4401
  },
4328
4402
  fields: [
4403
+ {
4404
+ name: 'persistent_id',
4405
+ type: {
4406
+ type: 'str',
4407
+ },
4408
+ description: {
4409
+ markdown: 'Unique identifier of the option, persistent on option addition and deletion',
4410
+ },
4411
+ required: true,
4412
+ },
4329
4413
  {
4330
4414
  name: 'text',
4331
4415
  type: {
@@ -4356,10 +4440,42 @@ const PollOption = t({
4356
4440
  type: 'int32',
4357
4441
  },
4358
4442
  description: {
4359
- markdown: 'Number of users that voted for this option',
4443
+ markdown: 'Number of users who voted for this option; may be 0 if unknown',
4360
4444
  },
4361
4445
  required: true,
4362
4446
  },
4447
+ {
4448
+ name: 'added_by_user',
4449
+ type: {
4450
+ type: 'api-type',
4451
+ name: 'User',
4452
+ },
4453
+ description: {
4454
+ markdown: 'User who added the option; omitted if the option wasn\'t added by a user after poll creation',
4455
+ },
4456
+ required: false,
4457
+ },
4458
+ {
4459
+ name: 'added_by_chat',
4460
+ type: {
4461
+ type: 'api-type',
4462
+ name: 'Chat',
4463
+ },
4464
+ description: {
4465
+ markdown: 'Chat that added the option; omitted if the option wasn\'t added by a chat after poll creation',
4466
+ },
4467
+ required: false,
4468
+ },
4469
+ {
4470
+ name: 'addition_date',
4471
+ type: {
4472
+ type: 'int32',
4473
+ },
4474
+ description: {
4475
+ markdown: 'Point in time (Unix timestamp) when the option was added; omitted if the option existed in the original poll',
4476
+ },
4477
+ required: false,
4478
+ },
4363
4479
  ],
4364
4480
  })
4365
4481
 
@@ -4471,6 +4587,19 @@ const PollAnswer = t({
4471
4587
  },
4472
4588
  required: true,
4473
4589
  },
4590
+ {
4591
+ name: 'option_persistent_ids',
4592
+ type: {
4593
+ type: 'array',
4594
+ of: {
4595
+ type: 'str',
4596
+ },
4597
+ },
4598
+ description: {
4599
+ markdown: 'Persistent identifiers of the chosen answer options. May be empty if the vote was retracted.',
4600
+ },
4601
+ required: true,
4602
+ },
4474
4603
  ],
4475
4604
  })
4476
4605
 
@@ -4589,12 +4718,25 @@ const Poll = t({
4589
4718
  required: true,
4590
4719
  },
4591
4720
  {
4592
- name: 'correct_option_id',
4721
+ name: 'allows_revoting',
4593
4722
  type: {
4594
- type: 'int32',
4723
+ type: 'bool',
4724
+ },
4725
+ description: {
4726
+ markdown: '_True_, if the poll allows to change the chosen answer options',
4727
+ },
4728
+ required: true,
4729
+ },
4730
+ {
4731
+ name: 'correct_option_ids',
4732
+ type: {
4733
+ type: 'array',
4734
+ of: {
4735
+ type: 'int32',
4736
+ },
4595
4737
  },
4596
4738
  description: {
4597
- markdown: '0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.',
4739
+ markdown: 'Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot.',
4598
4740
  },
4599
4741
  required: false,
4600
4742
  },
@@ -4642,6 +4784,30 @@ const Poll = t({
4642
4784
  },
4643
4785
  required: false,
4644
4786
  },
4787
+ {
4788
+ name: 'description',
4789
+ type: {
4790
+ type: 'str',
4791
+ },
4792
+ description: {
4793
+ markdown: 'Description of the poll; for polls inside the [Message](https://core.telegram.org/bots/api#message) object only',
4794
+ },
4795
+ required: false,
4796
+ },
4797
+ {
4798
+ name: 'description_entities',
4799
+ type: {
4800
+ type: 'array',
4801
+ of: {
4802
+ type: 'api-type',
4803
+ name: 'MessageEntity',
4804
+ },
4805
+ },
4806
+ description: {
4807
+ markdown: 'Special entities like usernames, URLs, bot commands, etc. that appear in the description',
4808
+ },
4809
+ required: false,
4810
+ },
4645
4811
  ],
4646
4812
  })
4647
4813
 
@@ -4849,7 +5015,7 @@ const InputChecklistTask = t({
4849
5015
  },
4850
5016
  },
4851
5017
  description: {
4852
- markdown: 'List of special entities that appear in the text, which can be specified instead of parse\\_mode. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\\_emoji_ entities are allowed.',
5018
+ markdown: 'List of special entities that appear in the text, which can be specified instead of parse\\_mode. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, _custom\\_emoji_, and _date\\_time_ entities are allowed.',
4853
5019
  },
4854
5020
  required: false,
4855
5021
  },
@@ -4906,7 +5072,7 @@ const InputChecklist = t({
4906
5072
  },
4907
5073
  },
4908
5074
  description: {
4909
- markdown: 'List of special entities that appear in the title, which can be specified instead of parse\\_mode. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\\_emoji_ entities are allowed.',
5075
+ markdown: 'List of special entities that appear in the title, which can be specified instead of parse\\_mode. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, _custom\\_emoji_, and _date\\_time_ entities are allowed.',
4910
5076
  },
4911
5077
  required: false,
4912
5078
  },
@@ -5265,6 +5431,165 @@ const MessageAutoDeleteTimerChanged = t({
5265
5431
  ],
5266
5432
  })
5267
5433
 
5434
+ const ManagedBotCreated = t({
5435
+ name: 'ManagedBotCreated',
5436
+ description: {
5437
+ markdown: 'This object contains information about the bot that was created to be managed by the current bot.',
5438
+ },
5439
+ fields: [
5440
+ {
5441
+ name: 'bot',
5442
+ type: {
5443
+ type: 'api-type',
5444
+ name: 'User',
5445
+ },
5446
+ description: {
5447
+ markdown: 'Information about the bot. The bot\'s token can be fetched using the method [getManagedBotToken](https://core.telegram.org/bots/api#getmanagedbottoken).',
5448
+ },
5449
+ required: true,
5450
+ },
5451
+ ],
5452
+ })
5453
+
5454
+ const ManagedBotUpdated = t({
5455
+ name: 'ManagedBotUpdated',
5456
+ description: {
5457
+ markdown: 'This object contains information about the creation or token update of a bot that is managed by the current bot.',
5458
+ },
5459
+ fields: [
5460
+ {
5461
+ name: 'user',
5462
+ type: {
5463
+ type: 'api-type',
5464
+ name: 'User',
5465
+ },
5466
+ description: {
5467
+ markdown: 'User that created the bot',
5468
+ },
5469
+ required: true,
5470
+ },
5471
+ {
5472
+ name: 'bot',
5473
+ type: {
5474
+ type: 'api-type',
5475
+ name: 'User',
5476
+ },
5477
+ description: {
5478
+ markdown: 'Information about the bot. Token of the bot can be fetched using the method [getManagedBotToken](https://core.telegram.org/bots/api#getmanagedbottoken).',
5479
+ },
5480
+ required: true,
5481
+ },
5482
+ ],
5483
+ })
5484
+
5485
+ const PollOptionAdded = t({
5486
+ name: 'PollOptionAdded',
5487
+ description: {
5488
+ markdown: 'Describes a service message about an option added to a poll.',
5489
+ },
5490
+ fields: [
5491
+ {
5492
+ name: 'poll_message',
5493
+ type: {
5494
+ type: 'api-type',
5495
+ name: 'MaybeInaccessibleMessage',
5496
+ },
5497
+ description: {
5498
+ markdown: 'Message containing the poll to which the option was added, if known. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\\_to\\_message_ field even if it itself is a reply.',
5499
+ },
5500
+ required: false,
5501
+ },
5502
+ {
5503
+ name: 'option_persistent_id',
5504
+ type: {
5505
+ type: 'str',
5506
+ },
5507
+ description: {
5508
+ markdown: 'Unique identifier of the added option',
5509
+ },
5510
+ required: true,
5511
+ },
5512
+ {
5513
+ name: 'option_text',
5514
+ type: {
5515
+ type: 'str',
5516
+ },
5517
+ description: {
5518
+ markdown: 'Option text',
5519
+ },
5520
+ required: true,
5521
+ },
5522
+ {
5523
+ name: 'option_text_entities',
5524
+ type: {
5525
+ type: 'array',
5526
+ of: {
5527
+ type: 'api-type',
5528
+ name: 'MessageEntity',
5529
+ },
5530
+ },
5531
+ description: {
5532
+ markdown: 'Special entities that appear in the _option\\_text_',
5533
+ },
5534
+ required: false,
5535
+ },
5536
+ ],
5537
+ })
5538
+
5539
+ const PollOptionDeleted = t({
5540
+ name: 'PollOptionDeleted',
5541
+ description: {
5542
+ markdown: 'Describes a service message about an option deleted from a poll.',
5543
+ },
5544
+ fields: [
5545
+ {
5546
+ name: 'poll_message',
5547
+ type: {
5548
+ type: 'api-type',
5549
+ name: 'MaybeInaccessibleMessage',
5550
+ },
5551
+ description: {
5552
+ markdown: 'Message containing the poll from which the option was deleted, if known. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\\_to\\_message_ field even if it itself is a reply.',
5553
+ },
5554
+ required: false,
5555
+ },
5556
+ {
5557
+ name: 'option_persistent_id',
5558
+ type: {
5559
+ type: 'str',
5560
+ },
5561
+ description: {
5562
+ markdown: 'Unique identifier of the deleted option',
5563
+ },
5564
+ required: true,
5565
+ },
5566
+ {
5567
+ name: 'option_text',
5568
+ type: {
5569
+ type: 'str',
5570
+ },
5571
+ description: {
5572
+ markdown: 'Option text',
5573
+ },
5574
+ required: true,
5575
+ },
5576
+ {
5577
+ name: 'option_text_entities',
5578
+ type: {
5579
+ type: 'array',
5580
+ of: {
5581
+ type: 'api-type',
5582
+ name: 'MessageEntity',
5583
+ },
5584
+ },
5585
+ description: {
5586
+ markdown: 'Special entities that appear in the _option\\_text_',
5587
+ },
5588
+ required: false,
5589
+ },
5590
+ ],
5591
+ })
5592
+
5268
5593
  const ChatBoostAdded = t({
5269
5594
  name: 'ChatBoostAdded',
5270
5595
  description: {
@@ -7119,6 +7444,17 @@ const KeyboardButton = t({
7119
7444
  },
7120
7445
  required: false,
7121
7446
  },
7447
+ {
7448
+ name: 'request_managed_bot',
7449
+ type: {
7450
+ type: 'api-type',
7451
+ name: 'KeyboardButtonRequestManagedBot',
7452
+ },
7453
+ description: {
7454
+ markdown: 'If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the [@BotFather](https://t.me/BotFather) Mini App. Available in private chats only.',
7455
+ },
7456
+ required: false,
7457
+ },
7122
7458
  {
7123
7459
  name: 'request_contact',
7124
7460
  type: {
@@ -7364,6 +7700,45 @@ const KeyboardButtonRequestChat = t({
7364
7700
  ],
7365
7701
  })
7366
7702
 
7703
+ const KeyboardButtonRequestManagedBot = t({
7704
+ name: 'KeyboardButtonRequestManagedBot',
7705
+ description: {
7706
+ markdown: 'This object defines the parameters for the creation of a managed bot. Information about the created bot will be shared with the bot using the update _managed\\_bot_ and a [Message](https://core.telegram.org/bots/api#message) with the field _managed\\_bot\\_created_.',
7707
+ },
7708
+ fields: [
7709
+ {
7710
+ name: 'request_id',
7711
+ type: {
7712
+ type: 'int32',
7713
+ },
7714
+ description: {
7715
+ markdown: 'Signed 32-bit identifier of the request. Must be unique within the message',
7716
+ },
7717
+ required: true,
7718
+ },
7719
+ {
7720
+ name: 'suggested_name',
7721
+ type: {
7722
+ type: 'str',
7723
+ },
7724
+ description: {
7725
+ markdown: 'Suggested name for the bot',
7726
+ },
7727
+ required: false,
7728
+ },
7729
+ {
7730
+ name: 'suggested_username',
7731
+ type: {
7732
+ type: 'str',
7733
+ },
7734
+ description: {
7735
+ markdown: 'Suggested username for the bot',
7736
+ },
7737
+ required: false,
7738
+ },
7739
+ ],
7740
+ })
7741
+
7367
7742
  const KeyboardButtonPollType = t({
7368
7743
  name: 'KeyboardButtonPollType',
7369
7744
  description: {
@@ -12455,6 +12830,73 @@ const BusinessMessagesDeleted = t({
12455
12830
  ],
12456
12831
  })
12457
12832
 
12833
+ const SentWebAppMessage = t({
12834
+ name: 'SentWebAppMessage',
12835
+ description: {
12836
+ markdown: 'Describes an inline message sent by a [Web App](https://core.telegram.org/bots/webapps) on behalf of a user.',
12837
+ },
12838
+ fields: [
12839
+ {
12840
+ name: 'inline_message_id',
12841
+ type: {
12842
+ type: 'str',
12843
+ },
12844
+ description: {
12845
+ markdown: 'Identifier of the sent inline message. Available only if there is an [inline keyboard](https://core.telegram.org/bots/api#inlinekeyboardmarkup) attached to the message.',
12846
+ },
12847
+ required: false,
12848
+ },
12849
+ ],
12850
+ })
12851
+
12852
+ const PreparedInlineMessage = t({
12853
+ name: 'PreparedInlineMessage',
12854
+ description: {
12855
+ markdown: 'Describes an inline message to be sent by a user of a Mini App.',
12856
+ },
12857
+ fields: [
12858
+ {
12859
+ name: 'id',
12860
+ type: {
12861
+ type: 'str',
12862
+ },
12863
+ description: {
12864
+ markdown: 'Unique identifier of the prepared message',
12865
+ },
12866
+ required: true,
12867
+ },
12868
+ {
12869
+ name: 'expiration_date',
12870
+ type: {
12871
+ type: 'int32',
12872
+ },
12873
+ description: {
12874
+ markdown: 'Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used',
12875
+ },
12876
+ required: true,
12877
+ },
12878
+ ],
12879
+ })
12880
+
12881
+ const PreparedKeyboardButton = t({
12882
+ name: 'PreparedKeyboardButton',
12883
+ description: {
12884
+ markdown: 'Describes a keyboard button to be used by a user of a Mini App.',
12885
+ },
12886
+ fields: [
12887
+ {
12888
+ name: 'id',
12889
+ type: {
12890
+ type: 'str',
12891
+ },
12892
+ description: {
12893
+ markdown: 'Unique identifier of the keyboard button',
12894
+ },
12895
+ required: true,
12896
+ },
12897
+ ],
12898
+ })
12899
+
12458
12900
  const ResponseParameters = t({
12459
12901
  name: 'ResponseParameters',
12460
12902
  description: {
@@ -17448,54 +17890,6 @@ const ChosenInlineResult = t({
17448
17890
  ],
17449
17891
  })
17450
17892
 
17451
- const SentWebAppMessage = t({
17452
- name: 'SentWebAppMessage',
17453
- description: {
17454
- markdown: 'Describes an inline message sent by a [Web App](https://core.telegram.org/bots/webapps) on behalf of a user.',
17455
- },
17456
- fields: [
17457
- {
17458
- name: 'inline_message_id',
17459
- type: {
17460
- type: 'str',
17461
- },
17462
- description: {
17463
- markdown: 'Identifier of the sent inline message. Available only if there is an [inline keyboard](https://core.telegram.org/bots/api#inlinekeyboardmarkup) attached to the message.',
17464
- },
17465
- required: false,
17466
- },
17467
- ],
17468
- })
17469
-
17470
- const PreparedInlineMessage = t({
17471
- name: 'PreparedInlineMessage',
17472
- description: {
17473
- markdown: 'Describes an inline message to be sent by a user of a Mini App.',
17474
- },
17475
- fields: [
17476
- {
17477
- name: 'id',
17478
- type: {
17479
- type: 'str',
17480
- },
17481
- description: {
17482
- markdown: 'Unique identifier of the prepared message',
17483
- },
17484
- required: true,
17485
- },
17486
- {
17487
- name: 'expiration_date',
17488
- type: {
17489
- type: 'int32',
17490
- },
17491
- description: {
17492
- markdown: 'Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used',
17493
- },
17494
- required: true,
17495
- },
17496
- ],
17497
- })
17498
-
17499
17893
  const LabeledPrice = t({
17500
17894
  name: 'LabeledPrice',
17501
17895
  description: {
@@ -19877,6 +20271,10 @@ export const types = {
19877
20271
  WebAppData,
19878
20272
  ProximityAlertTriggered,
19879
20273
  MessageAutoDeleteTimerChanged,
20274
+ ManagedBotCreated,
20275
+ ManagedBotUpdated,
20276
+ PollOptionAdded,
20277
+ PollOptionDeleted,
19880
20278
  ChatBoostAdded,
19881
20279
  BackgroundFill,
19882
20280
  BackgroundFillSolid,
@@ -19926,6 +20324,7 @@ export const types = {
19926
20324
  KeyboardButton,
19927
20325
  KeyboardButtonRequestUsers,
19928
20326
  KeyboardButtonRequestChat,
20327
+ KeyboardButtonRequestManagedBot,
19929
20328
  KeyboardButtonPollType,
19930
20329
  ReplyKeyboardRemove,
19931
20330
  InlineKeyboardMarkup,
@@ -20018,6 +20417,9 @@ export const types = {
20018
20417
  BusinessBotRights,
20019
20418
  BusinessConnection,
20020
20419
  BusinessMessagesDeleted,
20420
+ SentWebAppMessage,
20421
+ PreparedInlineMessage,
20422
+ PreparedKeyboardButton,
20021
20423
  ResponseParameters,
20022
20424
  InputMedia,
20023
20425
  InputMediaPhoto,
@@ -20068,8 +20470,6 @@ export const types = {
20068
20470
  InputContactMessageContent,
20069
20471
  InputInvoiceMessageContent,
20070
20472
  ChosenInlineResult,
20071
- SentWebAppMessage,
20072
- PreparedInlineMessage,
20073
20473
  LabeledPrice,
20074
20474
  Invoice,
20075
20475
  ShippingAddress,