@telegram.ts/types 1.22.0 → 1.23.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.
@@ -153,7 +153,7 @@ export interface BotCommandScopeAllChatAdministrators {
153
153
  export interface BotCommandScopeChat {
154
154
  /** The scope type, must be "chat". */
155
155
  type: "chat";
156
- /** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). */
156
+ /** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported.*/
157
157
  chat_id: number | string;
158
158
  }
159
159
 
@@ -163,7 +163,7 @@ export interface BotCommandScopeChat {
163
163
  export interface BotCommandScopeChatAdministrators {
164
164
  /** The scope type, must be "chat_administrators". */
165
165
  type: "chat_administrators";
166
- /** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). */
166
+ /** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
167
167
  chat_id: number | string;
168
168
  }
169
169
 
@@ -173,7 +173,7 @@ export interface BotCommandScopeChatAdministrators {
173
173
  export interface BotCommandScopeChatMember {
174
174
  /** The scope type, must be "chat_member". */
175
175
  type: "chat_member";
176
- /** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). */
176
+ /** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel direct messages chats and channel chats aren't supported. */
177
177
  chat_id: number | string;
178
178
  /** The unique identifier of the target user. */
179
179
  user_id: number;
@@ -0,0 +1,76 @@
1
+ import type { User } from "./manageTypes";
2
+ import type { Message, MessageEntity, ParseMode } from "./messageTypes";
3
+
4
+ /** Describes a task in a checklist. */
5
+ export interface ChecklistTask {
6
+ /** Unique identifier of the task */
7
+ id: number;
8
+ /** Text of the task */
9
+ text: string;
10
+ /** Special entities that appear in the task text */
11
+ text_entities?: MessageEntity[];
12
+ /** User that completed the task; omitted if the task wasn't completed */
13
+ completed_by_user?: User;
14
+ /** Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed */
15
+ completion_date?: number;
16
+ }
17
+
18
+ /** Describes a checklist. */
19
+ export interface Checklist {
20
+ /** Title of the checklist */
21
+ title: string;
22
+ /** Special entities that appear in the checklist title */
23
+ title_entities?: MessageEntity[];
24
+ /** List of tasks in the checklist */
25
+ tasks: ChecklistTask[];
26
+ /** True, if users other than the creator of the list can add tasks to the list */
27
+ others_can_add_tasks?: true;
28
+ /** True, if users other than the creator of the list can mark tasks as done or not done */
29
+ others_can_mark_tasks_as_done?: true;
30
+ }
31
+
32
+ /** Describes a task to add to a checklist. */
33
+ export interface InputChecklistTask {
34
+ /** Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist */
35
+ id: number;
36
+ /** Text of the task; 1-100 characters after entities parsing */
37
+ text: string;
38
+ /** Mode for parsing entities in the text. See formatting options for more details. */
39
+ parse_mode?: string;
40
+ /** 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. */
41
+ text_entities?: MessageEntity[];
42
+ }
43
+
44
+ /** Describes a checklist to create. */
45
+ export interface InputChecklist {
46
+ /** Title of the checklist; 1-255 characters after entities parsing */
47
+ title: string;
48
+ /** Mode for parsing entities in the title. See formatting options for more details. */
49
+ parse_mode?: ParseMode;
50
+ /** 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. */
51
+ title_entities?: MessageEntity[];
52
+ /** List of 1-30 tasks in the checklist */
53
+ tasks: InputChecklistTask[];
54
+ /** Pass True if other users can add tasks to the checklist */
55
+ others_can_add_tasks?: boolean;
56
+ /** Pass True if other users can mark tasks as done or not done in the checklist */
57
+ others_can_mark_tasks_as_done?: true;
58
+ }
59
+
60
+ /** Describes a service message about checklist tasks marked as done or not done. */
61
+ export interface ChecklistTasksDone {
62
+ /** Message containing the checklist whose tasks were marked as done or not done. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
63
+ checklist_message?: Message;
64
+ /** Identifiers of the tasks that were marked as done */
65
+ marked_as_done_task_ids?: number[];
66
+ /** Identifiers of the tasks that were marked as not done */
67
+ marked_as_not_done_task_ids?: number[];
68
+ }
69
+
70
+ /** Describes a service message about tasks added to a checklist. */
71
+ export interface ChecklistTasksAdded {
72
+ /** Message containing the checklist to which the tasks were added. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
73
+ checklist_message?: Message;
74
+ /** List of tasks added to the checklist */
75
+ tasks: ChecklistTask[];
76
+ }
package/src/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./telegramTypes";
2
+ export * from "./checkListTask";
2
3
  export * from "./inlineTypes";
3
4
  export * from "./manageTypes";
4
5
  export * from "./markupTypes";
@@ -1,5 +1,10 @@
1
1
  import type { Chat, User } from "./manageTypes";
2
- import type { MessageEntity, PaidMedia, Sticker } from "./messageTypes";
2
+ import type {
3
+ Message,
4
+ MessageEntity,
5
+ PaidMedia,
6
+ Sticker,
7
+ } from "./messageTypes";
3
8
 
4
9
  /** This object represents a portion of the price for goods or services. */
5
10
  export interface LabeledPrice {
@@ -304,6 +309,8 @@ export interface PaidMediaPurchased {
304
309
  export interface Gift {
305
310
  /** Unique identifier of the gift */
306
311
  id: string;
312
+ /** Information about the chat that published the gift */
313
+ publisher_chat?: Chat;
307
314
  /** The sticker that represents the gift */
308
315
  sticker: Sticker;
309
316
  /** The number of Telegram Stars that must be paid to send the sticker */
@@ -326,6 +333,8 @@ export interface Gifts {
326
333
  export interface UniqueGiftModel {
327
334
  /** Name of the model */
328
335
  name: string;
336
+ /** Information about the chat that published the gift */
337
+ publisher_chat?: Chat;
329
338
  /** The sticker that represents the unique gift */
330
339
  sticker: Sticker;
331
340
  /** The number of unique gifts that receive this model for every 1000 gifts upgraded */
@@ -404,12 +413,16 @@ export interface GiftInfo {
404
413
  export interface UniqueGiftInfo {
405
414
  /** Information about the gift */
406
415
  gift: UniqueGift;
407
- /** Origin of the gift. Currently, either “upgrade” or “transfer” */
408
- origin: "upgrade" | "transfer";
416
+ /** Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, or “resale” for gifts bought from other users */
417
+ origin: "upgrade" | "transfer" | "resale";
409
418
  /** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
410
419
  owned_gift_id?: string;
411
420
  /** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
412
421
  transfer_star_count?: number;
422
+ /** For gifts bought from other users, the price paid for the gift */
423
+ last_resale_star_count?: number;
424
+ /** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
425
+ next_transfer_date?: string;
413
426
  }
414
427
 
415
428
  /** Describes a service message about a change in the price of paid messages within a chat. */
@@ -422,7 +435,7 @@ export interface PaidMessagePriceChanged {
422
435
  export interface StarAmount {
423
436
  /** Integer amount of Telegram Stars, rounded to 0; can be negative */
424
437
  amount: number;
425
- /** The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if amount is negative */
438
+ /** The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive */
426
439
  nanostar_amount?: number;
427
440
  }
428
441
 
@@ -459,6 +472,8 @@ export interface OwnedGiftRegular {
459
472
  convert_star_count?: number;
460
473
  /** Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift */
461
474
  prepaid_upgrade_star_count?: number;
475
+ /** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
476
+ next_transfer_date?: string;
462
477
  }
463
478
 
464
479
  /** Describes a unique gift received and owned by a user or a chat. */
@@ -490,3 +505,67 @@ export interface OwnedGifts {
490
505
  /** Offset for the next request. If empty, then there are no more results */
491
506
  next_offset?: string;
492
507
  }
508
+
509
+ /** Desribes price of a suggested post. */
510
+ export interface SuggestedPostPrice {
511
+ /** Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins */
512
+ currency: "XTR" | "TON";
513
+ /** The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000. */
514
+ amount: number;
515
+ }
516
+
517
+ /** Contains information about a suggested post. */
518
+ export interface SuggestedPostInfo {
519
+ /** State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”. */
520
+ state: "pending" | "approved" | "declined";
521
+ /** Proposed price of the post. If the field is omitted, then the post is unpaid. */
522
+ price?: SuggestedPostPrice;
523
+ /** Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it. */
524
+ send_date?: number;
525
+ }
526
+
527
+ /** Describes a service message about the approval of a suggested post. */
528
+ export interface SuggestedPostApproved {
529
+ /** Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
530
+ suggested_post_message?: Message;
531
+ /** Amount paid for the post */
532
+ price?: SuggestedPostPrice;
533
+ /** Date when the post will be published */
534
+ send_date: number;
535
+ }
536
+
537
+ /** Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval. */
538
+ export interface SuggestedPostApprovalFailed {
539
+ /** Message containing the suggested post whose approval has failed. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
540
+ suggested_post_message?: Message;
541
+ /** Expected price of the post */
542
+ price: SuggestedPostPrice;
543
+ }
544
+
545
+ /** Describes a service message about the rejection of a suggested post. */
546
+ export interface SuggestedPostDeclined {
547
+ /** Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
548
+ suggested_post_message?: Message;
549
+ /** Comment with which the post was declined */
550
+ comment?: string;
551
+ }
552
+
553
+ /** Describes a service message about a successful payment for a suggested post. */
554
+ export interface SuggestedPostPaid {
555
+ /** Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
556
+ suggested_post_message?: Message;
557
+ /** Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins */
558
+ currency: string;
559
+ /** The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only */
560
+ amount?: number;
561
+ /** The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only */
562
+ star_amount?: StarAmount;
563
+ }
564
+
565
+ /** Describes a service message about a payment refund for a suggested post. */
566
+ export interface SuggestedPostRefunded {
567
+ /** Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
568
+ suggested_post_message?: Message;
569
+ /** Reason for the refund. Currently, one of “post_deleted” if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or “payment_refunded” if the payer refunded their payment. */
570
+ reason: string;
571
+ }
@@ -95,6 +95,8 @@ export declare namespace Chat {
95
95
  last_name?: string;
96
96
  /** True, if the supergroup chat is a forum (has topics enabled) */
97
97
  is_forum?: undefined;
98
+ /** True, if the chat is the direct messages chat of a channel */
99
+ is_direct_messages?: undefined;
98
100
  }
99
101
  /** Internal type for group chats */
100
102
  export interface GroupChat {
@@ -112,6 +114,8 @@ export declare namespace Chat {
112
114
  last_name?: undefined;
113
115
  /** True, if the supergroup chat is a forum (has topics enabled) */
114
116
  is_forum?: undefined;
117
+ /** True, if the chat is the direct messages chat of a channel */
118
+ is_direct_messages?: undefined;
115
119
  }
116
120
  /** Internal type for supergroup chats */
117
121
  export interface SupergroupChat {
@@ -129,6 +133,8 @@ export declare namespace Chat {
129
133
  last_name?: undefined;
130
134
  /** True, if the supergroup chat is a forum (has topics enabled) */
131
135
  is_forum?: true;
136
+ /** True, if the chat is the direct messages chat of a channel */
137
+ is_direct_messages?: true;
132
138
  }
133
139
  /** Internal type for channel chats */
134
140
  export interface ChannelChat {
@@ -146,6 +152,8 @@ export declare namespace Chat {
146
152
  last_name?: undefined;
147
153
  /** True, if the supergroup chat is a forum (has topics enabled) */
148
154
  is_forum?: undefined;
155
+ /** True, if the chat is the direct messages chat of a channel */
156
+ is_direct_messages?: undefined;
149
157
  }
150
158
  }
151
159
 
@@ -245,6 +253,8 @@ export declare namespace ChatFullInfo {
245
253
  custom_emoji_sticker_set_name?: undefined;
246
254
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
247
255
  linked_chat_id?: undefined;
256
+ /** Information about the corresponding channel chat; for direct messages chats only */
257
+ parent_chat?: undefined;
248
258
  /** For supergroups, the location to which the supergroup is connected */
249
259
  location?: undefined;
250
260
  /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
@@ -338,6 +348,8 @@ export declare namespace ChatFullInfo {
338
348
  custom_emoji_sticker_set_name?: undefined;
339
349
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
340
350
  linked_chat_id?: undefined;
351
+ /** Information about the corresponding channel chat; for direct messages chats only */
352
+ parent_chat?: undefined;
341
353
  /** For supergroups, the location to which the supergroup is connected */
342
354
  location?: undefined;
343
355
  /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
@@ -431,6 +443,8 @@ export declare namespace ChatFullInfo {
431
443
  custom_emoji_sticker_set_name?: string;
432
444
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
433
445
  linked_chat_id?: number;
446
+ /** Information about the corresponding channel chat; for direct messages chats only */
447
+ parent_chat?: Chat.ChannelChat;
434
448
  /** For supergroups, the location to which the supergroup is connected */
435
449
  location?: ChatLocation;
436
450
  /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
@@ -524,6 +538,8 @@ export declare namespace ChatFullInfo {
524
538
  custom_emoji_sticker_set_name?: undefined;
525
539
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
526
540
  linked_chat_id?: number;
541
+ /** Information about the corresponding channel chat; for direct messages chats only */
542
+ parent_chat?: undefined;
527
543
  /** For supergroups, the location to which the supergroup is connected */
528
544
  location?: undefined;
529
545
  /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
@@ -590,7 +606,7 @@ export interface ChatInviteLink {
590
606
  export interface ChatAdministratorRights {
591
607
  /** True, if the user's presence in the chat is hidden */
592
608
  is_anonymous: boolean;
593
- /** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. */
609
+ /** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
594
610
  can_manage_chat: boolean;
595
611
  /** True, if the administrator can delete messages of other users */
596
612
  can_delete_messages: boolean;
@@ -610,7 +626,7 @@ export interface ChatAdministratorRights {
610
626
  can_edit_stories: boolean;
611
627
  /** True, if the administrator can delete stories posted by other users */
612
628
  can_delete_stories: boolean;
613
- /** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
629
+ /** True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
614
630
  can_post_messages?: boolean;
615
631
  /** True, if the administrator can edit messages of other users and can pin messages; for channels only */
616
632
  can_edit_messages?: boolean;
@@ -618,6 +634,8 @@ export interface ChatAdministratorRights {
618
634
  can_pin_messages?: boolean;
619
635
  /** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
620
636
  can_manage_topics?: boolean;
637
+ /** True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
638
+ can_manage_direct_messages?: boolean;
621
639
  }
622
640
 
623
641
  /** This object represents changes in the status of a chat member. */
@@ -677,7 +695,7 @@ export interface ChatMemberAdministrator {
677
695
  can_be_edited: boolean;
678
696
  /** True, if the user's presence in the chat is hidden */
679
697
  is_anonymous: boolean;
680
- /** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. */
698
+ /** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
681
699
  can_manage_chat: boolean;
682
700
  /** True, if the administrator can delete messages of other users */
683
701
  can_delete_messages: boolean;
@@ -697,7 +715,7 @@ export interface ChatMemberAdministrator {
697
715
  can_edit_stories: boolean;
698
716
  /** True, if the administrator can delete stories posted by other users */
699
717
  can_delete_stories: boolean;
700
- /** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
718
+ /** True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
701
719
  can_post_messages?: boolean;
702
720
  /** True, if the administrator can edit messages of other users and can pin messages; for channels only */
703
721
  can_edit_messages?: boolean;
@@ -705,6 +723,8 @@ export interface ChatMemberAdministrator {
705
723
  can_pin_messages?: boolean;
706
724
  /** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
707
725
  can_manage_topics?: boolean;
726
+ /** True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
727
+ can_manage_direct_messages?: boolean;
708
728
  /** Custom title for this user */
709
729
  custom_title?: string;
710
730
  }
@@ -741,7 +761,7 @@ export interface ChatMemberRestricted {
741
761
  can_send_video_notes: boolean;
742
762
  /** True, if the user is allowed to send voice notes */
743
763
  can_send_voice_notes: boolean;
744
- /** True, if the user is allowed to send polls */
764
+ /** True, if the user is allowed to send polls and checklists */
745
765
  can_send_polls: boolean;
746
766
  /** True, if the user is allowed to send animations, games, stickers and use inline bots */
747
767
  can_send_other_messages: boolean;
@@ -809,7 +829,7 @@ export interface ChatPermissions {
809
829
  can_send_video_notes?: boolean;
810
830
  /** True, if the user is allowed to send voice notes */
811
831
  can_send_voice_notes?: boolean;
812
- /** True, if the user is allowed to send polls */
832
+ /** True, if the user is allowed to send polls and checklists */
813
833
  can_send_polls?: boolean;
814
834
  /** True, if the user is allowed to send animations, games, stickers and use inline bots */
815
835
  can_send_other_messages?: boolean;
@@ -975,6 +995,7 @@ export interface UserChatBoosts {
975
995
  boosts: ChatBoost[];
976
996
  }
977
997
 
998
+ /** Represents the rights of a business bot. */
978
999
  export interface BusinessBotRights {
979
1000
  /** True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours */
980
1001
  can_reply?: true;
@@ -1002,7 +1023,7 @@ export interface BusinessBotRights {
1002
1023
  can_transfer_and_upgrade_gifts?: true;
1003
1024
  /** True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts */
1004
1025
  can_transfer_stars?: true;
1005
- /** True, if the bot can send, edit and delete stories on behalf of the business account */
1026
+ /** True, if the bot can post, edit and delete stories on behalf of the business account */
1006
1027
  can_manage_stories?: true;
1007
1028
  }
1008
1029
 
@@ -29,19 +29,19 @@ export declare namespace InlineKeyboardButton {
29
29
  login_url: LoginUrl;
30
30
  }
31
31
  export interface SwitchInlineButton extends AbstractInlineKeyboardButton {
32
- /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account. */
32
+ /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account */
33
33
  switch_inline_query: string;
34
34
  }
35
35
  export interface SwitchInlineCurrentChatButton
36
36
  extends AbstractInlineKeyboardButton {
37
- /** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.
37
+ /** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.
38
38
 
39
- This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account. */
39
+ This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
40
40
  switch_inline_query_current_chat: string;
41
41
  }
42
42
  export interface SwitchInlineChosenChatButton
43
43
  extends AbstractInlineKeyboardButton {
44
- /** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account. */
44
+ /** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
45
45
  switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
46
46
  }
47
47
  export interface CopyTextButtonButton extends AbstractInlineKeyboardButton {
@@ -1,12 +1,24 @@
1
1
  import type { Chat, User } from "./manageTypes";
2
2
  import type { InlineKeyboardMarkup } from "./markupTypes";
3
3
  import type { PassportData } from "./passportTypes";
4
+ import type {
5
+ Checklist,
6
+ ChecklistTasksAdded,
7
+ ChecklistTasksDone,
8
+ } from "./checkListTask";
4
9
  import type {
5
10
  GiftInfo,
6
11
  Invoice,
7
12
  PaidMessagePriceChanged,
8
13
  RefundedPayment,
9
14
  SuccessfulPayment,
15
+ SuggestedPostApprovalFailed,
16
+ SuggestedPostApproved,
17
+ SuggestedPostDeclined,
18
+ SuggestedPostInfo,
19
+ SuggestedPostPaid,
20
+ SuggestedPostPrice,
21
+ SuggestedPostRefunded,
10
22
  UniqueGiftInfo,
11
23
  } from "./invoiceTypes";
12
24
 
@@ -30,6 +42,8 @@ export declare namespace Message {
30
42
  chat: Chat;
31
43
  /** True, if the message is sent to a forum topic */
32
44
  is_topic_message?: boolean;
45
+ /** Information about the direct messages chat topic that contains the message */
46
+ direct_messages_topic?: DirectMessagesTopic;
33
47
  }
34
48
  export interface CommonMessage extends ServiceMessage {
35
49
  /** If the sender of the message boosted the chat, the number of boosts added by the user */
@@ -42,6 +56,10 @@ export declare namespace Message {
42
56
  is_automatic_forward?: true;
43
57
  /** For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */
44
58
  reply_to_message?: ReplyMessage;
59
+ /** Identifier of the specific checklist task that is being replied to */
60
+ reply_to_checklist_task_id?: number;
61
+ /** True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited. */
62
+ is_paid_post?: true;
45
63
  /** Information about the message that is being replied to, which may come from another chat or forum topic */
46
64
  external_reply?: ExternalReplyInfo;
47
65
  /** For replies that quote part of the original message, the quoted part of the message */
@@ -99,6 +117,25 @@ export declare namespace Message {
99
117
  export type LocationMessage = CommonMessage & MsgWith<"location">;
100
118
  export type PaidMediaMessage = CommonMessage & MsgWith<"paid_media">;
101
119
  export type VenueMessage = LocationMessage & MsgWith<"venue">;
120
+ export type DirectMessagePriceChangedMessage = ServiceMessage &
121
+ MsgWith<"direct_message_price_changed">;
122
+ export type ChecklistMessage = CommonMessage & MsgWith<"checklist">;
123
+ export type ChecklistTasksDoneMessage = ServiceMessage &
124
+ MsgWith<"checklist_tasks_done">;
125
+ export type ChecklistTasksAddedMessage = ServiceMessage &
126
+ MsgWith<"checklist_tasks_added">;
127
+ export type SuggestedPostInfoMessage = ServiceMessage &
128
+ MsgWith<"suggested_post_info">;
129
+ export type SuggestedPostApprovedMessage = ServiceMessage &
130
+ MsgWith<"suggested_post_approved">;
131
+ export type SuggestedPostApprovalFailedMessage = ServiceMessage &
132
+ MsgWith<"suggested_post_approval_failed">;
133
+ export type SuggestedPostDeclinedMessage = ServiceMessage &
134
+ MsgWith<"suggested_post_declined">;
135
+ export type SuggestedPostPaidMessage = ServiceMessage &
136
+ MsgWith<"suggested_post_paid">;
137
+ export type SuggestedPostRefundedMessage = ServiceMessage &
138
+ MsgWith<"suggested_post_refunded">;
102
139
  export type NewChatMembersMessage = ServiceMessage &
103
140
  MsgWith<"new_chat_members">;
104
141
  export type LeftChatMemberMessage = ServiceMessage &
@@ -156,6 +193,10 @@ export declare namespace Message {
156
193
  MsgWith<"giveaway_winners">;
157
194
  export type GiveawayCompletedMessage = ServiceMessage &
158
195
  MsgWith<"giveaway_completed">;
196
+ export type GiftMessage = ServiceMessage & MsgWith<"gift">;
197
+ export type UniqueGiftMessage = ServiceMessage & MsgWith<"unique_gift">;
198
+ export type PaidMessagePriceChangedMessage = ServiceMessage &
199
+ MsgWith<"paid_message_price_changed">;
159
200
  export type VideoChatScheduledMessage = ServiceMessage &
160
201
  MsgWith<"video_chat_scheduled">;
161
202
  export type VideoChatStartedMessage = ServiceMessage &
@@ -206,6 +247,24 @@ export interface Message extends Message.MediaMessage {
206
247
  location?: Location;
207
248
  /** Message contains paid media; information about the paid media */
208
249
  paid_media?: PaidMediaInfo;
250
+ /** Message is a checklist */
251
+ checklist?: Checklist;
252
+ /** Service message: some tasks in a checklist were marked as done or not done */
253
+ checklist_tasks_done?: ChecklistTasksDone;
254
+ /** Service message: tasks were added to a checklist */
255
+ checklist_tasks_added?: ChecklistTasksAdded;
256
+ /** Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited. */
257
+ suggested_post_info?: SuggestedPostInfo;
258
+ /** Service message: a suggested post was approved */
259
+ suggested_post_approved?: SuggestedPostApproved;
260
+ /** Service message: approval of a suggested post has failed */
261
+ suggested_post_approval_failed?: SuggestedPostApprovalFailed;
262
+ /** Service message: a suggested post was declined */
263
+ suggested_post_declined?: SuggestedPostDeclined;
264
+ /** Service message: payment for a suggested post was received */
265
+ suggested_post_paid?: SuggestedPostPaid;
266
+ /** Service message: payment for a suggested post was refunded */
267
+ suggested_post_refunded?: SuggestedPostRefunded;
209
268
  /** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
210
269
  new_chat_members?: User[];
211
270
  /** A member was removed from the group, information about them (this member may be the bot itself) */
@@ -278,6 +337,8 @@ export interface Message extends Message.MediaMessage {
278
337
  unique_gift?: UniqueGiftInfo;
279
338
  /** Service message: the price for paid messages has changed in the chat */
280
339
  paid_message_price_changed?: PaidMessagePriceChanged;
340
+ /** Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed */
341
+ direct_message_price_changed?: DirectMessagePriceChanged;
281
342
  /** Service message: video chat scheduled */
282
343
  video_chat_scheduled?: VideoChatScheduled;
283
344
  /** Service message: video chat started */
@@ -556,6 +617,8 @@ export interface ExternalReplyInfo {
556
617
  paid_media?: PaidMediaInfo;
557
618
  /** Message is a native poll, information about the poll */
558
619
  poll?: Poll;
620
+ /** Message is a checklist */
621
+ checklist?: Checklist;
559
622
  /** Message is a venue, information about the venue */
560
623
  venue?: Venue;
561
624
  }
@@ -564,8 +627,10 @@ export interface ExternalReplyInfo {
564
627
  export interface ReplyParameters {
565
628
  /** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */
566
629
  message_id: number;
567
- /** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account. */
630
+ /** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account and messages from channel direct messages chats. */
568
631
  chat_id?: number | string;
632
+ /** Identifier of the specific checklist task to be replied to */
633
+ checklist_task_id?: number;
569
634
  /** Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic. Always True for messages sent on behalf of a business account. */
570
635
  allow_sending_without_reply?: boolean;
571
636
  /** 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. */
@@ -1136,6 +1201,14 @@ export interface WriteAccessAllowed {
1136
1201
  from_attachment_menu?: boolean;
1137
1202
  }
1138
1203
 
1204
+ /** Describes a service message about a change in the price of direct messages sent to a channel chat. */
1205
+ export interface DirectMessagePriceChanged {
1206
+ /** True, if direct messages are enabled for the channel chat; false otherwise */
1207
+ are_direct_messages_enabled: boolean;
1208
+ /** The new number of Telegram Stars that must be paid by users for each direct message sent to the channel. Defaults to 0. */
1209
+ direct_message_star_count?: number;
1210
+ }
1211
+
1139
1212
  /** This object represents a service message about a video chat scheduled in the chat. */
1140
1213
  export interface VideoChatScheduled {
1141
1214
  /** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */
@@ -1506,3 +1579,19 @@ export interface PreparedInlineMessage {
1506
1579
  /** Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used */
1507
1580
  expiration_date: number;
1508
1581
  }
1582
+
1583
+ /** Describes a topic of a direct messages chat. */
1584
+ export interface DirectMessagesTopic {
1585
+ /** Unique identifier of the topic */
1586
+ topic_id: number;
1587
+ /** Information about the user that created the topic. Currently, it is always present */
1588
+ user: User;
1589
+ }
1590
+
1591
+ /** Contains parameters of a post that is being suggested by the bot. */
1592
+ export interface SuggestedPostParameters {
1593
+ /** Proposed price for the post. If the field is omitted, then the post is unpaid. */
1594
+ price?: SuggestedPostPrice;
1595
+ /** Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. */
1596
+ send_date?: number;
1597
+ }
@@ -1,4 +1,4 @@
1
- import type { ReactionType } from "./message.ts";
1
+ import type { ReactionType } from "./messageTypes";
2
2
 
3
3
  /** Describes the position of a clickable area within a story. */
4
4
  export interface StoryAreaPosition {