@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/dist/types.gen.js CHANGED
@@ -275,6 +275,17 @@ const Update = t({
275
275
  },
276
276
  required: false,
277
277
  },
278
+ {
279
+ name: 'managed_bot',
280
+ type: {
281
+ type: 'api-type',
282
+ name: 'ManagedBotUpdated',
283
+ },
284
+ description: {
285
+ markdown: 'A new bot was created to be managed by the bot or token of a bot was changed',
286
+ },
287
+ required: false,
288
+ },
278
289
  ],
279
290
  });
280
291
  const WebhookInfo = t({
@@ -536,6 +547,16 @@ const User = t({
536
547
  },
537
548
  required: false,
538
549
  },
550
+ {
551
+ name: 'can_manage_bots',
552
+ type: {
553
+ type: 'bool',
554
+ },
555
+ description: {
556
+ 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).',
557
+ },
558
+ required: false,
559
+ },
539
560
  ],
540
561
  });
541
562
  const Chat = t({
@@ -1423,6 +1444,16 @@ const Message = t({
1423
1444
  },
1424
1445
  required: false,
1425
1446
  },
1447
+ {
1448
+ name: 'reply_to_poll_option_id',
1449
+ type: {
1450
+ type: 'str',
1451
+ },
1452
+ description: {
1453
+ markdown: 'Persistent identifier of the specific poll option that is being replied to',
1454
+ },
1455
+ required: false,
1456
+ },
1426
1457
  {
1427
1458
  name: 'via_bot',
1428
1459
  type: {
@@ -2252,6 +2283,17 @@ const Message = t({
2252
2283
  },
2253
2284
  required: false,
2254
2285
  },
2286
+ {
2287
+ name: 'managed_bot_created',
2288
+ type: {
2289
+ type: 'api-type',
2290
+ name: 'ManagedBotCreated',
2291
+ },
2292
+ description: {
2293
+ markdown: 'Service message: user created a bot that will be managed by the current bot',
2294
+ },
2295
+ required: false,
2296
+ },
2255
2297
  {
2256
2298
  name: 'paid_message_price_changed',
2257
2299
  type: {
@@ -2263,6 +2305,28 @@ const Message = t({
2263
2305
  },
2264
2306
  required: false,
2265
2307
  },
2308
+ {
2309
+ name: 'poll_option_added',
2310
+ type: {
2311
+ type: 'api-type',
2312
+ name: 'PollOptionAdded',
2313
+ },
2314
+ description: {
2315
+ markdown: 'Service message: answer option was added to a poll',
2316
+ },
2317
+ required: false,
2318
+ },
2319
+ {
2320
+ name: 'poll_option_deleted',
2321
+ type: {
2322
+ type: 'api-type',
2323
+ name: 'PollOptionDeleted',
2324
+ },
2325
+ description: {
2326
+ markdown: 'Service message: answer option was deleted from a poll',
2327
+ },
2328
+ required: false,
2329
+ },
2266
2330
  {
2267
2331
  name: 'suggested_post_approved',
2268
2332
  type: {
@@ -2667,7 +2731,7 @@ const TextQuote = t({
2667
2731
  },
2668
2732
  },
2669
2733
  description: {
2670
- markdown: 'Special entities that appear in the quote. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\\_emoji_ entities are kept in quotes.',
2734
+ 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.',
2671
2735
  },
2672
2736
  required: false,
2673
2737
  },
@@ -3029,7 +3093,7 @@ const ReplyParameters = t({
3029
3093
  type: 'str',
3030
3094
  },
3031
3095
  description: {
3032
- 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.',
3096
+ 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.',
3033
3097
  },
3034
3098
  required: false,
3035
3099
  },
@@ -3091,6 +3155,16 @@ const ReplyParameters = t({
3091
3155
  },
3092
3156
  required: false,
3093
3157
  },
3158
+ {
3159
+ name: 'poll_option_id',
3160
+ type: {
3161
+ type: 'str',
3162
+ },
3163
+ description: {
3164
+ markdown: 'Persistent identifier of the specific poll option to be replied to',
3165
+ },
3166
+ required: false,
3167
+ },
3094
3168
  ],
3095
3169
  });
3096
3170
  const MessageOrigin = t({
@@ -4288,6 +4362,16 @@ const PollOption = t({
4288
4362
  markdown: 'This object contains information about one answer option in a poll.',
4289
4363
  },
4290
4364
  fields: [
4365
+ {
4366
+ name: 'persistent_id',
4367
+ type: {
4368
+ type: 'str',
4369
+ },
4370
+ description: {
4371
+ markdown: 'Unique identifier of the option, persistent on option addition and deletion',
4372
+ },
4373
+ required: true,
4374
+ },
4291
4375
  {
4292
4376
  name: 'text',
4293
4377
  type: {
@@ -4318,10 +4402,42 @@ const PollOption = t({
4318
4402
  type: 'int32',
4319
4403
  },
4320
4404
  description: {
4321
- markdown: 'Number of users that voted for this option',
4405
+ markdown: 'Number of users who voted for this option; may be 0 if unknown',
4322
4406
  },
4323
4407
  required: true,
4324
4408
  },
4409
+ {
4410
+ name: 'added_by_user',
4411
+ type: {
4412
+ type: 'api-type',
4413
+ name: 'User',
4414
+ },
4415
+ description: {
4416
+ markdown: 'User who added the option; omitted if the option wasn\'t added by a user after poll creation',
4417
+ },
4418
+ required: false,
4419
+ },
4420
+ {
4421
+ name: 'added_by_chat',
4422
+ type: {
4423
+ type: 'api-type',
4424
+ name: 'Chat',
4425
+ },
4426
+ description: {
4427
+ markdown: 'Chat that added the option; omitted if the option wasn\'t added by a chat after poll creation',
4428
+ },
4429
+ required: false,
4430
+ },
4431
+ {
4432
+ name: 'addition_date',
4433
+ type: {
4434
+ type: 'int32',
4435
+ },
4436
+ description: {
4437
+ markdown: 'Point in time (Unix timestamp) when the option was added; omitted if the option existed in the original poll',
4438
+ },
4439
+ required: false,
4440
+ },
4325
4441
  ],
4326
4442
  });
4327
4443
  const InputPollOption = t({
@@ -4431,6 +4547,19 @@ const PollAnswer = t({
4431
4547
  },
4432
4548
  required: true,
4433
4549
  },
4550
+ {
4551
+ name: 'option_persistent_ids',
4552
+ type: {
4553
+ type: 'array',
4554
+ of: {
4555
+ type: 'str',
4556
+ },
4557
+ },
4558
+ description: {
4559
+ markdown: 'Persistent identifiers of the chosen answer options. May be empty if the vote was retracted.',
4560
+ },
4561
+ required: true,
4562
+ },
4434
4563
  ],
4435
4564
  });
4436
4565
  const Poll = t({
@@ -4548,12 +4677,25 @@ const Poll = t({
4548
4677
  required: true,
4549
4678
  },
4550
4679
  {
4551
- name: 'correct_option_id',
4680
+ name: 'allows_revoting',
4552
4681
  type: {
4553
- type: 'int32',
4682
+ type: 'bool',
4554
4683
  },
4555
4684
  description: {
4556
- 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.',
4685
+ markdown: '_True_, if the poll allows to change the chosen answer options',
4686
+ },
4687
+ required: true,
4688
+ },
4689
+ {
4690
+ name: 'correct_option_ids',
4691
+ type: {
4692
+ type: 'array',
4693
+ of: {
4694
+ type: 'int32',
4695
+ },
4696
+ },
4697
+ description: {
4698
+ 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.',
4557
4699
  },
4558
4700
  required: false,
4559
4701
  },
@@ -4601,6 +4743,30 @@ const Poll = t({
4601
4743
  },
4602
4744
  required: false,
4603
4745
  },
4746
+ {
4747
+ name: 'description',
4748
+ type: {
4749
+ type: 'str',
4750
+ },
4751
+ description: {
4752
+ markdown: 'Description of the poll; for polls inside the [Message](https://core.telegram.org/bots/api#message) object only',
4753
+ },
4754
+ required: false,
4755
+ },
4756
+ {
4757
+ name: 'description_entities',
4758
+ type: {
4759
+ type: 'array',
4760
+ of: {
4761
+ type: 'api-type',
4762
+ name: 'MessageEntity',
4763
+ },
4764
+ },
4765
+ description: {
4766
+ markdown: 'Special entities like usernames, URLs, bot commands, etc. that appear in the description',
4767
+ },
4768
+ required: false,
4769
+ },
4604
4770
  ],
4605
4771
  });
4606
4772
  const ChecklistTask = t({
@@ -4805,7 +4971,7 @@ const InputChecklistTask = t({
4805
4971
  },
4806
4972
  },
4807
4973
  description: {
4808
- 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.',
4974
+ 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.',
4809
4975
  },
4810
4976
  required: false,
4811
4977
  },
@@ -4861,7 +5027,7 @@ const InputChecklist = t({
4861
5027
  },
4862
5028
  },
4863
5029
  description: {
4864
- 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.',
5030
+ 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.',
4865
5031
  },
4866
5032
  required: false,
4867
5033
  },
@@ -5212,6 +5378,161 @@ const MessageAutoDeleteTimerChanged = t({
5212
5378
  },
5213
5379
  ],
5214
5380
  });
5381
+ const ManagedBotCreated = t({
5382
+ name: 'ManagedBotCreated',
5383
+ description: {
5384
+ markdown: 'This object contains information about the bot that was created to be managed by the current bot.',
5385
+ },
5386
+ fields: [
5387
+ {
5388
+ name: 'bot',
5389
+ type: {
5390
+ type: 'api-type',
5391
+ name: 'User',
5392
+ },
5393
+ description: {
5394
+ markdown: 'Information about the bot. The bot\'s token can be fetched using the method [getManagedBotToken](https://core.telegram.org/bots/api#getmanagedbottoken).',
5395
+ },
5396
+ required: true,
5397
+ },
5398
+ ],
5399
+ });
5400
+ const ManagedBotUpdated = t({
5401
+ name: 'ManagedBotUpdated',
5402
+ description: {
5403
+ markdown: 'This object contains information about the creation or token update of a bot that is managed by the current bot.',
5404
+ },
5405
+ fields: [
5406
+ {
5407
+ name: 'user',
5408
+ type: {
5409
+ type: 'api-type',
5410
+ name: 'User',
5411
+ },
5412
+ description: {
5413
+ markdown: 'User that created the bot',
5414
+ },
5415
+ required: true,
5416
+ },
5417
+ {
5418
+ name: 'bot',
5419
+ type: {
5420
+ type: 'api-type',
5421
+ name: 'User',
5422
+ },
5423
+ description: {
5424
+ markdown: 'Information about the bot. Token of the bot can be fetched using the method [getManagedBotToken](https://core.telegram.org/bots/api#getmanagedbottoken).',
5425
+ },
5426
+ required: true,
5427
+ },
5428
+ ],
5429
+ });
5430
+ const PollOptionAdded = t({
5431
+ name: 'PollOptionAdded',
5432
+ description: {
5433
+ markdown: 'Describes a service message about an option added to a poll.',
5434
+ },
5435
+ fields: [
5436
+ {
5437
+ name: 'poll_message',
5438
+ type: {
5439
+ type: 'api-type',
5440
+ name: 'MaybeInaccessibleMessage',
5441
+ },
5442
+ description: {
5443
+ 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.',
5444
+ },
5445
+ required: false,
5446
+ },
5447
+ {
5448
+ name: 'option_persistent_id',
5449
+ type: {
5450
+ type: 'str',
5451
+ },
5452
+ description: {
5453
+ markdown: 'Unique identifier of the added option',
5454
+ },
5455
+ required: true,
5456
+ },
5457
+ {
5458
+ name: 'option_text',
5459
+ type: {
5460
+ type: 'str',
5461
+ },
5462
+ description: {
5463
+ markdown: 'Option text',
5464
+ },
5465
+ required: true,
5466
+ },
5467
+ {
5468
+ name: 'option_text_entities',
5469
+ type: {
5470
+ type: 'array',
5471
+ of: {
5472
+ type: 'api-type',
5473
+ name: 'MessageEntity',
5474
+ },
5475
+ },
5476
+ description: {
5477
+ markdown: 'Special entities that appear in the _option\\_text_',
5478
+ },
5479
+ required: false,
5480
+ },
5481
+ ],
5482
+ });
5483
+ const PollOptionDeleted = t({
5484
+ name: 'PollOptionDeleted',
5485
+ description: {
5486
+ markdown: 'Describes a service message about an option deleted from a poll.',
5487
+ },
5488
+ fields: [
5489
+ {
5490
+ name: 'poll_message',
5491
+ type: {
5492
+ type: 'api-type',
5493
+ name: 'MaybeInaccessibleMessage',
5494
+ },
5495
+ description: {
5496
+ 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.',
5497
+ },
5498
+ required: false,
5499
+ },
5500
+ {
5501
+ name: 'option_persistent_id',
5502
+ type: {
5503
+ type: 'str',
5504
+ },
5505
+ description: {
5506
+ markdown: 'Unique identifier of the deleted option',
5507
+ },
5508
+ required: true,
5509
+ },
5510
+ {
5511
+ name: 'option_text',
5512
+ type: {
5513
+ type: 'str',
5514
+ },
5515
+ description: {
5516
+ markdown: 'Option text',
5517
+ },
5518
+ required: true,
5519
+ },
5520
+ {
5521
+ name: 'option_text_entities',
5522
+ type: {
5523
+ type: 'array',
5524
+ of: {
5525
+ type: 'api-type',
5526
+ name: 'MessageEntity',
5527
+ },
5528
+ },
5529
+ description: {
5530
+ markdown: 'Special entities that appear in the _option\\_text_',
5531
+ },
5532
+ required: false,
5533
+ },
5534
+ ],
5535
+ });
5215
5536
  const ChatBoostAdded = t({
5216
5537
  name: 'ChatBoostAdded',
5217
5538
  description: {
@@ -7020,6 +7341,17 @@ const KeyboardButton = t({
7020
7341
  },
7021
7342
  required: false,
7022
7343
  },
7344
+ {
7345
+ name: 'request_managed_bot',
7346
+ type: {
7347
+ type: 'api-type',
7348
+ name: 'KeyboardButtonRequestManagedBot',
7349
+ },
7350
+ description: {
7351
+ 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.',
7352
+ },
7353
+ required: false,
7354
+ },
7023
7355
  {
7024
7356
  name: 'request_contact',
7025
7357
  type: {
@@ -7262,6 +7594,44 @@ const KeyboardButtonRequestChat = t({
7262
7594
  },
7263
7595
  ],
7264
7596
  });
7597
+ const KeyboardButtonRequestManagedBot = t({
7598
+ name: 'KeyboardButtonRequestManagedBot',
7599
+ description: {
7600
+ 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_.',
7601
+ },
7602
+ fields: [
7603
+ {
7604
+ name: 'request_id',
7605
+ type: {
7606
+ type: 'int32',
7607
+ },
7608
+ description: {
7609
+ markdown: 'Signed 32-bit identifier of the request. Must be unique within the message',
7610
+ },
7611
+ required: true,
7612
+ },
7613
+ {
7614
+ name: 'suggested_name',
7615
+ type: {
7616
+ type: 'str',
7617
+ },
7618
+ description: {
7619
+ markdown: 'Suggested name for the bot',
7620
+ },
7621
+ required: false,
7622
+ },
7623
+ {
7624
+ name: 'suggested_username',
7625
+ type: {
7626
+ type: 'str',
7627
+ },
7628
+ description: {
7629
+ markdown: 'Suggested username for the bot',
7630
+ },
7631
+ required: false,
7632
+ },
7633
+ ],
7634
+ });
7265
7635
  const KeyboardButtonPollType = t({
7266
7636
  name: 'KeyboardButtonPollType',
7267
7637
  description: {
@@ -12261,6 +12631,70 @@ const BusinessMessagesDeleted = t({
12261
12631
  },
12262
12632
  ],
12263
12633
  });
12634
+ const SentWebAppMessage = t({
12635
+ name: 'SentWebAppMessage',
12636
+ description: {
12637
+ markdown: 'Describes an inline message sent by a [Web App](https://core.telegram.org/bots/webapps) on behalf of a user.',
12638
+ },
12639
+ fields: [
12640
+ {
12641
+ name: 'inline_message_id',
12642
+ type: {
12643
+ type: 'str',
12644
+ },
12645
+ description: {
12646
+ 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.',
12647
+ },
12648
+ required: false,
12649
+ },
12650
+ ],
12651
+ });
12652
+ const PreparedInlineMessage = t({
12653
+ name: 'PreparedInlineMessage',
12654
+ description: {
12655
+ markdown: 'Describes an inline message to be sent by a user of a Mini App.',
12656
+ },
12657
+ fields: [
12658
+ {
12659
+ name: 'id',
12660
+ type: {
12661
+ type: 'str',
12662
+ },
12663
+ description: {
12664
+ markdown: 'Unique identifier of the prepared message',
12665
+ },
12666
+ required: true,
12667
+ },
12668
+ {
12669
+ name: 'expiration_date',
12670
+ type: {
12671
+ type: 'int32',
12672
+ },
12673
+ description: {
12674
+ markdown: 'Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used',
12675
+ },
12676
+ required: true,
12677
+ },
12678
+ ],
12679
+ });
12680
+ const PreparedKeyboardButton = t({
12681
+ name: 'PreparedKeyboardButton',
12682
+ description: {
12683
+ markdown: 'Describes a keyboard button to be used by a user of a Mini App.',
12684
+ },
12685
+ fields: [
12686
+ {
12687
+ name: 'id',
12688
+ type: {
12689
+ type: 'str',
12690
+ },
12691
+ description: {
12692
+ markdown: 'Unique identifier of the keyboard button',
12693
+ },
12694
+ required: true,
12695
+ },
12696
+ ],
12697
+ });
12264
12698
  const ResponseParameters = t({
12265
12699
  name: 'ResponseParameters',
12266
12700
  description: {
@@ -17204,52 +17638,6 @@ const ChosenInlineResult = t({
17204
17638
  },
17205
17639
  ],
17206
17640
  });
17207
- const SentWebAppMessage = t({
17208
- name: 'SentWebAppMessage',
17209
- description: {
17210
- markdown: 'Describes an inline message sent by a [Web App](https://core.telegram.org/bots/webapps) on behalf of a user.',
17211
- },
17212
- fields: [
17213
- {
17214
- name: 'inline_message_id',
17215
- type: {
17216
- type: 'str',
17217
- },
17218
- description: {
17219
- 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.',
17220
- },
17221
- required: false,
17222
- },
17223
- ],
17224
- });
17225
- const PreparedInlineMessage = t({
17226
- name: 'PreparedInlineMessage',
17227
- description: {
17228
- markdown: 'Describes an inline message to be sent by a user of a Mini App.',
17229
- },
17230
- fields: [
17231
- {
17232
- name: 'id',
17233
- type: {
17234
- type: 'str',
17235
- },
17236
- description: {
17237
- markdown: 'Unique identifier of the prepared message',
17238
- },
17239
- required: true,
17240
- },
17241
- {
17242
- name: 'expiration_date',
17243
- type: {
17244
- type: 'int32',
17245
- },
17246
- description: {
17247
- markdown: 'Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used',
17248
- },
17249
- required: true,
17250
- },
17251
- ],
17252
- });
17253
17641
  const LabeledPrice = t({
17254
17642
  name: 'LabeledPrice',
17255
17643
  description: {
@@ -19589,6 +19977,10 @@ export const types = {
19589
19977
  WebAppData,
19590
19978
  ProximityAlertTriggered,
19591
19979
  MessageAutoDeleteTimerChanged,
19980
+ ManagedBotCreated,
19981
+ ManagedBotUpdated,
19982
+ PollOptionAdded,
19983
+ PollOptionDeleted,
19592
19984
  ChatBoostAdded,
19593
19985
  BackgroundFill,
19594
19986
  BackgroundFillSolid,
@@ -19638,6 +20030,7 @@ export const types = {
19638
20030
  KeyboardButton,
19639
20031
  KeyboardButtonRequestUsers,
19640
20032
  KeyboardButtonRequestChat,
20033
+ KeyboardButtonRequestManagedBot,
19641
20034
  KeyboardButtonPollType,
19642
20035
  ReplyKeyboardRemove,
19643
20036
  InlineKeyboardMarkup,
@@ -19730,6 +20123,9 @@ export const types = {
19730
20123
  BusinessBotRights,
19731
20124
  BusinessConnection,
19732
20125
  BusinessMessagesDeleted,
20126
+ SentWebAppMessage,
20127
+ PreparedInlineMessage,
20128
+ PreparedKeyboardButton,
19733
20129
  ResponseParameters,
19734
20130
  InputMedia,
19735
20131
  InputMediaPhoto,
@@ -19780,8 +20176,6 @@ export const types = {
19780
20176
  InputContactMessageContent,
19781
20177
  InputInvoiceMessageContent,
19782
20178
  ChosenInlineResult,
19783
- SentWebAppMessage,
19784
- PreparedInlineMessage,
19785
20179
  LabeledPrice,
19786
20180
  Invoice,
19787
20181
  ShippingAddress,