@effect-ak/tg-bot-client 0.0.2

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.
@@ -0,0 +1,3823 @@
1
+ export interface Update {
2
+ /**
3
+ * The update's unique identifier
4
+ * Update identifiers start from a certain positive number and increase sequentially
5
+ * This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order
6
+ * If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially
7
+ */
8
+ update_id: number;
9
+ /** New incoming message of any kind - text, photo, sticker, etc */
10
+ message?: Message;
11
+ /**
12
+ * New version of a message that is known to the bot and was edited
13
+ * This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot
14
+ */
15
+ edited_message?: Message;
16
+ /** New incoming channel post of any kind - text, photo, sticker, etc */
17
+ channel_post?: Message;
18
+ /**
19
+ * New version of a channel post that is known to the bot and was edited
20
+ * This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot
21
+ */
22
+ edited_channel_post?: Message;
23
+ /** The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot */
24
+ business_connection?: BusinessConnection;
25
+ /** New message from a connected business account */
26
+ business_message?: Message;
27
+ /** New version of a message from a connected business account */
28
+ edited_business_message?: Message;
29
+ /** Messages were deleted from a connected business account */
30
+ deleted_business_messages?: BusinessMessagesDeleted;
31
+ /**
32
+ * A reaction to a message was changed by a user
33
+ * The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates
34
+ * The update isn't received for reactions set by bots
35
+ */
36
+ message_reaction?: MessageReactionUpdated;
37
+ /**
38
+ * Reactions to a message with anonymous reactions were changed
39
+ * The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates
40
+ * The updates are grouped and can be sent with delay up to a few minutes
41
+ */
42
+ message_reaction_count?: MessageReactionCountUpdated;
43
+ /** New incoming inline query */
44
+ inline_query?: InlineQuery;
45
+ /**
46
+ * The result of an inline query that was chosen by a user and sent to their chat partner
47
+ * Please see our documentation on the feedback collecting for details on how to enable these updates for your bot
48
+ */
49
+ chosen_inline_result?: ChosenInlineResult;
50
+ /** New incoming callback query */
51
+ callback_query?: CallbackQuery;
52
+ /**
53
+ * New incoming shipping query
54
+ * Only for invoices with flexible price
55
+ */
56
+ shipping_query?: ShippingQuery;
57
+ /**
58
+ * New incoming pre-checkout query
59
+ * Contains full information about checkout
60
+ */
61
+ pre_checkout_query?: PreCheckoutQuery;
62
+ /** A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat */
63
+ purchased_paid_media?: PaidMediaPurchased;
64
+ /**
65
+ * New poll state
66
+ * Bots receive only updates about manually stopped polls and polls, which are sent by the bot
67
+ */
68
+ poll?: Poll;
69
+ /**
70
+ * A user changed their answer in a non-anonymous poll
71
+ * Bots receive new votes only in polls that were sent by the bot itself
72
+ */
73
+ poll_answer?: PollAnswer;
74
+ /**
75
+ * The bot's chat member status was updated in a chat
76
+ * For private chats, this update is received only when the bot is blocked or unblocked by the user
77
+ */
78
+ my_chat_member?: ChatMemberUpdated;
79
+ /**
80
+ * A chat member's status was updated in a chat
81
+ * The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates
82
+ */
83
+ chat_member?: ChatMemberUpdated;
84
+ /**
85
+ * A request to join the chat has been sent
86
+ * The bot must have the can_invite_users administrator right in the chat to receive these updates
87
+ */
88
+ chat_join_request?: ChatJoinRequest;
89
+ /**
90
+ * A chat boost was added or changed
91
+ * The bot must be an administrator in the chat to receive these updates
92
+ */
93
+ chat_boost?: ChatBoostUpdated;
94
+ /**
95
+ * A boost was removed from a chat
96
+ * The bot must be an administrator in the chat to receive these updates
97
+ */
98
+ removed_chat_boost?: ChatBoostRemoved;
99
+ }
100
+ export interface WebhookInfo {
101
+ /** Webhook URL, may be empty if webhook is not set up */
102
+ url: string;
103
+ /** True, if a custom certificate was provided for webhook certificate checks */
104
+ has_custom_certificate: boolean;
105
+ /** Number of updates awaiting delivery */
106
+ pending_update_count: number;
107
+ /** Currently used webhook IP address */
108
+ ip_address?: string;
109
+ /** Unix time for the most recent error that happened when trying to deliver an update via webhook */
110
+ last_error_date?: number;
111
+ /** Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */
112
+ last_error_message?: string;
113
+ /** Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */
114
+ last_synchronization_error_date?: number;
115
+ /** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
116
+ max_connections?: number;
117
+ /**
118
+ * A list of update types the bot is subscribed to
119
+ * Defaults to all update types except chat_member
120
+ */
121
+ allowed_updates?: string[];
122
+ }
123
+ export interface User {
124
+ /**
125
+ * Unique identifier for this user or bot
126
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
127
+ * But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier
128
+ */
129
+ id: number;
130
+ /** True, if this user is a bot */
131
+ is_bot: boolean;
132
+ /** User's or bot's first name */
133
+ first_name: string;
134
+ /** User's or bot's last name */
135
+ last_name?: string;
136
+ /** User's or bot's username */
137
+ username?: string;
138
+ /** IETF language tag of the user's language */
139
+ language_code?: string;
140
+ /** True, if this user is a Telegram Premium user */
141
+ is_premium?: boolean;
142
+ /** True, if this user added the bot to the attachment menu */
143
+ added_to_attachment_menu?: boolean;
144
+ /**
145
+ * True, if the bot can be invited to groups
146
+ * Returned only in getMe
147
+ */
148
+ can_join_groups?: boolean;
149
+ /**
150
+ * True, if privacy mode is disabled for the bot
151
+ * Returned only in getMe
152
+ */
153
+ can_read_all_group_messages?: boolean;
154
+ /**
155
+ * True, if the bot supports inline queries
156
+ * Returned only in getMe
157
+ */
158
+ supports_inline_queries?: boolean;
159
+ /**
160
+ * True, if the bot can be connected to a Telegram Business account to receive its messages
161
+ * Returned only in getMe
162
+ */
163
+ can_connect_to_business?: boolean;
164
+ /**
165
+ * True, if the bot has a main Web App
166
+ * Returned only in getMe
167
+ */
168
+ has_main_web_app?: boolean;
169
+ }
170
+ export interface Chat {
171
+ /**
172
+ * Unique identifier for this chat
173
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
174
+ * 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
175
+ */
176
+ id: number;
177
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
178
+ type: "private" | "group" | "supergroup" | "channel";
179
+ /** Title, for supergroups, channels and group chats */
180
+ title?: string;
181
+ /** Username, for private chats, supergroups and channels if available */
182
+ username?: string;
183
+ /** First name of the other party in a private chat */
184
+ first_name?: string;
185
+ /** Last name of the other party in a private chat */
186
+ last_name?: string;
187
+ /** True, if the supergroup chat is a forum (has topics enabled) */
188
+ is_forum?: boolean;
189
+ }
190
+ export interface ChatFullInfo {
191
+ /**
192
+ * Unique identifier for this chat
193
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
194
+ * 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
195
+ */
196
+ id: number;
197
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
198
+ type: string;
199
+ /** Title, for supergroups, channels and group chats */
200
+ title?: string;
201
+ /** Username, for private chats, supergroups and channels if available */
202
+ username?: string;
203
+ /** First name of the other party in a private chat */
204
+ first_name?: string;
205
+ /** Last name of the other party in a private chat */
206
+ last_name?: string;
207
+ /** True, if the supergroup chat is a forum (has topics enabled) */
208
+ is_forum?: boolean;
209
+ /**
210
+ * Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview
211
+ * See accent colors for more details
212
+ */
213
+ accent_color_id: number;
214
+ /** The maximum number of reactions that can be set on a message in the chat */
215
+ max_reaction_count: number;
216
+ /** Chat photo */
217
+ photo?: ChatPhoto;
218
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
219
+ active_usernames?: string[];
220
+ /** For private chats, the date of birth of the user */
221
+ birthdate?: Birthdate;
222
+ /** For private chats with business accounts, the intro of the business */
223
+ business_intro?: BusinessIntro;
224
+ /** For private chats with business accounts, the location of the business */
225
+ business_location?: BusinessLocation;
226
+ /** For private chats with business accounts, the opening hours of the business */
227
+ business_opening_hours?: BusinessOpeningHours;
228
+ /** For private chats, the personal channel of the user */
229
+ personal_chat?: Chat;
230
+ /**
231
+ * List of available reactions allowed in the chat
232
+ * If omitted, then all emoji reactions are allowed
233
+ */
234
+ available_reactions?: ReactionType[];
235
+ /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
236
+ background_custom_emoji_id?: string;
237
+ /**
238
+ * Identifier of the accent color for the chat's profile background
239
+ * See profile accent colors for more details
240
+ */
241
+ profile_accent_color_id?: number;
242
+ /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
243
+ profile_background_custom_emoji_id?: string;
244
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
245
+ emoji_status_custom_emoji_id?: string;
246
+ /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
247
+ emoji_status_expiration_date?: number;
248
+ /** Bio of the other party in a private chat */
249
+ bio?: string;
250
+ /** True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user */
251
+ has_private_forwards?: boolean;
252
+ /** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat */
253
+ has_restricted_voice_and_video_messages?: boolean;
254
+ /** True, if users need to join the supergroup before they can send messages */
255
+ join_to_send_messages?: boolean;
256
+ /** True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators */
257
+ join_by_request?: boolean;
258
+ /** Description, for groups, supergroups and channel chats */
259
+ description?: string;
260
+ /** Primary invite link, for groups, supergroups and channel chats */
261
+ invite_link?: string;
262
+ /** The most recent pinned message (by sending date) */
263
+ pinned_message?: Message;
264
+ /** Default chat member permissions, for groups and supergroups */
265
+ permissions?: ChatPermissions;
266
+ /**
267
+ * True, if paid media messages can be sent or forwarded to the channel chat
268
+ * The field is available only for channel chats
269
+ */
270
+ can_send_paid_media?: boolean;
271
+ /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
272
+ slow_mode_delay?: number;
273
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
274
+ unrestrict_boost_count?: number;
275
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
276
+ message_auto_delete_time?: number;
277
+ /**
278
+ * True, if aggressive anti-spam checks are enabled in the supergroup
279
+ * The field is only available to chat administrators
280
+ */
281
+ has_aggressive_anti_spam_enabled?: boolean;
282
+ /** True, if non-administrators can only get the list of bots and administrators in the chat */
283
+ has_hidden_members?: boolean;
284
+ /** True, if messages from the chat can't be forwarded to other chats */
285
+ has_protected_content?: boolean;
286
+ /** True, if new chat members will have access to old messages; available only to chat administrators */
287
+ has_visible_history?: boolean;
288
+ /** For supergroups, name of the group sticker set */
289
+ sticker_set_name?: string;
290
+ /** True, if the bot can change the group sticker set */
291
+ can_set_sticker_set?: boolean;
292
+ /**
293
+ * For supergroups, the name of the group's custom emoji sticker set
294
+ * Custom emoji from this set can be used by all users and bots in the group
295
+ */
296
+ custom_emoji_sticker_set_name?: string;
297
+ /**
298
+ * Unique identifier for the linked chat, i
299
+ * e
300
+ * the discussion group identifier for a channel and vice versa; for supergroups and channel chats
301
+ * This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it
302
+ * But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier
303
+ */
304
+ linked_chat_id?: number;
305
+ /** For supergroups, the location to which the supergroup is connected */
306
+ location?: ChatLocation;
307
+ }
308
+ export interface Message {
309
+ /**
310
+ * Unique message identifier inside this chat
311
+ * In specific instances (e
312
+ * g
313
+ * , message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately
314
+ * In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
315
+ */
316
+ message_id: number;
317
+ /** Unique identifier of a message thread to which the message belongs; for supergroups only */
318
+ message_thread_id?: number;
319
+ /**
320
+ * Sender of the message; may be empty for messages sent to channels
321
+ * For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
322
+ */
323
+ from?: User;
324
+ /**
325
+ * Sender of the message when sent on behalf of a chat
326
+ * For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group
327
+ * For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats
328
+ */
329
+ sender_chat?: Chat;
330
+ /** If the sender of the message boosted the chat, the number of boosts added by the user */
331
+ sender_boost_count?: number;
332
+ /**
333
+ * The bot that actually sent the message on behalf of the business account
334
+ * Available only for outgoing messages sent on behalf of the connected business account
335
+ */
336
+ sender_business_bot?: User;
337
+ /**
338
+ * Date the message was sent in Unix time
339
+ * It is always a positive number, representing a valid date
340
+ */
341
+ date: number;
342
+ /**
343
+ * Unique identifier of the business connection from which the message was received
344
+ * 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
345
+ */
346
+ business_connection_id?: string;
347
+ /** Chat the message belongs to */
348
+ chat: Chat;
349
+ /** Information about the original message for forwarded messages */
350
+ forward_origin?: MessageOrigin;
351
+ /** True, if the message is sent to a forum topic */
352
+ is_topic_message?: boolean;
353
+ /** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
354
+ is_automatic_forward?: boolean;
355
+ /**
356
+ * For replies in the same chat and message thread, the original message
357
+ * Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply
358
+ */
359
+ reply_to_message?: Message;
360
+ /** Information about the message that is being replied to, which may come from another chat or forum topic */
361
+ external_reply?: ExternalReplyInfo;
362
+ /** For replies that quote part of the original message, the quoted part of the message */
363
+ quote?: TextQuote;
364
+ /** For replies to a story, the original story */
365
+ reply_to_story?: Story;
366
+ /** Bot through which the message was sent */
367
+ via_bot?: User;
368
+ /** Date the message was last edited in Unix time */
369
+ edit_date?: number;
370
+ /** True, if the message can't be forwarded */
371
+ has_protected_content?: boolean;
372
+ /** 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 */
373
+ is_from_offline?: boolean;
374
+ /** The unique identifier of a media message group this message belongs to */
375
+ media_group_id?: string;
376
+ /** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
377
+ author_signature?: string;
378
+ /** For text messages, the actual UTF-8 text of the message */
379
+ text?: string;
380
+ /**
381
+ * For text messages, special entities like usernames, URLs, bot commands, etc
382
+ * that appear in the text
383
+ */
384
+ entities?: MessageEntity[];
385
+ /** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
386
+ link_preview_options?: LinkPreviewOptions;
387
+ /** Unique identifier of the message effect added to the message */
388
+ effect_id?: string;
389
+ /**
390
+ * Message is an animation, information about the animation
391
+ * For backward compatibility, when this field is set, the document field will also be set
392
+ */
393
+ animation?: Animation;
394
+ /** Message is an audio file, information about the file */
395
+ audio?: Audio;
396
+ /** Message is a general file, information about the file */
397
+ document?: Document;
398
+ /** Message contains paid media; information about the paid media */
399
+ paid_media?: PaidMediaInfo;
400
+ /** Message is a photo, available sizes of the photo */
401
+ photo?: PhotoSize[];
402
+ /** Message is a sticker, information about the sticker */
403
+ sticker?: Sticker;
404
+ /** Message is a forwarded story */
405
+ story?: Story;
406
+ /** Message is a video, information about the video */
407
+ video?: Video;
408
+ /** Message is a video note, information about the video message */
409
+ video_note?: VideoNote;
410
+ /** Message is a voice message, information about the file */
411
+ voice?: Voice;
412
+ /** Caption for the animation, audio, document, paid media, photo, video or voice */
413
+ caption?: string;
414
+ /**
415
+ * For messages with a caption, special entities like usernames, URLs, bot commands, etc
416
+ * that appear in the caption
417
+ */
418
+ caption_entities?: MessageEntity[];
419
+ /** True, if the caption must be shown above the message media */
420
+ show_caption_above_media?: boolean;
421
+ /** True, if the message media is covered by a spoiler animation */
422
+ has_media_spoiler?: boolean;
423
+ /** Message is a shared contact, information about the contact */
424
+ contact?: Contact;
425
+ /** Message is a dice with random value */
426
+ dice?: Dice;
427
+ /**
428
+ * Message is a game, information about the game
429
+ * More about games »
430
+ */
431
+ game?: Game;
432
+ /** Message is a native poll, information about the poll */
433
+ poll?: Poll;
434
+ /**
435
+ * Message is a venue, information about the venue
436
+ * For backward compatibility, when this field is set, the location field will also be set
437
+ */
438
+ venue?: Venue;
439
+ /** Message is a shared location, information about the location */
440
+ location?: Location;
441
+ /** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
442
+ new_chat_members?: User[];
443
+ /** A member was removed from the group, information about them (this member may be the bot itself) */
444
+ left_chat_member?: User;
445
+ /** A chat title was changed to this value */
446
+ new_chat_title?: string;
447
+ /** A chat photo was change to this value */
448
+ new_chat_photo?: PhotoSize[];
449
+ /** Service message: the chat photo was deleted */
450
+ delete_chat_photo?: boolean;
451
+ /** Service message: the group has been created */
452
+ group_chat_created?: boolean;
453
+ /**
454
+ * Service message: the supergroup has been created
455
+ * 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
456
+ * It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup
457
+ */
458
+ supergroup_chat_created?: boolean;
459
+ /**
460
+ * Service message: the channel has been created
461
+ * 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
462
+ * It can only be found in reply_to_message if someone replies to a very first message in a channel
463
+ */
464
+ channel_chat_created?: boolean;
465
+ /** Service message: auto-delete timer settings changed in the chat */
466
+ message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged;
467
+ /**
468
+ * The group has been migrated to a supergroup with the specified identifier
469
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
470
+ * 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
471
+ */
472
+ migrate_to_chat_id?: number;
473
+ /**
474
+ * The supergroup has been migrated from a group with the specified identifier
475
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
476
+ * 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
477
+ */
478
+ migrate_from_chat_id?: number;
479
+ /**
480
+ * Specified message was pinned
481
+ * Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply
482
+ */
483
+ pinned_message?: MaybeInaccessibleMessage;
484
+ /**
485
+ * Message is an invoice for a payment, information about the invoice
486
+ * More about payments »
487
+ */
488
+ invoice?: Invoice;
489
+ /**
490
+ * Message is a service message about a successful payment, information about the payment
491
+ * More about payments »
492
+ */
493
+ successful_payment?: SuccessfulPayment;
494
+ /**
495
+ * Message is a service message about a refunded payment, information about the payment
496
+ * More about payments »
497
+ */
498
+ refunded_payment?: RefundedPayment;
499
+ /** Service message: users were shared with the bot */
500
+ users_shared?: UsersShared;
501
+ /** Service message: a chat was shared with the bot */
502
+ chat_shared?: ChatShared;
503
+ /**
504
+ * The domain name of the website on which the user has logged in
505
+ * More about Telegram Login »
506
+ */
507
+ connected_website?: string;
508
+ /** 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 */
509
+ write_access_allowed?: WriteAccessAllowed;
510
+ /** Telegram Passport data */
511
+ passport_data?: PassportData;
512
+ /**
513
+ * Service message
514
+ * A user in the chat triggered another user's proximity alert while sharing Live Location
515
+ */
516
+ proximity_alert_triggered?: ProximityAlertTriggered;
517
+ /** Service message: user boosted the chat */
518
+ boost_added?: ChatBoostAdded;
519
+ /** Service message: chat background set */
520
+ chat_background_set?: ChatBackground;
521
+ /** Service message: forum topic created */
522
+ forum_topic_created?: ForumTopicCreated;
523
+ /** Service message: forum topic edited */
524
+ forum_topic_edited?: ForumTopicEdited;
525
+ /** Service message: forum topic closed */
526
+ forum_topic_closed?: ForumTopicClosed;
527
+ /** Service message: forum topic reopened */
528
+ forum_topic_reopened?: ForumTopicReopened;
529
+ /** Service message: the 'General' forum topic hidden */
530
+ general_forum_topic_hidden?: GeneralForumTopicHidden;
531
+ /** Service message: the 'General' forum topic unhidden */
532
+ general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
533
+ /** Service message: a scheduled giveaway was created */
534
+ giveaway_created?: GiveawayCreated;
535
+ /** The message is a scheduled giveaway message */
536
+ giveaway?: Giveaway;
537
+ /** A giveaway with public winners was completed */
538
+ giveaway_winners?: GiveawayWinners;
539
+ /** Service message: a giveaway without public winners was completed */
540
+ giveaway_completed?: GiveawayCompleted;
541
+ /** Service message: video chat scheduled */
542
+ video_chat_scheduled?: VideoChatScheduled;
543
+ /** Service message: video chat started */
544
+ video_chat_started?: VideoChatStarted;
545
+ /** Service message: video chat ended */
546
+ video_chat_ended?: VideoChatEnded;
547
+ /** Service message: new participants invited to a video chat */
548
+ video_chat_participants_invited?: VideoChatParticipantsInvited;
549
+ /** Service message: data sent by a Web App */
550
+ web_app_data?: WebAppData;
551
+ /**
552
+ * Inline keyboard attached to the message
553
+ * login_url buttons are represented as ordinary url buttons
554
+ */
555
+ reply_markup?: InlineKeyboardMarkup;
556
+ }
557
+ export interface MessageId {
558
+ /**
559
+ * Unique message identifier
560
+ * In specific instances (e
561
+ * g
562
+ * , message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately
563
+ * In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
564
+ */
565
+ message_id: number;
566
+ }
567
+ export interface InaccessibleMessage {
568
+ /** Chat the message belonged to */
569
+ chat: Chat;
570
+ /** Unique message identifier inside the chat */
571
+ message_id: number;
572
+ /**
573
+ * Always 0
574
+ * The field can be used to differentiate regular and inaccessible messages
575
+ */
576
+ date: number;
577
+ }
578
+ export type MaybeInaccessibleMessage = Message | InaccessibleMessage;
579
+ export interface MessageEntity {
580
+ /**
581
+ * Type of the entity
582
+ * Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram
583
+ * org), “email” (do-not-reply@telegram
584
+ * 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)
585
+ */
586
+ type: string;
587
+ /** Offset in UTF-16 code units to the start of the entity */
588
+ offset: number;
589
+ /** Length of the entity in UTF-16 code units */
590
+ length: number;
591
+ /** For “text_link” only, URL that will be opened after user taps on the text */
592
+ url?: string;
593
+ /** For “text_mention” only, the mentioned user */
594
+ user?: User;
595
+ /** For “pre” only, the programming language of the entity text */
596
+ language?: string;
597
+ /**
598
+ * For “custom_emoji” only, unique identifier of the custom emoji
599
+ * Use getCustomEmojiStickers to get full information about the sticker
600
+ */
601
+ custom_emoji_id?: string;
602
+ }
603
+ export interface TextQuote {
604
+ /** Text of the quoted part of a message that is replied to by the given message */
605
+ text: string;
606
+ /**
607
+ * Special entities that appear in the quote
608
+ * Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes
609
+ */
610
+ entities?: MessageEntity[];
611
+ /** Approximate quote position in the original message in UTF-16 code units as specified by the sender */
612
+ position: number;
613
+ /**
614
+ * True, if the quote was chosen manually by the message sender
615
+ * Otherwise, the quote was added automatically by the server
616
+ */
617
+ is_manual?: boolean;
618
+ }
619
+ export interface ExternalReplyInfo {
620
+ /** Origin of the message replied to by the given message */
621
+ origin: MessageOrigin;
622
+ /**
623
+ * Chat the original message belongs to
624
+ * Available only if the chat is a supergroup or a channel
625
+ */
626
+ chat?: Chat;
627
+ /**
628
+ * Unique message identifier inside the original chat
629
+ * Available only if the original chat is a supergroup or a channel
630
+ */
631
+ message_id?: number;
632
+ /** Options used for link preview generation for the original message, if it is a text message */
633
+ link_preview_options?: LinkPreviewOptions;
634
+ /** Message is an animation, information about the animation */
635
+ animation?: Animation;
636
+ /** Message is an audio file, information about the file */
637
+ audio?: Audio;
638
+ /** Message is a general file, information about the file */
639
+ document?: Document;
640
+ /** Message contains paid media; information about the paid media */
641
+ paid_media?: PaidMediaInfo;
642
+ /** Message is a photo, available sizes of the photo */
643
+ photo?: PhotoSize[];
644
+ /** Message is a sticker, information about the sticker */
645
+ sticker?: Sticker;
646
+ /** Message is a forwarded story */
647
+ story?: Story;
648
+ /** Message is a video, information about the video */
649
+ video?: Video;
650
+ /** Message is a video note, information about the video message */
651
+ video_note?: VideoNote;
652
+ /** Message is a voice message, information about the file */
653
+ voice?: Voice;
654
+ /** True, if the message media is covered by a spoiler animation */
655
+ has_media_spoiler?: boolean;
656
+ /** Message is a shared contact, information about the contact */
657
+ contact?: Contact;
658
+ /** Message is a dice with random value */
659
+ dice?: Dice;
660
+ /**
661
+ * Message is a game, information about the game
662
+ * More about games »
663
+ */
664
+ game?: Game;
665
+ /** Message is a scheduled giveaway, information about the giveaway */
666
+ giveaway?: Giveaway;
667
+ /** A giveaway with public winners was completed */
668
+ giveaway_winners?: GiveawayWinners;
669
+ /**
670
+ * Message is an invoice for a payment, information about the invoice
671
+ * More about payments »
672
+ */
673
+ invoice?: Invoice;
674
+ /** Message is a shared location, information about the location */
675
+ location?: Location;
676
+ /** Message is a native poll, information about the poll */
677
+ poll?: Poll;
678
+ /** Message is a venue, information about the venue */
679
+ venue?: Venue;
680
+ }
681
+ export interface ReplyParameters {
682
+ /** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */
683
+ message_id: number;
684
+ /**
685
+ * 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)
686
+ * Not supported for messages sent on behalf of a business account
687
+ */
688
+ chat_id?: number | string;
689
+ /**
690
+ * Pass True if the message should be sent even if the specified message to be replied to is not found
691
+ * Always False for replies in another chat or forum topic
692
+ * Always True for messages sent on behalf of a business account
693
+ */
694
+ allow_sending_without_reply?: boolean;
695
+ /**
696
+ * Quoted part of the message to be replied to; 0-1024 characters after entities parsing
697
+ * The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities
698
+ * The message will fail to send if the quote isn't found in the original message
699
+ */
700
+ quote?: string;
701
+ /**
702
+ * Mode for parsing entities in the quote
703
+ * See formatting options for more details
704
+ */
705
+ quote_parse_mode?: string;
706
+ /**
707
+ * A JSON-serialized list of special entities that appear in the quote
708
+ * It can be specified instead of quote_parse_mode
709
+ */
710
+ quote_entities?: MessageEntity[];
711
+ /** Position of the quote in the original message in UTF-16 code units */
712
+ quote_position?: number;
713
+ }
714
+ export type MessageOrigin = MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel;
715
+ export interface MessageOriginUser {
716
+ /** Type of the message origin, always “user” */
717
+ type: string;
718
+ /** Date the message was sent originally in Unix time */
719
+ date: number;
720
+ /** User that sent the message originally */
721
+ sender_user: User;
722
+ }
723
+ export interface MessageOriginHiddenUser {
724
+ /** Type of the message origin, always “hidden_user” */
725
+ type: string;
726
+ /** Date the message was sent originally in Unix time */
727
+ date: number;
728
+ /** Name of the user that sent the message originally */
729
+ sender_user_name: string;
730
+ }
731
+ export interface MessageOriginChat {
732
+ /** Type of the message origin, always “chat” */
733
+ type: string;
734
+ /** Date the message was sent originally in Unix time */
735
+ date: number;
736
+ /** Chat that sent the message originally */
737
+ sender_chat: Chat;
738
+ /** For messages originally sent by an anonymous chat administrator, original message author signature */
739
+ author_signature?: string;
740
+ }
741
+ export interface MessageOriginChannel {
742
+ /** Type of the message origin, always “channel” */
743
+ type: string;
744
+ /** Date the message was sent originally in Unix time */
745
+ date: number;
746
+ /** Channel chat to which the message was originally sent */
747
+ chat: Chat;
748
+ /** Unique message identifier inside the chat */
749
+ message_id: number;
750
+ /** Signature of the original post author */
751
+ author_signature?: string;
752
+ }
753
+ export interface PhotoSize {
754
+ /** Identifier for this file, which can be used to download or reuse the file */
755
+ file_id: string;
756
+ /**
757
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
758
+ * Can't be used to download or reuse the file
759
+ */
760
+ file_unique_id: string;
761
+ /** Photo width */
762
+ width: number;
763
+ /** Photo height */
764
+ height: number;
765
+ /** File size in bytes */
766
+ file_size?: number;
767
+ }
768
+ export interface Animation {
769
+ /** Identifier for this file, which can be used to download or reuse the file */
770
+ file_id: string;
771
+ /**
772
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
773
+ * Can't be used to download or reuse the file
774
+ */
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
+ /**
789
+ * File size in bytes
790
+ * It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it
791
+ * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value
792
+ */
793
+ file_size?: number;
794
+ }
795
+ export interface Audio {
796
+ /** Identifier for this file, which can be used to download or reuse the file */
797
+ file_id: string;
798
+ /**
799
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
800
+ * Can't be used to download or reuse the file
801
+ */
802
+ file_unique_id: string;
803
+ /** Duration of the audio in seconds as defined by the sender */
804
+ duration: number;
805
+ /** Performer of the audio as defined by the sender or by audio tags */
806
+ performer?: string;
807
+ /** Title of the audio as defined by the sender or by audio tags */
808
+ title?: string;
809
+ /** Original filename as defined by the sender */
810
+ file_name?: string;
811
+ /** MIME type of the file as defined by the sender */
812
+ mime_type?: string;
813
+ /**
814
+ * File size in bytes
815
+ * It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it
816
+ * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value
817
+ */
818
+ file_size?: number;
819
+ /** Thumbnail of the album cover to which the music file belongs */
820
+ thumbnail?: PhotoSize;
821
+ }
822
+ export interface Document {
823
+ /** Identifier for this file, which can be used to download or reuse the file */
824
+ file_id: string;
825
+ /**
826
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
827
+ * Can't be used to download or reuse the file
828
+ */
829
+ file_unique_id: string;
830
+ /** Document thumbnail as defined by the sender */
831
+ thumbnail?: PhotoSize;
832
+ /** Original filename as defined by the sender */
833
+ file_name?: string;
834
+ /** MIME type of the file as defined by the sender */
835
+ mime_type?: string;
836
+ /**
837
+ * File size in bytes
838
+ * It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it
839
+ * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value
840
+ */
841
+ file_size?: number;
842
+ }
843
+ export interface Story {
844
+ /** Chat that posted the story */
845
+ chat: Chat;
846
+ /** Unique identifier for the story in the chat */
847
+ id: number;
848
+ }
849
+ export interface Video {
850
+ /** Identifier for this file, which can be used to download or reuse the file */
851
+ file_id: string;
852
+ /**
853
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
854
+ * Can't be used to download or reuse the file
855
+ */
856
+ file_unique_id: string;
857
+ /** Video width as defined by the sender */
858
+ width: number;
859
+ /** Video height as defined by the sender */
860
+ height: number;
861
+ /** Duration of the video in seconds as defined by the sender */
862
+ duration: number;
863
+ /** Video thumbnail */
864
+ thumbnail?: PhotoSize;
865
+ /** Original filename as defined by the sender */
866
+ file_name?: string;
867
+ /** MIME type of the file as defined by the sender */
868
+ mime_type?: string;
869
+ /**
870
+ * File size in bytes
871
+ * It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it
872
+ * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value
873
+ */
874
+ file_size?: number;
875
+ }
876
+ export interface VideoNote {
877
+ /** Identifier for this file, which can be used to download or reuse the file */
878
+ file_id: string;
879
+ /**
880
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
881
+ * Can't be used to download or reuse the file
882
+ */
883
+ file_unique_id: string;
884
+ /** Video width and height (diameter of the video message) as defined by the sender */
885
+ length: number;
886
+ /** Duration of the video in seconds as defined by the sender */
887
+ duration: number;
888
+ /** Video thumbnail */
889
+ thumbnail?: PhotoSize;
890
+ /** File size in bytes */
891
+ file_size?: number;
892
+ }
893
+ export interface Voice {
894
+ /** Identifier for this file, which can be used to download or reuse the file */
895
+ file_id: string;
896
+ /**
897
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
898
+ * Can't be used to download or reuse the file
899
+ */
900
+ file_unique_id: string;
901
+ /** Duration of the audio in seconds as defined by the sender */
902
+ duration: number;
903
+ /** MIME type of the file as defined by the sender */
904
+ mime_type?: string;
905
+ /**
906
+ * File size in bytes
907
+ * It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it
908
+ * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value
909
+ */
910
+ file_size?: number;
911
+ }
912
+ export interface PaidMediaInfo {
913
+ /** The number of Telegram Stars that must be paid to buy access to the media */
914
+ star_count: number;
915
+ /** Information about the paid media */
916
+ paid_media: PaidMedia[];
917
+ }
918
+ export type PaidMedia = PaidMediaPreview | PaidMediaPhoto | PaidMediaVideo;
919
+ export interface PaidMediaPreview {
920
+ /** Type of the paid media, always “preview” */
921
+ type: string;
922
+ /** Media width as defined by the sender */
923
+ width?: number;
924
+ /** Media height as defined by the sender */
925
+ height?: number;
926
+ /** Duration of the media in seconds as defined by the sender */
927
+ duration?: number;
928
+ }
929
+ export interface PaidMediaPhoto {
930
+ /** Type of the paid media, always “photo” */
931
+ type: string;
932
+ /** The photo */
933
+ photo: PhotoSize[];
934
+ }
935
+ export interface PaidMediaVideo {
936
+ /** Type of the paid media, always “video” */
937
+ type: string;
938
+ /** The video */
939
+ video: Video;
940
+ }
941
+ export interface Contact {
942
+ /** Contact's phone number */
943
+ phone_number: string;
944
+ /** Contact's first name */
945
+ first_name: string;
946
+ /** Contact's last name */
947
+ last_name?: string;
948
+ /**
949
+ * Contact's user identifier in Telegram
950
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
951
+ * But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier
952
+ */
953
+ user_id?: number;
954
+ /** Additional data about the contact in the form of a vCard */
955
+ vcard?: string;
956
+ }
957
+ export interface Dice {
958
+ /** Emoji on which the dice throw animation is based */
959
+ emoji: string;
960
+ /** Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base emoji, 1-64 for “” base emoji */
961
+ value: number;
962
+ }
963
+ export interface PollOption {
964
+ /** Option text, 1-100 characters */
965
+ text: string;
966
+ /**
967
+ * Special entities that appear in the option text
968
+ * Currently, only custom emoji entities are allowed in poll option texts
969
+ */
970
+ text_entities?: MessageEntity[];
971
+ /** Number of users that voted for this option */
972
+ voter_count: number;
973
+ }
974
+ export interface InputPollOption {
975
+ /** Option text, 1-100 characters */
976
+ text: string;
977
+ /**
978
+ * Mode for parsing entities in the text
979
+ * See formatting options for more details
980
+ * Currently, only custom emoji entities are allowed
981
+ */
982
+ text_parse_mode?: string;
983
+ /**
984
+ * A JSON-serialized list of special entities that appear in the poll option text
985
+ * It can be specified instead of text_parse_mode
986
+ */
987
+ text_entities?: MessageEntity[];
988
+ }
989
+ export interface PollAnswer {
990
+ /** Unique poll identifier */
991
+ poll_id: string;
992
+ /** The chat that changed the answer to the poll, if the voter is anonymous */
993
+ voter_chat?: Chat;
994
+ /** The user that changed the answer to the poll, if the voter isn't anonymous */
995
+ user?: User;
996
+ /**
997
+ * 0-based identifiers of chosen answer options
998
+ * May be empty if the vote was retracted
999
+ */
1000
+ option_ids: number[];
1001
+ }
1002
+ export interface Poll {
1003
+ /** Unique poll identifier */
1004
+ id: string;
1005
+ /** Poll question, 1-300 characters */
1006
+ question: string;
1007
+ /**
1008
+ * Special entities that appear in the question
1009
+ * Currently, only custom emoji entities are allowed in poll questions
1010
+ */
1011
+ question_entities?: MessageEntity[];
1012
+ /** List of poll options */
1013
+ options: PollOption[];
1014
+ /** Total number of users that voted in the poll */
1015
+ total_voter_count: number;
1016
+ /** True, if the poll is closed */
1017
+ is_closed: boolean;
1018
+ /** True, if the poll is anonymous */
1019
+ is_anonymous: boolean;
1020
+ /** Poll type, currently can be “regular” or “quiz” */
1021
+ type: string;
1022
+ /** True, if the poll allows multiple answers */
1023
+ allows_multiple_answers: boolean;
1024
+ /**
1025
+ * 0-based identifier of the correct answer option
1026
+ * 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
1027
+ */
1028
+ correct_option_id?: number;
1029
+ /** 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 */
1030
+ explanation?: string;
1031
+ /**
1032
+ * Special entities like usernames, URLs, bot commands, etc
1033
+ * that appear in the explanation
1034
+ */
1035
+ explanation_entities?: MessageEntity[];
1036
+ /** Amount of time in seconds the poll will be active after creation */
1037
+ open_period?: number;
1038
+ /** Point in time (Unix timestamp) when the poll will be automatically closed */
1039
+ close_date?: number;
1040
+ }
1041
+ export interface Location {
1042
+ /** Latitude as defined by the sender */
1043
+ latitude: number;
1044
+ /** Longitude as defined by the sender */
1045
+ longitude: number;
1046
+ /** The radius of uncertainty for the location, measured in meters; 0-1500 */
1047
+ horizontal_accuracy?: number;
1048
+ /**
1049
+ * Time relative to the message sending date, during which the location can be updated; in seconds
1050
+ * For active live locations only
1051
+ */
1052
+ live_period?: number;
1053
+ /**
1054
+ * The direction in which user is moving, in degrees; 1-360
1055
+ * For active live locations only
1056
+ */
1057
+ heading?: number;
1058
+ /**
1059
+ * The maximum distance for proximity alerts about approaching another chat member, in meters
1060
+ * For sent live locations only
1061
+ */
1062
+ proximity_alert_radius?: number;
1063
+ }
1064
+ export interface Venue {
1065
+ /**
1066
+ * Venue location
1067
+ * Can't be a live location
1068
+ */
1069
+ location: Location;
1070
+ /** Name of the venue */
1071
+ title: string;
1072
+ /** Address of the venue */
1073
+ address: string;
1074
+ /** Foursquare identifier of the venue */
1075
+ foursquare_id?: string;
1076
+ /**
1077
+ * Foursquare type of the venue
1078
+ * (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”
1079
+ */
1080
+ foursquare_type?: string;
1081
+ /** Google Places identifier of the venue */
1082
+ google_place_id?: string;
1083
+ /**
1084
+ * Google Places type of the venue
1085
+ * (See supported types
1086
+ */
1087
+ google_place_type?: string;
1088
+ }
1089
+ export interface WebAppData {
1090
+ /**
1091
+ * The data
1092
+ * Be aware that a bad client can send arbitrary data in this field
1093
+ */
1094
+ data: string;
1095
+ /**
1096
+ * Text of the web_app keyboard button from which the Web App was opened
1097
+ * Be aware that a bad client can send arbitrary data in this field
1098
+ */
1099
+ button_text: string;
1100
+ }
1101
+ export interface ProximityAlertTriggered {
1102
+ /** User that triggered the alert */
1103
+ traveler: User;
1104
+ /** User that set the alert */
1105
+ watcher: User;
1106
+ /** The distance between the users */
1107
+ distance: number;
1108
+ }
1109
+ export interface MessageAutoDeleteTimerChanged {
1110
+ /** New auto-delete time for messages in the chat; in seconds */
1111
+ message_auto_delete_time: number;
1112
+ }
1113
+ export interface ChatBoostAdded {
1114
+ /** Number of boosts added by the user */
1115
+ boost_count: number;
1116
+ }
1117
+ export type BackgroundFill = BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient;
1118
+ export interface BackgroundFillSolid {
1119
+ /** Type of the background fill, always “solid” */
1120
+ type: string;
1121
+ /** The color of the background fill in the RGB24 format */
1122
+ color: number;
1123
+ }
1124
+ export interface BackgroundFillGradient {
1125
+ /** Type of the background fill, always “gradient” */
1126
+ type: string;
1127
+ /** Top color of the gradient in the RGB24 format */
1128
+ top_color: number;
1129
+ /** Bottom color of the gradient in the RGB24 format */
1130
+ bottom_color: number;
1131
+ /** Clockwise rotation angle of the background fill in degrees; 0-359 */
1132
+ rotation_angle: number;
1133
+ }
1134
+ export interface BackgroundFillFreeformGradient {
1135
+ /** Type of the background fill, always “freeform_gradient” */
1136
+ type: string;
1137
+ /** A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format */
1138
+ colors: number[];
1139
+ }
1140
+ export type BackgroundType = BackgroundTypeFill | BackgroundTypeWallpaper | BackgroundTypePattern | BackgroundTypeChatTheme;
1141
+ export interface BackgroundTypeFill {
1142
+ /** Type of the background, always “fill” */
1143
+ type: string;
1144
+ /** The background fill */
1145
+ fill: BackgroundFill;
1146
+ /** Dimming of the background in dark themes, as a percentage; 0-100 */
1147
+ dark_theme_dimming: number;
1148
+ }
1149
+ export interface BackgroundTypeWallpaper {
1150
+ /** Type of the background, always “wallpaper” */
1151
+ type: string;
1152
+ /** Document with the wallpaper */
1153
+ document: Document;
1154
+ /** Dimming of the background in dark themes, as a percentage; 0-100 */
1155
+ dark_theme_dimming: number;
1156
+ /** True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 */
1157
+ is_blurred?: boolean;
1158
+ /** True, if the background moves slightly when the device is tilted */
1159
+ is_moving?: boolean;
1160
+ }
1161
+ export interface BackgroundTypePattern {
1162
+ /** Type of the background, always “pattern” */
1163
+ type: string;
1164
+ /** Document with the pattern */
1165
+ document: Document;
1166
+ /** The background fill that is combined with the pattern */
1167
+ fill: BackgroundFill;
1168
+ /** Intensity of the pattern when it is shown above the filled background; 0-100 */
1169
+ intensity: number;
1170
+ /**
1171
+ * True, if the background fill must be applied only to the pattern itself
1172
+ * All other pixels are black in this case
1173
+ * For dark themes only
1174
+ */
1175
+ is_inverted?: boolean;
1176
+ /** True, if the background moves slightly when the device is tilted */
1177
+ is_moving?: boolean;
1178
+ }
1179
+ export interface BackgroundTypeChatTheme {
1180
+ /** Type of the background, always “chat_theme” */
1181
+ type: string;
1182
+ /** Name of the chat theme, which is usually an emoji */
1183
+ theme_name: string;
1184
+ }
1185
+ export interface ChatBackground {
1186
+ /** Type of the background */
1187
+ type: BackgroundType;
1188
+ }
1189
+ export interface ForumTopicCreated {
1190
+ /** Name of the topic */
1191
+ name: string;
1192
+ /** Color of the topic icon in RGB format */
1193
+ icon_color: number;
1194
+ /** Unique identifier of the custom emoji shown as the topic icon */
1195
+ icon_custom_emoji_id?: string;
1196
+ }
1197
+ export type ForumTopicClosed = never;
1198
+ export interface ForumTopicEdited {
1199
+ /** New name of the topic, if it was edited */
1200
+ name?: string;
1201
+ /** New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed */
1202
+ icon_custom_emoji_id?: string;
1203
+ }
1204
+ export type ForumTopicReopened = never;
1205
+ export type GeneralForumTopicHidden = never;
1206
+ export type GeneralForumTopicUnhidden = never;
1207
+ export interface SharedUser {
1208
+ /**
1209
+ * Identifier of the shared user
1210
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
1211
+ * But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers
1212
+ * 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
1213
+ */
1214
+ user_id: number;
1215
+ /** First name of the user, if the name was requested by the bot */
1216
+ first_name?: string;
1217
+ /** Last name of the user, if the name was requested by the bot */
1218
+ last_name?: string;
1219
+ /** Username of the user, if the username was requested by the bot */
1220
+ username?: string;
1221
+ /** Available sizes of the chat photo, if the photo was requested by the bot */
1222
+ photo?: PhotoSize[];
1223
+ }
1224
+ export interface UsersShared {
1225
+ /** Identifier of the request */
1226
+ request_id: number;
1227
+ /** Information about users shared with the bot */
1228
+ users: SharedUser[];
1229
+ }
1230
+ export interface ChatShared {
1231
+ /** Identifier of the request */
1232
+ request_id: number;
1233
+ /**
1234
+ * Identifier of the shared chat
1235
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
1236
+ * But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier
1237
+ * 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
1238
+ */
1239
+ chat_id: number;
1240
+ /** Title of the chat, if the title was requested by the bot */
1241
+ title?: string;
1242
+ /** Username of the chat, if the username was requested by the bot and available */
1243
+ username?: string;
1244
+ /** Available sizes of the chat photo, if the photo was requested by the bot */
1245
+ photo?: PhotoSize[];
1246
+ }
1247
+ export interface WriteAccessAllowed {
1248
+ /** True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess */
1249
+ from_request?: boolean;
1250
+ /** Name of the Web App, if the access was granted when the Web App was launched from a link */
1251
+ web_app_name?: string;
1252
+ /** True, if the access was granted when the bot was added to the attachment or side menu */
1253
+ from_attachment_menu?: boolean;
1254
+ }
1255
+ export interface VideoChatScheduled {
1256
+ /** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */
1257
+ start_date: number;
1258
+ }
1259
+ export type VideoChatStarted = never;
1260
+ export interface VideoChatEnded {
1261
+ /** Video chat duration in seconds */
1262
+ duration: number;
1263
+ }
1264
+ export interface VideoChatParticipantsInvited {
1265
+ /** New members that were invited to the video chat */
1266
+ users: User[];
1267
+ }
1268
+ export interface GiveawayCreated {
1269
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1270
+ prize_star_count?: number;
1271
+ }
1272
+ export interface Giveaway {
1273
+ /** The list of chats which the user must join to participate in the giveaway */
1274
+ chats: Chat[];
1275
+ /** Point in time (Unix timestamp) when winners of the giveaway will be selected */
1276
+ winners_selection_date: number;
1277
+ /** The number of users which are supposed to be selected as winners of the giveaway */
1278
+ winner_count: number;
1279
+ /** True, if only users who join the chats after the giveaway started should be eligible to win */
1280
+ only_new_members?: boolean;
1281
+ /** True, if the list of giveaway winners will be visible to everyone */
1282
+ has_public_winners?: boolean;
1283
+ /** Description of additional giveaway prize */
1284
+ prize_description?: string;
1285
+ /**
1286
+ * A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come
1287
+ * If empty, then all users can participate in the giveaway
1288
+ * Users with a phone number that was bought on Fragment can always participate in giveaways
1289
+ */
1290
+ country_codes?: string[];
1291
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
1292
+ prize_star_count?: number;
1293
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1294
+ premium_subscription_month_count?: number;
1295
+ }
1296
+ export interface GiveawayWinners {
1297
+ /** The chat that created the giveaway */
1298
+ chat: Chat;
1299
+ /** Identifier of the message with the giveaway in the chat */
1300
+ giveaway_message_id: number;
1301
+ /** Point in time (Unix timestamp) when winners of the giveaway were selected */
1302
+ winners_selection_date: number;
1303
+ /** Total number of winners in the giveaway */
1304
+ winner_count: number;
1305
+ /** List of up to 100 winners of the giveaway */
1306
+ winners: User[];
1307
+ /** The number of other chats the user had to join in order to be eligible for the giveaway */
1308
+ additional_chat_count?: number;
1309
+ /** The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only */
1310
+ prize_star_count?: number;
1311
+ /** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
1312
+ premium_subscription_month_count?: number;
1313
+ /** Number of undistributed prizes */
1314
+ unclaimed_prize_count?: number;
1315
+ /** True, if only users who had joined the chats after the giveaway started were eligible to win */
1316
+ only_new_members?: boolean;
1317
+ /** True, if the giveaway was canceled because the payment for it was refunded */
1318
+ was_refunded?: boolean;
1319
+ /** Description of additional giveaway prize */
1320
+ prize_description?: string;
1321
+ }
1322
+ export interface GiveawayCompleted {
1323
+ /** Number of winners in the giveaway */
1324
+ winner_count: number;
1325
+ /** Number of undistributed prizes */
1326
+ unclaimed_prize_count?: number;
1327
+ /** Message with the giveaway that was completed, if it wasn't deleted */
1328
+ giveaway_message?: Message;
1329
+ /**
1330
+ * True, if the giveaway is a Telegram Star giveaway
1331
+ * Otherwise, currently, the giveaway is a Telegram Premium giveaway
1332
+ */
1333
+ is_star_giveaway?: boolean;
1334
+ }
1335
+ export interface LinkPreviewOptions {
1336
+ /** True, if the link preview is disabled */
1337
+ is_disabled?: boolean;
1338
+ /**
1339
+ * URL to use for the link preview
1340
+ * If empty, then the first URL found in the message text will be used
1341
+ */
1342
+ url?: string;
1343
+ /** 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 */
1344
+ prefer_small_media?: boolean;
1345
+ /** 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 */
1346
+ prefer_large_media?: boolean;
1347
+ /** True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text */
1348
+ show_above_text?: boolean;
1349
+ }
1350
+ export interface UserProfilePhotos {
1351
+ /** Total number of profile pictures the target user has */
1352
+ total_count: number;
1353
+ /** Requested profile pictures (in up to 4 sizes each) */
1354
+ photos: PhotoSize[][];
1355
+ }
1356
+ export interface File {
1357
+ /** Identifier for this file, which can be used to download or reuse the file */
1358
+ file_id: string;
1359
+ /**
1360
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
1361
+ * Can't be used to download or reuse the file
1362
+ */
1363
+ file_unique_id: string;
1364
+ /**
1365
+ * File size in bytes
1366
+ * It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it
1367
+ * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value
1368
+ */
1369
+ file_size?: number;
1370
+ /**
1371
+ * File path
1372
+ * Use https://api
1373
+ * telegram
1374
+ * org/file/bot<token>/<file_path> to get the file
1375
+ */
1376
+ file_path?: string;
1377
+ }
1378
+ export interface WebAppInfo {
1379
+ /** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */
1380
+ url: string;
1381
+ }
1382
+ export interface ReplyKeyboardMarkup {
1383
+ /** Array of button rows, each represented by an Array of KeyboardButton objects */
1384
+ keyboard: KeyboardButton[][];
1385
+ /**
1386
+ * Requests clients to always show the keyboard when the regular keyboard is hidden
1387
+ * Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon
1388
+ */
1389
+ is_persistent?: boolean;
1390
+ /**
1391
+ * Requests clients to resize the keyboard vertically for optimal fit (e
1392
+ * g
1393
+ * , make the keyboard smaller if there are just two rows of buttons)
1394
+ * Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard
1395
+ */
1396
+ resize_keyboard?: boolean;
1397
+ /**
1398
+ * Requests clients to hide the keyboard as soon as it's been used
1399
+ * The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again
1400
+ * Defaults to false
1401
+ */
1402
+ one_time_keyboard?: boolean;
1403
+ /** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
1404
+ input_field_placeholder?: string;
1405
+ /**
1406
+ * Use this parameter if you want to show the keyboard to specific users only
1407
+ * Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message
1408
+ * Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language
1409
+ * Other users in the group don't see the keyboard
1410
+ */
1411
+ selective?: boolean;
1412
+ }
1413
+ export interface KeyboardButton {
1414
+ /**
1415
+ * Text of the button
1416
+ * If none of the optional fields are used, it will be sent as a message when the button is pressed
1417
+ */
1418
+ text: string;
1419
+ /**
1420
+ * If specified, pressing the button will open a list of suitable users
1421
+ * Identifiers of selected users will be sent to the bot in a “users_shared” service message
1422
+ * Available in private chats only
1423
+ */
1424
+ request_users?: KeyboardButtonRequestUsers;
1425
+ /**
1426
+ * If specified, pressing the button will open a list of suitable chats
1427
+ * Tapping on a chat will send its identifier to the bot in a “chat_shared” service message
1428
+ * Available in private chats only
1429
+ */
1430
+ request_chat?: KeyboardButtonRequestChat;
1431
+ /**
1432
+ * If True, the user's phone number will be sent as a contact when the button is pressed
1433
+ * Available in private chats only
1434
+ */
1435
+ request_contact?: boolean;
1436
+ /**
1437
+ * If True, the user's current location will be sent when the button is pressed
1438
+ * Available in private chats only
1439
+ */
1440
+ request_location?: boolean;
1441
+ /**
1442
+ * If specified, the user will be asked to create a poll and send it to the bot when the button is pressed
1443
+ * Available in private chats only
1444
+ */
1445
+ request_poll?: KeyboardButtonPollType;
1446
+ /**
1447
+ * If specified, the described Web App will be launched when the button is pressed
1448
+ * The Web App will be able to send a “web_app_data” service message
1449
+ * Available in private chats only
1450
+ */
1451
+ web_app?: WebAppInfo;
1452
+ }
1453
+ export interface KeyboardButtonRequestUsers {
1454
+ /**
1455
+ * Signed 32-bit identifier of the request that will be received back in the UsersShared object
1456
+ * Must be unique within the message
1457
+ */
1458
+ request_id: number;
1459
+ /**
1460
+ * Pass True to request bots, pass False to request regular users
1461
+ * If not specified, no additional restrictions are applied
1462
+ */
1463
+ user_is_bot?: boolean;
1464
+ /**
1465
+ * Pass True to request premium users, pass False to request non-premium users
1466
+ * If not specified, no additional restrictions are applied
1467
+ */
1468
+ user_is_premium?: boolean;
1469
+ /**
1470
+ * The maximum number of users to be selected; 1-10
1471
+ * Defaults to 1
1472
+ */
1473
+ max_quantity?: number;
1474
+ /** Pass True to request the users' first and last names */
1475
+ request_name?: boolean;
1476
+ /** Pass True to request the users' usernames */
1477
+ request_username?: boolean;
1478
+ /** Pass True to request the users' photos */
1479
+ request_photo?: boolean;
1480
+ }
1481
+ export interface KeyboardButtonRequestChat {
1482
+ /**
1483
+ * Signed 32-bit identifier of the request, which will be received back in the ChatShared object
1484
+ * Must be unique within the message
1485
+ */
1486
+ request_id: number;
1487
+ /** Pass True to request a channel chat, pass False to request a group or a supergroup chat */
1488
+ chat_is_channel: boolean;
1489
+ /**
1490
+ * Pass True to request a forum supergroup, pass False to request a non-forum chat
1491
+ * If not specified, no additional restrictions are applied
1492
+ */
1493
+ chat_is_forum?: boolean;
1494
+ /**
1495
+ * Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username
1496
+ * If not specified, no additional restrictions are applied
1497
+ */
1498
+ chat_has_username?: boolean;
1499
+ /**
1500
+ * Pass True to request a chat owned by the user
1501
+ * Otherwise, no additional restrictions are applied
1502
+ */
1503
+ chat_is_created?: boolean;
1504
+ /**
1505
+ * A JSON-serialized object listing the required administrator rights of the user in the chat
1506
+ * The rights must be a superset of bot_administrator_rights
1507
+ * If not specified, no additional restrictions are applied
1508
+ */
1509
+ user_administrator_rights?: ChatAdministratorRights;
1510
+ /**
1511
+ * A JSON-serialized object listing the required administrator rights of the bot in the chat
1512
+ * The rights must be a subset of user_administrator_rights
1513
+ * If not specified, no additional restrictions are applied
1514
+ */
1515
+ bot_administrator_rights?: ChatAdministratorRights;
1516
+ /**
1517
+ * Pass True to request a chat with the bot as a member
1518
+ * Otherwise, no additional restrictions are applied
1519
+ */
1520
+ bot_is_member?: boolean;
1521
+ /** Pass True to request the chat's title */
1522
+ request_title?: boolean;
1523
+ /** Pass True to request the chat's username */
1524
+ request_username?: boolean;
1525
+ /** Pass True to request the chat's photo */
1526
+ request_photo?: boolean;
1527
+ }
1528
+ export interface KeyboardButtonPollType {
1529
+ /**
1530
+ * If quiz is passed, the user will be allowed to create only polls in the quiz mode
1531
+ * If regular is passed, only regular polls will be allowed
1532
+ * Otherwise, the user will be allowed to create a poll of any type
1533
+ */
1534
+ type?: string;
1535
+ }
1536
+ export interface ReplyKeyboardRemove {
1537
+ /** Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) */
1538
+ remove_keyboard: boolean;
1539
+ /**
1540
+ * Use this parameter if you want to remove the keyboard for specific users only
1541
+ * Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message
1542
+ * Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet
1543
+ */
1544
+ selective?: boolean;
1545
+ }
1546
+ export interface InlineKeyboardMarkup {
1547
+ /** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
1548
+ inline_keyboard: InlineKeyboardButton[][];
1549
+ }
1550
+ export interface InlineKeyboardButton {
1551
+ /** Label text on the button */
1552
+ text: string;
1553
+ /**
1554
+ * HTTP or tg:// URL to be opened when the button is pressed
1555
+ * Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings
1556
+ */
1557
+ url?: string;
1558
+ /** Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes */
1559
+ callback_data?: string;
1560
+ /**
1561
+ * Description of the Web App that will be launched when the user presses the button
1562
+ * The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery
1563
+ * Available only in private chats between a user and the bot
1564
+ * Not supported for messages sent on behalf of a Telegram Business account
1565
+ */
1566
+ web_app?: WebAppInfo;
1567
+ /**
1568
+ * An HTTPS URL used to automatically authorize the user
1569
+ * Can be used as a replacement for the Telegram Login Widget
1570
+ */
1571
+ login_url?: LoginUrl;
1572
+ /**
1573
+ * If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field
1574
+ * May be empty, in which case just the bot's username will be inserted
1575
+ * Not supported for messages sent on behalf of a Telegram Business account
1576
+ */
1577
+ switch_inline_query?: string;
1578
+ /**
1579
+ * If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field
1580
+ * May be empty, in which case only the bot's username will be inserted
1581
+ * This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options
1582
+ * Not supported in channels and for messages sent on behalf of a Telegram Business account
1583
+ */
1584
+ switch_inline_query_current_chat?: string;
1585
+ /**
1586
+ * If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field
1587
+ * Not supported for messages sent on behalf of a Telegram Business account
1588
+ */
1589
+ switch_inline_query_chosen_chat?: SwitchInlineQueryChosenChat;
1590
+ /** Description of the button that copies the specified text to the clipboard */
1591
+ copy_text?: CopyTextButton;
1592
+ /**
1593
+ * Description of the game that will be launched when the user presses the button
1594
+ * NOTE: This type of button must always be the first button in the first row
1595
+ */
1596
+ callback_game?: CallbackGame;
1597
+ /**
1598
+ * Specify True, to send a Pay button
1599
+ * Substrings “” and “XTR” in the buttons's text will be replaced with a Telegram Star icon
1600
+ * NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages
1601
+ */
1602
+ pay?: boolean;
1603
+ }
1604
+ export interface LoginUrl {
1605
+ /**
1606
+ * An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed
1607
+ * If the user refuses to provide authorization data, the original URL without information about the user will be opened
1608
+ * The data added is the same as described in Receiving authorization data
1609
+ * NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization
1610
+ */
1611
+ url: string;
1612
+ /** New text of the button in forwarded messages */
1613
+ forward_text?: string;
1614
+ /**
1615
+ * Username of a bot, which will be used for user authorization
1616
+ * See Setting up a bot for more details
1617
+ * If not specified, the current bot's username will be assumed
1618
+ * The url's domain must be the same as the domain linked with the bot
1619
+ * See Linking your domain to the bot for more details
1620
+ */
1621
+ bot_username?: string;
1622
+ /** Pass True to request the permission for your bot to send messages to the user */
1623
+ request_write_access?: boolean;
1624
+ }
1625
+ export interface SwitchInlineQueryChosenChat {
1626
+ /**
1627
+ * The default inline query to be inserted in the input field
1628
+ * If left empty, only the bot's username will be inserted
1629
+ */
1630
+ query?: string;
1631
+ /** True, if private chats with users can be chosen */
1632
+ allow_user_chats?: boolean;
1633
+ /** True, if private chats with bots can be chosen */
1634
+ allow_bot_chats?: boolean;
1635
+ /** True, if group and supergroup chats can be chosen */
1636
+ allow_group_chats?: boolean;
1637
+ /** True, if channel chats can be chosen */
1638
+ allow_channel_chats?: boolean;
1639
+ }
1640
+ export interface CopyTextButton {
1641
+ /** The text to be copied to the clipboard; 1-256 characters */
1642
+ text: string;
1643
+ }
1644
+ export interface CallbackQuery {
1645
+ /** Unique identifier for this query */
1646
+ id: string;
1647
+ /** Sender */
1648
+ from: User;
1649
+ /** Message sent by the bot with the callback button that originated the query */
1650
+ message?: MaybeInaccessibleMessage;
1651
+ /** Identifier of the message sent via the bot in inline mode, that originated the query */
1652
+ inline_message_id?: string;
1653
+ /**
1654
+ * Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent
1655
+ * Useful for high scores in games
1656
+ */
1657
+ chat_instance: string;
1658
+ /**
1659
+ * Data associated with the callback button
1660
+ * Be aware that the message originated the query can contain no callback buttons with this data
1661
+ */
1662
+ data?: string;
1663
+ /** Short name of a Game to be returned, serves as the unique identifier for the game */
1664
+ game_short_name?: string;
1665
+ }
1666
+ export interface ForceReply {
1667
+ /** Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' */
1668
+ force_reply: boolean;
1669
+ /** The placeholder to be shown in the input field when the reply is active; 1-64 characters */
1670
+ input_field_placeholder?: string;
1671
+ /**
1672
+ * Use this parameter if you want to force reply from specific users only
1673
+ * Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message
1674
+ */
1675
+ selective?: boolean;
1676
+ }
1677
+ export interface ChatPhoto {
1678
+ /**
1679
+ * File identifier of small (160x160) chat photo
1680
+ * This file_id can be used only for photo download and only for as long as the photo is not changed
1681
+ */
1682
+ small_file_id: string;
1683
+ /**
1684
+ * Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots
1685
+ * Can't be used to download or reuse the file
1686
+ */
1687
+ small_file_unique_id: string;
1688
+ /**
1689
+ * File identifier of big (640x640) chat photo
1690
+ * This file_id can be used only for photo download and only for as long as the photo is not changed
1691
+ */
1692
+ big_file_id: string;
1693
+ /**
1694
+ * Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots
1695
+ * Can't be used to download or reuse the file
1696
+ */
1697
+ big_file_unique_id: string;
1698
+ }
1699
+ export interface ChatInviteLink {
1700
+ /**
1701
+ * The invite link
1702
+ * If the link was created by another chat administrator, then the second part of the link will be replaced with “…”
1703
+ */
1704
+ invite_link: string;
1705
+ /** Creator of the link */
1706
+ creator: User;
1707
+ /** True, if users joining the chat via the link need to be approved by chat administrators */
1708
+ creates_join_request: boolean;
1709
+ /** True, if the link is primary */
1710
+ is_primary: boolean;
1711
+ /** True, if the link is revoked */
1712
+ is_revoked: boolean;
1713
+ /** Invite link name */
1714
+ name?: string;
1715
+ /** Point in time (Unix timestamp) when the link will expire or has been expired */
1716
+ expire_date?: number;
1717
+ /** The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
1718
+ member_limit?: number;
1719
+ /** Number of pending join requests created using this link */
1720
+ pending_join_request_count?: number;
1721
+ /** The number of seconds the subscription will be active for before the next payment */
1722
+ subscription_period?: number;
1723
+ /** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link */
1724
+ subscription_price?: number;
1725
+ }
1726
+ export interface ChatAdministratorRights {
1727
+ /** True, if the user's presence in the chat is hidden */
1728
+ is_anonymous: boolean;
1729
+ /**
1730
+ * True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode
1731
+ * Implied by any other administrator privilege
1732
+ */
1733
+ can_manage_chat: boolean;
1734
+ /** True, if the administrator can delete messages of other users */
1735
+ can_delete_messages: boolean;
1736
+ /** True, if the administrator can manage video chats */
1737
+ can_manage_video_chats: boolean;
1738
+ /** True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics */
1739
+ can_restrict_members: boolean;
1740
+ /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
1741
+ can_promote_members: boolean;
1742
+ /** True, if the user is allowed to change the chat title, photo and other settings */
1743
+ can_change_info: boolean;
1744
+ /** True, if the user is allowed to invite new users to the chat */
1745
+ can_invite_users: boolean;
1746
+ /** True, if the administrator can post stories to the chat */
1747
+ can_post_stories: boolean;
1748
+ /** True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
1749
+ can_edit_stories: boolean;
1750
+ /** True, if the administrator can delete stories posted by other users */
1751
+ can_delete_stories: boolean;
1752
+ /** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
1753
+ can_post_messages?: boolean;
1754
+ /** True, if the administrator can edit messages of other users and can pin messages; for channels only */
1755
+ can_edit_messages?: boolean;
1756
+ /** True, if the user is allowed to pin messages; for groups and supergroups only */
1757
+ can_pin_messages?: boolean;
1758
+ /** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
1759
+ can_manage_topics?: boolean;
1760
+ }
1761
+ export interface ChatMemberUpdated {
1762
+ /** Chat the user belongs to */
1763
+ chat: Chat;
1764
+ /** Performer of the action, which resulted in the change */
1765
+ from: User;
1766
+ /** Date the change was done in Unix time */
1767
+ date: number;
1768
+ /** Previous information about the chat member */
1769
+ old_chat_member: ChatMember;
1770
+ /** New information about the chat member */
1771
+ new_chat_member: ChatMember;
1772
+ /** Chat invite link, which was used by the user to join the chat; for joining by invite link events only */
1773
+ invite_link?: ChatInviteLink;
1774
+ /** True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator */
1775
+ via_join_request?: boolean;
1776
+ /** True, if the user joined the chat via a chat folder invite link */
1777
+ via_chat_folder_invite_link?: boolean;
1778
+ }
1779
+ export type ChatMember = ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned;
1780
+ export interface ChatMemberOwner {
1781
+ /** The member's status in the chat, always “creator” */
1782
+ status: string;
1783
+ /** Information about the user */
1784
+ user: User;
1785
+ /** True, if the user's presence in the chat is hidden */
1786
+ is_anonymous: boolean;
1787
+ /** Custom title for this user */
1788
+ custom_title?: string;
1789
+ }
1790
+ export interface ChatMemberAdministrator {
1791
+ /** The member's status in the chat, always “administrator” */
1792
+ status: string;
1793
+ /** Information about the user */
1794
+ user: User;
1795
+ /** True, if the bot is allowed to edit administrator privileges of that user */
1796
+ can_be_edited: boolean;
1797
+ /** True, if the user's presence in the chat is hidden */
1798
+ is_anonymous: boolean;
1799
+ /**
1800
+ * True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode
1801
+ * Implied by any other administrator privilege
1802
+ */
1803
+ can_manage_chat: boolean;
1804
+ /** True, if the administrator can delete messages of other users */
1805
+ can_delete_messages: boolean;
1806
+ /** True, if the administrator can manage video chats */
1807
+ can_manage_video_chats: boolean;
1808
+ /** True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics */
1809
+ can_restrict_members: boolean;
1810
+ /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
1811
+ can_promote_members: boolean;
1812
+ /** True, if the user is allowed to change the chat title, photo and other settings */
1813
+ can_change_info: boolean;
1814
+ /** True, if the user is allowed to invite new users to the chat */
1815
+ can_invite_users: boolean;
1816
+ /** True, if the administrator can post stories to the chat */
1817
+ can_post_stories: boolean;
1818
+ /** True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
1819
+ can_edit_stories: boolean;
1820
+ /** True, if the administrator can delete stories posted by other users */
1821
+ can_delete_stories: boolean;
1822
+ /** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
1823
+ can_post_messages?: boolean;
1824
+ /** True, if the administrator can edit messages of other users and can pin messages; for channels only */
1825
+ can_edit_messages?: boolean;
1826
+ /** True, if the user is allowed to pin messages; for groups and supergroups only */
1827
+ can_pin_messages?: boolean;
1828
+ /** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
1829
+ can_manage_topics?: boolean;
1830
+ /** Custom title for this user */
1831
+ custom_title?: string;
1832
+ }
1833
+ export interface ChatMemberMember {
1834
+ /** The member's status in the chat, always “member” */
1835
+ status: string;
1836
+ /** Information about the user */
1837
+ user: User;
1838
+ /** Date when the user's subscription will expire; Unix time */
1839
+ until_date?: number;
1840
+ }
1841
+ export interface ChatMemberRestricted {
1842
+ /** The member's status in the chat, always “restricted” */
1843
+ status: string;
1844
+ /** Information about the user */
1845
+ user: User;
1846
+ /** True, if the user is a member of the chat at the moment of the request */
1847
+ is_member: boolean;
1848
+ /** True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues */
1849
+ can_send_messages: boolean;
1850
+ /** True, if the user is allowed to send audios */
1851
+ can_send_audios: boolean;
1852
+ /** True, if the user is allowed to send documents */
1853
+ can_send_documents: boolean;
1854
+ /** True, if the user is allowed to send photos */
1855
+ can_send_photos: boolean;
1856
+ /** True, if the user is allowed to send videos */
1857
+ can_send_videos: boolean;
1858
+ /** True, if the user is allowed to send video notes */
1859
+ can_send_video_notes: boolean;
1860
+ /** True, if the user is allowed to send voice notes */
1861
+ can_send_voice_notes: boolean;
1862
+ /** True, if the user is allowed to send polls */
1863
+ can_send_polls: boolean;
1864
+ /** True, if the user is allowed to send animations, games, stickers and use inline bots */
1865
+ can_send_other_messages: boolean;
1866
+ /** True, if the user is allowed to add web page previews to their messages */
1867
+ can_add_web_page_previews: boolean;
1868
+ /** True, if the user is allowed to change the chat title, photo and other settings */
1869
+ can_change_info: boolean;
1870
+ /** True, if the user is allowed to invite new users to the chat */
1871
+ can_invite_users: boolean;
1872
+ /** True, if the user is allowed to pin messages */
1873
+ can_pin_messages: boolean;
1874
+ /** True, if the user is allowed to create forum topics */
1875
+ can_manage_topics: boolean;
1876
+ /**
1877
+ * Date when restrictions will be lifted for this user; Unix time
1878
+ * If 0, then the user is restricted forever
1879
+ */
1880
+ until_date: number;
1881
+ }
1882
+ export interface ChatMemberLeft {
1883
+ /** The member's status in the chat, always “left” */
1884
+ status: string;
1885
+ /** Information about the user */
1886
+ user: User;
1887
+ }
1888
+ export interface ChatMemberBanned {
1889
+ /** The member's status in the chat, always “kicked” */
1890
+ status: string;
1891
+ /** Information about the user */
1892
+ user: User;
1893
+ /**
1894
+ * Date when restrictions will be lifted for this user; Unix time
1895
+ * If 0, then the user is banned forever
1896
+ */
1897
+ until_date: number;
1898
+ }
1899
+ export interface ChatJoinRequest {
1900
+ /** Chat to which the request was sent */
1901
+ chat: Chat;
1902
+ /** User that sent the join request */
1903
+ from: User;
1904
+ /**
1905
+ * Identifier of a private chat with the user who sent the join request
1906
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
1907
+ * But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier
1908
+ * The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user
1909
+ */
1910
+ user_chat_id: number;
1911
+ /** Date the request was sent in Unix time */
1912
+ date: number;
1913
+ /** Bio of the user */
1914
+ bio?: string;
1915
+ /** Chat invite link that was used by the user to send the join request */
1916
+ invite_link?: ChatInviteLink;
1917
+ }
1918
+ export interface ChatPermissions {
1919
+ /** True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues */
1920
+ can_send_messages?: boolean;
1921
+ /** True, if the user is allowed to send audios */
1922
+ can_send_audios?: boolean;
1923
+ /** True, if the user is allowed to send documents */
1924
+ can_send_documents?: boolean;
1925
+ /** True, if the user is allowed to send photos */
1926
+ can_send_photos?: boolean;
1927
+ /** True, if the user is allowed to send videos */
1928
+ can_send_videos?: boolean;
1929
+ /** True, if the user is allowed to send video notes */
1930
+ can_send_video_notes?: boolean;
1931
+ /** True, if the user is allowed to send voice notes */
1932
+ can_send_voice_notes?: boolean;
1933
+ /** True, if the user is allowed to send polls */
1934
+ can_send_polls?: boolean;
1935
+ /** True, if the user is allowed to send animations, games, stickers and use inline bots */
1936
+ can_send_other_messages?: boolean;
1937
+ /** True, if the user is allowed to add web page previews to their messages */
1938
+ can_add_web_page_previews?: boolean;
1939
+ /**
1940
+ * True, if the user is allowed to change the chat title, photo and other settings
1941
+ * Ignored in public supergroups
1942
+ */
1943
+ can_change_info?: boolean;
1944
+ /** True, if the user is allowed to invite new users to the chat */
1945
+ can_invite_users?: boolean;
1946
+ /**
1947
+ * True, if the user is allowed to pin messages
1948
+ * Ignored in public supergroups
1949
+ */
1950
+ can_pin_messages?: boolean;
1951
+ /**
1952
+ * True, if the user is allowed to create forum topics
1953
+ * If omitted defaults to the value of can_pin_messages
1954
+ */
1955
+ can_manage_topics?: boolean;
1956
+ }
1957
+ export interface Birthdate {
1958
+ /** Day of the user's birth; 1-31 */
1959
+ day: number;
1960
+ /** Month of the user's birth; 1-12 */
1961
+ month: number;
1962
+ /** Year of the user's birth */
1963
+ year?: number;
1964
+ }
1965
+ export interface BusinessIntro {
1966
+ /** Title text of the business intro */
1967
+ title?: string;
1968
+ /** Message text of the business intro */
1969
+ message?: string;
1970
+ /** Sticker of the business intro */
1971
+ sticker?: Sticker;
1972
+ }
1973
+ export interface BusinessLocation {
1974
+ /** Address of the business */
1975
+ address: string;
1976
+ /** Location of the business */
1977
+ location?: Location;
1978
+ }
1979
+ export interface BusinessOpeningHoursInterval {
1980
+ /** The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60 */
1981
+ opening_minute: number;
1982
+ /** The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60 */
1983
+ closing_minute: number;
1984
+ }
1985
+ export interface BusinessOpeningHours {
1986
+ /** Unique name of the time zone for which the opening hours are defined */
1987
+ time_zone_name: string;
1988
+ /** List of time intervals describing business opening hours */
1989
+ opening_hours: BusinessOpeningHoursInterval[];
1990
+ }
1991
+ export interface ChatLocation {
1992
+ /**
1993
+ * The location to which the supergroup is connected
1994
+ * Can't be a live location
1995
+ */
1996
+ location: Location;
1997
+ /** Location address; 1-64 characters, as defined by the chat owner */
1998
+ address: string;
1999
+ }
2000
+ export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid;
2001
+ export interface ReactionTypeEmoji {
2002
+ /** Type of the reaction, always “emoji” */
2003
+ type: string;
2004
+ /**
2005
+ * Reaction emoji
2006
+ * Currently, it can be one of "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
2007
+ */
2008
+ emoji: string;
2009
+ }
2010
+ export interface ReactionTypeCustomEmoji {
2011
+ /** Type of the reaction, always “custom_emoji” */
2012
+ type: string;
2013
+ /** Custom emoji identifier */
2014
+ custom_emoji_id: string;
2015
+ }
2016
+ export interface ReactionTypePaid {
2017
+ /** Type of the reaction, always “paid” */
2018
+ type: string;
2019
+ }
2020
+ export interface ReactionCount {
2021
+ /** Type of the reaction */
2022
+ type: ReactionType;
2023
+ /** Number of times the reaction was added */
2024
+ total_count: number;
2025
+ }
2026
+ export interface MessageReactionUpdated {
2027
+ /** The chat containing the message the user reacted to */
2028
+ chat: Chat;
2029
+ /** Unique identifier of the message inside the chat */
2030
+ message_id: number;
2031
+ /** The user that changed the reaction, if the user isn't anonymous */
2032
+ user?: User;
2033
+ /** The chat on behalf of which the reaction was changed, if the user is anonymous */
2034
+ actor_chat?: Chat;
2035
+ /** Date of the change in Unix time */
2036
+ date: number;
2037
+ /** Previous list of reaction types that were set by the user */
2038
+ old_reaction: ReactionType[];
2039
+ /** New list of reaction types that have been set by the user */
2040
+ new_reaction: ReactionType[];
2041
+ }
2042
+ export interface MessageReactionCountUpdated {
2043
+ /** The chat containing the message */
2044
+ chat: Chat;
2045
+ /** Unique message identifier inside the chat */
2046
+ message_id: number;
2047
+ /** Date of the change in Unix time */
2048
+ date: number;
2049
+ /** List of reactions that are present on the message */
2050
+ reactions: ReactionCount[];
2051
+ }
2052
+ export interface ForumTopic {
2053
+ /** Unique identifier of the forum topic */
2054
+ message_thread_id: number;
2055
+ /** Name of the topic */
2056
+ name: string;
2057
+ /** Color of the topic icon in RGB format */
2058
+ icon_color: number;
2059
+ /** Unique identifier of the custom emoji shown as the topic icon */
2060
+ icon_custom_emoji_id?: string;
2061
+ }
2062
+ export interface BotCommand {
2063
+ /**
2064
+ * Text of the command; 1-32 characters
2065
+ * Can contain only lowercase English letters, digits and underscores
2066
+ */
2067
+ command: string;
2068
+ /** Description of the command; 1-256 characters */
2069
+ description: string;
2070
+ }
2071
+ export type BotCommandScope = BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember;
2072
+ export interface BotCommandScopeDefault {
2073
+ /** Scope type, must be default */
2074
+ type: string;
2075
+ }
2076
+ export interface BotCommandScopeAllPrivateChats {
2077
+ /** Scope type, must be all_private_chats */
2078
+ type: string;
2079
+ }
2080
+ export interface BotCommandScopeAllGroupChats {
2081
+ /** Scope type, must be all_group_chats */
2082
+ type: string;
2083
+ }
2084
+ export interface BotCommandScopeAllChatAdministrators {
2085
+ /** Scope type, must be all_chat_administrators */
2086
+ type: string;
2087
+ }
2088
+ export interface BotCommandScopeChat {
2089
+ /** Scope type, must be chat */
2090
+ type: string;
2091
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2092
+ chat_id: number | string;
2093
+ }
2094
+ export interface BotCommandScopeChatAdministrators {
2095
+ /** Scope type, must be chat_administrators */
2096
+ type: string;
2097
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2098
+ chat_id: number | string;
2099
+ }
2100
+ export interface BotCommandScopeChatMember {
2101
+ /** Scope type, must be chat_member */
2102
+ type: string;
2103
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2104
+ chat_id: number | string;
2105
+ /** Unique identifier of the target user */
2106
+ user_id: number;
2107
+ }
2108
+ export interface BotName {
2109
+ /** The bot's name */
2110
+ name: string;
2111
+ }
2112
+ export interface BotDescription {
2113
+ /** The bot's description */
2114
+ description: string;
2115
+ }
2116
+ export interface BotShortDescription {
2117
+ /** The bot's short description */
2118
+ short_description: string;
2119
+ }
2120
+ export type MenuButton = MenuButtonCommands | MenuButtonWebApp | MenuButtonDefault;
2121
+ export interface MenuButtonCommands {
2122
+ /** Type of the button, must be commands */
2123
+ type: string;
2124
+ }
2125
+ export interface MenuButtonWebApp {
2126
+ /** Type of the button, must be web_app */
2127
+ type: string;
2128
+ /** Text on the button */
2129
+ text: string;
2130
+ /**
2131
+ * Description of the Web App that will be launched when the user presses the button
2132
+ * The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery
2133
+ * Alternatively, a t
2134
+ * me link to a Web App of the bot can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link
2135
+ */
2136
+ web_app: WebAppInfo;
2137
+ }
2138
+ export interface MenuButtonDefault {
2139
+ /** Type of the button, must be default */
2140
+ type: string;
2141
+ }
2142
+ export type ChatBoostSource = ChatBoostSourcePremium | ChatBoostSourceGiftCode | ChatBoostSourceGiveaway;
2143
+ export interface ChatBoostSourcePremium {
2144
+ /** Source of the boost, always “premium” */
2145
+ source: string;
2146
+ /** User that boosted the chat */
2147
+ user: User;
2148
+ }
2149
+ export interface ChatBoostSourceGiftCode {
2150
+ /** Source of the boost, always “gift_code” */
2151
+ source: string;
2152
+ /** User for which the gift code was created */
2153
+ user: User;
2154
+ }
2155
+ export interface ChatBoostSourceGiveaway {
2156
+ /** Source of the boost, always “giveaway” */
2157
+ source: string;
2158
+ /**
2159
+ * Identifier of a message in the chat with the giveaway; the message could have been deleted already
2160
+ * May be 0 if the message isn't sent yet
2161
+ */
2162
+ giveaway_message_id: number;
2163
+ /** User that won the prize in the giveaway if any; for Telegram Premium giveaways only */
2164
+ user?: User;
2165
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
2166
+ prize_star_count?: number;
2167
+ /** True, if the giveaway was completed, but there was no user to win the prize */
2168
+ is_unclaimed?: boolean;
2169
+ }
2170
+ export interface ChatBoost {
2171
+ /** Unique identifier of the boost */
2172
+ boost_id: string;
2173
+ /** Point in time (Unix timestamp) when the chat was boosted */
2174
+ add_date: number;
2175
+ /** Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged */
2176
+ expiration_date: number;
2177
+ /** Source of the added boost */
2178
+ source: ChatBoostSource;
2179
+ }
2180
+ export interface ChatBoostUpdated {
2181
+ /** Chat which was boosted */
2182
+ chat: Chat;
2183
+ /** Information about the chat boost */
2184
+ boost: ChatBoost;
2185
+ }
2186
+ export interface ChatBoostRemoved {
2187
+ /** Chat which was boosted */
2188
+ chat: Chat;
2189
+ /** Unique identifier of the boost */
2190
+ boost_id: string;
2191
+ /** Point in time (Unix timestamp) when the boost was removed */
2192
+ remove_date: number;
2193
+ /** Source of the removed boost */
2194
+ source: ChatBoostSource;
2195
+ }
2196
+ export interface UserChatBoosts {
2197
+ /** The list of boosts added to the chat by the user */
2198
+ boosts: ChatBoost[];
2199
+ }
2200
+ export interface BusinessConnection {
2201
+ /** Unique identifier of the business connection */
2202
+ id: string;
2203
+ /** Business account user that created the business connection */
2204
+ user: User;
2205
+ /**
2206
+ * Identifier of a private chat with the user who created the business connection
2207
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
2208
+ * But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier
2209
+ */
2210
+ user_chat_id: number;
2211
+ /** Date the connection was established in Unix time */
2212
+ date: number;
2213
+ /** True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours */
2214
+ can_reply: boolean;
2215
+ /** True, if the connection is active */
2216
+ is_enabled: boolean;
2217
+ }
2218
+ export interface BusinessMessagesDeleted {
2219
+ /** Unique identifier of the business connection */
2220
+ business_connection_id: string;
2221
+ /**
2222
+ * Information about a chat in the business account
2223
+ * The bot may not have access to the chat or the corresponding user
2224
+ */
2225
+ chat: Chat;
2226
+ /** The list of identifiers of deleted messages in the chat of the business account */
2227
+ message_ids: number[];
2228
+ }
2229
+ export interface ResponseParameters {
2230
+ /**
2231
+ * The group has been migrated to a supergroup with the specified identifier
2232
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it
2233
+ * 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
2234
+ */
2235
+ migrate_to_chat_id?: number;
2236
+ /** In case of exceeding flood control, the number of seconds left to wait before the request can be repeated */
2237
+ retry_after?: number;
2238
+ }
2239
+ export type InputMedia = InputMediaAnimation | InputMediaDocument | InputMediaAudio | InputMediaPhoto | InputMediaVideo;
2240
+ export interface InputMediaPhoto {
2241
+ /** Type of the result, must be photo */
2242
+ type: string;
2243
+ /**
2244
+ * File to send
2245
+ * Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name
2246
+ * More information on Sending Files »
2247
+ */
2248
+ media: string;
2249
+ /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
2250
+ caption?: string;
2251
+ /**
2252
+ * Mode for parsing entities in the photo caption
2253
+ * See formatting options for more details
2254
+ */
2255
+ parse_mode?: string;
2256
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2257
+ caption_entities?: MessageEntity[];
2258
+ /** Pass True, if the caption must be shown above the message media */
2259
+ show_caption_above_media?: boolean;
2260
+ /** Pass True if the photo needs to be covered with a spoiler animation */
2261
+ has_spoiler?: boolean;
2262
+ }
2263
+ export interface InputMediaVideo {
2264
+ /** Type of the result, must be video */
2265
+ type: string;
2266
+ /**
2267
+ * File to send
2268
+ * Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name
2269
+ * More information on Sending Files »
2270
+ */
2271
+ media: string;
2272
+ /**
2273
+ * Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side
2274
+ * The thumbnail should be in JPEG format and less than 200 kB in size
2275
+ * A thumbnail's width and height should not exceed 320
2276
+ * Ignored if the file is not uploaded using multipart/form-data
2277
+ * Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
2278
+ * More information on Sending Files »
2279
+ */
2280
+ thumbnail?: InputFile | string;
2281
+ /** Caption of the video to be sent, 0-1024 characters after entities parsing */
2282
+ caption?: string;
2283
+ /**
2284
+ * Mode for parsing entities in the video caption
2285
+ * See formatting options for more details
2286
+ */
2287
+ parse_mode?: string;
2288
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2289
+ caption_entities?: MessageEntity[];
2290
+ /** Pass True, if the caption must be shown above the message media */
2291
+ show_caption_above_media?: boolean;
2292
+ /** Video width */
2293
+ width?: number;
2294
+ /** Video height */
2295
+ height?: number;
2296
+ /** Video duration in seconds */
2297
+ duration?: number;
2298
+ /** Pass True if the uploaded video is suitable for streaming */
2299
+ supports_streaming?: boolean;
2300
+ /** Pass True if the video needs to be covered with a spoiler animation */
2301
+ has_spoiler?: boolean;
2302
+ }
2303
+ export interface InputMediaAnimation {
2304
+ /** Type of the result, must be animation */
2305
+ type: string;
2306
+ /**
2307
+ * File to send
2308
+ * Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name
2309
+ * More information on Sending Files »
2310
+ */
2311
+ media: string;
2312
+ /**
2313
+ * Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side
2314
+ * The thumbnail should be in JPEG format and less than 200 kB in size
2315
+ * A thumbnail's width and height should not exceed 320
2316
+ * Ignored if the file is not uploaded using multipart/form-data
2317
+ * Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
2318
+ * More information on Sending Files »
2319
+ */
2320
+ thumbnail?: InputFile | string;
2321
+ /** Caption of the animation to be sent, 0-1024 characters after entities parsing */
2322
+ caption?: string;
2323
+ /**
2324
+ * Mode for parsing entities in the animation caption
2325
+ * See formatting options for more details
2326
+ */
2327
+ parse_mode?: string;
2328
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2329
+ caption_entities?: MessageEntity[];
2330
+ /** Pass True, if the caption must be shown above the message media */
2331
+ show_caption_above_media?: boolean;
2332
+ /** Animation width */
2333
+ width?: number;
2334
+ /** Animation height */
2335
+ height?: number;
2336
+ /** Animation duration in seconds */
2337
+ duration?: number;
2338
+ /** Pass True if the animation needs to be covered with a spoiler animation */
2339
+ has_spoiler?: boolean;
2340
+ }
2341
+ export interface InputMediaAudio {
2342
+ /** Type of the result, must be audio */
2343
+ type: string;
2344
+ /**
2345
+ * File to send
2346
+ * Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name
2347
+ * More information on Sending Files »
2348
+ */
2349
+ media: string;
2350
+ /**
2351
+ * Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side
2352
+ * The thumbnail should be in JPEG format and less than 200 kB in size
2353
+ * A thumbnail's width and height should not exceed 320
2354
+ * Ignored if the file is not uploaded using multipart/form-data
2355
+ * Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
2356
+ * More information on Sending Files »
2357
+ */
2358
+ thumbnail?: InputFile | string;
2359
+ /** Caption of the audio to be sent, 0-1024 characters after entities parsing */
2360
+ caption?: string;
2361
+ /**
2362
+ * Mode for parsing entities in the audio caption
2363
+ * See formatting options for more details
2364
+ */
2365
+ parse_mode?: string;
2366
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2367
+ caption_entities?: MessageEntity[];
2368
+ /** Duration of the audio in seconds */
2369
+ duration?: number;
2370
+ /** Performer of the audio */
2371
+ performer?: string;
2372
+ /** Title of the audio */
2373
+ title?: string;
2374
+ }
2375
+ export interface InputMediaDocument {
2376
+ /** Type of the result, must be document */
2377
+ type: string;
2378
+ /**
2379
+ * File to send
2380
+ * Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name
2381
+ * More information on Sending Files »
2382
+ */
2383
+ media: string;
2384
+ /**
2385
+ * Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side
2386
+ * The thumbnail should be in JPEG format and less than 200 kB in size
2387
+ * A thumbnail's width and height should not exceed 320
2388
+ * Ignored if the file is not uploaded using multipart/form-data
2389
+ * Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
2390
+ * More information on Sending Files »
2391
+ */
2392
+ thumbnail?: InputFile | string;
2393
+ /** Caption of the document to be sent, 0-1024 characters after entities parsing */
2394
+ caption?: string;
2395
+ /**
2396
+ * Mode for parsing entities in the document caption
2397
+ * See formatting options for more details
2398
+ */
2399
+ parse_mode?: string;
2400
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2401
+ caption_entities?: MessageEntity[];
2402
+ /**
2403
+ * Disables automatic server-side content type detection for files uploaded using multipart/form-data
2404
+ * Always True, if the document is sent as part of an album
2405
+ */
2406
+ disable_content_type_detection?: boolean;
2407
+ }
2408
+ export type InputFile = {
2409
+ file_content: Uint8Array;
2410
+ file_name: string;
2411
+ };
2412
+ export type InputPaidMedia = InputPaidMediaPhoto | InputPaidMediaVideo;
2413
+ export interface InputPaidMediaPhoto {
2414
+ /** Type of the media, must be photo */
2415
+ type: string;
2416
+ /**
2417
+ * File to send
2418
+ * Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name
2419
+ * More information on Sending Files »
2420
+ */
2421
+ media: string;
2422
+ }
2423
+ export interface InputPaidMediaVideo {
2424
+ /** Type of the media, must be video */
2425
+ type: string;
2426
+ /**
2427
+ * File to send
2428
+ * Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name
2429
+ * More information on Sending Files »
2430
+ */
2431
+ media: string;
2432
+ /**
2433
+ * Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side
2434
+ * The thumbnail should be in JPEG format and less than 200 kB in size
2435
+ * A thumbnail's width and height should not exceed 320
2436
+ * Ignored if the file is not uploaded using multipart/form-data
2437
+ * Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
2438
+ * More information on Sending Files »
2439
+ */
2440
+ thumbnail?: InputFile | string;
2441
+ /** Video width */
2442
+ width?: number;
2443
+ /** Video height */
2444
+ height?: number;
2445
+ /** Video duration in seconds */
2446
+ duration?: number;
2447
+ /** Pass True if the uploaded video is suitable for streaming */
2448
+ supports_streaming?: boolean;
2449
+ }
2450
+ export interface Sticker {
2451
+ /** Identifier for this file, which can be used to download or reuse the file */
2452
+ file_id: string;
2453
+ /**
2454
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
2455
+ * Can't be used to download or reuse the file
2456
+ */
2457
+ file_unique_id: string;
2458
+ /**
2459
+ * Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”
2460
+ * The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video
2461
+ */
2462
+ type: string;
2463
+ /** Sticker width */
2464
+ width: number;
2465
+ /** Sticker height */
2466
+ height: number;
2467
+ /** True, if the sticker is animated */
2468
+ is_animated: boolean;
2469
+ /** True, if the sticker is a video sticker */
2470
+ is_video: boolean;
2471
+ /**
2472
+ * Sticker thumbnail in the
2473
+ * WEBP or
2474
+ * JPG format
2475
+ */
2476
+ thumbnail?: PhotoSize;
2477
+ /** Emoji associated with the sticker */
2478
+ emoji?: string;
2479
+ /** Name of the sticker set to which the sticker belongs */
2480
+ set_name?: string;
2481
+ /** For premium regular stickers, premium animation for the sticker */
2482
+ premium_animation?: File;
2483
+ /** For mask stickers, the position where the mask should be placed */
2484
+ mask_position?: MaskPosition;
2485
+ /** For custom emoji stickers, unique identifier of the custom emoji */
2486
+ custom_emoji_id?: string;
2487
+ /** True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places */
2488
+ needs_repainting?: boolean;
2489
+ /** File size in bytes */
2490
+ file_size?: number;
2491
+ }
2492
+ export interface StickerSet {
2493
+ /** Sticker set name */
2494
+ name: string;
2495
+ /** Sticker set title */
2496
+ title: string;
2497
+ /** Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” */
2498
+ sticker_type: string;
2499
+ /** List of all set stickers */
2500
+ stickers: Sticker[];
2501
+ /**
2502
+ * Sticker set thumbnail in the
2503
+ * WEBP,
2504
+ * TGS, or
2505
+ * WEBM format
2506
+ */
2507
+ thumbnail?: PhotoSize;
2508
+ }
2509
+ export interface MaskPosition {
2510
+ /**
2511
+ * The part of the face relative to which the mask should be placed
2512
+ * One of “forehead”, “eyes”, “mouth”, or “chin”
2513
+ */
2514
+ point: string;
2515
+ /**
2516
+ * Shift by X-axis measured in widths of the mask scaled to the face size, from left to right
2517
+ * For example, choosing -1
2518
+ * 0 will place mask just to the left of the default mask position
2519
+ */
2520
+ x_shift: number;
2521
+ /**
2522
+ * Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom
2523
+ * For example, 1
2524
+ * 0 will place the mask just below the default mask position
2525
+ */
2526
+ y_shift: number;
2527
+ /**
2528
+ * Mask scaling coefficient
2529
+ * For example, 2
2530
+ * 0 means double size
2531
+ */
2532
+ scale: number;
2533
+ }
2534
+ export interface InputSticker {
2535
+ /**
2536
+ * The added sticker
2537
+ * Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name
2538
+ * Animated and video stickers can't be uploaded via HTTP URL
2539
+ * More information on Sending Files »
2540
+ */
2541
+ sticker: InputFile | string;
2542
+ /**
2543
+ * Format of the added sticker, must be one of “static” for a
2544
+ * WEBP or
2545
+ * PNG image, “animated” for a
2546
+ * TGS animation, “video” for a WEBM video
2547
+ */
2548
+ format: string;
2549
+ /** List of 1-20 emoji associated with the sticker */
2550
+ emoji_list: string[];
2551
+ /**
2552
+ * Position where the mask should be placed on faces
2553
+ * For “mask” stickers only
2554
+ */
2555
+ mask_position?: MaskPosition;
2556
+ /**
2557
+ * List of 0-20 search keywords for the sticker with total length of up to 64 characters
2558
+ * For “regular” and “custom_emoji” stickers only
2559
+ */
2560
+ keywords?: string[];
2561
+ }
2562
+ export interface Gift {
2563
+ /** Unique identifier of the gift */
2564
+ id: string;
2565
+ /** The sticker that represents the gift */
2566
+ sticker: Sticker;
2567
+ /** The number of Telegram Stars that must be paid to send the sticker */
2568
+ star_count: number;
2569
+ /** The total number of the gifts of this type that can be sent; for limited gifts only */
2570
+ total_count?: number;
2571
+ /** The number of remaining gifts of this type that can be sent; for limited gifts only */
2572
+ remaining_count?: number;
2573
+ }
2574
+ export interface Gifts {
2575
+ /** The list of gifts */
2576
+ gifts: Gift[];
2577
+ }
2578
+ export interface InlineQuery {
2579
+ /** Unique identifier for this query */
2580
+ id: string;
2581
+ /** Sender */
2582
+ from: User;
2583
+ /** Text of the query (up to 256 characters) */
2584
+ query: string;
2585
+ /** Offset of the results to be returned, can be controlled by the bot */
2586
+ offset: string;
2587
+ /**
2588
+ * Type of the chat from which the inline query was sent
2589
+ * Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”
2590
+ * The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat
2591
+ */
2592
+ chat_type?: string;
2593
+ /** Sender location, only for bots that request user location */
2594
+ location?: Location;
2595
+ }
2596
+ export interface InlineQueryResultsButton {
2597
+ /** Label text on the button */
2598
+ text: string;
2599
+ /**
2600
+ * Description of the Web App that will be launched when the user presses the button
2601
+ * The Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web App
2602
+ */
2603
+ web_app?: WebAppInfo;
2604
+ /**
2605
+ * Deep-linking parameter for the /start message sent to the bot when a user presses the button
2606
+ * 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed
2607
+ * Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly
2608
+ * To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any
2609
+ * The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link
2610
+ * Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities
2611
+ */
2612
+ start_parameter?: string;
2613
+ }
2614
+ export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice;
2615
+ export interface InlineQueryResultArticle {
2616
+ /** Type of the result, must be article */
2617
+ type: string;
2618
+ /** Unique identifier for this result, 1-64 Bytes */
2619
+ id: string;
2620
+ /** Title of the result */
2621
+ title: string;
2622
+ /** Content of the message to be sent */
2623
+ input_message_content: InputMessageContent;
2624
+ /** Inline keyboard attached to the message */
2625
+ reply_markup?: InlineKeyboardMarkup;
2626
+ /** URL of the result */
2627
+ url?: string;
2628
+ /** Pass True if you don't want the URL to be shown in the message */
2629
+ hide_url?: boolean;
2630
+ /** Short description of the result */
2631
+ description?: string;
2632
+ /** Url of the thumbnail for the result */
2633
+ thumbnail_url?: string;
2634
+ /** Thumbnail width */
2635
+ thumbnail_width?: number;
2636
+ /** Thumbnail height */
2637
+ thumbnail_height?: number;
2638
+ }
2639
+ export interface InlineQueryResultPhoto {
2640
+ /** Type of the result, must be photo */
2641
+ type: string;
2642
+ /** Unique identifier for this result, 1-64 bytes */
2643
+ id: string;
2644
+ /**
2645
+ * A valid URL of the photo
2646
+ * Photo must be in JPEG format
2647
+ * Photo size must not exceed 5MB
2648
+ */
2649
+ photo_url: string;
2650
+ /** URL of the thumbnail for the photo */
2651
+ thumbnail_url: string;
2652
+ /** Width of the photo */
2653
+ photo_width?: number;
2654
+ /** Height of the photo */
2655
+ photo_height?: number;
2656
+ /** Title for the result */
2657
+ title?: string;
2658
+ /** Short description of the result */
2659
+ description?: string;
2660
+ /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
2661
+ caption?: string;
2662
+ /**
2663
+ * Mode for parsing entities in the photo caption
2664
+ * See formatting options for more details
2665
+ */
2666
+ parse_mode?: string;
2667
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2668
+ caption_entities?: MessageEntity[];
2669
+ /** Pass True, if the caption must be shown above the message media */
2670
+ show_caption_above_media?: boolean;
2671
+ /** Inline keyboard attached to the message */
2672
+ reply_markup?: InlineKeyboardMarkup;
2673
+ /** Content of the message to be sent instead of the photo */
2674
+ input_message_content?: InputMessageContent;
2675
+ }
2676
+ export interface InlineQueryResultGif {
2677
+ /** Type of the result, must be gif */
2678
+ type: string;
2679
+ /** Unique identifier for this result, 1-64 bytes */
2680
+ id: string;
2681
+ /**
2682
+ * A valid URL for the GIF file
2683
+ * File size must not exceed 1MB
2684
+ */
2685
+ gif_url: string;
2686
+ /** Width of the GIF */
2687
+ gif_width?: number;
2688
+ /** Height of the GIF */
2689
+ gif_height?: number;
2690
+ /** Duration of the GIF in seconds */
2691
+ gif_duration?: number;
2692
+ /** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
2693
+ thumbnail_url: string;
2694
+ /**
2695
+ * MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”
2696
+ * Defaults to “image/jpeg”
2697
+ */
2698
+ thumbnail_mime_type?: string;
2699
+ /** Title for the result */
2700
+ title?: string;
2701
+ /** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
2702
+ caption?: string;
2703
+ /**
2704
+ * Mode for parsing entities in the caption
2705
+ * See formatting options for more details
2706
+ */
2707
+ parse_mode?: string;
2708
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2709
+ caption_entities?: MessageEntity[];
2710
+ /** Pass True, if the caption must be shown above the message media */
2711
+ show_caption_above_media?: boolean;
2712
+ /** Inline keyboard attached to the message */
2713
+ reply_markup?: InlineKeyboardMarkup;
2714
+ /** Content of the message to be sent instead of the GIF animation */
2715
+ input_message_content?: InputMessageContent;
2716
+ }
2717
+ export interface InlineQueryResultMpeg4Gif {
2718
+ /** Type of the result, must be mpeg4_gif */
2719
+ type: string;
2720
+ /** Unique identifier for this result, 1-64 bytes */
2721
+ id: string;
2722
+ /**
2723
+ * A valid URL for the MPEG4 file
2724
+ * File size must not exceed 1MB
2725
+ */
2726
+ mpeg4_url: string;
2727
+ /** Video width */
2728
+ mpeg4_width?: number;
2729
+ /** Video height */
2730
+ mpeg4_height?: number;
2731
+ /** Video duration in seconds */
2732
+ mpeg4_duration?: number;
2733
+ /** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
2734
+ thumbnail_url: string;
2735
+ /**
2736
+ * MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”
2737
+ * Defaults to “image/jpeg”
2738
+ */
2739
+ thumbnail_mime_type?: string;
2740
+ /** Title for the result */
2741
+ title?: string;
2742
+ /** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
2743
+ caption?: string;
2744
+ /**
2745
+ * Mode for parsing entities in the caption
2746
+ * See formatting options for more details
2747
+ */
2748
+ parse_mode?: string;
2749
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2750
+ caption_entities?: MessageEntity[];
2751
+ /** Pass True, if the caption must be shown above the message media */
2752
+ show_caption_above_media?: boolean;
2753
+ /** Inline keyboard attached to the message */
2754
+ reply_markup?: InlineKeyboardMarkup;
2755
+ /** Content of the message to be sent instead of the video animation */
2756
+ input_message_content?: InputMessageContent;
2757
+ }
2758
+ export interface InlineQueryResultVideo {
2759
+ /** Type of the result, must be video */
2760
+ type: string;
2761
+ /** Unique identifier for this result, 1-64 bytes */
2762
+ id: string;
2763
+ /** A valid URL for the embedded video player or video file */
2764
+ video_url: string;
2765
+ /** MIME type of the content of the video URL, “text/html” or “video/mp4” */
2766
+ mime_type: string;
2767
+ /** URL of the thumbnail (JPEG only) for the video */
2768
+ thumbnail_url: string;
2769
+ /** Title for the result */
2770
+ title: string;
2771
+ /** Caption of the video to be sent, 0-1024 characters after entities parsing */
2772
+ caption?: string;
2773
+ /**
2774
+ * Mode for parsing entities in the video caption
2775
+ * See formatting options for more details
2776
+ */
2777
+ parse_mode?: string;
2778
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2779
+ caption_entities?: MessageEntity[];
2780
+ /** Pass True, if the caption must be shown above the message media */
2781
+ show_caption_above_media?: boolean;
2782
+ /** Video width */
2783
+ video_width?: number;
2784
+ /** Video height */
2785
+ video_height?: number;
2786
+ /** Video duration in seconds */
2787
+ video_duration?: number;
2788
+ /** Short description of the result */
2789
+ description?: string;
2790
+ /** Inline keyboard attached to the message */
2791
+ reply_markup?: InlineKeyboardMarkup;
2792
+ /**
2793
+ * Content of the message to be sent instead of the video
2794
+ * This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e
2795
+ * g
2796
+ * , a YouTube video)
2797
+ */
2798
+ input_message_content?: InputMessageContent;
2799
+ }
2800
+ export interface InlineQueryResultAudio {
2801
+ /** Type of the result, must be audio */
2802
+ type: string;
2803
+ /** Unique identifier for this result, 1-64 bytes */
2804
+ id: string;
2805
+ /** A valid URL for the audio file */
2806
+ audio_url: string;
2807
+ /** Title */
2808
+ title: string;
2809
+ /** Caption, 0-1024 characters after entities parsing */
2810
+ caption?: string;
2811
+ /**
2812
+ * Mode for parsing entities in the audio caption
2813
+ * See formatting options for more details
2814
+ */
2815
+ parse_mode?: string;
2816
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2817
+ caption_entities?: MessageEntity[];
2818
+ /** Performer */
2819
+ performer?: string;
2820
+ /** Audio duration in seconds */
2821
+ audio_duration?: number;
2822
+ /** Inline keyboard attached to the message */
2823
+ reply_markup?: InlineKeyboardMarkup;
2824
+ /** Content of the message to be sent instead of the audio */
2825
+ input_message_content?: InputMessageContent;
2826
+ }
2827
+ export interface InlineQueryResultVoice {
2828
+ /** Type of the result, must be voice */
2829
+ type: string;
2830
+ /** Unique identifier for this result, 1-64 bytes */
2831
+ id: string;
2832
+ /** A valid URL for the voice recording */
2833
+ voice_url: string;
2834
+ /** Recording title */
2835
+ title: string;
2836
+ /** Caption, 0-1024 characters after entities parsing */
2837
+ caption?: string;
2838
+ /**
2839
+ * Mode for parsing entities in the voice message caption
2840
+ * See formatting options for more details
2841
+ */
2842
+ parse_mode?: string;
2843
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2844
+ caption_entities?: MessageEntity[];
2845
+ /** Recording duration in seconds */
2846
+ voice_duration?: number;
2847
+ /** Inline keyboard attached to the message */
2848
+ reply_markup?: InlineKeyboardMarkup;
2849
+ /** Content of the message to be sent instead of the voice recording */
2850
+ input_message_content?: InputMessageContent;
2851
+ }
2852
+ export interface InlineQueryResultDocument {
2853
+ /** Type of the result, must be document */
2854
+ type: string;
2855
+ /** Unique identifier for this result, 1-64 bytes */
2856
+ id: string;
2857
+ /** Title for the result */
2858
+ title: string;
2859
+ /** Caption of the document to be sent, 0-1024 characters after entities parsing */
2860
+ caption?: string;
2861
+ /**
2862
+ * Mode for parsing entities in the document caption
2863
+ * See formatting options for more details
2864
+ */
2865
+ parse_mode?: string;
2866
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
2867
+ caption_entities?: MessageEntity[];
2868
+ /** A valid URL for the file */
2869
+ document_url: string;
2870
+ /** MIME type of the content of the file, either “application/pdf” or “application/zip” */
2871
+ mime_type: string;
2872
+ /** Short description of the result */
2873
+ description?: string;
2874
+ /** Inline keyboard attached to the message */
2875
+ reply_markup?: InlineKeyboardMarkup;
2876
+ /** Content of the message to be sent instead of the file */
2877
+ input_message_content?: InputMessageContent;
2878
+ /** URL of the thumbnail (JPEG only) for the file */
2879
+ thumbnail_url?: string;
2880
+ /** Thumbnail width */
2881
+ thumbnail_width?: number;
2882
+ /** Thumbnail height */
2883
+ thumbnail_height?: number;
2884
+ }
2885
+ export interface InlineQueryResultLocation {
2886
+ /** Type of the result, must be location */
2887
+ type: string;
2888
+ /** Unique identifier for this result, 1-64 Bytes */
2889
+ id: string;
2890
+ /** Location latitude in degrees */
2891
+ latitude: number;
2892
+ /** Location longitude in degrees */
2893
+ longitude: number;
2894
+ /** Location title */
2895
+ title: string;
2896
+ /** The radius of uncertainty for the location, measured in meters; 0-1500 */
2897
+ horizontal_accuracy?: number;
2898
+ /** Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely */
2899
+ live_period?: number;
2900
+ /**
2901
+ * For live locations, a direction in which the user is moving, in degrees
2902
+ * Must be between 1 and 360 if specified
2903
+ */
2904
+ heading?: number;
2905
+ /**
2906
+ * For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters
2907
+ * Must be between 1 and 100000 if specified
2908
+ */
2909
+ proximity_alert_radius?: number;
2910
+ /** Inline keyboard attached to the message */
2911
+ reply_markup?: InlineKeyboardMarkup;
2912
+ /** Content of the message to be sent instead of the location */
2913
+ input_message_content?: InputMessageContent;
2914
+ /** Url of the thumbnail for the result */
2915
+ thumbnail_url?: string;
2916
+ /** Thumbnail width */
2917
+ thumbnail_width?: number;
2918
+ /** Thumbnail height */
2919
+ thumbnail_height?: number;
2920
+ }
2921
+ export interface InlineQueryResultVenue {
2922
+ /** Type of the result, must be venue */
2923
+ type: string;
2924
+ /** Unique identifier for this result, 1-64 Bytes */
2925
+ id: string;
2926
+ /** Latitude of the venue location in degrees */
2927
+ latitude: number;
2928
+ /** Longitude of the venue location in degrees */
2929
+ longitude: number;
2930
+ /** Title of the venue */
2931
+ title: string;
2932
+ /** Address of the venue */
2933
+ address: string;
2934
+ /** Foursquare identifier of the venue if known */
2935
+ foursquare_id?: string;
2936
+ /**
2937
+ * Foursquare type of the venue, if known
2938
+ * (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”
2939
+ */
2940
+ foursquare_type?: string;
2941
+ /** Google Places identifier of the venue */
2942
+ google_place_id?: string;
2943
+ /**
2944
+ * Google Places type of the venue
2945
+ * (See supported types
2946
+ */
2947
+ google_place_type?: string;
2948
+ /** Inline keyboard attached to the message */
2949
+ reply_markup?: InlineKeyboardMarkup;
2950
+ /** Content of the message to be sent instead of the venue */
2951
+ input_message_content?: InputMessageContent;
2952
+ /** Url of the thumbnail for the result */
2953
+ thumbnail_url?: string;
2954
+ /** Thumbnail width */
2955
+ thumbnail_width?: number;
2956
+ /** Thumbnail height */
2957
+ thumbnail_height?: number;
2958
+ }
2959
+ export interface InlineQueryResultContact {
2960
+ /** Type of the result, must be contact */
2961
+ type: string;
2962
+ /** Unique identifier for this result, 1-64 Bytes */
2963
+ id: string;
2964
+ /** Contact's phone number */
2965
+ phone_number: string;
2966
+ /** Contact's first name */
2967
+ first_name: string;
2968
+ /** Contact's last name */
2969
+ last_name?: string;
2970
+ /** Additional data about the contact in the form of a vCard, 0-2048 bytes */
2971
+ vcard?: string;
2972
+ /** Inline keyboard attached to the message */
2973
+ reply_markup?: InlineKeyboardMarkup;
2974
+ /** Content of the message to be sent instead of the contact */
2975
+ input_message_content?: InputMessageContent;
2976
+ /** Url of the thumbnail for the result */
2977
+ thumbnail_url?: string;
2978
+ /** Thumbnail width */
2979
+ thumbnail_width?: number;
2980
+ /** Thumbnail height */
2981
+ thumbnail_height?: number;
2982
+ }
2983
+ export interface InlineQueryResultGame {
2984
+ /** Type of the result, must be game */
2985
+ type: string;
2986
+ /** Unique identifier for this result, 1-64 bytes */
2987
+ id: string;
2988
+ /** Short name of the game */
2989
+ game_short_name: string;
2990
+ /** Inline keyboard attached to the message */
2991
+ reply_markup?: InlineKeyboardMarkup;
2992
+ }
2993
+ export interface InlineQueryResultCachedPhoto {
2994
+ /** Type of the result, must be photo */
2995
+ type: string;
2996
+ /** Unique identifier for this result, 1-64 bytes */
2997
+ id: string;
2998
+ /** A valid file identifier of the photo */
2999
+ photo_file_id: string;
3000
+ /** Title for the result */
3001
+ title?: string;
3002
+ /** Short description of the result */
3003
+ description?: string;
3004
+ /** Caption of the photo to be sent, 0-1024 characters after entities parsing */
3005
+ caption?: string;
3006
+ /**
3007
+ * Mode for parsing entities in the photo caption
3008
+ * See formatting options for more details
3009
+ */
3010
+ parse_mode?: string;
3011
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
3012
+ caption_entities?: MessageEntity[];
3013
+ /** Pass True, if the caption must be shown above the message media */
3014
+ show_caption_above_media?: boolean;
3015
+ /** Inline keyboard attached to the message */
3016
+ reply_markup?: InlineKeyboardMarkup;
3017
+ /** Content of the message to be sent instead of the photo */
3018
+ input_message_content?: InputMessageContent;
3019
+ }
3020
+ export interface InlineQueryResultCachedGif {
3021
+ /** Type of the result, must be gif */
3022
+ type: string;
3023
+ /** Unique identifier for this result, 1-64 bytes */
3024
+ id: string;
3025
+ /** A valid file identifier for the GIF file */
3026
+ gif_file_id: string;
3027
+ /** Title for the result */
3028
+ title?: string;
3029
+ /** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
3030
+ caption?: string;
3031
+ /**
3032
+ * Mode for parsing entities in the caption
3033
+ * See formatting options for more details
3034
+ */
3035
+ parse_mode?: string;
3036
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
3037
+ caption_entities?: MessageEntity[];
3038
+ /** Pass True, if the caption must be shown above the message media */
3039
+ show_caption_above_media?: boolean;
3040
+ /** Inline keyboard attached to the message */
3041
+ reply_markup?: InlineKeyboardMarkup;
3042
+ /** Content of the message to be sent instead of the GIF animation */
3043
+ input_message_content?: InputMessageContent;
3044
+ }
3045
+ export interface InlineQueryResultCachedMpeg4Gif {
3046
+ /** Type of the result, must be mpeg4_gif */
3047
+ type: string;
3048
+ /** Unique identifier for this result, 1-64 bytes */
3049
+ id: string;
3050
+ /** A valid file identifier for the MPEG4 file */
3051
+ mpeg4_file_id: string;
3052
+ /** Title for the result */
3053
+ title?: string;
3054
+ /** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
3055
+ caption?: string;
3056
+ /**
3057
+ * Mode for parsing entities in the caption
3058
+ * See formatting options for more details
3059
+ */
3060
+ parse_mode?: string;
3061
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
3062
+ caption_entities?: MessageEntity[];
3063
+ /** Pass True, if the caption must be shown above the message media */
3064
+ show_caption_above_media?: boolean;
3065
+ /** Inline keyboard attached to the message */
3066
+ reply_markup?: InlineKeyboardMarkup;
3067
+ /** Content of the message to be sent instead of the video animation */
3068
+ input_message_content?: InputMessageContent;
3069
+ }
3070
+ export interface InlineQueryResultCachedSticker {
3071
+ /** Type of the result, must be sticker */
3072
+ type: string;
3073
+ /** Unique identifier for this result, 1-64 bytes */
3074
+ id: string;
3075
+ /** A valid file identifier of the sticker */
3076
+ sticker_file_id: string;
3077
+ /** Inline keyboard attached to the message */
3078
+ reply_markup?: InlineKeyboardMarkup;
3079
+ /** Content of the message to be sent instead of the sticker */
3080
+ input_message_content?: InputMessageContent;
3081
+ }
3082
+ export interface InlineQueryResultCachedDocument {
3083
+ /** Type of the result, must be document */
3084
+ type: string;
3085
+ /** Unique identifier for this result, 1-64 bytes */
3086
+ id: string;
3087
+ /** Title for the result */
3088
+ title: string;
3089
+ /** A valid file identifier for the file */
3090
+ document_file_id: string;
3091
+ /** Short description of the result */
3092
+ description?: string;
3093
+ /** Caption of the document to be sent, 0-1024 characters after entities parsing */
3094
+ caption?: string;
3095
+ /**
3096
+ * Mode for parsing entities in the document caption
3097
+ * See formatting options for more details
3098
+ */
3099
+ parse_mode?: string;
3100
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
3101
+ caption_entities?: MessageEntity[];
3102
+ /** Inline keyboard attached to the message */
3103
+ reply_markup?: InlineKeyboardMarkup;
3104
+ /** Content of the message to be sent instead of the file */
3105
+ input_message_content?: InputMessageContent;
3106
+ }
3107
+ export interface InlineQueryResultCachedVideo {
3108
+ /** Type of the result, must be video */
3109
+ type: string;
3110
+ /** Unique identifier for this result, 1-64 bytes */
3111
+ id: string;
3112
+ /** A valid file identifier for the video file */
3113
+ video_file_id: string;
3114
+ /** Title for the result */
3115
+ title: string;
3116
+ /** Short description of the result */
3117
+ description?: string;
3118
+ /** Caption of the video to be sent, 0-1024 characters after entities parsing */
3119
+ caption?: string;
3120
+ /**
3121
+ * Mode for parsing entities in the video caption
3122
+ * See formatting options for more details
3123
+ */
3124
+ parse_mode?: string;
3125
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
3126
+ caption_entities?: MessageEntity[];
3127
+ /** Pass True, if the caption must be shown above the message media */
3128
+ show_caption_above_media?: boolean;
3129
+ /** Inline keyboard attached to the message */
3130
+ reply_markup?: InlineKeyboardMarkup;
3131
+ /** Content of the message to be sent instead of the video */
3132
+ input_message_content?: InputMessageContent;
3133
+ }
3134
+ export interface InlineQueryResultCachedVoice {
3135
+ /** Type of the result, must be voice */
3136
+ type: string;
3137
+ /** Unique identifier for this result, 1-64 bytes */
3138
+ id: string;
3139
+ /** A valid file identifier for the voice message */
3140
+ voice_file_id: string;
3141
+ /** Voice message title */
3142
+ title: string;
3143
+ /** Caption, 0-1024 characters after entities parsing */
3144
+ caption?: string;
3145
+ /**
3146
+ * Mode for parsing entities in the voice message caption
3147
+ * See formatting options for more details
3148
+ */
3149
+ parse_mode?: string;
3150
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
3151
+ caption_entities?: MessageEntity[];
3152
+ /** Inline keyboard attached to the message */
3153
+ reply_markup?: InlineKeyboardMarkup;
3154
+ /** Content of the message to be sent instead of the voice message */
3155
+ input_message_content?: InputMessageContent;
3156
+ }
3157
+ export interface InlineQueryResultCachedAudio {
3158
+ /** Type of the result, must be audio */
3159
+ type: string;
3160
+ /** Unique identifier for this result, 1-64 bytes */
3161
+ id: string;
3162
+ /** A valid file identifier for the audio file */
3163
+ audio_file_id: string;
3164
+ /** Caption, 0-1024 characters after entities parsing */
3165
+ caption?: string;
3166
+ /**
3167
+ * Mode for parsing entities in the audio caption
3168
+ * See formatting options for more details
3169
+ */
3170
+ parse_mode?: string;
3171
+ /** List of special entities that appear in the caption, which can be specified instead of parse_mode */
3172
+ caption_entities?: MessageEntity[];
3173
+ /** Inline keyboard attached to the message */
3174
+ reply_markup?: InlineKeyboardMarkup;
3175
+ /** Content of the message to be sent instead of the audio */
3176
+ input_message_content?: InputMessageContent;
3177
+ }
3178
+ export type InputMessageContent = InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent;
3179
+ export interface InputTextMessageContent {
3180
+ /** Text of the message to be sent, 1-4096 characters */
3181
+ message_text: string;
3182
+ /**
3183
+ * Mode for parsing entities in the message text
3184
+ * See formatting options for more details
3185
+ */
3186
+ parse_mode?: string;
3187
+ /** List of special entities that appear in message text, which can be specified instead of parse_mode */
3188
+ entities?: MessageEntity[];
3189
+ /** Link preview generation options for the message */
3190
+ link_preview_options?: LinkPreviewOptions;
3191
+ }
3192
+ export interface InputLocationMessageContent {
3193
+ /** Latitude of the location in degrees */
3194
+ latitude: number;
3195
+ /** Longitude of the location in degrees */
3196
+ longitude: number;
3197
+ /** The radius of uncertainty for the location, measured in meters; 0-1500 */
3198
+ horizontal_accuracy?: number;
3199
+ /** Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely */
3200
+ live_period?: number;
3201
+ /**
3202
+ * For live locations, a direction in which the user is moving, in degrees
3203
+ * Must be between 1 and 360 if specified
3204
+ */
3205
+ heading?: number;
3206
+ /**
3207
+ * For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters
3208
+ * Must be between 1 and 100000 if specified
3209
+ */
3210
+ proximity_alert_radius?: number;
3211
+ }
3212
+ export interface InputVenueMessageContent {
3213
+ /** Latitude of the venue in degrees */
3214
+ latitude: number;
3215
+ /** Longitude of the venue in degrees */
3216
+ longitude: number;
3217
+ /** Name of the venue */
3218
+ title: string;
3219
+ /** Address of the venue */
3220
+ address: string;
3221
+ /** Foursquare identifier of the venue, if known */
3222
+ foursquare_id?: string;
3223
+ /**
3224
+ * Foursquare type of the venue, if known
3225
+ * (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”
3226
+ */
3227
+ foursquare_type?: string;
3228
+ /** Google Places identifier of the venue */
3229
+ google_place_id?: string;
3230
+ /**
3231
+ * Google Places type of the venue
3232
+ * (See supported types
3233
+ */
3234
+ google_place_type?: string;
3235
+ }
3236
+ export interface InputContactMessageContent {
3237
+ /** Contact's phone number */
3238
+ phone_number: string;
3239
+ /** Contact's first name */
3240
+ first_name: string;
3241
+ /** Contact's last name */
3242
+ last_name?: string;
3243
+ /** Additional data about the contact in the form of a vCard, 0-2048 bytes */
3244
+ vcard?: string;
3245
+ }
3246
+ export interface InputInvoiceMessageContent {
3247
+ /** Product name, 1-32 characters */
3248
+ title: string;
3249
+ /** Product description, 1-255 characters */
3250
+ description: string;
3251
+ /**
3252
+ * Bot-defined invoice payload, 1-128 bytes
3253
+ * This will not be displayed to the user, use it for your internal processes
3254
+ */
3255
+ payload: string;
3256
+ /**
3257
+ * Payment provider token, obtained via @BotFather
3258
+ * Pass an empty string for payments in Telegram Stars
3259
+ */
3260
+ provider_token?: string;
3261
+ /**
3262
+ * Three-letter ISO 4217 currency code, see more on currencies
3263
+ * Pass “XTR” for payments in Telegram Stars
3264
+ */
3265
+ currency: string;
3266
+ /**
3267
+ * Price breakdown, a JSON-serialized list of components (e
3268
+ * g
3269
+ * product price, tax, discount, delivery cost, delivery tax, bonus, etc
3270
+ * Must contain exactly one item for payments in Telegram Stars
3271
+ */
3272
+ prices: LabeledPrice[];
3273
+ /**
3274
+ * The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double)
3275
+ * For example, for a maximum tip of US$ 1
3276
+ * 45 pass max_tip_amount = 145
3277
+ * See the exp parameter in currencies
3278
+ * json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
3279
+ * Defaults to 0
3280
+ * Not supported for payments in Telegram Stars
3281
+ */
3282
+ max_tip_amount?: number;
3283
+ /**
3284
+ * A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double)
3285
+ * At most 4 suggested tip amounts can be specified
3286
+ * The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount
3287
+ */
3288
+ suggested_tip_amounts?: number[];
3289
+ /**
3290
+ * A JSON-serialized object for data about the invoice, which will be shared with the payment provider
3291
+ * A detailed description of the required fields should be provided by the payment provider
3292
+ */
3293
+ provider_data?: string;
3294
+ /**
3295
+ * URL of the product photo for the invoice
3296
+ * Can be a photo of the goods or a marketing image for a service
3297
+ */
3298
+ photo_url?: string;
3299
+ /** Photo size in bytes */
3300
+ photo_size?: number;
3301
+ /** Photo width */
3302
+ photo_width?: number;
3303
+ /** Photo height */
3304
+ photo_height?: number;
3305
+ /**
3306
+ * Pass True if you require the user's full name to complete the order
3307
+ * Ignored for payments in Telegram Stars
3308
+ */
3309
+ need_name?: boolean;
3310
+ /**
3311
+ * Pass True if you require the user's phone number to complete the order
3312
+ * Ignored for payments in Telegram Stars
3313
+ */
3314
+ need_phone_number?: boolean;
3315
+ /**
3316
+ * Pass True if you require the user's email address to complete the order
3317
+ * Ignored for payments in Telegram Stars
3318
+ */
3319
+ need_email?: boolean;
3320
+ /**
3321
+ * Pass True if you require the user's shipping address to complete the order
3322
+ * Ignored for payments in Telegram Stars
3323
+ */
3324
+ need_shipping_address?: boolean;
3325
+ /**
3326
+ * Pass True if the user's phone number should be sent to the provider
3327
+ * Ignored for payments in Telegram Stars
3328
+ */
3329
+ send_phone_number_to_provider?: boolean;
3330
+ /**
3331
+ * Pass True if the user's email address should be sent to the provider
3332
+ * Ignored for payments in Telegram Stars
3333
+ */
3334
+ send_email_to_provider?: boolean;
3335
+ /**
3336
+ * Pass True if the final price depends on the shipping method
3337
+ * Ignored for payments in Telegram Stars
3338
+ */
3339
+ is_flexible?: boolean;
3340
+ }
3341
+ export interface ChosenInlineResult {
3342
+ /** The unique identifier for the result that was chosen */
3343
+ result_id: string;
3344
+ /** The user that chose the result */
3345
+ from: User;
3346
+ /** Sender location, only for bots that require user location */
3347
+ location?: Location;
3348
+ /**
3349
+ * Identifier of the sent inline message
3350
+ * Available only if there is an inline keyboard attached to the message
3351
+ * Will be also received in callback queries and can be used to edit the message
3352
+ */
3353
+ inline_message_id?: string;
3354
+ /** The query that was used to obtain the result */
3355
+ query: string;
3356
+ }
3357
+ export interface SentWebAppMessage {
3358
+ /**
3359
+ * Identifier of the sent inline message
3360
+ * Available only if there is an inline keyboard attached to the message
3361
+ */
3362
+ inline_message_id?: string;
3363
+ }
3364
+ export interface PreparedInlineMessage {
3365
+ /** Unique identifier of the prepared message */
3366
+ id: string;
3367
+ /**
3368
+ * Expiration date of the prepared message, in Unix time
3369
+ * Expired prepared messages can no longer be used
3370
+ */
3371
+ expiration_date: number;
3372
+ }
3373
+ export interface LabeledPrice {
3374
+ /** Portion label */
3375
+ label: string;
3376
+ /**
3377
+ * Price of the product in the smallest units of the currency (integer, not float/double)
3378
+ * For example, for a price of US$ 1
3379
+ * 45 pass amount = 145
3380
+ * See the exp parameter in currencies
3381
+ * json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
3382
+ */
3383
+ amount: number;
3384
+ }
3385
+ export interface Invoice {
3386
+ /** Product name */
3387
+ title: string;
3388
+ /** Product description */
3389
+ description: string;
3390
+ /** Unique bot deep-linking parameter that can be used to generate this invoice */
3391
+ start_parameter: string;
3392
+ /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
3393
+ currency: string;
3394
+ /**
3395
+ * Total price in the smallest units of the currency (integer, not float/double)
3396
+ * For example, for a price of US$ 1
3397
+ * 45 pass amount = 145
3398
+ * See the exp parameter in currencies
3399
+ * json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
3400
+ */
3401
+ total_amount: number;
3402
+ }
3403
+ export interface ShippingAddress {
3404
+ /** Two-letter ISO 3166-1 alpha-2 country code */
3405
+ country_code: string;
3406
+ /** State, if applicable */
3407
+ state: string;
3408
+ /** City */
3409
+ city: string;
3410
+ /** First line for the address */
3411
+ street_line1: string;
3412
+ /** Second line for the address */
3413
+ street_line2: string;
3414
+ /** Address post code */
3415
+ post_code: string;
3416
+ }
3417
+ export interface OrderInfo {
3418
+ /** User name */
3419
+ name?: string;
3420
+ /** User's phone number */
3421
+ phone_number?: string;
3422
+ /** User email */
3423
+ email?: string;
3424
+ /** User shipping address */
3425
+ shipping_address?: ShippingAddress;
3426
+ }
3427
+ export interface ShippingOption {
3428
+ /** Shipping option identifier */
3429
+ id: string;
3430
+ /** Option title */
3431
+ title: string;
3432
+ /** List of price portions */
3433
+ prices: LabeledPrice[];
3434
+ }
3435
+ export interface SuccessfulPayment {
3436
+ /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
3437
+ currency: string;
3438
+ /**
3439
+ * Total price in the smallest units of the currency (integer, not float/double)
3440
+ * For example, for a price of US$ 1
3441
+ * 45 pass amount = 145
3442
+ * See the exp parameter in currencies
3443
+ * json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
3444
+ */
3445
+ total_amount: number;
3446
+ /** Bot-specified invoice payload */
3447
+ invoice_payload: string;
3448
+ /** Expiration date of the subscription, in Unix time; for recurring payments only */
3449
+ subscription_expiration_date?: number;
3450
+ /** True, if the payment is a recurring payment for a subscription */
3451
+ is_recurring?: boolean;
3452
+ /** True, if the payment is the first payment for a subscription */
3453
+ is_first_recurring?: boolean;
3454
+ /** Identifier of the shipping option chosen by the user */
3455
+ shipping_option_id?: string;
3456
+ /** Order information provided by the user */
3457
+ order_info?: OrderInfo;
3458
+ /** Telegram payment identifier */
3459
+ telegram_payment_charge_id: string;
3460
+ /** Provider payment identifier */
3461
+ provider_payment_charge_id: string;
3462
+ }
3463
+ export interface RefundedPayment {
3464
+ /**
3465
+ * Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars
3466
+ * Currently, always “XTR”
3467
+ */
3468
+ currency: string;
3469
+ /**
3470
+ * Total refunded price in the smallest units of the currency (integer, not float/double)
3471
+ * For example, for a price of US$ 1
3472
+ * 45, total_amount = 145
3473
+ * See the exp parameter in currencies
3474
+ * json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
3475
+ */
3476
+ total_amount: number;
3477
+ /** Bot-specified invoice payload */
3478
+ invoice_payload: string;
3479
+ /** Telegram payment identifier */
3480
+ telegram_payment_charge_id: string;
3481
+ /** Provider payment identifier */
3482
+ provider_payment_charge_id?: string;
3483
+ }
3484
+ export interface ShippingQuery {
3485
+ /** Unique query identifier */
3486
+ id: string;
3487
+ /** User who sent the query */
3488
+ from: User;
3489
+ /** Bot-specified invoice payload */
3490
+ invoice_payload: string;
3491
+ /** User specified shipping address */
3492
+ shipping_address: ShippingAddress;
3493
+ }
3494
+ export interface PreCheckoutQuery {
3495
+ /** Unique query identifier */
3496
+ id: string;
3497
+ /** User who sent the query */
3498
+ from: User;
3499
+ /** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
3500
+ currency: string;
3501
+ /**
3502
+ * Total price in the smallest units of the currency (integer, not float/double)
3503
+ * For example, for a price of US$ 1
3504
+ * 45 pass amount = 145
3505
+ * See the exp parameter in currencies
3506
+ * json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
3507
+ */
3508
+ total_amount: number;
3509
+ /** Bot-specified invoice payload */
3510
+ invoice_payload: string;
3511
+ /** Identifier of the shipping option chosen by the user */
3512
+ shipping_option_id?: string;
3513
+ /** Order information provided by the user */
3514
+ order_info?: OrderInfo;
3515
+ }
3516
+ export interface PaidMediaPurchased {
3517
+ /** User who purchased the media */
3518
+ from: User;
3519
+ /** Bot-specified paid media payload */
3520
+ paid_media_payload: string;
3521
+ }
3522
+ export type RevenueWithdrawalState = RevenueWithdrawalStatePending | RevenueWithdrawalStateSucceeded | RevenueWithdrawalStateFailed;
3523
+ export interface RevenueWithdrawalStatePending {
3524
+ /** Type of the state, always “pending” */
3525
+ type: string;
3526
+ }
3527
+ export interface RevenueWithdrawalStateSucceeded {
3528
+ /** Type of the state, always “succeeded” */
3529
+ type: string;
3530
+ /** Date the withdrawal was completed in Unix time */
3531
+ date: number;
3532
+ /** An HTTPS URL that can be used to see transaction details */
3533
+ url: string;
3534
+ }
3535
+ export interface RevenueWithdrawalStateFailed {
3536
+ /** Type of the state, always “failed” */
3537
+ type: string;
3538
+ }
3539
+ export interface AffiliateInfo {
3540
+ /** The bot or the user that received an affiliate commission if it was received by a bot or a user */
3541
+ affiliate_user?: User;
3542
+ /** The chat that received an affiliate commission if it was received by a chat */
3543
+ affiliate_chat?: Chat;
3544
+ /** The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users */
3545
+ commission_per_mille: number;
3546
+ /** Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds */
3547
+ amount: number;
3548
+ /** The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds */
3549
+ nanostar_amount?: number;
3550
+ }
3551
+ export type TransactionPartner = TransactionPartnerUser | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther;
3552
+ export interface TransactionPartnerUser {
3553
+ /** Type of the transaction partner, always “user” */
3554
+ type: string;
3555
+ /** Information about the user */
3556
+ user: User;
3557
+ /** Information about the affiliate that received a commission via this transaction */
3558
+ affiliate?: AffiliateInfo;
3559
+ /** Bot-specified invoice payload */
3560
+ invoice_payload?: string;
3561
+ /** The duration of the paid subscription */
3562
+ subscription_period?: number;
3563
+ /** Information about the paid media bought by the user */
3564
+ paid_media?: PaidMedia[];
3565
+ /** Bot-specified paid media payload */
3566
+ paid_media_payload?: string;
3567
+ /** The gift sent to the user by the bot */
3568
+ gift?: Gift;
3569
+ }
3570
+ export interface TransactionPartnerAffiliateProgram {
3571
+ /** Type of the transaction partner, always “affiliate_program” */
3572
+ type: string;
3573
+ /** Information about the bot that sponsored the affiliate program */
3574
+ sponsor_user?: User;
3575
+ /** The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users */
3576
+ commission_per_mille: number;
3577
+ }
3578
+ export interface TransactionPartnerFragment {
3579
+ /** Type of the transaction partner, always “fragment” */
3580
+ type: string;
3581
+ /** State of the transaction if the transaction is outgoing */
3582
+ withdrawal_state?: RevenueWithdrawalState;
3583
+ }
3584
+ export interface TransactionPartnerTelegramAds {
3585
+ /** Type of the transaction partner, always “telegram_ads” */
3586
+ type: string;
3587
+ }
3588
+ export interface TransactionPartnerTelegramApi {
3589
+ /** Type of the transaction partner, always “telegram_api” */
3590
+ type: string;
3591
+ /** The number of successful requests that exceeded regular limits and were therefore billed */
3592
+ request_count: number;
3593
+ }
3594
+ export interface TransactionPartnerOther {
3595
+ /** Type of the transaction partner, always “other” */
3596
+ type: string;
3597
+ }
3598
+ export interface StarTransaction {
3599
+ /**
3600
+ * Unique identifier of the transaction
3601
+ * Coincides with the identifier of the original transaction for refund transactions
3602
+ * Coincides with SuccessfulPayment
3603
+ * telegram_payment_charge_id for successful incoming payments from users
3604
+ */
3605
+ id: string;
3606
+ /** Integer amount of Telegram Stars transferred by the transaction */
3607
+ amount: number;
3608
+ /** The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999 */
3609
+ nanostar_amount?: number;
3610
+ /** Date the transaction was created in Unix time */
3611
+ date: number;
3612
+ /**
3613
+ * Source of an incoming transaction (e
3614
+ * g
3615
+ * , a user purchasing goods or services, Fragment refunding a failed withdrawal)
3616
+ * Only for incoming transactions
3617
+ */
3618
+ source?: TransactionPartner;
3619
+ /**
3620
+ * Receiver of an outgoing transaction (e
3621
+ * g
3622
+ * , a user for a purchase refund, Fragment for a withdrawal)
3623
+ * Only for outgoing transactions
3624
+ */
3625
+ receiver?: TransactionPartner;
3626
+ }
3627
+ export interface StarTransactions {
3628
+ /** The list of transactions */
3629
+ transactions: StarTransaction[];
3630
+ }
3631
+ export interface PassportData {
3632
+ /** Array with information about documents and other Telegram Passport elements that was shared with the bot */
3633
+ data: EncryptedPassportElement[];
3634
+ /** Encrypted credentials required to decrypt the data */
3635
+ credentials: EncryptedCredentials;
3636
+ }
3637
+ export interface PassportFile {
3638
+ /** Identifier for this file, which can be used to download or reuse the file */
3639
+ file_id: string;
3640
+ /**
3641
+ * Unique identifier for this file, which is supposed to be the same over time and for different bots
3642
+ * Can't be used to download or reuse the file
3643
+ */
3644
+ file_unique_id: string;
3645
+ /** File size in bytes */
3646
+ file_size: number;
3647
+ /** Unix time when the file was uploaded */
3648
+ file_date: number;
3649
+ }
3650
+ export interface EncryptedPassportElement {
3651
+ /**
3652
+ * Element type
3653
+ * One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”
3654
+ */
3655
+ type: string;
3656
+ /**
3657
+ * Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types
3658
+ * Can be decrypted and verified using the accompanying EncryptedCredentials
3659
+ */
3660
+ data?: string;
3661
+ /** User's verified phone number; available only for “phone_number” type */
3662
+ phone_number?: string;
3663
+ /** User's verified email address; available only for “email” type */
3664
+ email?: string;
3665
+ /**
3666
+ * Array of encrypted files with documents provided by the user; available only for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types
3667
+ * Files can be decrypted and verified using the accompanying EncryptedCredentials
3668
+ */
3669
+ files?: PassportFile[];
3670
+ /**
3671
+ * Encrypted file with the front side of the document, provided by the user; available only for “passport”, “driver_license”, “identity_card” and “internal_passport”
3672
+ * The file can be decrypted and verified using the accompanying EncryptedCredentials
3673
+ */
3674
+ front_side?: PassportFile;
3675
+ /**
3676
+ * Encrypted file with the reverse side of the document, provided by the user; available only for “driver_license” and “identity_card”
3677
+ * The file can be decrypted and verified using the accompanying EncryptedCredentials
3678
+ */
3679
+ reverse_side?: PassportFile;
3680
+ /**
3681
+ * Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for “passport”, “driver_license”, “identity_card” and “internal_passport”
3682
+ * The file can be decrypted and verified using the accompanying EncryptedCredentials
3683
+ */
3684
+ selfie?: PassportFile;
3685
+ /**
3686
+ * Array of encrypted files with translated versions of documents provided by the user; available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types
3687
+ * Files can be decrypted and verified using the accompanying EncryptedCredentials
3688
+ */
3689
+ translation?: PassportFile[];
3690
+ /** Base64-encoded element hash for using in PassportElementErrorUnspecified */
3691
+ hash: string;
3692
+ }
3693
+ export interface EncryptedCredentials {
3694
+ /** Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication */
3695
+ data: string;
3696
+ /** Base64-encoded data hash for data authentication */
3697
+ hash: string;
3698
+ /** Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption */
3699
+ secret: string;
3700
+ }
3701
+ export type PassportElementError = PassportElementErrorDataField | PassportElementErrorFrontSide | PassportElementErrorReverseSide | PassportElementErrorSelfie | PassportElementErrorFile | PassportElementErrorFiles | PassportElementErrorTranslationFile | PassportElementErrorTranslationFiles | PassportElementErrorUnspecified;
3702
+ export interface PassportElementErrorDataField {
3703
+ /** Error source, must be data */
3704
+ source: string;
3705
+ /** The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address” */
3706
+ type: string;
3707
+ /** Name of the data field which has the error */
3708
+ field_name: string;
3709
+ /** Base64-encoded data hash */
3710
+ data_hash: string;
3711
+ /** Error message */
3712
+ message: string;
3713
+ }
3714
+ export interface PassportElementErrorFrontSide {
3715
+ /** Error source, must be front_side */
3716
+ source: string;
3717
+ /** The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” */
3718
+ type: string;
3719
+ /** Base64-encoded hash of the file with the front side of the document */
3720
+ file_hash: string;
3721
+ /** Error message */
3722
+ message: string;
3723
+ }
3724
+ export interface PassportElementErrorReverseSide {
3725
+ /** Error source, must be reverse_side */
3726
+ source: string;
3727
+ /** The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card” */
3728
+ type: string;
3729
+ /** Base64-encoded hash of the file with the reverse side of the document */
3730
+ file_hash: string;
3731
+ /** Error message */
3732
+ message: string;
3733
+ }
3734
+ export interface PassportElementErrorSelfie {
3735
+ /** Error source, must be selfie */
3736
+ source: string;
3737
+ /** The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” */
3738
+ type: string;
3739
+ /** Base64-encoded hash of the file with the selfie */
3740
+ file_hash: string;
3741
+ /** Error message */
3742
+ message: string;
3743
+ }
3744
+ export interface PassportElementErrorFile {
3745
+ /** Error source, must be file */
3746
+ source: string;
3747
+ /** The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” */
3748
+ type: string;
3749
+ /** Base64-encoded file hash */
3750
+ file_hash: string;
3751
+ /** Error message */
3752
+ message: string;
3753
+ }
3754
+ export interface PassportElementErrorFiles {
3755
+ /** Error source, must be files */
3756
+ source: string;
3757
+ /** The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” */
3758
+ type: string;
3759
+ /** List of base64-encoded file hashes */
3760
+ file_hashes: string[];
3761
+ /** Error message */
3762
+ message: string;
3763
+ }
3764
+ export interface PassportElementErrorTranslationFile {
3765
+ /** Error source, must be translation_file */
3766
+ source: string;
3767
+ /** Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” */
3768
+ type: string;
3769
+ /** Base64-encoded file hash */
3770
+ file_hash: string;
3771
+ /** Error message */
3772
+ message: string;
3773
+ }
3774
+ export interface PassportElementErrorTranslationFiles {
3775
+ /** Error source, must be translation_files */
3776
+ source: string;
3777
+ /** Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” */
3778
+ type: string;
3779
+ /** List of base64-encoded file hashes */
3780
+ file_hashes: string[];
3781
+ /** Error message */
3782
+ message: string;
3783
+ }
3784
+ export interface PassportElementErrorUnspecified {
3785
+ /** Error source, must be unspecified */
3786
+ source: string;
3787
+ /** Type of element of the user's Telegram Passport which has the issue */
3788
+ type: string;
3789
+ /** Base64-encoded element hash */
3790
+ element_hash: string;
3791
+ /** Error message */
3792
+ message: string;
3793
+ }
3794
+ export interface Game {
3795
+ /** Title of the game */
3796
+ title: string;
3797
+ /** Description of the game */
3798
+ description: string;
3799
+ /** Photo that will be displayed in the game message in chats */
3800
+ photo: PhotoSize[];
3801
+ /**
3802
+ * Brief description of the game or high scores included in the game message
3803
+ * Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText
3804
+ * 0-4096 characters
3805
+ */
3806
+ text?: string;
3807
+ /** Special entities that appear in text, such as usernames, URLs, bot commands, etc */
3808
+ text_entities?: MessageEntity[];
3809
+ /**
3810
+ * Animation that will be displayed in the game message in chats
3811
+ * Upload via BotFather
3812
+ */
3813
+ animation?: Animation;
3814
+ }
3815
+ export type CallbackGame = never;
3816
+ export interface GameHighScore {
3817
+ /** Position in high score table for the game */
3818
+ position: number;
3819
+ /** User */
3820
+ user: User;
3821
+ /** Score */
3822
+ score: number;
3823
+ }