@telegram.ts/types 1.4.0 → 1.6.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.
@@ -1,8 +1,10 @@
1
- import type { Chat, File, User } from "./manageTypes.js";
2
- import type { InlineKeyboardMarkup } from "./markupTypes.js";
3
- import type { PassportData } from "./passportTypes.js";
4
- import type { Invoice, SuccessfulPayment } from "./invoiceTypes.js";
1
+ import type { Chat, User } from "./manageTypes";
2
+ import type { InlineKeyboardMarkup } from "./markupTypes";
3
+ import type { PassportData } from "./passportTypes";
4
+ import type { Invoice, SuccessfulPayment } from "./invoiceTypes";
5
+
5
6
  type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
7
+
6
8
  export declare namespace Message {
7
9
  interface ServiceMessage {
8
10
  /** Unique message identifier inside this chat */
@@ -13,30 +15,28 @@ export declare namespace Message {
13
15
  from?: User;
14
16
  /** Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
15
17
  sender_chat?: Chat;
16
- /** Date the message was sent in Unix time */
18
+ /** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */
17
19
  date: number;
18
- /** Conversation the message belongs to */
20
+ /** Chat the message belongs to */
19
21
  chat: Chat;
20
22
  /** True, if the message is sent to a forum topic */
21
23
  is_topic_message?: boolean;
22
24
  }
23
25
  export interface CommonMessage extends ServiceMessage {
24
- /** For forwarded messages, sender of the original message */
25
- forward_from?: User;
26
- /** For messages forwarded from channels or from anonymous administrators, information about the original sender chat */
27
- forward_from_chat?: Chat;
28
- /** For messages forwarded from channels, identifier of the original message in the channel */
29
- forward_from_message_id?: number;
30
- /** For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present */
31
- forward_signature?: string;
32
- /** Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages */
33
- forward_sender_name?: string;
34
- /** For forwarded messages, date the original message was sent in Unix time */
35
- forward_date?: number;
26
+ /** If the sender of the message boosted the chat, the number of boosts added by the user */
27
+ sender_boost_count?: number;
28
+ /** Information about the original message for forwarded messages */
29
+ forward_origin?: MessageOrigin;
36
30
  /** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
37
31
  is_automatic_forward?: true;
38
- /** For replies, 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. */
32
+ /** 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. */
39
33
  reply_to_message?: ReplyMessage;
34
+ /** Information about the message that is being replied to, which may come from another chat or forum topic */
35
+ external_reply?: ExternalReplyInfo;
36
+ /** For replies that quote part of the original message, the quoted part of the message */
37
+ quote?: TextQuote;
38
+ /** For replies to a story, the original message */
39
+ reply_to_story?: Story;
40
40
  /** Bot through which the message was sent */
41
41
  via_bot?: User;
42
42
  /** Date the message was last edited in Unix time */
@@ -45,6 +45,8 @@ export declare namespace Message {
45
45
  has_protected_content?: true;
46
46
  /** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
47
47
  author_signature?: string;
48
+ /** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
49
+ link_preview_options?: LinkPreviewOptions;
48
50
  /** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
49
51
  reply_markup?: InlineKeyboardMarkup;
50
52
  }
@@ -60,6 +62,7 @@ export declare namespace Message {
60
62
  /** True, if the message media is covered by a spoiler animation */
61
63
  has_media_spoiler?: true;
62
64
  }
65
+
63
66
  export type TextMessage = CommonMessage & MsgWith<"text">;
64
67
  export type AudioMessage = CaptionableMessage & MsgWith<"audio">;
65
68
  export type DocumentMessage = CaptionableMessage & MsgWith<"document">;
@@ -100,7 +103,7 @@ export declare namespace Message {
100
103
  export type InvoiceMessage = ServiceMessage & MsgWith<"invoice">;
101
104
  export type SuccessfulPaymentMessage = ServiceMessage &
102
105
  MsgWith<"successful_payment">;
103
- export type UserSharedMessage = ServiceMessage & MsgWith<"user_shared">;
106
+ export type UsersSharedMessage = ServiceMessage & MsgWith<"users_shared">;
104
107
  export type ChatSharedMessage = ServiceMessage & MsgWith<"chat_shared">;
105
108
  export type ConnectedWebsiteMessage = ServiceMessage &
106
109
  MsgWith<"connected_website">;
@@ -109,6 +112,7 @@ export declare namespace Message {
109
112
  export type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">;
110
113
  export type ProximityAlertTriggeredMessage = ServiceMessage &
111
114
  MsgWith<"proximity_alert_triggered">;
115
+ export type BoostAddedMessage = ServiceMessage & MsgWith<"boost_added">;
112
116
  export type ForumTopicCreatedMessage = ServiceMessage &
113
117
  MsgWith<"forum_topic_created">;
114
118
  export type ForumTopicEditedMessage = ServiceMessage &
@@ -121,6 +125,13 @@ export declare namespace Message {
121
125
  MsgWith<"general_forum_topic_hidden">;
122
126
  export type GeneralForumTopicUnhiddenMessage = ServiceMessage &
123
127
  MsgWith<"general_forum_topic_unhidden">;
128
+ export type GiveawayCreatedMessage = ServiceMessage &
129
+ MsgWith<"giveaway_created">;
130
+ export type GiveawayMessage = ServiceMessage & MsgWith<"giveaway">;
131
+ export type GiveawayWinnersMessage = ServiceMessage &
132
+ MsgWith<"giveaway_winners">;
133
+ export type GiveawayCompletedMessage = ServiceMessage &
134
+ MsgWith<"giveaway_completed">;
124
135
  export type VideoChatScheduledMessage = ServiceMessage &
125
136
  MsgWith<"video_chat_scheduled">;
126
137
  export type VideoChatStartedMessage = ServiceMessage &
@@ -130,11 +141,10 @@ export declare namespace Message {
130
141
  export type VideoChatParticipantsInvitedMessage = ServiceMessage &
131
142
  MsgWith<"video_chat_participants_invited">;
132
143
  export type WebAppDataMessage = ServiceMessage & MsgWith<"web_app_data">;
133
- export {};
134
144
  }
135
- type ReplyMessage = Message & {
136
- reply_to_message: undefined;
137
- };
145
+
146
+ type ReplyMessage = Message & { reply_to_message: undefined };
147
+
138
148
  export interface Message extends Message.MediaMessage {
139
149
  /** For text messages, the actual UTF-8 text of the message */
140
150
  text?: string;
@@ -150,6 +160,8 @@ export interface Message extends Message.MediaMessage {
150
160
  photo?: PhotoSize[];
151
161
  /** Message is a sticker, information about the sticker */
152
162
  sticker?: Sticker;
163
+ /** Message is a forwarded story */
164
+ story?: Story;
153
165
  /** Message is a video, information about the video */
154
166
  video?: Video;
155
167
  /** Message is a video note, information about the video message */
@@ -176,8 +188,6 @@ export interface Message extends Message.MediaMessage {
176
188
  new_chat_title?: string;
177
189
  /** A chat photo was change to this value */
178
190
  new_chat_photo?: PhotoSize[];
179
- /** Message is a forwarded story */
180
- story?: Story;
181
191
  /** Service message: the chat photo was deleted */
182
192
  delete_chat_photo?: true;
183
193
  /** Service message: the group has been created */
@@ -188,28 +198,30 @@ export interface Message extends Message.MediaMessage {
188
198
  channel_chat_created?: true;
189
199
  /** Service message: auto-delete timer settings changed in the chat */
190
200
  message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged;
191
- /** The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
201
+ /** The group has been migrated to a supergroup with the specified identifier. */
192
202
  migrate_to_chat_id?: number;
193
- /** The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
203
+ /** The supergroup has been migrated from a group with the specified identifier. */
194
204
  migrate_from_chat_id?: number;
195
- /** Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. */
196
- pinned_message?: ReplyMessage;
205
+ /** Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */
206
+ pinned_message?: MaybeInaccessibleMessage;
197
207
  /** Message is an invoice for a payment, information about the invoice. More about payments » */
198
208
  invoice?: Invoice;
199
209
  /** Message is a service message about a successful payment, information about the payment. More about payments » */
200
210
  successful_payment?: SuccessfulPayment;
201
- /** Service message: a user was shared with the bot */
202
- user_shared?: UserShared;
211
+ /** Service message: users were shared with the bot */
212
+ users_shared?: UsersShared;
203
213
  /** Service message: a chat was shared with the bot */
204
214
  chat_shared?: ChatShared;
205
215
  /** The domain name of the website on which the user has logged in. More about Telegram Login » */
206
216
  connected_website?: string;
207
- /** Service message: the user allowed the bot added to the attachment menu to write messages */
217
+ /** Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess */
208
218
  write_access_allowed?: WriteAccessAllowed;
209
219
  /** Telegram Passport data */
210
220
  passport_data?: PassportData;
211
221
  /** Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */
212
222
  proximity_alert_triggered?: ProximityAlertTriggered;
223
+ /** Service message: user boosted the chat */
224
+ boost_added?: ChatBoostAdded;
213
225
  /** Service message: forum topic created */
214
226
  forum_topic_created?: ForumTopicCreated;
215
227
  /** Service message: forum topic edited */
@@ -222,6 +234,14 @@ export interface Message extends Message.MediaMessage {
222
234
  general_forum_topic_hidden?: GeneralForumTopicHidden;
223
235
  /** Service message: the 'General' forum topic unhidden */
224
236
  general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
237
+ /** Service message: a scheduled giveaway was created */
238
+ giveaway_created?: GiveawayCreated;
239
+ /** The message is a scheduled giveaway message */
240
+ giveaway?: Giveaway;
241
+ /** A giveaway with public winners was completed */
242
+ giveaway_winners?: GiveawayWinners;
243
+ /** Service message: a giveaway without public winners was completed */
244
+ giveaway_completed?: GiveawayCompleted;
225
245
  /** Service message: video chat scheduled */
226
246
  video_chat_scheduled?: VideoChatScheduled;
227
247
  /** Service message: video chat started */
@@ -233,23 +253,51 @@ export interface Message extends Message.MediaMessage {
233
253
  /** Service message: data sent by a Web App */
234
254
  web_app_data?: WebAppData;
235
255
  }
256
+
236
257
  /** This object represents a unique message identifier. */
237
258
  export interface MessageId {
238
259
  /** Unique message identifier */
239
260
  message_id: number;
240
261
  }
262
+
241
263
  /** Describes an inline message sent by a Web App on behalf of a user. */
242
264
  export interface SentWebAppMessage {
243
265
  /** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. */
244
266
  inline_message_id: string;
245
267
  }
246
- /** The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, and spoiler text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.
268
+
269
+ /** This object describes a message that was deleted or is otherwise inaccessible to the bot. */
270
+ export interface InaccessibleMessage
271
+ extends Omit<
272
+ // TypeScript cannot discriminate union types based on `0` and `number` so
273
+ // we work around this by including all other properties here. This mostly
274
+ // negates the benefit of having this interface in the first place, but not
275
+ // extending Message is not very ergonomic to use. If you have a better idea
276
+ // how to model this, please let us know!
277
+ Message,
278
+ "chat" | "message_id" | "date"
279
+ > {
280
+ /** Chat the message belonged to */
281
+ chat: Chat;
282
+ /** Unique message identifier inside the chat */
283
+ message_id: number;
284
+ /** Always 0. The field can be used to differentiate regular and inaccessible messages. */
285
+ date: 0;
286
+ }
287
+
288
+ /** This object describes a message that can be inaccessible to the bot. It can be one of
289
+ - Message
290
+ - InaccessibleMessage */
291
+ export type MaybeInaccessibleMessage = Message | InaccessibleMessage;
292
+
293
+ /** The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, spoiler text, block quotations as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can specify text entities directly, or use markdown-style or HTML-style formatting.
247
294
 
248
295
  Note that Telegram clients will display an **alert** to the user before opening an inline link ('Open this link?' together with the full URL).
249
296
 
250
297
  Message entities can be nested, providing following restrictions are met:
251
298
  - If two entities have common characters, then one of them is fully contained inside another.
252
299
  - bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
300
+ - blockquote entities can't be nested.
253
301
  - All other entities can't contain each other.
254
302
 
255
303
  Links `tg://user?id=<user_id>` can be used to mention a user by their ID without using a username. Please note:
@@ -257,6 +305,8 @@ Links `tg://user?id=<user_id>` can be used to mention a user by their ID without
257
305
  - These links will work only if they are used inside an inline link or in an inline keyboard button. For example, they will not work, when used in a message text.
258
306
  - Unless the user is a member of the chat where they were mentioned, these mentions are only guaranteed to work if the user has contacted the bot in private in the past or has sent a callback query to the bot via an inline button and doesn't have Forwarded Messages privacy enabled for the bot.
259
307
 
308
+ You can find the list of programming and markup languages for which syntax highlighting is supported at [libprisma#supported-languages](https://github.com/TelegramMessenger/libprisma#supported-languages).
309
+
260
310
  #### MarkdownV2 style
261
311
  To use this mode, pass *MarkdownV2* in the *parse_mode* field. Use the following syntax in your message:
262
312
 
@@ -277,16 +327,21 @@ pre-formatted fixed-width code block
277
327
  ```python
278
328
  pre-formatted fixed-width code block written in the Python programming language
279
329
  ```
330
+ >Block quotation started
331
+ >Block quotation continued
332
+ >The last line of the block quotation**
333
+ >The second block quotation started right after the previous\r
334
+ >The third block quotation started right after the previous
280
335
  ```
281
336
  Please note:
282
337
 
283
338
  - Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup. This implies that '\' character usually must be escaped with a preceding '\' character.
284
339
  - Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
285
- - Inside `(...)` part of inline link definition, all ')' and '\' must be escaped with a preceding '\' character.
286
- - A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
287
- - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
340
+ - Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
288
341
  - In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
289
342
  - In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of `underline` entity, so instead of `___italic underline___` use `___italic underline_\r__`, where `\r` is a character with code 13, which will be ignored.
343
+ - A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
344
+ - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
290
345
 
291
346
  #### HTML style
292
347
  To use this mode, pass *HTML* in the *parse_mode* field. The following tags are currently supported:
@@ -304,6 +359,7 @@ To use this mode, pass *HTML* in the *parse_mode* field. The following tags are
304
359
  <code>inline fixed-width code</code>
305
360
  <pre>pre-formatted fixed-width code block</pre>
306
361
  <pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
362
+ <blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>
307
363
  ```
308
364
  Please note:
309
365
 
@@ -335,13 +391,14 @@ pre-formatted fixed-width code block written in the Python programming language
335
391
  Please note:
336
392
 
337
393
  - Entities must not be nested, use parse mode MarkdownV2 instead.
338
- - There is no way to specify underline and strikethrough entities, use parse mode MarkdownV2 instead.
394
+ - There is no way to specify underline”, “strikethrough”, “spoiler”, “blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
339
395
  - To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
340
396
  - Escaping inside entities is not allowed, so entity must be closed first and reopened again: use `_snake_\__case_` for italic `snake_case` and `*2*\**2=4*` for bold `2*2=4`. */
341
397
  export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
398
+
342
399
  export declare namespace MessageEntity {
343
400
  interface AbstractMessageEntity {
344
- /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “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), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
401
+ /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “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), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
345
402
  type: string;
346
403
  /** Offset in UTF-16 code units to the start of the entity */
347
404
  offset: number;
@@ -362,6 +419,7 @@ export declare namespace MessageEntity {
362
419
  | "underline"
363
420
  | "strikethrough"
364
421
  | "spoiler"
422
+ | "blockquote"
365
423
  | "code";
366
424
  }
367
425
  export interface PreMessageEntity extends AbstractMessageEntity {
@@ -384,8 +442,8 @@ export declare namespace MessageEntity {
384
442
  /** For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker */
385
443
  custom_emoji_id: string;
386
444
  }
387
- export {};
388
445
  }
446
+
389
447
  /** This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. */
390
448
  export type MessageEntity =
391
449
  | MessageEntity.CommonMessageEntity
@@ -393,6 +451,144 @@ export type MessageEntity =
393
451
  | MessageEntity.PreMessageEntity
394
452
  | MessageEntity.TextLinkMessageEntity
395
453
  | MessageEntity.TextMentionMessageEntity;
454
+
455
+ /** This object contains information about the quoted part of a message that is replied to by the given message. */
456
+ export interface TextQuote {
457
+ /** Text of the quoted part of a message that is replied to by the given message */
458
+ text: string;
459
+ /** Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes. */
460
+ entities?: MessageEntity[];
461
+ /** Approximate quote position in the original message in UTF-16 code units as specified by the sender */
462
+ position: number;
463
+ /** True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. */
464
+ is_manual?: true;
465
+ }
466
+
467
+ /** This object contains information about a message that is being replied to, which may come from another chat or forum topic. */
468
+ export interface ExternalReplyInfo {
469
+ /** Origin of the message replied to by the given message */
470
+ origin: MessageOrigin;
471
+ /** Chat the original message belongs to. Available only if the chat is a supergroup or a channel. */
472
+ chat?: Chat;
473
+ /** Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. */
474
+ message_id?: number;
475
+ /** Options used for link preview generation for the original message, if it is a text message */
476
+ link_preview_options?: LinkPreviewOptions;
477
+ /** Message is an animation, information about the animation */
478
+ animation?: Animation;
479
+ /** Message is an audio file, information about the file */
480
+ audio?: Audio;
481
+ /** Message is a general file, information about the file */
482
+ document?: Document;
483
+ /** Message is a photo, available sizes of the photo */
484
+ photo?: PhotoSize[];
485
+ /** Message is a sticker, information about the sticker */
486
+ sticker?: Sticker;
487
+ /** Message is a forwarded story */
488
+ story?: Story;
489
+ /** Message is a video, information about the video */
490
+ video?: Video;
491
+ /** Message is a video note, information about the video message */
492
+ video_note?: VideoNote;
493
+ /** Message is a voice message, information about the file */
494
+ voice?: Voice;
495
+ /** True, if the message media is covered by a spoiler animation */
496
+ has_media_spoiler?: true;
497
+ /** Message is a shared contact, information about the contact */
498
+ contact?: Contact;
499
+ /** Message is a dice with random value */
500
+ dice?: Dice;
501
+ /** Message is a game, information about the game. More about games » */
502
+ game?: Game;
503
+ /** Message is a scheduled giveaway, information about the giveaway */
504
+ giveaway?: Giveaway;
505
+ /** A giveaway with public winners was completed */
506
+ giveaway_winners?: GiveawayWinners;
507
+ /** Message is an invoice for a payment, information about the invoice. More about payments » */
508
+ invoice?: Invoice;
509
+ /** Message is a shared location, information about the location */
510
+ location?: Location;
511
+ /** Message is a native poll, information about the poll */
512
+ poll?: Poll;
513
+ /** Message is a venue, information about the venue */
514
+ venue?: Venue;
515
+ }
516
+
517
+ /** Describes reply parameters for the message that is being sent. */
518
+ export interface ReplyParameters {
519
+ /** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */
520
+ message_id: number;
521
+ /** 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) */
522
+ chat_id?: number | string;
523
+ /** 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. */
524
+ allow_sending_without_reply?: boolean;
525
+ /** 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. */
526
+ quote?: string;
527
+ /** Mode for parsing entities in the quote. See formatting options for more details. */
528
+ quote_parse_mode?: string;
529
+ /** A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. */
530
+ quote_entities?: MessageEntity[];
531
+ /** Position of the quote in the original message in UTF-16 code units */
532
+ quote_position?: number;
533
+ }
534
+
535
+ /** This object describes the origin of a message. It can be one of
536
+ - MessageOriginUser
537
+ - MessageOriginHiddenUser
538
+ - MessageOriginChat
539
+ - MessageOriginChannel */
540
+ export type MessageOrigin =
541
+ | MessageOriginUser
542
+ | MessageOriginHiddenUser
543
+ | MessageOriginChat
544
+ | MessageOriginChannel;
545
+
546
+ /** The message was originally sent by a known user. */
547
+ export interface MessageOriginUser {
548
+ /** Type of the message origin, always “user” */
549
+ type: "user";
550
+ /** Date the message was sent originally in Unix time */
551
+ date: number;
552
+ /** User that sent the message originally */
553
+ sender_user: User;
554
+ }
555
+
556
+ /** The message was originally sent by an unknown user. */
557
+ export interface MessageOriginHiddenUser {
558
+ /** Type of the message origin, always “hidden_user” */
559
+ type: "hidden_user";
560
+ /** Date the message was sent originally in Unix time */
561
+ date: number;
562
+ /** Name of the user that sent the message originally */
563
+ sender_user_name: string;
564
+ }
565
+
566
+ /** The message was originally sent on behalf of a chat to a group chat. */
567
+ export interface MessageOriginChat {
568
+ /** Type of the message origin, always “chat” */
569
+ type: "chat";
570
+ /** Date the message was sent originally in Unix time */
571
+ date: number;
572
+ /** Chat that sent the message originally */
573
+ sender_chat: Chat;
574
+ /** For messages originally sent by an anonymous chat administrator, original message author signature */
575
+ author_signature?: string;
576
+ }
577
+
578
+ /** The message was originally sent to a channel chat. */
579
+ export interface MessageOriginChannel {
580
+ /** Type of the message origin, always “channel” */
581
+ type: "channel";
582
+ /** Date the message was sent originally in Unix time */
583
+ date: number;
584
+ /** Channel chat to which the message was originally sent */
585
+ chat: Chat;
586
+ /** Unique message identifier inside the chat */
587
+ message_id: number;
588
+ /** Signature of the original post author */
589
+ author_signature?: string;
590
+ }
591
+
396
592
  /** This object represents one size of a photo or a file / sticker thumbnail. */
397
593
  export interface PhotoSize {
398
594
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -406,6 +602,7 @@ export interface PhotoSize {
406
602
  /** File size in bytes */
407
603
  file_size?: number;
408
604
  }
605
+
409
606
  /** This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */
410
607
  export interface Animation {
411
608
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -427,6 +624,7 @@ export interface Animation {
427
624
  /** File size in bytes */
428
625
  file_size?: number;
429
626
  }
627
+
430
628
  /** This object represents an audio file to be treated as music by the Telegram clients. */
431
629
  export interface Audio {
432
630
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -448,6 +646,7 @@ export interface Audio {
448
646
  /** Thumbnail of the album cover to which the music file belongs */
449
647
  thumbnail?: PhotoSize;
450
648
  }
649
+
451
650
  /** This object represents a general file (as opposed to photos, voice messages and audio files). */
452
651
  export interface Document {
453
652
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -463,6 +662,7 @@ export interface Document {
463
662
  /** File size in bytes */
464
663
  file_size?: number;
465
664
  }
665
+
466
666
  /** This object represents a video file. */
467
667
  export interface Video {
468
668
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -484,6 +684,7 @@ export interface Video {
484
684
  /** File size in bytes */
485
685
  file_size?: number;
486
686
  }
687
+
487
688
  /** This object represents a video message (available in Telegram apps as of v.4.0). */
488
689
  export interface VideoNote {
489
690
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -499,6 +700,7 @@ export interface VideoNote {
499
700
  /** File size in bytes */
500
701
  file_size?: number;
501
702
  }
703
+
502
704
  /** This object represents a voice note. */
503
705
  export interface Voice {
504
706
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -512,6 +714,7 @@ export interface Voice {
512
714
  /** File size in bytes */
513
715
  file_size?: number;
514
716
  }
717
+
515
718
  /** This object represents a phone contact. */
516
719
  export interface Contact {
517
720
  /** Contact's phone number */
@@ -520,11 +723,12 @@ export interface Contact {
520
723
  first_name: string;
521
724
  /** Contact's last name */
522
725
  last_name?: string;
523
- /** Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */
726
+ /** Contact's user identifier in Telegram. */
524
727
  user_id?: number;
525
728
  /** Additional data about the contact in the form of a vCard */
526
729
  vcard?: string;
527
730
  }
731
+
528
732
  /** This object represents an animated emoji that displays a random value. */
529
733
  export interface Dice {
530
734
  /** Emoji on which the dice throw animation is based */
@@ -532,6 +736,7 @@ export interface Dice {
532
736
  /** Value of the dice, 1-6 for "🎲", "🎯" and "🎳" base emoji, 1-5 for "🏀" and "⚽" base emoji, 1-64 for "🎰" base emoji */
533
737
  value: number;
534
738
  }
739
+
535
740
  /** This object contains information about one answer option in a poll. */
536
741
  export interface PollOption {
537
742
  /** Option text, 1-100 characters */
@@ -539,6 +744,7 @@ export interface PollOption {
539
744
  /** Number of users that voted for this option */
540
745
  voter_count: number;
541
746
  }
747
+
542
748
  /** This object represents an answer of a user in a non-anonymous poll. */
543
749
  export interface PollAnswer {
544
750
  /** Unique poll identifier */
@@ -550,6 +756,7 @@ export interface PollAnswer {
550
756
  /** 0-based identifiers of chosen answer options. May be empty if the vote was retracted. */
551
757
  option_ids: number[];
552
758
  }
759
+
553
760
  /** This object contains information about a poll. */
554
761
  export interface Poll {
555
762
  /** Unique poll identifier */
@@ -579,6 +786,7 @@ export interface Poll {
579
786
  /** Point in time (Unix timestamp) when the poll will be automatically closed */
580
787
  close_date?: number;
581
788
  }
789
+
582
790
  /** This object represents a point on the map. */
583
791
  export interface Location {
584
792
  /** Longitude as defined by sender */
@@ -594,6 +802,7 @@ export interface Location {
594
802
  /** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
595
803
  proximity_alert_radius?: number;
596
804
  }
805
+
597
806
  /** This object represents a venue. */
598
807
  export interface Venue {
599
808
  /** Venue location. Can't be a live location */
@@ -611,8 +820,15 @@ export interface Venue {
611
820
  /** Google Places type of the venue. (See supported types.) */
612
821
  google_place_type?: string;
613
822
  }
614
- /** This object represents a message about a forwarded story in the chat. Currently holds no information. */
615
- export interface Story {}
823
+
824
+ /** This object represents a story. */
825
+ export interface Story {
826
+ /** Chat that posted the story */
827
+ chat: Chat;
828
+ /** Unique identifier for the story in the chat */
829
+ id: number;
830
+ }
831
+
616
832
  /** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */
617
833
  export interface ProximityAlertTriggered {
618
834
  /** User that triggered the alert */
@@ -622,11 +838,13 @@ export interface ProximityAlertTriggered {
622
838
  /** The distance between the users */
623
839
  distance: number;
624
840
  }
841
+
625
842
  /** This object represents a service message about a change in auto-delete timer settings. */
626
843
  export interface MessageAutoDeleteTimerChanged {
627
844
  /** New auto-delete time for messages in the chat; in seconds */
628
845
  message_auto_delete_time: number;
629
846
  }
847
+
630
848
  /** This object represents a service message about a new forum topic created in the chat. */
631
849
  export interface ForumTopicCreated {
632
850
  /** Name of the topic */
@@ -636,6 +854,7 @@ export interface ForumTopicCreated {
636
854
  /** Unique identifier of the custom emoji shown as the topic icon */
637
855
  icon_custom_emoji_id?: string;
638
856
  }
857
+
639
858
  /** This object represents a service message about an edited forum topic. */
640
859
  export interface ForumTopicEdited {
641
860
  /** New name of the topic, if it was edited */
@@ -643,54 +862,145 @@ export interface ForumTopicEdited {
643
862
  /** New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed */
644
863
  icon_custom_emoji_id?: string;
645
864
  }
865
+
646
866
  /** This object represents a service message about a forum topic closed in the chat. Currently holds no information. */
647
867
  export interface ForumTopicClosed {}
868
+
648
869
  /** This object represents a service message about a forum topic reopened in the chat. Currently holds no information. */
649
870
  export interface ForumTopicReopened {}
871
+
650
872
  /** This object represents a service message about General forum topic hidden in the chat. Currently holds no information. */
651
873
  export interface GeneralForumTopicHidden {}
874
+
652
875
  /** This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. */
653
876
  export interface GeneralForumTopicUnhidden {}
654
- /** This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button. */
655
- export interface UserShared {
877
+
878
+ /** This object represents a service message about a user boosting a chat. */
879
+ export interface ChatBoostAdded {
880
+ /** Number of boosts added by the user */
881
+ boost_count: number;
882
+ }
883
+
884
+ /** This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUsers button. */
885
+ export interface UsersShared {
656
886
  /** Identifier of the request */
657
887
  request_id: number;
658
- /** Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
659
- user_id: number;
888
+ /** Identifiers of the shared users. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means. */
889
+ user_ids: number[];
660
890
  }
891
+
661
892
  /** This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button. */
662
893
  export interface ChatShared {
663
894
  /** Identifier of the request */
664
895
  request_id: number;
665
- /** Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. */
896
+ /** Identifier of the shared chat. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. */
666
897
  chat_id: number;
667
898
  }
668
- /** This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link. */
899
+
900
+ /** This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess. */
669
901
  export interface WriteAccessAllowed {
670
902
  /** True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess */
671
903
  from_request?: boolean;
672
- /** Name of the Web App which was launched from a link */
904
+ /** Name of the Web App, if the access was granted when the Web App was launched from a link */
673
905
  web_app_name?: string;
674
906
  /** True, if the access was granted when the bot was added to the attachment or side menu */
675
907
  from_attachment_menu?: boolean;
676
908
  }
909
+
677
910
  /** This object represents a service message about a video chat scheduled in the chat. */
678
911
  export interface VideoChatScheduled {
679
912
  /** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */
680
913
  start_date: number;
681
914
  }
915
+
682
916
  /** This object represents a service message about a video chat started in the chat. Currently holds no information. */
683
917
  export interface VideoChatStarted {}
918
+
684
919
  /** This object represents a service message about a video chat ended in the chat. */
685
920
  export interface VideoChatEnded {
686
921
  /** Video chat duration in seconds */
687
922
  duration: number;
688
923
  }
924
+
689
925
  /** This object represents a service message about new members invited to a video chat. */
690
926
  export interface VideoChatParticipantsInvited {
691
927
  /** New members that were invited to the video chat */
692
928
  users: User[];
693
929
  }
930
+
931
+ /** This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. */
932
+ export interface GiveawayCreated {}
933
+
934
+ /** This object represents a message about a scheduled giveaway. */
935
+ export interface Giveaway {
936
+ /** The list of chats which the user must join to participate in the giveaway */
937
+ chats: Chat[];
938
+ /** Point in time (Unix timestamp) when winners of the giveaway will be selected */
939
+ winners_selection_date: number;
940
+ /** The number of users which are supposed to be selected as winners of the giveaway */
941
+ winner_count: number;
942
+ /** True, if only users who join the chats after the giveaway started should be eligible to win */
943
+ only_new_members?: true;
944
+ /** True, if the list of giveaway winners will be visible to everyone */
945
+ has_public_winners?: true;
946
+ /** Description of additional giveaway prize */
947
+ prize_description?: string;
948
+ /** A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. */
949
+ country_codes?: string[];
950
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for */
951
+ premium_subscription_month_count?: number;
952
+ }
953
+
954
+ /** This object represents a message about the completion of a giveaway with public winners. */
955
+ export interface GiveawayWinners {
956
+ /** The chat that created the giveaway */
957
+ chat: Chat;
958
+ /** Identifier of the messsage with the giveaway in the chat */
959
+ giveaway_message_id: number;
960
+ /** Point in time (Unix timestamp) when winners of the giveaway were selected */
961
+ winners_selection_date: number;
962
+ /** Total number of winners in the giveaway */
963
+ winner_count: number;
964
+ /** List of up to 100 winners of the giveaway */
965
+ winners: User[];
966
+ /** The number of other chats the user had to join in order to be eligible for the giveaway */
967
+ additional_chat_count?: number;
968
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for */
969
+ premium_subscription_month_count?: number;
970
+ /** Number of undistributed prizes */
971
+ unclaimed_prize_count?: number;
972
+ /** True, if only users who had joined the chats after the giveaway started were eligible to win */
973
+ only_new_members?: true;
974
+ /** True, if the giveaway was canceled because the payment for it was refunded */
975
+ was_refunded?: true;
976
+ /** Description of additional giveaway prize */
977
+ prize_description?: string;
978
+ }
979
+
980
+ /** This object represents a service message about the completion of a giveaway without public winners. */
981
+ export interface GiveawayCompleted {
982
+ /** Number of winners in the giveaway */
983
+ winner_count: number;
984
+ /** Number of undistributed prizes */
985
+ unclaimed_prize_count?: number;
986
+ /** Message with the giveaway that was completed, if it wasn't deleted */
987
+ giveaway_message?: Message;
988
+ }
989
+
990
+ /** Describes the options used for link preview generation. */
991
+ export interface LinkPreviewOptions {
992
+ /** True, if the link preview is disabled */
993
+ is_disabled?: boolean;
994
+ /** URL to use for the link preview. If empty, then the first URL found in the message text will be used */
995
+ url?: string;
996
+ /** True, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */
997
+ prefer_small_media?: boolean;
998
+ /** True, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */
999
+ prefer_large_media?: boolean;
1000
+ /** True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text */
1001
+ show_above_text?: boolean;
1002
+ }
1003
+
694
1004
  /** Describes data sent from a Web App to the bot. */
695
1005
  export interface WebAppData {
696
1006
  /** The data. Be aware that a bad client can send arbitrary data in this field. */
@@ -698,6 +1008,7 @@ export interface WebAppData {
698
1008
  /** Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. */
699
1009
  button_text: string;
700
1010
  }
1011
+
701
1012
  /** This object represents a sticker. */
702
1013
  export interface Sticker {
703
1014
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -729,6 +1040,7 @@ export interface Sticker {
729
1040
  /** File size in bytes */
730
1041
  file_size?: number;
731
1042
  }
1043
+
732
1044
  /** This object represents a sticker set. */
733
1045
  export interface StickerSet {
734
1046
  /** Sticker set name */
@@ -746,6 +1058,7 @@ export interface StickerSet {
746
1058
  /** Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
747
1059
  thumbnail?: PhotoSize;
748
1060
  }
1061
+
749
1062
  /** This object describes the position on faces where a mask should be placed by default. */
750
1063
  export interface MaskPosition {
751
1064
  /** The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. */
@@ -757,6 +1070,7 @@ export interface MaskPosition {
757
1070
  /** Mask scaling coefficient. For example, 2.0 means double size. */
758
1071
  scale: number;
759
1072
  }
1073
+
760
1074
  /** This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. */
761
1075
  export interface Game {
762
1076
  /** Title of the game */
@@ -772,6 +1086,7 @@ export interface Game {
772
1086
  /** Animation that will be displayed in the game message in chats. Upload via BotFather */
773
1087
  animation: Animation;
774
1088
  }
1089
+
775
1090
  /** This object represents one row of the high scores table for a game. */
776
1091
  export interface GameHighScore {
777
1092
  /** Position in high score table for the game */
@@ -781,4 +1096,145 @@ export interface GameHighScore {
781
1096
  /** Score */
782
1097
  score: number;
783
1098
  }
784
- export {};
1099
+
1100
+ /** This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. */
1101
+ export interface File {
1102
+ /** Identifier for this file, which can be used to download or reuse the file */
1103
+ file_id: string;
1104
+ /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
1105
+ file_unique_id: string;
1106
+ /** File size in bytes */
1107
+ file_size?: number;
1108
+ /** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
1109
+ file_path?: string;
1110
+ }
1111
+
1112
+ /** This object describes the type of a reaction. Currently, it can be one of */
1113
+ export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji;
1114
+
1115
+ /** The reaction is based on an emoji. */
1116
+ export interface ReactionTypeEmoji {
1117
+ /** Type of the reaction, always “emoji” */
1118
+ type: "emoji";
1119
+ /** Reaction emoji. Currently, it can be one of "👍", "👎", "❤", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤‍🔥", "🌚", "🌭", "💯", "🤣", "⚡", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨‍💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍", "🤗", "🫡", "🎅", "🎄", "☃", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷‍♂", "🤷", "🤷‍♀", "😡" */
1120
+ emoji:
1121
+ | "👍"
1122
+ | "👎"
1123
+ | "❤"
1124
+ | "🔥"
1125
+ | "🥰"
1126
+ | "👏"
1127
+ | "😁"
1128
+ | "🤔"
1129
+ | "🤯"
1130
+ | "😱"
1131
+ | "🤬"
1132
+ | "😢"
1133
+ | "🎉"
1134
+ | "🤩"
1135
+ | "🤮"
1136
+ | "💩"
1137
+ | "🙏"
1138
+ | "👌"
1139
+ | "🕊"
1140
+ | "🤡"
1141
+ | "🥱"
1142
+ | "🥴"
1143
+ | "😍"
1144
+ | "🐳"
1145
+ | "❤‍🔥"
1146
+ | "🌚"
1147
+ | "🌭"
1148
+ | "💯"
1149
+ | "🤣"
1150
+ | "⚡"
1151
+ | "🍌"
1152
+ | "🏆"
1153
+ | "💔"
1154
+ | "🤨"
1155
+ | "😐"
1156
+ | "🍓"
1157
+ | "🍾"
1158
+ | "💋"
1159
+ | "🖕"
1160
+ | "😈"
1161
+ | "😴"
1162
+ | "😭"
1163
+ | "🤓"
1164
+ | "👻"
1165
+ | "👨‍💻"
1166
+ | "👀"
1167
+ | "🎃"
1168
+ | "🙈"
1169
+ | "😇"
1170
+ | "😨"
1171
+ | "🤝"
1172
+ | "✍"
1173
+ | "🤗"
1174
+ | "🫡"
1175
+ | "🎅"
1176
+ | "🎄"
1177
+ | "☃"
1178
+ | "💅"
1179
+ | "🤪"
1180
+ | "🗿"
1181
+ | "🆒"
1182
+ | "💘"
1183
+ | "🙉"
1184
+ | "🦄"
1185
+ | "😘"
1186
+ | "💊"
1187
+ | "🙊"
1188
+ | "😎"
1189
+ | "👾"
1190
+ | "🤷‍♂"
1191
+ | "🤷"
1192
+ | "🤷‍♀"
1193
+ | "😡";
1194
+ }
1195
+
1196
+ /** The reaction is based on a custom emoji. */
1197
+ export interface ReactionTypeCustomEmoji {
1198
+ /** Type of the reaction, always “custom_emoji” */
1199
+ type: "custom_emoji";
1200
+ /** Custom emoji identifier */
1201
+ custom_emoji: string;
1202
+ }
1203
+
1204
+ /** Represents a reaction added to a message along with the number of times it was added. */
1205
+ export interface ReactionCount {
1206
+ /** Type of the reaction */
1207
+ type: ReactionType;
1208
+ /** Number of times the reaction was added */
1209
+ total_count: number;
1210
+ }
1211
+
1212
+ /** This object represents a change of a reaction on a message performed by a user. */
1213
+ export interface MessageReactionUpdated {
1214
+ /** The chat containing the message the user reacted to */
1215
+ chat: Chat;
1216
+ /** Unique identifier of the message inside the chat */
1217
+ message_id: number;
1218
+ /** The user that changed the reaction, if the user isn't anonymous */
1219
+ user?: User;
1220
+ /** The chat on behalf of which the reaction was changed, if the user is anonymous */
1221
+ actor_chat?: Chat;
1222
+ /** Date of the change in Unix time */
1223
+ date: number;
1224
+ /** Previous list of reaction types that were set by the user */
1225
+ old_reaction: ReactionType[];
1226
+ /** New list of reaction types that have been set by the user */
1227
+ new_reaction: ReactionType[];
1228
+ }
1229
+
1230
+ /** This object represents reaction changes on a message with anonymous reactions. */
1231
+ export interface MessageReactionCountUpdated {
1232
+ /** The chat containing the message */
1233
+ chat: Chat;
1234
+ /** Unique message identifier inside the chat */
1235
+ message_id: number;
1236
+ /** Date of the change in Unix time */
1237
+ date: number;
1238
+ /** List of reactions that are present on the message */
1239
+ reactions: ReactionCount[];
1240
+ }