@tgify/types 9.2.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/message.d.ts ADDED
@@ -0,0 +1,1568 @@
1
+ import type { Chat, DirectMessagesTopic, File, Gift, StarAmount, SuggestedPostInfo, SuggestedPostPrice, UniqueGift, User } from "./manage.js";
2
+ import type { InlineKeyboardMarkup } from "./markup.js";
3
+ import type { PassportData } from "./passport.js";
4
+ import type { Invoice, RefundedPayment, SuccessfulPayment } from "./payment.js";
5
+ export declare namespace Message {
6
+ interface ServiceMessage {
7
+ /** Unique message identifier inside this chat */
8
+ message_id: number;
9
+ /** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */
10
+ message_thread_id?: number;
11
+ /** Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
12
+ /** Information about the direct messages chat topic that contains the message */
13
+ direct_messages_topic?: DirectMessagesTopic;
14
+ from?: User;
15
+ /** 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. */
16
+ sender_chat?: Chat;
17
+ /** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */
18
+ date: number;
19
+ /** Chat the message belongs to */
20
+ chat: Chat;
21
+ /** True, if the message is sent to a forum topic */
22
+ is_topic_message?: boolean;
23
+ }
24
+ interface CommonMessage extends ServiceMessage {
25
+ /** If the sender of the message boosted the chat, the number of boosts added by the user */
26
+ sender_boost_count?: number;
27
+ /** Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier. */
28
+ business_connection_id?: string;
29
+ /** Information about the original message for forwarded messages */
30
+ forward_origin?: MessageOrigin;
31
+ /** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
32
+ is_automatic_forward?: true;
33
+ /** 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. */
34
+ reply_to_message?: ReplyMessage;
35
+ /** Information about the message that is being replied to, which may come from another chat or forum topic */
36
+ external_reply?: ExternalReplyInfo;
37
+ /** For replies that quote part of the original message, the quoted part of the message */
38
+ quote?: TextQuote;
39
+ /** For replies to a story, the original story */
40
+ reply_to_story?: Story;
41
+ /** Identifier of the specific checklist task that is being replied to */
42
+ reply_to_checklist_task_id?: number;
43
+ /** Bot through which the message was sent */
44
+ via_bot?: User;
45
+ /** Date the message was last edited in Unix time */
46
+ edit_date?: number;
47
+ /** True, if the message can't be forwarded */
48
+ has_protected_content?: true;
49
+ /** True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message */
50
+ is_from_offline?: true;
51
+ /** 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. */
52
+ is_paid_post?: true;
53
+ /** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
54
+ author_signature?: string;
55
+ /** The number of Telegram Stars that were paid by the sender of the message to send it */
56
+ paid_star_count?: number;
57
+ /** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
58
+ link_preview_options?: LinkPreviewOptions;
59
+ /** 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. */
60
+ suggested_post_info?: SuggestedPostInfo;
61
+ /** Unique identifier of the message effect added to the message */
62
+ effect_id?: string;
63
+ /** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
64
+ reply_markup?: InlineKeyboardMarkup;
65
+ }
66
+ interface BusinessSentMessage {
67
+ /** The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account. */
68
+ sender_business_bot?: User;
69
+ }
70
+ interface TextMessage extends CommonMessage {
71
+ /** For text messages, the actual UTF-8 text of the message */
72
+ text: string;
73
+ /** For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */
74
+ entities?: MessageEntity[];
75
+ }
76
+ interface CaptionableMessage extends CommonMessage {
77
+ /** Caption for the animation, audio, document, photo, video or voice */
78
+ caption?: string;
79
+ /** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */
80
+ caption_entities?: MessageEntity[];
81
+ }
82
+ interface MediaMessage extends CaptionableMessage {
83
+ /** The unique identifier of a media message group this message belongs to */
84
+ media_group_id?: string;
85
+ /** True, if the message media is covered by a spoiler animation */
86
+ has_media_spoiler?: true;
87
+ }
88
+ interface AudioMessage extends MediaMessage {
89
+ /** Message is an audio file, information about the file */
90
+ audio: Audio;
91
+ }
92
+ interface DocumentMessage extends MediaMessage {
93
+ /** Message is a general file, information about the file */
94
+ document: Document;
95
+ }
96
+ interface PaidMediaMessage extends CaptionableMessage {
97
+ /** Message contains paid media; information about the paid media */
98
+ paid_media: PaidMediaInfo;
99
+ }
100
+ interface AnimationMessage extends DocumentMessage {
101
+ /** Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set */
102
+ animation: Animation;
103
+ /** True, if the caption must be shown above the message media */
104
+ show_caption_above_media?: true;
105
+ }
106
+ interface PhotoMessage extends MediaMessage {
107
+ /** Message is a photo, available sizes of the photo */
108
+ photo: PhotoSize[];
109
+ /** True, if the caption must be shown above the message media */
110
+ show_caption_above_media?: true;
111
+ }
112
+ interface StickerMessage extends CommonMessage {
113
+ /** Message is a sticker, information about the sticker */
114
+ sticker: Sticker;
115
+ }
116
+ interface StoryMessage extends CommonMessage {
117
+ /** Message is a forwarded story. Currently holds no information */
118
+ story: Story;
119
+ }
120
+ interface VideoMessage extends MediaMessage {
121
+ /** Message is a video, information about the video */
122
+ video: Video;
123
+ /** True, if the caption must be shown above the message media */
124
+ show_caption_above_media?: true;
125
+ }
126
+ interface VideoNoteMessage extends CommonMessage {
127
+ /** Message is a video note, information about the video message */
128
+ video_note: VideoNote;
129
+ }
130
+ interface VoiceMessage extends CaptionableMessage {
131
+ /** Message is a voice message, information about the file */
132
+ voice: Voice;
133
+ }
134
+ interface ChecklistMessage extends CommonMessage {
135
+ /** Message is a checklist */
136
+ checklist: Checklist;
137
+ }
138
+ interface ContactMessage extends CommonMessage {
139
+ /** Message is a shared contact, information about the contact */
140
+ contact: Contact;
141
+ }
142
+ interface DiceMessage extends CommonMessage {
143
+ /** Message is a dice with random value */
144
+ dice: Dice;
145
+ }
146
+ interface GameMessage extends CommonMessage {
147
+ /** Message is a game, information about the game. More about games » */
148
+ game: Game;
149
+ }
150
+ interface PollMessage extends CommonMessage {
151
+ /** Message is a native poll, information about the poll */
152
+ poll: Poll;
153
+ }
154
+ interface LocationMessage extends CommonMessage {
155
+ /** Message is a shared location, information about the location */
156
+ location: Location;
157
+ }
158
+ interface VenueMessage extends LocationMessage {
159
+ /** Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */
160
+ venue: Venue;
161
+ }
162
+ interface NewChatMembersMessage extends ServiceMessage {
163
+ /** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
164
+ new_chat_members: User[];
165
+ }
166
+ interface LeftChatMemberMessage extends ServiceMessage {
167
+ /** A member was removed from the group, information about them (this member may be the bot itself) */
168
+ left_chat_member: User;
169
+ }
170
+ interface NewChatTitleMessage extends ServiceMessage {
171
+ /** A chat title was changed to this value */
172
+ new_chat_title: string;
173
+ }
174
+ interface NewChatPhotoMessage extends ServiceMessage {
175
+ /** A chat photo was change to this value */
176
+ new_chat_photo: PhotoSize[];
177
+ }
178
+ interface DeleteChatPhotoMessage extends ServiceMessage {
179
+ /** Service message: the chat photo was deleted */
180
+ delete_chat_photo: true;
181
+ }
182
+ interface GroupChatCreatedMessage extends ServiceMessage {
183
+ /** Service message: the group has been created */
184
+ group_chat_created: true;
185
+ }
186
+ interface SupergroupChatCreated extends ServiceMessage {
187
+ /** Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. */
188
+ supergroup_chat_created: true;
189
+ }
190
+ interface ChannelChatCreatedMessage extends ServiceMessage {
191
+ /** Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */
192
+ channel_chat_created: true;
193
+ }
194
+ interface MessageAutoDeleteTimerChangedMessage extends ServiceMessage {
195
+ /** Service message: auto-delete timer settings changed in the chat */
196
+ message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged;
197
+ }
198
+ interface MigrateToChatIdMessage extends ServiceMessage {
199
+ /** The group has been migrated to a supergroup with the specified identifier. */
200
+ migrate_to_chat_id: number;
201
+ }
202
+ interface MigrateFromChatIdMessage extends ServiceMessage {
203
+ /** The supergroup has been migrated from a group with the specified identifier. */
204
+ migrate_from_chat_id: number;
205
+ }
206
+ interface PinnedMessageMessage extends ServiceMessage {
207
+ /** 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. */
208
+ pinned_message: Omit<MaybeInaccessibleMessage, "reply_to_message">;
209
+ }
210
+ interface InvoiceMessage extends ServiceMessage {
211
+ /** Message is an invoice for a payment, information about the invoice. */
212
+ invoice: Invoice;
213
+ }
214
+ interface SuccessfulPaymentMessage extends ServiceMessage {
215
+ /** Message is a service message about a successful payment, information about the payment. */
216
+ successful_payment: SuccessfulPayment;
217
+ }
218
+ interface RefundedPaymentMessage extends ServiceMessage {
219
+ /** Message is a service message about a refunded payment, information about the payment. */
220
+ refunded_payment: RefundedPayment;
221
+ }
222
+ interface UsersSharedMessage extends ServiceMessage {
223
+ /** Service message: a user was shared with the bot */
224
+ users_shared: UsersShared;
225
+ }
226
+ interface ChatSharedMessage extends ServiceMessage {
227
+ /** Service message: a chat was shared with the bot */
228
+ chat_shared: ChatShared;
229
+ }
230
+ interface GiftMessage extends ServiceMessage {
231
+ /** Service message: a regular gift was sent or received */
232
+ gift: GiftInfo;
233
+ }
234
+ interface UniqueGiftMessage extends ServiceMessage {
235
+ /** Service message: a unique gift was sent or received */
236
+ unique_gift: UniqueGiftInfo;
237
+ }
238
+ interface ConnectedWebsiteMessage extends ServiceMessage {
239
+ /** The domain name of the website on which the user has logged in. More about Telegram Login » */
240
+ connected_website: string;
241
+ }
242
+ interface WriteAccessAllowedMessage extends ServiceMessage {
243
+ /** Service message: the user allowed the bot added to the attachment menu to write messages */
244
+ write_access_allowed: WriteAccessAllowed;
245
+ }
246
+ interface PassportDataMessage extends ServiceMessage {
247
+ /** Telegram Passport data */
248
+ passport_data: PassportData;
249
+ }
250
+ interface ProximityAlertTriggeredMessage extends ServiceMessage {
251
+ /** Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */
252
+ proximity_alert_triggered: ProximityAlertTriggered;
253
+ }
254
+ interface BoostAddedMessage extends ServiceMessage {
255
+ /** Service message: user boosted the chat */
256
+ boost_added: ChatBoostAdded;
257
+ }
258
+ interface ChatBackgroundSetMessage extends ServiceMessage {
259
+ /** Service message: chat background set */
260
+ chat_background_set: ChatBackground;
261
+ }
262
+ interface ChecklistTasksDoneMessage extends ServiceMessage {
263
+ /** Service message: some tasks in a checklist were marked as done or not done */
264
+ checklist_tasks_done: ChecklistTasksDone;
265
+ }
266
+ interface ChecklistTasksAddedMessage extends ServiceMessage {
267
+ /** Service message: tasks were added to a checklist */
268
+ checklist_tasks_added: ChecklistTasksAdded;
269
+ }
270
+ interface DirectMessagePriceChangedMessage extends ServiceMessage {
271
+ /** Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed */
272
+ direct_message_price_changed: DirectMessagePriceChanged;
273
+ }
274
+ interface ForumTopicCreatedMessage extends ServiceMessage {
275
+ /** Service message: forum topic created */
276
+ forum_topic_created: ForumTopicCreated;
277
+ }
278
+ interface ForumTopicEditedMessage extends ServiceMessage {
279
+ /** Service message: forum topic edited */
280
+ forum_topic_edited: ForumTopicEdited;
281
+ }
282
+ interface ForumTopicClosedMessage extends ServiceMessage {
283
+ /** Service message: forum topic closed */
284
+ forum_topic_closed: ForumTopicClosed;
285
+ }
286
+ interface ForumTopicReopenedMessage extends ServiceMessage {
287
+ /** Service message: forum topic reopened */
288
+ forum_topic_reopened: ForumTopicReopened;
289
+ }
290
+ interface GeneralForumTopicHiddenMessage extends ServiceMessage {
291
+ /** Service message: the 'General' forum topic hidden */
292
+ general_forum_topic_hidden: GeneralForumTopicHidden;
293
+ }
294
+ interface GeneralForumTopicUnhiddenMessage extends ServiceMessage {
295
+ /** Service message: the 'General' forum topic unhidden */
296
+ general_forum_topic_unhidden: GeneralForumTopicUnhidden;
297
+ }
298
+ interface GiveawayCreatedMessage extends ServiceMessage {
299
+ /** Service message: a scheduled giveaway was created */
300
+ giveaway_created: GiveawayCreated;
301
+ }
302
+ interface GiveawayMessage extends ServiceMessage {
303
+ /** The message is a scheduled giveaway message */
304
+ giveaway: Giveaway;
305
+ }
306
+ interface GiveawayWinnersMessage extends ServiceMessage {
307
+ /** A giveaway with public winners was completed */
308
+ giveaway_winners: GiveawayWinners;
309
+ }
310
+ interface GiveawayCompletedMessage extends ServiceMessage {
311
+ /** Service message: a giveaway without public winners was completed */
312
+ giveaway_completed: GiveawayCompleted;
313
+ }
314
+ interface PaidMessagePriceChangedMessage extends ServiceMessage {
315
+ /** Service message: the price for paid messages has changed in the chat */
316
+ paid_message_price_changed: PaidMessagePriceChanged;
317
+ }
318
+ interface SuggestedPostApprovedMessage extends ServiceMessage {
319
+ /** Service message: a suggested post was approved */
320
+ suggested_post_approved: SuggestedPostApproved;
321
+ }
322
+ interface SuggestedPostApprovalFailedMessage extends ServiceMessage {
323
+ /** Service message: approval of a suggested post has failed */
324
+ suggested_post_approval_failed: SuggestedPostApprovalFailed;
325
+ }
326
+ interface SuggestedPostDeclinedMessage extends ServiceMessage {
327
+ /** Service message: a suggested post was declined */
328
+ suggested_post_declined: SuggestedPostDeclined;
329
+ }
330
+ interface SuggestedPostPaidMessage extends ServiceMessage {
331
+ /** Service message: payment for a suggested post was received */
332
+ suggested_post_paid: SuggestedPostPaid;
333
+ }
334
+ interface SuggestedPostRefundedMessage extends ServiceMessage {
335
+ /** Service message: payment for a suggested post was refunded */
336
+ suggested_post_refunded: SuggestedPostRefunded;
337
+ }
338
+ interface VideoChatScheduledMessage extends ServiceMessage {
339
+ /** Service message: video chat scheduled */
340
+ video_chat_scheduled: VideoChatScheduled;
341
+ }
342
+ interface VideoChatStartedMessage extends ServiceMessage {
343
+ /** Service message: video chat started */
344
+ video_chat_started: VideoChatStarted;
345
+ }
346
+ interface VideoChatEndedMessage extends ServiceMessage {
347
+ /** Service message: video chat ended */
348
+ video_chat_ended: VideoChatEnded;
349
+ }
350
+ interface VideoChatParticipantsInvitedMessage extends ServiceMessage {
351
+ /** Service message: new participants invited to a video chat */
352
+ video_chat_participants_invited: VideoChatParticipantsInvited;
353
+ }
354
+ interface WebAppDataMessage extends ServiceMessage {
355
+ /** Service message: data sent by a Web App */
356
+ web_app_data: WebAppData;
357
+ }
358
+ }
359
+ /** Helper type that bundles all possible `Message.ServiceMessage`s. More specifically, bundles all messages that do not have a `reply_to_message` field, i.e. are not a `Message.CommonMessage`. */
360
+ export type ServiceMessageBundle = Message.NewChatMembersMessage | Message.LeftChatMemberMessage | Message.NewChatTitleMessage | Message.NewChatPhotoMessage | Message.DeleteChatPhotoMessage | Message.GroupChatCreatedMessage | Message.SupergroupChatCreated | Message.ChannelChatCreatedMessage | Message.MessageAutoDeleteTimerChangedMessage | Message.MigrateToChatIdMessage | Message.MigrateFromChatIdMessage | Message.PinnedMessageMessage | Message.InvoiceMessage | Message.SuccessfulPaymentMessage | Message.UsersSharedMessage | Message.ChatSharedMessage | Message.GiftMessage | Message.UniqueGiftMessage | Message.ConnectedWebsiteMessage | Message.WriteAccessAllowedMessage | Message.PassportDataMessage | Message.ProximityAlertTriggeredMessage | Message.BoostAddedMessage | Message.ForumTopicCreatedMessage | Message.ForumTopicEditedMessage | Message.ForumTopicClosedMessage | Message.ForumTopicReopenedMessage | Message.GeneralForumTopicHiddenMessage | Message.GeneralForumTopicUnhiddenMessage | Message.GiveawayCreatedMessage | Message.GiveawayMessage | Message.GiveawayWinnersMessage | Message.GiveawayCompletedMessage | Message.VideoChatScheduledMessage | Message.VideoChatStartedMessage | Message.VideoChatEndedMessage | Message.VideoChatParticipantsInvitedMessage | Message.WebAppDataMessage;
361
+ /** Helper type that bundles all possible `Message.CommonMessage`s. More specifically, bundles all messages that do have a `reply_to_message` field, i.e. are a `Message.CommonMessage`. */
362
+ export type CommonMessageBundle = Message.AnimationMessage | Message.AudioMessage | Message.ContactMessage | Message.DiceMessage | Message.DocumentMessage | Message.GameMessage | Message.LocationMessage | Message.PhotoMessage | Message.PollMessage | Message.StickerMessage | Message.StoryMessage | Message.TextMessage | Message.VenueMessage | Message.VideoMessage | Message.VideoNoteMessage | Message.VoiceMessage;
363
+ /** Helper type that represents a message which occurs in a `reply_to_message` field. */
364
+ type ReplyMessage = ServiceMessageBundle | (CommonMessageBundle & {
365
+ reply_to_message: undefined;
366
+ });
367
+ /** This object represents a message. */
368
+ export type Message = ServiceMessageBundle | CommonMessageBundle;
369
+ /** This object represents a unique message identifier. */
370
+ export interface MessageId {
371
+ /** Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent */
372
+ message_id: number;
373
+ }
374
+ /** This object describes a message that was deleted or is otherwise inaccessible to the bot. */
375
+ export interface InaccessibleMessage {
376
+ /** Chat the message belonged to. */
377
+ chat: Chat;
378
+ /** Unique message identifier inside the chat. */
379
+ message_id: number;
380
+ /** Always 0. The field can be used to differentiate regular and inaccessible messages. */
381
+ date: 0;
382
+ }
383
+ /** This object describes a message that can be inaccessible to the bot. It can be one of
384
+
385
+ - Message
386
+ - InaccessibleMessage */
387
+ export type MaybeInaccessibleMessage = Message | InaccessibleMessage;
388
+ /** Describes an inline message sent by a Web App on behalf of a user. */
389
+ export interface SentWebAppMessage {
390
+ /** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. */
391
+ inline_message_id: string;
392
+ }
393
+ /** Describes an inline message to be sent by a user of a Mini App. */
394
+ export interface PreparedInlineMessage {
395
+ /** Unique identifier of the prepared message */
396
+ id: string;
397
+ /** Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used */
398
+ expiration_date: number;
399
+ }
400
+ /** 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.
401
+
402
+ Note that Telegram clients will display an **alert** to the user before opening an inline link ('Open this link?' together with the full URL).
403
+
404
+ Message entities can be nested, providing following restrictions are met:
405
+ - If two entities have common characters, then one of them is fully contained inside another.
406
+ - bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
407
+ - blockquote and expandable_blockquote entities can't be nested.
408
+ - All other entities can't contain each other.
409
+
410
+ Links `tg://user?id=<user_id>` can be used to mention a user by their identifier without using a username. Please note:
411
+
412
+ - 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.
413
+ - 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.
414
+
415
+ 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).
416
+
417
+ #### MarkdownV2 style
418
+ To use this mode, pass *MarkdownV2* in the *parse_mode* field. Use the following syntax in your message:
419
+
420
+ ```
421
+ *bold \*text*
422
+ _italic \*text_
423
+ __underline__
424
+ ~strikethrough~
425
+ ||spoiler||
426
+ *bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*
427
+ [inline URL](http://www.example.com/)
428
+ [inline mention of a user](tg://user?id=123456789)
429
+ ![👍](tg://emoji?id=5368324170671202286)
430
+ `inline fixed-width code`
431
+ `​`​`
432
+ pre-formatted fixed-width code block
433
+ `​`​`
434
+ `​`​`python
435
+ pre-formatted fixed-width code block written in the Python programming language
436
+ `​`​`
437
+ >Block quotation started
438
+ >Block quotation continued
439
+ >Block quotation continued
440
+ >Block quotation continued
441
+ >The last line of the block quotation
442
+ **>The expandable block quotation started right after the previous block quotation
443
+ >It is separated from the previous block quotation by an empty bold entity
444
+ >Expandable block quotation continued
445
+ >Hidden by default part of the expandable block quotation started
446
+ >Expandable block quotation continued
447
+ >The last line of the expandable block quotation with the expandability mark||
448
+ ```
449
+ Please note:
450
+
451
+ - 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.
452
+ - Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
453
+ - Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
454
+ - In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
455
+ In case of ambiguity between italic and underline entities __ is always greedily treated from left to right as beginning or end of an underline entity, so instead of ___italic underline___ use ___italic underline_**__, adding an empty bold entity as a separator.
456
+ - 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.
457
+ - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
458
+
459
+ #### HTML style
460
+ To use this mode, pass *HTML* in the *parse_mode* field. The following tags are currently supported:
461
+
462
+ ```html
463
+ <b>bold</b>, <strong>bold</strong>
464
+ <i>italic</i>, <em>italic</em>
465
+ <u>underline</u>, <ins>underline</ins>
466
+ <s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
467
+ <span class="tg-spoiler">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler>
468
+ <b>bold <i>italic bold <s>italic bold strikethrough <span class="tg-spoiler">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>
469
+ <a href="http://www.example.com/">inline URL</a>
470
+ <a href="tg://user?id=123456789">inline mention of a user</a>
471
+ <tg-emoji emoji-id="5368324170671202286">👍</tg-emoji>
472
+ <code>inline fixed-width code</code>
473
+ <pre>pre-formatted fixed-width code block</pre>
474
+ <pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
475
+ <blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>
476
+ <blockquote expandable>Expandable block quotation started\nExpandable block quotation continued\nExpandable block quotation continued\nHidden by default part of the block quotation started\nExpandable block quotation continued\nThe last line of the block quotation</blockquote>
477
+ ```
478
+ Please note:
479
+
480
+ - Only the tags mentioned above are currently supported.
481
+ - All `<`, `>` and `&` symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (`<` with `&lt;`, `>` with `&gt;` and `&` with `&amp;`).
482
+ - All numerical HTML entities are supported.
483
+ - The API currently supports only the following named HTML entities: `&lt;`, `&gt;`, `&amp;` and `&quot;`.
484
+ - Use nested `pre` and `code` tags, to define programming language for pre entity.
485
+ - Programming language can't be specified for standalone `code` tags.
486
+ - A valid emoji must be used as the content of the tg-emoji tag. 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.
487
+ - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
488
+
489
+ #### Markdown style
490
+ This is a legacy mode, retained for backward compatibility. To use this mode, pass *Markdown* in the *parse_mode* field. Use the following syntax in your message:
491
+
492
+ ```
493
+ *bold text*
494
+ _italic text_
495
+ [inline URL](http://www.example.com/)
496
+ [inline mention of a user](tg://user?id=123456789)
497
+ `inline fixed-width code`
498
+ `​`​`
499
+ pre-formatted fixed-width code block
500
+ `​`​`
501
+ `​`​`python
502
+ pre-formatted fixed-width code block written in the Python programming language
503
+ `​`​`
504
+ ```
505
+ Please note:
506
+
507
+ - Entities must not be nested, use parse mode MarkdownV2 instead.
508
+ There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote”, “expandable_blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
509
+ - To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
510
+ - 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`. */
511
+ export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
512
+ export declare namespace MessageEntity {
513
+ interface Abstract {
514
+ /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
515
+ type: string;
516
+ /** Offset in UTF-16 code units to the start of the entity */
517
+ offset: number;
518
+ /** Length of the entity in UTF-16 code units */
519
+ length: number;
520
+ }
521
+ interface Mention extends Abstract {
522
+ type: "mention";
523
+ }
524
+ interface Hashtag extends Abstract {
525
+ type: "hashtag";
526
+ }
527
+ interface Cashtag extends Abstract {
528
+ type: "cashtag";
529
+ }
530
+ interface BotCommand extends Abstract {
531
+ type: "bot_command";
532
+ }
533
+ interface Url extends Abstract {
534
+ type: "url";
535
+ }
536
+ interface Email extends Abstract {
537
+ type: "email";
538
+ }
539
+ interface PhoneNumber extends Abstract {
540
+ type: "phone_number";
541
+ }
542
+ interface Bold extends Abstract {
543
+ type: "bold";
544
+ }
545
+ interface Blockquote extends Abstract {
546
+ type: "blockquote";
547
+ }
548
+ interface ExpandableBlockquote extends Abstract {
549
+ type: "expandable_blockquote";
550
+ }
551
+ interface Italic extends Abstract {
552
+ type: "italic";
553
+ }
554
+ interface Underline extends Abstract {
555
+ type: "underline";
556
+ }
557
+ interface Strikethrough extends Abstract {
558
+ type: "strikethrough";
559
+ }
560
+ interface Spoiler extends Abstract {
561
+ type: "spoiler";
562
+ }
563
+ interface Code extends Abstract {
564
+ type: "code";
565
+ }
566
+ interface PreMessage extends Abstract {
567
+ type: "pre";
568
+ /** For “pre” only, the programming language of the entity text */
569
+ language?: string;
570
+ }
571
+ interface TextLink extends Abstract {
572
+ type: "text_link";
573
+ /** For “text_link” only, URL that will be opened after user taps on the text */
574
+ url: string;
575
+ }
576
+ interface TextMention extends Abstract {
577
+ type: "text_mention";
578
+ /** For “text_mention” only, the mentioned user */
579
+ user: User;
580
+ }
581
+ interface CustomEmoji extends Abstract {
582
+ type: "custom_emoji";
583
+ /** For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker */
584
+ custom_emoji_id: string;
585
+ }
586
+ }
587
+ /** This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. */
588
+ export type MessageEntity = MessageEntity.Mention | MessageEntity.Hashtag | MessageEntity.Cashtag | MessageEntity.BotCommand | MessageEntity.Url | MessageEntity.Email | MessageEntity.PhoneNumber | MessageEntity.Bold | MessageEntity.Blockquote | MessageEntity.ExpandableBlockquote | MessageEntity.Italic | MessageEntity.Underline | MessageEntity.Strikethrough | MessageEntity.Spoiler | MessageEntity.Code | MessageEntity.PreMessage | MessageEntity.TextLink | MessageEntity.TextMention | MessageEntity.CustomEmoji;
589
+ /** This object contains information about the quoted part of a message that is replied to by the given message. */
590
+ export interface TextQuote {
591
+ /** Text of the quoted part of a message that is replied to by the given message */
592
+ text: string;
593
+ /** Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes. */
594
+ entities?: MessageEntity[];
595
+ /** Approximate quote position in the original message in UTF-16 code units as specified by the sender */
596
+ position: number;
597
+ /** True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. */
598
+ is_manual?: true;
599
+ }
600
+ /** Base properties shared by all ExternalReplyInfo variants */
601
+ export interface AbstractExternalReply {
602
+ /** Origin of the message replied to by the given message */
603
+ origin: MessageOrigin;
604
+ /** Chat the original message belongs to. Available only if the chat is a supergroup or a channel. */
605
+ chat?: Chat;
606
+ /** Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. */
607
+ message_id?: number;
608
+ /** Options used for link preview generation for the original message, if it is a text message */
609
+ link_preview_options?: LinkPreviewOptions;
610
+ }
611
+ /** Properties shared by Animation, Photo, and Video ExternalReplyInfo */
612
+ export interface AbstractExternalReplyMedia {
613
+ /** True, if the message media is covered by a spoiler animation */
614
+ has_media_spoiler?: true;
615
+ }
616
+ export interface ExternalReplyAnimation extends AbstractExternalReply, AbstractExternalReplyMedia {
617
+ /** Message is an animation, information about the animation */
618
+ animation: Animation;
619
+ }
620
+ export interface ExternalReplyAudio extends AbstractExternalReply {
621
+ /** Message is an audio file, information about the file */
622
+ audio: Audio;
623
+ }
624
+ export interface ExternalReplyDocument extends AbstractExternalReply {
625
+ /** Message is a general file, information about the file */
626
+ document: Document;
627
+ }
628
+ export interface ExternalReplyPaidMedia extends AbstractExternalReply {
629
+ /** Message contains paid media; information about the paid media */
630
+ paid_media: PaidMediaInfo;
631
+ }
632
+ export interface ExternalReplyPhoto extends AbstractExternalReply, AbstractExternalReplyMedia {
633
+ /** Message is a photo, available sizes of the photo */
634
+ photo: PhotoSize[];
635
+ }
636
+ export interface ExternalReplySticker extends AbstractExternalReply {
637
+ /** Message is a sticker, information about the sticker */
638
+ sticker: Sticker;
639
+ }
640
+ export interface ExternalReplyStory extends AbstractExternalReply {
641
+ /** Message is a forwarded story */
642
+ story: Story;
643
+ }
644
+ export interface ExternalReplyVideo extends AbstractExternalReply, AbstractExternalReplyMedia {
645
+ /** Message is a video, information about the video */
646
+ video: Video;
647
+ }
648
+ export interface ExternalReplyVideoNote extends AbstractExternalReply {
649
+ /** Message is a video note, information about the video message */
650
+ video_note: VideoNote;
651
+ }
652
+ export interface ExternalReplyVoice extends AbstractExternalReply {
653
+ /** Message is a voice message, information about the file */
654
+ voice: Voice;
655
+ }
656
+ export interface ExternalReplyContact extends AbstractExternalReply {
657
+ /** Message is a shared contact, information about the contact */
658
+ contact: Contact;
659
+ }
660
+ export interface ExternalReplyDice extends AbstractExternalReply {
661
+ /** Message is a dice with random value */
662
+ dice: Dice;
663
+ }
664
+ export interface ExternalReplyGame extends AbstractExternalReply {
665
+ /** Message is a game, information about the game. More about games » */
666
+ game: Game;
667
+ }
668
+ export interface ExternalReplyGiveaway extends AbstractExternalReply {
669
+ /** Message is a scheduled giveaway, information about the giveaway */
670
+ giveaway: Giveaway;
671
+ }
672
+ export interface ExternalReplyGiveawayWinners extends AbstractExternalReply {
673
+ /** A giveaway with public winners was completed */
674
+ giveaway_winners: GiveawayWinners;
675
+ }
676
+ export interface ExternalReplyInvoice extends AbstractExternalReply {
677
+ /** Message is an invoice for a payment, information about the invoice. More about payments » */
678
+ invoice: Invoice;
679
+ }
680
+ export interface ExternalReplyLocation extends AbstractExternalReply {
681
+ /** Message is a shared location, information about the location */
682
+ location: Location;
683
+ }
684
+ export interface ExternalReplyPoll extends AbstractExternalReply {
685
+ /** Message is a native poll, information about the poll */
686
+ poll: Poll;
687
+ }
688
+ export interface ExternalReplyVenue extends AbstractExternalReply {
689
+ /** Message is a venue, information about the venue */
690
+ venue: Venue;
691
+ }
692
+ /** This object contains information about a message that is being replied to, which may come from another chat or forum topic. */
693
+ export type ExternalReplyInfo = ExternalReplyAnimation | ExternalReplyAudio | ExternalReplyDocument | ExternalReplyPhoto | ExternalReplySticker | ExternalReplyStory | ExternalReplyVideo | ExternalReplyVideoNote | ExternalReplyVoice | ExternalReplyContact | ExternalReplyDice | ExternalReplyGame | ExternalReplyGiveaway | ExternalReplyGiveawayWinners | ExternalReplyInvoice | ExternalReplyLocation | ExternalReplyPoll | ExternalReplyVenue;
694
+ /** Describes reply parameters for the message that is being sent. */
695
+ export interface ReplyParameters {
696
+ /** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */
697
+ message_id: number;
698
+ /** 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. */
699
+ chat_id?: number | string;
700
+ /** Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account. */
701
+ allow_sending_without_reply?: boolean;
702
+ /** 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. */
703
+ quote?: string;
704
+ /** Mode for parsing entities in the quote. See formatting options for more details. */
705
+ quote_parse_mode?: ParseMode;
706
+ /** A list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. */
707
+ quote_entities?: MessageEntity[];
708
+ /** Position of the quote in the original message in UTF-16 code units */
709
+ quote_position?: number;
710
+ /** Identifier of the specific checklist task to be replied to */
711
+ checklist_task_id?: number;
712
+ }
713
+ /** This object describes the origin of a message. It can be one of
714
+
715
+ - MessageOriginUser
716
+ - MessageOriginHiddenUser
717
+ - MessageOriginChat
718
+ - MessageOriginChannel
719
+ */
720
+ type MessageOrigin = MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel;
721
+ export interface AbstractMessageOrigin {
722
+ /** Type of the message origin */
723
+ type: string;
724
+ /** Date the message was sent originally in Unix time */
725
+ date: number;
726
+ }
727
+ /** The message was originally sent by a known user. */
728
+ export interface MessageOriginUser extends AbstractMessageOrigin {
729
+ type: "user";
730
+ /** User that sent the message originally */
731
+ sender_user: User;
732
+ }
733
+ /** The message was originally sent by an unknown user. */
734
+ export interface MessageOriginHiddenUser extends AbstractMessageOrigin {
735
+ type: "hidden_user";
736
+ /** Name of the user that sent the message originally */
737
+ sender_user_name: string;
738
+ }
739
+ /** The message was originally sent on behalf of a chat to a group chat. */
740
+ export interface MessageOriginChat extends AbstractMessageOrigin {
741
+ type: "chat";
742
+ /** Chat that sent the message originally */
743
+ sender_chat: Chat;
744
+ /** For messages originally sent by an anonymous chat administrator, original message author signature */
745
+ author_signature?: string;
746
+ }
747
+ /** The message was originally sent to a channel chat. */
748
+ export interface MessageOriginChannel extends AbstractMessageOrigin {
749
+ type: "channel";
750
+ /** Channel chat to which the message was originally sent */
751
+ chat: Chat;
752
+ /** Unique message identifier inside the chat */
753
+ message_id: number;
754
+ /** Signature of the original post author */
755
+ author_signature?: string;
756
+ }
757
+ /** This object represents one size of a photo or a file / sticker thumbnail. */
758
+ export interface PhotoSize {
759
+ /** Identifier for this file, which can be used to download or reuse the file */
760
+ file_id: string;
761
+ /** 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. */
762
+ file_unique_id: string;
763
+ /** Photo width */
764
+ width: number;
765
+ /** Photo height */
766
+ height: number;
767
+ /** File size in bytes */
768
+ file_size?: number;
769
+ }
770
+ /** This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */
771
+ export interface Animation {
772
+ /** Identifier for this file, which can be used to download or reuse the file */
773
+ file_id: string;
774
+ /** 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. */
775
+ file_unique_id: string;
776
+ /** Video width as defined by the sender */
777
+ width: number;
778
+ /** Video height as defined by the sender */
779
+ height: number;
780
+ /** Duration of the video in seconds as defined by the sender */
781
+ duration: number;
782
+ /** Animation thumbnail as defined by the sender */
783
+ thumbnail?: PhotoSize;
784
+ /** Original animation filename as defined by the sender */
785
+ file_name?: string;
786
+ /** MIME type of the file as defined by the sender */
787
+ mime_type?: string;
788
+ /** File size in bytes */
789
+ file_size?: number;
790
+ }
791
+ /** This object represents an audio file to be treated as music by the Telegram clients. */
792
+ export interface Audio {
793
+ /** Identifier for this file, which can be used to download or reuse the file */
794
+ file_id: string;
795
+ /** 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. */
796
+ file_unique_id: string;
797
+ /** Duration of the audio in seconds as defined by the sender */
798
+ duration: number;
799
+ /** Performer of the audio as defined by the sender or by audio tags */
800
+ performer?: string;
801
+ /** Title of the audio as defined by the sender or by audio tags */
802
+ title?: string;
803
+ /** Original filename as defined by the sender */
804
+ file_name?: string;
805
+ /** MIME type of the file as defined by the sender */
806
+ mime_type?: string;
807
+ /** File size in bytes */
808
+ file_size?: number;
809
+ /** Thumbnail of the album cover to which the music file belongs */
810
+ thumbnail?: PhotoSize;
811
+ }
812
+ /** This object represents a general file (as opposed to photos, voice messages and audio files). */
813
+ export interface Document {
814
+ /** Identifier for this file, which can be used to download or reuse the file */
815
+ file_id: string;
816
+ /** 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. */
817
+ file_unique_id: string;
818
+ /** Document thumbnail as defined by the sender */
819
+ thumbnail?: PhotoSize;
820
+ /** Original filename as defined by the sender */
821
+ file_name?: string;
822
+ /** MIME type of the file as defined by the sender */
823
+ mime_type?: string;
824
+ /** File size in bytes */
825
+ file_size?: number;
826
+ }
827
+ /** This object represents a story. */
828
+ export interface Story {
829
+ /** Chat that posted the story */
830
+ chat: Chat;
831
+ /** Unique identifier for the story in the chat */
832
+ id: number;
833
+ }
834
+ /** This object represents a video file. */
835
+ export interface Video {
836
+ /** Identifier for this file, which can be used to download or reuse the file */
837
+ file_id: string;
838
+ /** 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. */
839
+ file_unique_id: string;
840
+ /** Video width as defined by the sender */
841
+ width: number;
842
+ /** Video height as defined by the sender */
843
+ height: number;
844
+ /** Duration of the video in seconds as defined by the sender */
845
+ duration: number;
846
+ /** Video thumbnail */
847
+ thumbnail?: PhotoSize;
848
+ /** Available sizes of the cover of the video in the message */
849
+ cover?: PhotoSize[];
850
+ /** Timestamp in seconds from which the video will play in the message */
851
+ start_timestamp?: number;
852
+ /** Original filename as defined by the sender */
853
+ file_name?: string;
854
+ /** MIME type of the file as defined by the sender */
855
+ mime_type?: string;
856
+ /** File size in bytes */
857
+ file_size?: number;
858
+ }
859
+ /** This object represents a video message (available in Telegram apps as of v.4.0). */
860
+ export interface VideoNote {
861
+ /** Identifier for this file, which can be used to download or reuse the file */
862
+ file_id: string;
863
+ /** 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. */
864
+ file_unique_id: string;
865
+ /** Video width and height (diameter of the video message) as defined by the sender */
866
+ length: number;
867
+ /** Duration of the video in seconds as defined by the sender */
868
+ duration: number;
869
+ /** Video thumbnail */
870
+ thumbnail?: PhotoSize;
871
+ /** File size in bytes */
872
+ file_size?: number;
873
+ }
874
+ /** This object represents a voice note. */
875
+ export interface Voice {
876
+ /** Identifier for this file, which can be used to download or reuse the file */
877
+ file_id: string;
878
+ /** 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. */
879
+ file_unique_id: string;
880
+ /** Duration of the audio in seconds as defined by the sender */
881
+ duration: number;
882
+ /** MIME type of the file as defined by the sender */
883
+ mime_type?: string;
884
+ /** File size in bytes */
885
+ file_size?: number;
886
+ }
887
+ /** Describes the paid media added to a message. */
888
+ export interface PaidMediaInfo {
889
+ /** The number of Telegram Stars that must be paid to buy access to the media */
890
+ star_count: number;
891
+ /** Information about the paid media */
892
+ paid_media: PaidMedia[];
893
+ }
894
+ declare namespace PaidMedia {
895
+ /** The paid media isn't available before the payment. */
896
+ interface PaidMediaPreview {
897
+ /** Type of the paid media, always “preview” */
898
+ type: string;
899
+ /** Media width as defined by the sender */
900
+ width?: number;
901
+ /** Media height as defined by the sender */
902
+ height?: number;
903
+ /** Duration of the media in seconds as defined by the sender */
904
+ duration?: number;
905
+ }
906
+ /** The paid media is a photo. */
907
+ interface PaidMediaPhoto {
908
+ /** Type of the paid media, always “photo” */
909
+ type: string;
910
+ /** The photo */
911
+ photo: PhotoSize[];
912
+ }
913
+ /** The paid media is a video. */
914
+ interface PaidMediaVideo {
915
+ /** Type of the paid media, always “video” */
916
+ type: string;
917
+ /** The video */
918
+ video: Video;
919
+ }
920
+ }
921
+ /** This object describes paid media. Currently, it can be one of
922
+
923
+ - PaidMediaPreview
924
+ - PaidMediaPhoto
925
+ - PaidMediaVideo
926
+ */
927
+ export type PaidMedia = PaidMedia.PaidMediaPreview | PaidMedia.PaidMediaPhoto | PaidMedia.PaidMediaVideo;
928
+ /** Describes a task in a checklist. */
929
+ export interface ChecklistTask {
930
+ /** Unique identifier of the task */
931
+ id: number;
932
+ /** Text of the task */
933
+ text: string;
934
+ /** Special entities that appear in the task text */
935
+ text_entities?: MessageEntity[];
936
+ /** User that completed the task; omitted if the task wasn't completed */
937
+ completed_by_user?: User;
938
+ /** Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed */
939
+ completion_date?: number;
940
+ }
941
+ /** Describes a checklist. */
942
+ export interface Checklist {
943
+ /** Title of the checklist */
944
+ title: string;
945
+ /** Special entities that appear in the checklist title */
946
+ title_entities?: MessageEntity[];
947
+ /** List of tasks in the checklist */
948
+ tasks: ChecklistTask[];
949
+ /** True, if users other than the creator of the list can add tasks to the list */
950
+ others_can_add_tasks?: true;
951
+ /** True, if users other than the creator of the list can mark tasks as done or not done */
952
+ others_can_mark_tasks_as_done?: true;
953
+ }
954
+ /** Describes a task to add to a checklist. */
955
+ export interface InputChecklistTask {
956
+ /** Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist */
957
+ id: number;
958
+ /** Text of the task; 1-100 characters after entities parsing */
959
+ text: string;
960
+ /** Mode for parsing entities in the text. See formatting options for more details. */
961
+ parse_mode?: ParseMode;
962
+ /** 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. */
963
+ text_entities?: (MessageEntity.Bold | MessageEntity.Italic | MessageEntity.Underline | MessageEntity.Strikethrough | MessageEntity.Spoiler | MessageEntity.CustomEmoji)[];
964
+ }
965
+ /** Describes a checklist to create. */
966
+ export interface InputChecklist {
967
+ /** Title of the checklist; 1-255 characters after entities parsing */
968
+ title: string;
969
+ /** Mode for parsing entities in the title. See formatting options for more details. */
970
+ parse_mode?: ParseMode;
971
+ /** 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. */
972
+ title_entities?: (MessageEntity.Bold | MessageEntity.Italic | MessageEntity.Underline | MessageEntity.Strikethrough | MessageEntity.Spoiler | MessageEntity.CustomEmoji)[];
973
+ /** List of 1-30 tasks in the checklist */
974
+ tasks: InputChecklistTask[];
975
+ /** Pass True if other users can add tasks to the checklist */
976
+ others_can_add_tasks?: boolean;
977
+ /** Pass True if other users can mark tasks as done or not done in the checklist */
978
+ others_can_mark_tasks_as_done?: boolean;
979
+ }
980
+ /** Describes a service message about checklist tasks marked as done or not done. */
981
+ export interface ChecklistTasksDone {
982
+ /** 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. */
983
+ checklist_message?: Message;
984
+ /** Identifiers of the tasks that were marked as done */
985
+ marked_as_done_task_ids?: number[];
986
+ /** Identifiers of the tasks that were marked as not done */
987
+ marked_as_not_done_task_ids?: number[];
988
+ }
989
+ /** Describes a service message about tasks added to a checklist. */
990
+ export interface ChecklistTasksAdded {
991
+ /** 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. */
992
+ checklist_message?: Message;
993
+ /** List of tasks added to the checklist */
994
+ tasks: ChecklistTask[];
995
+ }
996
+ /** This object represents a phone contact. */
997
+ export interface Contact {
998
+ /** Contact's phone number */
999
+ phone_number: string;
1000
+ /** Contact's first name */
1001
+ first_name: string;
1002
+ /** Contact's last name */
1003
+ last_name?: string;
1004
+ /** Contact's user identifier in Telegram. */
1005
+ user_id?: number;
1006
+ /** Additional data about the contact in the form of a vCard */
1007
+ vcard?: string;
1008
+ }
1009
+ /** This object represents an animated emoji that displays a random value. */
1010
+ export interface Dice {
1011
+ /** Emoji on which the dice throw animation is based */
1012
+ emoji: string;
1013
+ /** Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji */
1014
+ value: number;
1015
+ }
1016
+ /** This object contains information about one answer option in a poll. */
1017
+ export interface PollOption {
1018
+ /** Option text, 1-100 characters */
1019
+ text: string;
1020
+ /** Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts */
1021
+ text_entities?: MessageEntity.CustomEmoji[];
1022
+ /** Number of users that voted for this option */
1023
+ voter_count: number;
1024
+ }
1025
+ /** This object contains information about one answer option in a poll to be sent. */
1026
+ export interface InputPollOption {
1027
+ /** Option text, 1-100 characters */
1028
+ text: string;
1029
+ /** Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed */
1030
+ text_parse_mode?: ParseMode;
1031
+ /** A list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode */
1032
+ text_entities?: MessageEntity.CustomEmoji[];
1033
+ }
1034
+ /** This object represents an answer of a user in a non-anonymous poll. */
1035
+ export interface PollAnswer {
1036
+ /** Unique poll identifier */
1037
+ poll_id: string;
1038
+ /** The chat that changed the answer to the poll, if the voter is anonymous */
1039
+ voter_chat?: Chat;
1040
+ /** The user, who changed the answer to the poll, if the voter isn't anonymous
1041
+ *
1042
+ * For backward compatibility, the field user will contain the user 136817688 (@Channel_Bot) if the voter was a chat
1043
+ */
1044
+ user?: User;
1045
+ /** 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. */
1046
+ option_ids: number[];
1047
+ }
1048
+ /** This object contains information about a poll. */
1049
+ export interface Poll {
1050
+ /** Unique poll identifier */
1051
+ id: string;
1052
+ /** Poll question, 1-300 characters */
1053
+ question: string;
1054
+ /** Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions */
1055
+ question_entities?: MessageEntity.CustomEmoji[];
1056
+ /** List of poll options */
1057
+ options: PollOption[];
1058
+ /** Total number of users that voted in the poll */
1059
+ total_voter_count: number;
1060
+ /** True, if the poll is closed */
1061
+ is_closed: boolean;
1062
+ /** True, if the poll is anonymous */
1063
+ is_anonymous: boolean;
1064
+ /** Poll type, currently can be “regular” or “quiz” */
1065
+ type: "regular" | "quiz";
1066
+ /** True, if the poll allows multiple answers */
1067
+ allows_multiple_answers: boolean;
1068
+ /** 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. */
1069
+ correct_option_id?: number;
1070
+ /** Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */
1071
+ explanation?: string;
1072
+ /** Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */
1073
+ explanation_entities?: MessageEntity[];
1074
+ /** Amount of time in seconds the poll will be active after creation */
1075
+ open_period?: number;
1076
+ /** Point in time (Unix timestamp) when the poll will be automatically closed */
1077
+ close_date?: number;
1078
+ }
1079
+ export declare namespace Location {
1080
+ interface CommonLocation {
1081
+ /** Latitude as defined by the sender */
1082
+ latitude: number;
1083
+ /** Longitude as defined by the sender */
1084
+ longitude: number;
1085
+ /** The radius of uncertainty for the location, measured in meters; 0-1500 */
1086
+ horizontal_accuracy?: number;
1087
+ }
1088
+ interface LiveLocation extends CommonLocation {
1089
+ /** Time relative to the message sending date, during which the location can be updated, in seconds. For active live locations only. */
1090
+ live_period: number;
1091
+ /** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
1092
+ heading: number;
1093
+ /** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
1094
+ proximity_alert_radius?: number;
1095
+ }
1096
+ }
1097
+ /** This object represents a point on the map. */
1098
+ export type Location = Location.CommonLocation | Location.LiveLocation;
1099
+ /** This object represents a venue. */
1100
+ export interface Venue {
1101
+ /** Venue location. Can't be a live location */
1102
+ location: Location;
1103
+ /** Name of the venue */
1104
+ title: string;
1105
+ /** Address of the venue */
1106
+ address: string;
1107
+ /** Foursquare identifier of the venue */
1108
+ foursquare_id?: string;
1109
+ /** Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */
1110
+ foursquare_type?: string;
1111
+ /** Google Places identifier of the venue */
1112
+ google_place_id?: string;
1113
+ /** Google Places type of the venue. (See supported types.) */
1114
+ google_place_type?: string;
1115
+ }
1116
+ /** This object represents a message about a forwarded story in the chat. Currently holds no information. */
1117
+ export interface Story {
1118
+ /** Chat that posted the story */
1119
+ chat: Chat;
1120
+ /** Unique identifier for the story in the chat */
1121
+ id: number;
1122
+ }
1123
+ /** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */
1124
+ export interface ProximityAlertTriggered {
1125
+ /** User that triggered the alert */
1126
+ traveler: User;
1127
+ /** User that set the alert */
1128
+ watcher: User;
1129
+ /** The distance between the users */
1130
+ distance: number;
1131
+ }
1132
+ /** This object represents a service message about a change in auto-delete timer settings. */
1133
+ export interface MessageAutoDeleteTimerChanged {
1134
+ /** New auto-delete time for messages in the chat; in seconds */
1135
+ message_auto_delete_time: number;
1136
+ }
1137
+ /** This object represents a service message about a user boosting a chat. */
1138
+ export interface ChatBoostAdded {
1139
+ /** Number of boosts added by the user */
1140
+ boost_count: number;
1141
+ }
1142
+ /** The background is filled using the selected color. */
1143
+ export interface BackgroundFillSolid {
1144
+ /** Type of the background fill, always “solid” */
1145
+ type: "solid";
1146
+ /** The color of the background fill in the RGB24 format */
1147
+ color: number;
1148
+ }
1149
+ /** The background is a gradient fill. */
1150
+ export interface BackgroundFillGradient {
1151
+ /** Type of the background fill, always “gradient” */
1152
+ type: "gradient";
1153
+ /** Top color of the gradient in the RGB24 format */
1154
+ top_color: number;
1155
+ /** Bottom color of the gradient in the RGB24 format */
1156
+ bottom_color: number;
1157
+ /** Clockwise rotation angle of the background fill in degrees; 0-359 */
1158
+ rotation_angle: number;
1159
+ }
1160
+ /** The background is a freeform gradient that rotates after every message in the chat. */
1161
+ export interface BackgroundFillFreeformGradient {
1162
+ /** Type of the background fill, always “freeform_gradient” */
1163
+ type: "freeform_gradient";
1164
+ /** A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format */
1165
+ colors: number[];
1166
+ }
1167
+ /** This object describes the way a background is filled based on the selected colors. Currently, it can be one of
1168
+
1169
+ - BackgroundFillSolid
1170
+ - BackgroundFillGradient
1171
+ - BackgroundFillFreeformGradient
1172
+ */
1173
+ export type BackgroundFill = BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient;
1174
+ /** The background is automatically filled based on the selected colors. */
1175
+ export interface BackgroundTypeFill {
1176
+ /** Type of the background, always “fill” */
1177
+ type: "fill";
1178
+ /** The background fill */
1179
+ fill: BackgroundFill;
1180
+ /** Dimming of the background in dark themes, as a percentage; 0-100 */
1181
+ dark_theme_dimming: number;
1182
+ }
1183
+ /** The background is a wallpaper in the JPEG format. */
1184
+ export interface BackgroundTypeWallpaper {
1185
+ /** Type of the background, always “wallpaper” */
1186
+ type: "wallpaper";
1187
+ /** Document with the wallpaper */
1188
+ document: Document;
1189
+ /** Dimming of the background in dark themes, as a percentage; 0-100 */
1190
+ dark_theme_dimming: number;
1191
+ /** True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 */
1192
+ is_blurred: boolean;
1193
+ /** True, if the background moves slightly when the device is tilted */
1194
+ is_moving: boolean;
1195
+ }
1196
+ /** The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. */
1197
+ export interface BackgroundTypePattern {
1198
+ /** Type of the background, always “pattern” */
1199
+ type: "pattern";
1200
+ /** Document with the pattern */
1201
+ document: Document;
1202
+ /** The background fill that is combined with the pattern */
1203
+ fill: BackgroundFill;
1204
+ /** Intensity of the pattern when it is shown above the filled background; 0-100 */
1205
+ intensity: number;
1206
+ /** True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only */
1207
+ is_inverted: boolean;
1208
+ /** True, if the background moves slightly when the device is tilted */
1209
+ is_moving: boolean;
1210
+ }
1211
+ /** The background is taken directly from a built-in chat theme. */
1212
+ export interface BackgroundTypeChatTheme {
1213
+ /** Type of the background, always “chat_theme” */
1214
+ type: "chat_theme";
1215
+ /** Name of the chat theme, which is usually an emoji */
1216
+ theme_name: string;
1217
+ }
1218
+ /** This object describes the type of a background. Currently, it can be one of
1219
+
1220
+ - BackgroundTypeFill
1221
+ - BackgroundTypeWallpaper
1222
+ - BackgroundTypePattern
1223
+ - BackgroundTypeChatTheme
1224
+ */
1225
+ export type BackgroundType = BackgroundTypeFill | BackgroundTypeWallpaper | BackgroundTypePattern | BackgroundTypeChatTheme;
1226
+ /** This object represents a chat background. */
1227
+ export interface ChatBackground {
1228
+ /** Type of the background */
1229
+ type: BackgroundType;
1230
+ }
1231
+ /** This object represents a service message about a new forum topic created in the chat. */
1232
+ export interface ForumTopicCreated {
1233
+ /** Name of the topic */
1234
+ name: string;
1235
+ /** Color of the topic icon in RGB format */
1236
+ icon_color: number;
1237
+ /** Unique identifier of the custom emoji shown as the topic icon */
1238
+ icon_custom_emoji_id?: string;
1239
+ }
1240
+ /** This object represents a service message about an edited forum topic. */
1241
+ export interface ForumTopicEdited {
1242
+ /** New name of the topic, if it was edited */
1243
+ name?: string;
1244
+ /** New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed */
1245
+ icon_custom_emoji_id?: string;
1246
+ }
1247
+ /** This object represents a service message about a forum topic closed in the chat. Currently holds no information. */
1248
+ export interface ForumTopicClosed {
1249
+ }
1250
+ /** This object represents a service message about a forum topic reopened in the chat. Currently holds no information. */
1251
+ export interface ForumTopicReopened {
1252
+ }
1253
+ /** This object represents a service message about General forum topic hidden in the chat. Currently holds no information. */
1254
+ export interface GeneralForumTopicHidden {
1255
+ }
1256
+ /** This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. */
1257
+ export interface GeneralForumTopicUnhidden {
1258
+ }
1259
+ /** This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button. **/
1260
+ export interface SharedUser {
1261
+ /** Identifier of the shared user. 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. */
1262
+ user_id: number;
1263
+ /** First name of the user, if the name was requested by the bot */
1264
+ first_name?: string;
1265
+ /** Last name of the user, if the name was requested by the bot */
1266
+ last_name?: string;
1267
+ /** Username of the user, if the username was requested by the bot */
1268
+ username?: string;
1269
+ /** Available sizes of the chat photo, if the photo was requested by the bot */
1270
+ photo?: PhotoSize[];
1271
+ }
1272
+ /** This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUsers button. */
1273
+ export interface UsersShared {
1274
+ /** Identifier of the request */
1275
+ request_id: number;
1276
+ /** Information about users shared with the bot. */
1277
+ users: SharedUser[];
1278
+ }
1279
+ /** This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button. */
1280
+ export interface ChatShared {
1281
+ /** Identifier of the request */
1282
+ request_id: number;
1283
+ /** 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. */
1284
+ chat_id: number;
1285
+ /** Title of the chat, if the title was requested by the bot. */
1286
+ title?: string;
1287
+ /** Username of the chat, if the username was requested by the bot and available. */
1288
+ username?: string;
1289
+ /** Available sizes of the chat photo, if the photo was requested by the bot */
1290
+ photo?: PhotoSize[];
1291
+ }
1292
+ /** Describes a service message about a regular gift that was sent or received. */
1293
+ export interface GiftInfo {
1294
+ /** Information about the gift */
1295
+ gift: Gift;
1296
+ /** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
1297
+ owned_gift_id?: string;
1298
+ /** Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible */
1299
+ convert_star_count?: number;
1300
+ /** Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift */
1301
+ prepaid_upgrade_star_count?: number;
1302
+ /** True, if the gift can be upgraded to a unique gift */
1303
+ can_be_upgraded?: boolean;
1304
+ /** Text of the message that was added to the gift */
1305
+ text?: string;
1306
+ /** Special entities that appear in the text */
1307
+ entities?: MessageEntity[];
1308
+ /** True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
1309
+ is_private?: boolean;
1310
+ }
1311
+ /** Describes a service message about a unique gift that was sent or received. */
1312
+ export interface UniqueGiftInfo {
1313
+ /** Information about the gift */
1314
+ gift: UniqueGift;
1315
+ /** 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 */
1316
+ origin: "upgrade" | "transfer" | "resale";
1317
+ /** For gifts bought from other users, the price paid for the gift */
1318
+ last_resale_star_count?: number;
1319
+ /** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
1320
+ owned_gift_id?: string;
1321
+ /** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
1322
+ transfer_star_count?: number;
1323
+ /** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
1324
+ next_transfer_date?: number;
1325
+ }
1326
+ /** 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. */
1327
+ export interface WriteAccessAllowed {
1328
+ /** True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess */
1329
+ from_request?: boolean;
1330
+ /** Name of the Web App, if the access was granted when the Web App was launched from a link */
1331
+ web_app_name?: string;
1332
+ /** True, if the access was granted when the bot was added to the attachment or side menu */
1333
+ from_attachment_menu?: boolean;
1334
+ }
1335
+ /** This object represents a service message about a video chat scheduled in the chat. */
1336
+ export interface VideoChatScheduled {
1337
+ /** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */
1338
+ start_date: number;
1339
+ }
1340
+ /** This object represents a service message about a video chat started in the chat. Currently holds no information. */
1341
+ export interface VideoChatStarted {
1342
+ }
1343
+ /** This object represents a service message about a video chat ended in the chat. */
1344
+ export interface VideoChatEnded {
1345
+ /** Video chat duration in seconds */
1346
+ duration: number;
1347
+ }
1348
+ /** This object represents a service message about new members invited to a video chat. */
1349
+ export interface VideoChatParticipantsInvited {
1350
+ /** New members that were invited to the video chat */
1351
+ users: User[];
1352
+ }
1353
+ /** This object represents a service message about the creation of a scheduled giveaway. */
1354
+ export interface GiveawayCreated {
1355
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1356
+ prize_star_count?: number;
1357
+ }
1358
+ /** This object represents a message about a scheduled giveaway. */
1359
+ export interface Giveaway {
1360
+ /** The list of chats which the user must join to participate in the giveaway */
1361
+ chats: Chat[];
1362
+ /** Point in time (Unix timestamp) when winners of the giveaway will be selected */
1363
+ winners_selection_date: number;
1364
+ /** The number of users which are supposed to be selected as winners of the giveaway */
1365
+ winner_count: number;
1366
+ /** True, if only users who join the chats after the giveaway started should be eligible to win */
1367
+ only_new_members?: true;
1368
+ /** True, if the list of giveaway winners will be visible to everyone */
1369
+ has_public_winners?: true;
1370
+ /** Description of additional giveaway prize */
1371
+ prize_description?: string;
1372
+ /** 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. */
1373
+ country_codes?: string[];
1374
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1375
+ prize_star_count?: number;
1376
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1377
+ premium_subscription_month_count?: number;
1378
+ }
1379
+ /** This object represents a message about the completion of a giveaway with public winners. */
1380
+ export interface GiveawayWinners {
1381
+ /** The chat that created the giveaway */
1382
+ chat: Chat;
1383
+ /** Identifier of the message with the giveaway in the chat */
1384
+ giveaway_message_id: number;
1385
+ /** Point in time (Unix timestamp) when winners of the giveaway were selected */
1386
+ winners_selection_date: number;
1387
+ /** Total number of winners in the giveaway */
1388
+ winner_count: number;
1389
+ /** List of up to 100 winners of the giveaway */
1390
+ winners: User[];
1391
+ /** The number of other chats the user had to join in order to be eligible for the giveaway */
1392
+ additional_chat_count?: number;
1393
+ /** The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only */
1394
+ prize_star_count?: number;
1395
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1396
+ premium_subscription_month_count?: number;
1397
+ /** Number of undistributed prizes */
1398
+ unclaimed_prize_count?: number;
1399
+ /** True, if only users who had joined the chats after the giveaway started were eligible to win */
1400
+ only_new_members?: true;
1401
+ /** True, if the giveaway was canceled because the payment for it was refunded */
1402
+ was_refunded?: true;
1403
+ /** Description of additional giveaway prize */
1404
+ prize_description?: string;
1405
+ /** True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. */
1406
+ is_star_giveaway?: true;
1407
+ }
1408
+ export interface PaidMessagePriceChanged {
1409
+ /** The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message */
1410
+ paid_message_star_count: number;
1411
+ }
1412
+ /** Describes a service message about a change in the price of direct messages sent to a channel chat. */
1413
+ export interface DirectMessagePriceChanged {
1414
+ /** True, if direct messages are enabled for the channel chat; false otherwise */
1415
+ are_direct_messages_enabled: boolean;
1416
+ /** The new number of Telegram Stars that must be paid by users for each direct message sent to the channel. Does not apply to users who have been exempted by administrators. Defaults to 0. */
1417
+ direct_message_star_count: number;
1418
+ }
1419
+ /** Describes a service message about the approval of a suggested post. */
1420
+ export interface SuggestedPostApproved {
1421
+ /** 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. */
1422
+ suggested_post_message?: Message;
1423
+ /** Amount paid for the post */
1424
+ price?: SuggestedPostPrice;
1425
+ /** Date when the post will be published */
1426
+ send_date: number;
1427
+ }
1428
+ /** Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval. */
1429
+ export interface SuggestedPostApprovalFailed {
1430
+ /** 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. */
1431
+ suggested_post_message?: Message;
1432
+ /** Expected price of the post */
1433
+ price?: SuggestedPostPrice;
1434
+ }
1435
+ /** Describes a service message about the rejection of a suggested post. */
1436
+ export interface SuggestedPostDeclined {
1437
+ /** 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. */
1438
+ suggested_post_message?: Message;
1439
+ /** Comment with which the post was declined */
1440
+ comment?: string;
1441
+ }
1442
+ /** Describes a service message about a successful payment for a suggested post. */
1443
+ export interface SuggestedPostPaid {
1444
+ /** 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. */
1445
+ suggested_post_message?: Message;
1446
+ /** Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins */
1447
+ currency: string;
1448
+ /** The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only */
1449
+ amount?: number;
1450
+ /** The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only */
1451
+ star_amount?: StarAmount;
1452
+ }
1453
+ /** Describes a service message about a payment refund for a suggested post. */
1454
+ export interface SuggestedPostRefunded {
1455
+ /** 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. */
1456
+ suggested_post_message?: Message;
1457
+ /** 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. */
1458
+ reason: "post_deleted" | "payment_refunded";
1459
+ }
1460
+ /** This object represents a service message about the completion of a giveaway without public winners. */
1461
+ export interface GiveawayCompleted {
1462
+ /** Number of winners in the giveaway */
1463
+ winner_count: number;
1464
+ /** Number of undistributed prizes */
1465
+ unclaimed_prize_count?: number;
1466
+ /** Message with the giveaway that was completed, if it wasn't deleted */
1467
+ giveaway_message?: Message;
1468
+ }
1469
+ /** Describes the options used for link preview generation. */
1470
+ export interface LinkPreviewOptions {
1471
+ /** True, if the link preview is disabled */
1472
+ is_disabled?: boolean;
1473
+ /** URL to use for the link preview. If empty, then the first URL found in the message text will be used */
1474
+ url?: string;
1475
+ /** True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */
1476
+ prefer_small_media?: boolean;
1477
+ /** True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */
1478
+ prefer_large_media?: boolean;
1479
+ /** True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text */
1480
+ show_above_text?: boolean;
1481
+ }
1482
+ /** Describes data sent from a Web App to the bot. */
1483
+ export interface WebAppData {
1484
+ /** The data. Be aware that a bad client can send arbitrary data in this field. */
1485
+ data: string;
1486
+ /** 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. */
1487
+ button_text: string;
1488
+ }
1489
+ /** This object represents a sticker. */
1490
+ export interface Sticker {
1491
+ /** Identifier for this file, which can be used to download or reuse the file */
1492
+ file_id: string;
1493
+ /** 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. */
1494
+ file_unique_id: string;
1495
+ /** Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
1496
+ type: "regular" | "mask" | "custom_emoji";
1497
+ /** Sticker width */
1498
+ width: number;
1499
+ /** Sticker height */
1500
+ height: number;
1501
+ /** True, if the sticker is animated */
1502
+ is_animated: boolean;
1503
+ /** True, if the sticker is a video sticker */
1504
+ is_video: boolean;
1505
+ /** Sticker thumbnail in the .WEBP or .JPG format */
1506
+ thumbnail?: PhotoSize;
1507
+ /** Emoji associated with the sticker */
1508
+ emoji?: string;
1509
+ /** Name of the sticker set to which the sticker belongs */
1510
+ set_name?: string;
1511
+ /** For premium regular stickers, premium animation for the sticker */
1512
+ premium_animation?: File;
1513
+ /** For mask stickers, the position where the mask should be placed */
1514
+ mask_position?: MaskPosition;
1515
+ /** For custom emoji stickers, unique identifier of the custom emoji */
1516
+ custom_emoji_id?: string;
1517
+ /** File size in bytes */
1518
+ file_size?: number;
1519
+ }
1520
+ /** This object represents a sticker set. */
1521
+ export interface StickerSet {
1522
+ /** Sticker set name */
1523
+ name: string;
1524
+ /** Sticker set title */
1525
+ title: string;
1526
+ /** Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” */
1527
+ sticker_type: "regular" | "mask" | "custom_emoji";
1528
+ /** List of all set stickers */
1529
+ stickers: Sticker[];
1530
+ /** Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
1531
+ thumbnail?: PhotoSize;
1532
+ }
1533
+ /** This object describes the position on faces where a mask should be placed by default. */
1534
+ export interface MaskPosition {
1535
+ /** The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. */
1536
+ point: "forehead" | "eyes" | "mouth" | "chin";
1537
+ /** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */
1538
+ x_shift: number;
1539
+ /** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */
1540
+ y_shift: number;
1541
+ /** Mask scaling coefficient. For example, 2.0 means double size. */
1542
+ scale: number;
1543
+ }
1544
+ /** This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. */
1545
+ export interface Game {
1546
+ /** Title of the game */
1547
+ title: string;
1548
+ /** Description of the game */
1549
+ description: string;
1550
+ /** Photo that will be displayed in the game message in chats. */
1551
+ photo: PhotoSize[];
1552
+ /** Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters. */
1553
+ text: string;
1554
+ /** Special entities that appear in text, such as usernames, URLs, bot commands, etc. */
1555
+ text_entities: MessageEntity[];
1556
+ /** Animation that will be displayed in the game message in chats. Upload via BotFather */
1557
+ animation: Animation;
1558
+ }
1559
+ /** This object represents one row of the high scores table for a game. */
1560
+ export interface GameHighScore {
1561
+ /** Position in high score table for the game */
1562
+ position: number;
1563
+ /** User */
1564
+ user: User;
1565
+ /** Score */
1566
+ score: number;
1567
+ }
1568
+ export {};