@tgify/types 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/manage.d.ts ADDED
@@ -0,0 +1,1115 @@
1
+ import type { Location, Message, MessageEntity, PhotoSize, Sticker } from "./message.js";
2
+ /** Describes the current status of a webhook. */
3
+ export interface WebhookInfo {
4
+ /** Webhook URL, may be empty if webhook is not set up */
5
+ url?: string;
6
+ /** True, if a custom certificate was provided for webhook certificate checks */
7
+ has_custom_certificate: boolean;
8
+ /** Number of updates awaiting delivery */
9
+ pending_update_count: number;
10
+ /** Currently used webhook IP address */
11
+ ip_address?: string;
12
+ /** Unix time for the most recent error that happened when trying to deliver an update via webhook */
13
+ last_error_date?: number;
14
+ /** Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */
15
+ last_error_message?: string;
16
+ /** Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */
17
+ last_synchronization_error_date?: number;
18
+ /** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
19
+ max_connections?: number;
20
+ /** A list of update types the bot is subscribed to. Defaults to all update types except chat_member */
21
+ allowed_updates?: string[];
22
+ }
23
+ /** This object represents a Telegram user or bot. */
24
+ export interface User {
25
+ /** Unique identifier for this user or bot. */
26
+ id: number;
27
+ /** True, if this user is a bot */
28
+ is_bot: boolean;
29
+ /** User's or bot's first name */
30
+ first_name: string;
31
+ /** User's or bot's last name */
32
+ last_name?: string;
33
+ /** User's or bot's username */
34
+ username?: string;
35
+ /** IETF language tag of the user's language */
36
+ language_code?: string;
37
+ /** True, if this user is a Telegram Premium user */
38
+ is_premium?: true;
39
+ /** True, if this user added the bot to the attachment menu */
40
+ added_to_attachment_menu?: true;
41
+ }
42
+ /** This object represents a Telegram user or bot that was returned by `getMe`. */
43
+ export interface UserFromGetMe extends User {
44
+ is_bot: true;
45
+ username: string;
46
+ /** True, if the bot can be invited to groups. Returned only in getMe. */
47
+ can_join_groups: boolean;
48
+ /** True, if privacy mode is disabled for the bot. Returned only in getMe. */
49
+ can_read_all_group_messages: boolean;
50
+ /** True, if the bot supports inline queries. Returned only in getMe. */
51
+ supports_inline_queries: boolean;
52
+ /** True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. */
53
+ can_connect_to_business?: boolean;
54
+ /** True, if the bot has a main Web App. Returned only in getMe. */
55
+ has_main_web_app?: boolean;
56
+ }
57
+ export declare namespace Chat {
58
+ /** Internal type representing private chats. */
59
+ interface PrivateChat {
60
+ /** Unique identifier for this chat. */
61
+ id: number;
62
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
63
+ type: "private";
64
+ /** Username, for private chats, supergroups and channels if available */
65
+ username?: string;
66
+ /** First name of the other party in a private chat */
67
+ first_name: string;
68
+ /** Last name of the other party in a private chat */
69
+ last_name?: string;
70
+ }
71
+ /** Internal type representing group chats. */
72
+ interface GroupChat {
73
+ /** Unique identifier for this chat. */
74
+ id: number;
75
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
76
+ type: "group";
77
+ /** Title, for supergroups, channels and group chats */
78
+ title: string;
79
+ /** Username, for private chats, supergroups and channels if available */
80
+ username?: string;
81
+ }
82
+ /** Internal type representing super group chats. */
83
+ interface SupergroupChat {
84
+ /** Unique identifier for this chat. */
85
+ id: number;
86
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
87
+ type: "supergroup";
88
+ /** Username, for private chats, supergroups and channels if available */
89
+ username?: string;
90
+ /** Title, for supergroups, channels and group chats */
91
+ title: string;
92
+ /** True, if the supergroup chat is a forum (has topics enabled) */
93
+ is_forum?: true;
94
+ /** True, if the chat is the direct messages chat of a channel */
95
+ is_direct_messages?: true;
96
+ }
97
+ /** Internal type representing channel chats. */
98
+ interface ChannelChat {
99
+ /** Unique identifier for this chat. */
100
+ id: number;
101
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
102
+ type: "channel";
103
+ /** Title, for supergroups, channels and group chats */
104
+ title: string;
105
+ /** Username, for private chats, supergroups and channels if available */
106
+ username?: string;
107
+ }
108
+ }
109
+ /** This object represents a chat. */
110
+ export type Chat = Chat.PrivateChat | Chat.GroupChat | Chat.SupergroupChat | Chat.ChannelChat;
111
+ declare namespace ChatFullInfo {
112
+ /** Internal type representing private chats returned from `getChat`. */
113
+ interface PrivateChat extends Chat.PrivateChat {
114
+ /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details */
115
+ accent_color_id: number;
116
+ /** The maximum number of reactions that can be set on a message in the chat */
117
+ max_reaction_count: number;
118
+ /** Chat photo */
119
+ photo?: ChatPhoto;
120
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
121
+ active_usernames?: string[];
122
+ /** For private chats, the date of birth of the user */
123
+ birthdate?: Birthdate;
124
+ /** For private chats with business accounts, the intro of the business */
125
+ business_intro?: BusinessIntro;
126
+ /** For private chats with business accounts, the location of the business */
127
+ business_location?: BusinessLocation;
128
+ /** For private chats with business accounts, the opening hours of the business */
129
+ business_opening_hours?: BusinessOpeningHours;
130
+ /** For private chats, the personal channel of the user */
131
+ personal_chat?: ChatFullInfo.ChannelChat;
132
+ /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
133
+ available_reactions?: ReactionType[];
134
+ /** Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background */
135
+ background_custom_emoji_id?: string;
136
+ /** Identifier of the accent color for the chat's profile background. See profile accent colors for more details. */
137
+ profile_accent_color_id?: number;
138
+ /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
139
+ profile_background_custom_emoji_id?: string;
140
+ /** Custom emoji identifier of emoji status of the other party in a private chat */
141
+ emoji_status_custom_emoji_id?: string;
142
+ /** Expiration date of the emoji status of the other party in a private chat in Unix time, if any */
143
+ emoji_status_expiration_date?: number;
144
+ /** Bio of the other party in a private chat */
145
+ bio?: string;
146
+ /** 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 */
147
+ has_private_forwards?: true;
148
+ /** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat */
149
+ has_restricted_voice_and_video_messages?: true;
150
+ /** The most recent pinned message (by sending date) */
151
+ pinned_message?: Message;
152
+ /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
153
+ accepted_gift_types?: AcceptedGiftTypes[];
154
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
155
+ message_auto_delete_time?: number;
156
+ /** True, if messages from the chat can't be forwarded to other chats */
157
+ has_protected_content?: true;
158
+ }
159
+ /** Internal type representing group chats returned from `getChat`. */
160
+ interface GroupChat extends Chat.GroupChat {
161
+ /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details */
162
+ accent_color_id: number;
163
+ /** The maximum number of reactions that can be set on a message in the chat */
164
+ max_reaction_count: number;
165
+ /** Chat photo */
166
+ photo?: ChatPhoto;
167
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
168
+ active_usernames?: string[];
169
+ /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed */
170
+ available_reactions?: ReactionType[];
171
+ /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
172
+ background_custom_emoji_id?: string;
173
+ /** Identifier of the accent color for the chat's profile background. See profile accent colors for more details */
174
+ profile_accent_color_id?: number;
175
+ /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
176
+ profile_background_custom_emoji_id?: string;
177
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
178
+ emoji_status_custom_emoji_id?: string;
179
+ /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
180
+ emoji_status_expiration_date?: number;
181
+ /** Description, for groups, supergroups and channel chats */
182
+ description?: string;
183
+ /** Primary invite link, for groups, supergroups and channel chats */
184
+ invite_link?: string;
185
+ /** The most recent pinned message (by sending date) */
186
+ pinned_message?: Message;
187
+ /** Default chat member permissions, for groups and supergroups */
188
+ permissions?: ChatPermissions;
189
+ /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
190
+ accepted_gift_types?: AcceptedGiftTypes[];
191
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
192
+ message_auto_delete_time?: number;
193
+ /** True, if non-administrators can only get the list of bots and administrators in the chat */
194
+ has_hidden_members?: true;
195
+ /** True, if messages from the chat can't be forwarded to other chats */
196
+ has_protected_content?: true;
197
+ /** True, if new chat members will have access to old messages; available only to chat administrators */
198
+ has_visible_history?: true;
199
+ /** True, if the bot can change the group sticker set */
200
+ can_set_sticker_set?: true;
201
+ }
202
+ /** Internal type representing supergroup chats returned from `getChat`. */
203
+ interface SupergroupChat extends Chat.SupergroupChat {
204
+ /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details */
205
+ accent_color_id: number;
206
+ /** The maximum number of reactions that can be set on a message in the chat */
207
+ max_reaction_count: number;
208
+ /** Chat photo */
209
+ photo?: ChatPhoto;
210
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
211
+ active_usernames?: string[];
212
+ /** Information about the corresponding channel chat; for direct messages chats only */
213
+ parent_chat?: Chat.ChannelChat;
214
+ /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed */
215
+ available_reactions?: ReactionType[];
216
+ /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
217
+ background_custom_emoji_id?: string;
218
+ /** Identifier of the accent color for the chat's profile background. See profile accent colors for more details */
219
+ profile_accent_color_id?: number;
220
+ /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
221
+ profile_background_custom_emoji_id?: string;
222
+ /** True, if users need to join the supergroup before they can send messages */
223
+ join_to_send_messages?: true;
224
+ /** True, if all users directly joining the supergroup need to be approved by supergroup administrators */
225
+ join_by_request?: true;
226
+ /** Description, for groups, supergroups and channel chats */
227
+ description?: string;
228
+ /** Primary invite link, for groups, supergroups and channel chats */
229
+ invite_link?: string;
230
+ /** The most recent pinned message (by sending date) */
231
+ pinned_message?: Message;
232
+ /** Default chat member permissions, for groups and supergroups */
233
+ permissions?: ChatPermissions;
234
+ /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
235
+ accepted_gift_types?: AcceptedGiftTypes[];
236
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
237
+ can_send_paid_media?: true;
238
+ /** For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds */
239
+ slow_mode_delay?: number;
240
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
241
+ unrestrict_boost_count?: number;
242
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
243
+ message_auto_delete_time?: number;
244
+ /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators */
245
+ has_aggressive_anti_spam_enabled?: true;
246
+ /** True, if non-administrators can only get the list of bots and administrators in the chat */
247
+ has_hidden_members?: true;
248
+ /** True, if messages from the chat can't be forwarded to other chats */
249
+ has_protected_content?: true;
250
+ /** True, if new chat members will have access to old messages; available only to chat administrators */
251
+ has_visible_history?: true;
252
+ /** For supergroups, name of group sticker set */
253
+ sticker_set_name?: string;
254
+ /** True, if the bot can change the group sticker set */
255
+ can_set_sticker_set?: true;
256
+ /** For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group */
257
+ custom_emoji_sticker_set_name?: string;
258
+ /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats */
259
+ linked_chat_id?: number;
260
+ /** For supergroups, the location to which the supergroup is connected */
261
+ location?: ChatLocation;
262
+ }
263
+ /** Internal type representing channel chats returned from `getChat`. */
264
+ interface ChannelChat extends Chat.ChannelChat {
265
+ /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details */
266
+ accent_color_id: number;
267
+ /** The maximum number of reactions that can be set on a message in the chat */
268
+ max_reaction_count: number;
269
+ /** Chat photo */
270
+ photo?: ChatPhoto;
271
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
272
+ active_usernames?: string[];
273
+ /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
274
+ available_reactions?: ReactionType[];
275
+ /** Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background */
276
+ background_custom_emoji_id?: string;
277
+ /** Identifier of the accent color for the chat's profile background. See profile accent colors for more details */
278
+ profile_accent_color_id?: number;
279
+ /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
280
+ profile_background_custom_emoji_id?: string;
281
+ /** Description, for groups, supergroups and channel chats */
282
+ description?: string;
283
+ /** Primary invite link, for groups, supergroups and channel chats */
284
+ invite_link?: string;
285
+ /** The most recent pinned message (by sending date) */
286
+ pinned_message?: Message;
287
+ /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
288
+ accepted_gift_types?: AcceptedGiftTypes[];
289
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
290
+ can_send_paid_media?: true;
291
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
292
+ message_auto_delete_time?: number;
293
+ /** True, if messages from the chat can't be forwarded to other chats */
294
+ has_protected_content?: true;
295
+ /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. */
296
+ linked_chat_id?: number;
297
+ }
298
+ }
299
+ /** This object contains full information about a chat. */
300
+ export type ChatFullInfo = ChatFullInfo.PrivateChat | ChatFullInfo.GroupChat | ChatFullInfo.SupergroupChat | ChatFullInfo.ChannelChat;
301
+ /** Describes the price of a suggested post. */
302
+ export interface SuggestedPostPrice {
303
+ /** Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins */
304
+ currency: string;
305
+ /** The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000. */
306
+ amount: number;
307
+ }
308
+ /** Contains information about a suggested post. */
309
+ export interface SuggestedPostInfo {
310
+ /** State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”. */
311
+ state: "pending" | "approved" | "declined";
312
+ /** Proposed price of the post. If the field is omitted, then the post is unpaid. */
313
+ price?: SuggestedPostPrice;
314
+ /** Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it. */
315
+ send_date?: number;
316
+ }
317
+ /** Contains parameters of a post that is being suggested by the bot. */
318
+ export interface SuggestedPostParameters {
319
+ /** Proposed price for the post. If the field is omitted, then the post is unpaid. */
320
+ price?: SuggestedPostPrice;
321
+ /** Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. */
322
+ send_date?: number;
323
+ }
324
+ /** Describes a topic of a direct messages chat. */
325
+ export interface DirectMessagesTopic {
326
+ /** Unique identifier of the topic */
327
+ topic_id: number;
328
+ /** Information about the user that created the topic. Currently, it is always present */
329
+ user: User;
330
+ }
331
+ /** This object represent a user's profile pictures. */
332
+ export interface UserProfilePhotos {
333
+ /** Total number of profile pictures the target user has */
334
+ total_count: number;
335
+ /** Requested profile pictures (in up to 4 sizes each) */
336
+ photos: PhotoSize[][];
337
+ }
338
+ /** This object represents a chat photo. */
339
+ export interface ChatPhoto {
340
+ /** File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
341
+ small_file_id: string;
342
+ /** Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
343
+ small_file_unique_id: string;
344
+ /** File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
345
+ big_file_id: string;
346
+ /** Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
347
+ big_file_unique_id: string;
348
+ }
349
+ /** Represents an invite link for a chat. */
350
+ export interface ChatInviteLink {
351
+ /** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. */
352
+ invite_link: string;
353
+ /** Creator of the link */
354
+ creator: User;
355
+ /** True, if users joining the chat via the link need to be approved by chat administrators */
356
+ creates_join_request: boolean;
357
+ /** True, if the link is primary */
358
+ is_primary: boolean;
359
+ /** True, if the link is revoked */
360
+ is_revoked: boolean;
361
+ /** Invite link name */
362
+ name?: string;
363
+ /** Point in time (Unix timestamp) when the link will expire or has been expired */
364
+ expire_date?: number;
365
+ /** The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
366
+ member_limit?: number;
367
+ /** Number of pending join requests created using this link */
368
+ pending_join_request_count?: number;
369
+ /** The number of seconds the subscription will be active for before the next payment */
370
+ subscription_period?: number;
371
+ /** 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 */
372
+ subscription_price?: number;
373
+ }
374
+ /** Represents the rights of an administrator in a chat. */
375
+ export interface ChatAdministratorRights {
376
+ /** True, if the user's presence in the chat is hidden */
377
+ is_anonymous: boolean;
378
+ /** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
379
+ can_manage_chat: boolean;
380
+ /** True, if the administrator can delete messages of other users */
381
+ can_delete_messages: boolean;
382
+ /** True, if the administrator can manage video chats */
383
+ can_manage_video_chats: boolean;
384
+ /** True, if the administrator can restrict, ban or unban chat members */
385
+ can_restrict_members: boolean;
386
+ /** 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) */
387
+ can_promote_members: boolean;
388
+ /** True, if the user is allowed to change the chat title, photo and other settings */
389
+ can_change_info: boolean;
390
+ /** True, if the user is allowed to invite new users to the chat */
391
+ can_invite_users: boolean;
392
+ /** True, if the administrator can post stories to the chat */
393
+ can_post_stories: boolean;
394
+ /** 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 */
395
+ can_edit_stories: boolean;
396
+ /** True, if the administrator can delete stories posted by other users */
397
+ can_delete_stories: boolean;
398
+ /** True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
399
+ can_post_messages: boolean;
400
+ /** True, if the administrator can edit messages of other users and can pin messages; for channels only */
401
+ can_edit_messages: boolean;
402
+ /** True, if the user is allowed to pin messages; for groups and supergroups only */
403
+ can_pin_messages: boolean;
404
+ /** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
405
+ can_manage_topics: boolean;
406
+ /** True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
407
+ can_manage_direct_messages: boolean;
408
+ }
409
+ /** This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
410
+ - ChatMemberOwner
411
+ - ChatMemberAdministrator
412
+ - ChatMemberMember
413
+ - ChatMemberRestricted
414
+ - ChatMemberLeft
415
+ - ChatMemberBanned */
416
+ export type ChatMember = ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned;
417
+ export interface AbstractChatMember {
418
+ /** The member's status in the chat */
419
+ status: string;
420
+ /** Information about the user */
421
+ user: User;
422
+ }
423
+ /** Represents a chat member that owns the chat and has all administrator privileges. */
424
+ export interface ChatMemberOwner extends AbstractChatMember {
425
+ status: "creator";
426
+ /** True, if the user's presence in the chat is hidden */
427
+ is_anonymous: boolean;
428
+ /** Custom title for this user */
429
+ custom_title?: string;
430
+ }
431
+ /** Represents a chat member that has some additional privileges. */
432
+ export interface ChatMemberAdministrator extends AbstractChatMember {
433
+ status: "administrator";
434
+ /** True, if the bot is allowed to edit administrator privileges of that user */
435
+ can_be_edited: boolean;
436
+ /** True, if the user's presence in the chat is hidden */
437
+ is_anonymous: boolean;
438
+ /** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
439
+ can_manage_chat: boolean;
440
+ /** True, if the administrator can delete messages of other users */
441
+ can_delete_messages: boolean;
442
+ /** True, if the administrator can manage video chats */
443
+ can_manage_video_chats: boolean;
444
+ /** True, if the administrator can restrict, ban or unban chat members */
445
+ can_restrict_members: boolean;
446
+ /** 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) */
447
+ can_promote_members: boolean;
448
+ /** True, if the user is allowed to change the chat title, photo and other settings */
449
+ can_change_info: boolean;
450
+ /** True, if the user is allowed to invite new users to the chat */
451
+ can_invite_users: boolean;
452
+ /** True, if the administrator can post stories to the chat */
453
+ can_post_stories: boolean;
454
+ /** 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 */
455
+ can_edit_stories: boolean;
456
+ /** True, if the administrator can delete stories posted by other users */
457
+ can_delete_stories: boolean;
458
+ /** True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
459
+ can_post_messages: boolean;
460
+ /** True, if the administrator can edit messages of other users and can pin messages; for channels only */
461
+ can_edit_messages: boolean;
462
+ /** True, if the user is allowed to pin messages; for groups and supergroups only */
463
+ can_pin_messages: boolean;
464
+ /** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
465
+ can_manage_topics: boolean;
466
+ /** True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
467
+ can_manage_direct_messages: boolean;
468
+ /** Custom title for this user */
469
+ custom_title?: string;
470
+ }
471
+ /** Represents a chat member that has no additional privileges or restrictions. */
472
+ export interface ChatMemberMember extends AbstractChatMember {
473
+ status: "member";
474
+ /** Date when the user's subscription will expire; Unix time */
475
+ until_date?: number;
476
+ }
477
+ /** Represents a chat member that is under certain restrictions in the chat. Supergroups only. */
478
+ export interface ChatMemberRestricted extends AbstractChatMember {
479
+ status: "restricted";
480
+ /** True, if the user is a member of the chat at the moment of the request */
481
+ is_member: boolean;
482
+ /** True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues */
483
+ can_send_messages: boolean;
484
+ /** True, if the user is allowed to send audios */
485
+ can_send_audios: boolean;
486
+ /** True, if the user is allowed to send documents */
487
+ can_send_documents: boolean;
488
+ /** True, if the user is allowed to send photos */
489
+ can_send_photos: boolean;
490
+ /** True, if the user is allowed to send videos */
491
+ can_send_videos: boolean;
492
+ /** True, if the user is allowed to send video notes */
493
+ can_send_video_notes: boolean;
494
+ /** True, if the user is allowed to send voice notes */
495
+ can_send_voice_notes: boolean;
496
+ /** True, if the user is allowed to send polls and checklists */
497
+ can_send_polls: boolean;
498
+ /** True, if the user is allowed to send animations, games, stickers and use inline bots */
499
+ can_send_other_messages: boolean;
500
+ /** True, if the user is allowed to add web page previews to their messages */
501
+ can_add_web_page_previews: boolean;
502
+ /** True, if the user is allowed to change the chat title, photo and other settings */
503
+ can_change_info: boolean;
504
+ /** True, if the user is allowed to invite new users to the chat */
505
+ can_invite_users: boolean;
506
+ /** True, if the user is allowed to pin messages */
507
+ can_pin_messages: boolean;
508
+ /** True, if the user is allowed to create forum topics */
509
+ can_manage_topics: boolean;
510
+ /** Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever */
511
+ until_date: number;
512
+ }
513
+ /** Represents a chat member that isn't currently a member of the chat, but may join it themselves. */
514
+ export interface ChatMemberLeft extends AbstractChatMember {
515
+ status: "left";
516
+ }
517
+ /** Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. */
518
+ export interface ChatMemberBanned extends AbstractChatMember {
519
+ status: "kicked";
520
+ /** Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever */
521
+ until_date: number;
522
+ }
523
+ /** This object represents changes in the status of a chat member. */
524
+ export interface ChatMemberUpdated {
525
+ /** Chat the user belongs to */
526
+ chat: Chat;
527
+ /** Performer of the action, which resulted in the change */
528
+ from: User;
529
+ /** Date the change was done in Unix time */
530
+ date: number;
531
+ /** Previous information about the chat member */
532
+ old_chat_member: ChatMember;
533
+ /** New information about the chat member */
534
+ new_chat_member: ChatMember;
535
+ /** Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */
536
+ invite_link?: ChatInviteLink;
537
+ /** True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator */
538
+ via_join_request?: boolean;
539
+ /** True, if the user joined the chat via a chat folder invite link */
540
+ via_chat_folder_invite_link?: boolean;
541
+ }
542
+ /** Represents a join request sent to a chat. */
543
+ export interface ChatJoinRequest {
544
+ /** Chat to which the request was sent */
545
+ chat: Chat.SupergroupChat | Chat.ChannelChat;
546
+ /** User that sent the join request */
547
+ from: User;
548
+ /** Identifier of a private chat with the user who sent the join request. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user. */
549
+ user_chat_id: number;
550
+ /** Date the request was sent in Unix time */
551
+ date: number;
552
+ /** Bio of the user. */
553
+ bio?: string;
554
+ /** Chat invite link that was used by the user to send the join request */
555
+ invite_link?: ChatInviteLink;
556
+ }
557
+ /** Describes actions that a non-administrator user is allowed to take in a chat. */
558
+ export interface ChatPermissions {
559
+ /** True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues */
560
+ can_send_messages?: boolean;
561
+ /** True, if the user is allowed to send audios */
562
+ can_send_audios?: boolean;
563
+ /** True, if the user is allowed to send documents */
564
+ can_send_documents?: boolean;
565
+ /** True, if the user is allowed to send photos */
566
+ can_send_photos?: boolean;
567
+ /** True, if the user is allowed to send videos */
568
+ can_send_videos?: boolean;
569
+ /** True, if the user is allowed to send video notes */
570
+ can_send_video_notes?: boolean;
571
+ /** True, if the user is allowed to send voice notes */
572
+ can_send_voice_notes?: boolean;
573
+ /** True, if the user is allowed to send polls and checklists */
574
+ can_send_polls?: boolean;
575
+ /** True, if the user is allowed to send animations, games, stickers and use inline bots */
576
+ can_send_other_messages?: boolean;
577
+ /** True, if the user is allowed to add web page previews to their messages */
578
+ can_add_web_page_previews?: boolean;
579
+ /** True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
580
+ can_change_info?: boolean;
581
+ /** True, if the user is allowed to invite new users to the chat */
582
+ can_invite_users?: boolean;
583
+ /** True, if the user is allowed to pin messages. Ignored in public supergroups */
584
+ can_pin_messages?: boolean;
585
+ /** True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages */
586
+ can_manage_topics?: boolean;
587
+ }
588
+ /** Describes the birthdate of a user. */
589
+ export interface Birthdate {
590
+ /** Day of the user's birth; 1-31 */
591
+ day: number;
592
+ /** Month of the user's birth; 1-12 */
593
+ month: number;
594
+ /** Optional. Year of the user's birth */
595
+ year?: number;
596
+ }
597
+ /** Contains information about the start page settings of a Telegram Business account. */
598
+ export interface BusinessIntro {
599
+ /** Title text of the business intro */
600
+ title?: string;
601
+ /** Message text of the business intro */
602
+ message?: string;
603
+ /** Sticker of the business intro */
604
+ sticker?: Sticker;
605
+ }
606
+ /** Contains information about the location of a Telegram Business account. */
607
+ export interface BusinessLocation {
608
+ /** Address of the business */
609
+ address: string;
610
+ /** Optional. Location of the business */
611
+ location?: Location;
612
+ }
613
+ /** Describes an interval of time during which a business is open. */
614
+ export interface BusinessOpeningHoursInterval {
615
+ /** 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 */
616
+ opening_minute: number;
617
+ /** 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 */
618
+ closing_minute: number;
619
+ }
620
+ /** Describes the opening hours of a business. */
621
+ export interface BusinessOpeningHours {
622
+ /** Unique name of the time zone for which the opening hours are defined */
623
+ time_zone_name: string;
624
+ /** List of time intervals describing business opening hours */
625
+ opening_hours: BusinessOpeningHoursInterval[];
626
+ }
627
+ /** Describes the position of a clickable area within a story. */
628
+ export interface StoryAreaPosition {
629
+ /** The abscissa of the area's center, as a percentage of the media width */
630
+ x_percentage: number;
631
+ /** The ordinate of the area's center, as a percentage of the media height */
632
+ y_percentage: number;
633
+ /** The width of the area's rectangle, as a percentage of the media width */
634
+ width_percentage: number;
635
+ /** The height of the area's rectangle, as a percentage of the media height */
636
+ height_percentage: number;
637
+ /** The clockwise rotation angle of the rectangle, in degrees; 0-360 */
638
+ rotation_angle: number;
639
+ /** The radius of the rectangle corner rounding, as a percentage of the media width */
640
+ corner_radius_percentage: number;
641
+ }
642
+ /** Describes the physical address of a location. */
643
+ export interface LocationAddress {
644
+ /** The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located */
645
+ country_code: string;
646
+ /** State of the location */
647
+ state?: string;
648
+ /** City of the location */
649
+ city?: string;
650
+ /** Street address of the location */
651
+ street?: string;
652
+ }
653
+ /** Describes the type of a clickable area on a story. Currently, it can be one of */
654
+ export type StoryAreaType = StoryAreaTypeLocation | StoryAreaTypeSuggestedReaction | StoryAreaTypeLink | StoryAreaTypeWeather | StoryAreaTypeUniqueGift;
655
+ /** Describes a story area pointing to a location. Currently, a story can have up to 10 location areas. */
656
+ export interface StoryAreaTypeLocation {
657
+ /** Type of the area, always “location” */
658
+ type: "location";
659
+ /** Location latitude in degrees */
660
+ latitude: number;
661
+ /** Location longitude in degrees */
662
+ longitude: number;
663
+ /** Address of the location */
664
+ address?: LocationAddress;
665
+ }
666
+ /** Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas. */
667
+ export interface StoryAreaTypeSuggestedReaction {
668
+ /** Type of the area, always “suggested_reaction” */
669
+ type: "suggested_reaction";
670
+ /** Type of the reaction */
671
+ reaction_type: ReactionType;
672
+ /** Pass True if the reaction area has a dark background */
673
+ is_dark?: boolean;
674
+ /** Pass True if reaction area corner is flipped */
675
+ is_flipped?: boolean;
676
+ }
677
+ /** Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas. */
678
+ export interface StoryAreaTypeLink {
679
+ /** Type of the area, always “link” */
680
+ type: "link";
681
+ /** HTTP or tg:// URL to be opened when the area is clicked */
682
+ url: string;
683
+ }
684
+ /** Describes a story area containing weather information. Currently, a story can have up to 3 weather areas. */
685
+ export interface StoryAreaTypeWeather {
686
+ /** Type of the area, always “weather” */
687
+ type: "weather";
688
+ /** Temperature, in degree Celsius */
689
+ temperature: number;
690
+ /** Emoji representing the weather */
691
+ emoji: string;
692
+ /** A color of the area background in the ARGB format */
693
+ background_color: number;
694
+ }
695
+ /** Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area. */
696
+ export interface StoryAreaTypeUniqueGift {
697
+ /** Type of the area, always “unique_gift” */
698
+ type: "unique_gift";
699
+ /** Unique name of the gift */
700
+ name: string;
701
+ }
702
+ /** Describes a clickable area on a story media. */
703
+ export interface StoryArea {
704
+ /** Position of the area */
705
+ position: StoryAreaPosition;
706
+ /** Type of the area */
707
+ type: StoryAreaType;
708
+ }
709
+ /** Represents a location to which a chat is connected. */
710
+ export interface ChatLocation {
711
+ /** The location to which the supergroup is connected. Can't be a live location. */
712
+ location: Location;
713
+ /** Location address; 1-64 characters, as defined by the chat owner */
714
+ address: string;
715
+ }
716
+ /** This object describes the type of a reaction. Currently, it can be one of
717
+ * - ReactionTypeEmoji
718
+ * - ReactionTypeCustomEmoji
719
+ */
720
+ export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid;
721
+ export interface AbstractReactionType {
722
+ /** Type of the reaction */
723
+ type: string;
724
+ }
725
+ export type TelegramEmoji = "❤" | "👍" | "👎" | "🔥" | "🥰" | "👏" | "😁" | "🤔" | "🤯" | "😱" | "🤬" | "😢" | "🎉" | "🤩" | "🤮" | "💩" | "🙏" | "👌" | "🕊" | "🤡" | "🥱" | "🥴" | "😍" | "🐳" | "❤‍🔥" | "🌚" | "🌭" | "💯" | "🤣" | "⚡" | "🍌" | "🏆" | "💔" | "🤨" | "😐" | "🍓" | "🍾" | "💋" | "🖕" | "😈" | "😴" | "😭" | "🤓" | "👻" | "👨‍💻" | "👀" | "🎃" | "🙈" | "😇" | "😨" | "🤝" | "✍" | "🤗" | "🫡" | "🎅" | "🎄" | "☃" | "💅" | "🤪" | "🗿" | "🆒" | "💘" | "🙉" | "🦄" | "😘" | "💊" | "🙊" | "😎" | "👾" | "🤷‍♂" | "🤷" | "🤷‍♀" | "😡";
726
+ /** The reaction is based on an emoji. */
727
+ export interface ReactionTypeEmoji extends AbstractReactionType {
728
+ type: "emoji";
729
+ /** Reaction emoji. */
730
+ emoji: TelegramEmoji;
731
+ }
732
+ /** The reaction is based on a custom emoji. */
733
+ export interface ReactionTypeCustomEmoji extends AbstractReactionType {
734
+ type: "custom_emoji";
735
+ /** Custom emoji identifier */
736
+ custom_emoji_id: string;
737
+ }
738
+ /** The reaction is paid. */
739
+ export interface ReactionTypePaid extends AbstractReactionType {
740
+ /** Type of the reaction, always “paid” */
741
+ type: "paid";
742
+ }
743
+ /** Represents a reaction added to a message along with the number of times it was added. */
744
+ export interface ReactionCount {
745
+ /** Type of the reaction */
746
+ type: ReactionType;
747
+ /** Number of times the reaction was added */
748
+ total_count: number;
749
+ }
750
+ /** Represents the rights of a business bot. */
751
+ export interface BusinessBotRights {
752
+ /** True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours */
753
+ can_reply?: true;
754
+ /** True, if the bot can mark incoming private messages as read */
755
+ can_read_messages?: true;
756
+ /** True, if the bot can delete messages sent by the bot */
757
+ can_delete_outgoing_messages?: true;
758
+ /** True, if the bot can delete all private messages in managed chats */
759
+ can_delete_all_messages?: true;
760
+ /** True, if the bot can edit the first and last name of the business account */
761
+ can_edit_name?: true;
762
+ /** True, if the bot can edit the bio of the business account */
763
+ can_edit_bio?: true;
764
+ /** True, if the bot can edit the profile photo of the business account */
765
+ can_edit_profile_photo?: true;
766
+ /** True, if the bot can edit the username of the business account */
767
+ can_edit_username?: true;
768
+ /** True, if the bot can change the privacy settings pertaining to gifts for the business account */
769
+ can_change_gift_settings?: true;
770
+ /** True, if the bot can view gifts and the amount of Telegram Stars owned by the business account */
771
+ can_view_gifts_and_stars?: true;
772
+ /** True, if the bot can convert regular gifts owned by the business account to Telegram Stars */
773
+ can_convert_gifts_to_stars?: true;
774
+ /** True, if the bot can transfer and upgrade gifts owned by the business account */
775
+ can_transfer_and_upgrade_gifts?: true;
776
+ /** True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts */
777
+ can_transfer_stars?: true;
778
+ /** True, if the bot can post, edit and delete stories on behalf of the business account */
779
+ can_manage_stories?: true;
780
+ }
781
+ /** Describes the connection of the bot with a business account. */
782
+ export interface BusinessConnection {
783
+ /** Unique identifier of the business connection */
784
+ id: string;
785
+ /** Business account user that created the business connection */
786
+ user: User;
787
+ /** Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */
788
+ user_chat_id: number;
789
+ /** Date the connection was established in Unix time */
790
+ date: number;
791
+ /** Rights of the business bot */
792
+ rights?: BusinessBotRights;
793
+ /** True, if the connection is active */
794
+ is_enabled: boolean;
795
+ }
796
+ export interface BusinessMessagesDeleted {
797
+ /** Unique identifier of the business connection */
798
+ business_connection_id: string;
799
+ /** Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. */
800
+ chat: Chat;
801
+ /** The list of identifiers of deleted messages in the chat of the business account */
802
+ message_ids: number[];
803
+ }
804
+ /** This object represents a change of a reaction on a message performed by a user. */
805
+ export interface MessageReactionUpdated {
806
+ /** The chat containing the message the user reacted to */
807
+ chat: Chat;
808
+ /** Unique identifier of the message inside the chat */
809
+ message_id: number;
810
+ /** The user that changed the reaction, if the user isn't anonymous */
811
+ user?: User;
812
+ /** The chat on behalf of which the reaction was changed, if the user is anonymous */
813
+ actor_chat?: Chat;
814
+ /** Date of the change in Unix time */
815
+ date: number;
816
+ /** Previous list of reaction types that were set by the user */
817
+ old_reaction: ReactionType[];
818
+ /** New list of reaction types that have been set by the user */
819
+ new_reaction: ReactionType[];
820
+ }
821
+ /** This object represents reaction changes on a message with anonymous reactions. */
822
+ export interface MessageReactionCountUpdated {
823
+ /** The chat containing the message */
824
+ chat: Chat;
825
+ /** Unique message identifier inside the chat */
826
+ message_id: number;
827
+ /** Date of the change in Unix time */
828
+ date: number;
829
+ /** List of reactions that are present on the message */
830
+ reactions: ReactionCount[];
831
+ }
832
+ /** This object represents a forum topic. */
833
+ export interface ForumTopic {
834
+ /** Unique identifier of the forum topic */
835
+ message_thread_id: number;
836
+ /** Name of the topic */
837
+ name: string;
838
+ /** Color of the topic icon in RGB format */
839
+ icon_color: number;
840
+ /** Unique identifier of the custom emoji shown as the topic icon */
841
+ icon_custom_emoji_id?: string;
842
+ }
843
+ /** This object represents a bot command. */
844
+ export interface BotCommand {
845
+ /** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */
846
+ command: string;
847
+ /** Description of the command; 1-256 characters. */
848
+ description: string;
849
+ }
850
+ /** This object describes the source of a chat boost. It can be one of
851
+
852
+ - ChatBoostSourcePremium
853
+ - ChatBoostSourceGiftCode
854
+ - ChatBoostSourceGiveaway
855
+ */
856
+ type ChatBoostSource = ChatBoostSourcePremium | ChatBoostSourceGiftCode | ChatBoostSourceGiveaway;
857
+ export interface AbstractChatBoostSource {
858
+ /** Source of the boost */
859
+ source: string;
860
+ }
861
+ /** The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. */
862
+ export interface ChatBoostSourcePremium extends AbstractChatBoostSource {
863
+ source: "premium";
864
+ /** User that boosted the chat. */
865
+ user: User;
866
+ }
867
+ /** The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. */
868
+ export interface ChatBoostSourceGiftCode extends AbstractChatBoostSource {
869
+ source: "gift_code";
870
+ /** User for which the gift code was created. */
871
+ user: User;
872
+ }
873
+ /** The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways. */
874
+ export interface ChatBoostSourceGiveaway extends AbstractChatBoostSource {
875
+ source: "giveaway";
876
+ /** Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet. */
877
+ giveaway_message_id: number;
878
+ /** Optional. User that won the prize in the giveaway if any; for Telegram Premium giveaways only */
879
+ user?: User;
880
+ /** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
881
+ prize_star_count?: number;
882
+ /** True, if the giveaway was completed, but there was no user to win the prize */
883
+ is_unclaimed?: true;
884
+ }
885
+ /** This object contains information about a chat boost. */
886
+ export interface ChatBoost {
887
+ /** Unique identifier of the boost */
888
+ boost_id: string;
889
+ /** Point in time (Unix timestamp) when the chat was boosted */
890
+ add_date: number;
891
+ /** Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged */
892
+ expiration_date: number;
893
+ /** Source of the added boost */
894
+ source: ChatBoostSource;
895
+ }
896
+ /** This object represents a boost added to a chat or changed. */
897
+ export interface ChatBoostUpdated {
898
+ /** Chat which was boosted */
899
+ chat: Chat;
900
+ /** Information about the chat boost */
901
+ boost: ChatBoost;
902
+ }
903
+ /** This object represents a boost removed from a chat. */
904
+ export interface ChatBoostRemoved {
905
+ /** Chat which was boosted */
906
+ chat: Chat;
907
+ /** Unique identifier of the boost */
908
+ boost_id: string;
909
+ /** Point in time (Unix timestamp) when the boost was removed */
910
+ remove_date: number;
911
+ /** Source of the removed boost */
912
+ source: ChatBoostSource;
913
+ }
914
+ /** This object represents a list of boosts added to a chat by a user. */
915
+ export interface UserChatBoosts {
916
+ /** The list of boosts added to the chat by the user */
917
+ boosts: ChatBoost[];
918
+ }
919
+ /** Describes the connection of the bot with a business account. */
920
+ export interface BusinessConnection {
921
+ /** Unique identifier of the business connection */
922
+ id: string;
923
+ /** Business account user that created the business connection */
924
+ user: User;
925
+ /** Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */
926
+ user_chat_id: number;
927
+ /** Date the connection was established in Unix time */
928
+ date: number;
929
+ /** True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours */
930
+ can_reply: boolean;
931
+ /** True, if the connection is active */
932
+ is_enabled: boolean;
933
+ }
934
+ /** This object is received when messages are deleted from a connected business account. */
935
+ export interface BusinessMessagesDeleted {
936
+ /** Unique identifier of the business connection */
937
+ business_connection_id: string;
938
+ /** Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. */
939
+ chat: Chat;
940
+ /** The list of identifiers of deleted messages in the chat of the business account */
941
+ message_ids: number[];
942
+ }
943
+ /** This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.
944
+
945
+ > The maximum file size to download is 20 MB
946
+ */
947
+ export interface File {
948
+ /** Identifier for this file, which can be used to download or reuse the file */
949
+ file_id: string;
950
+ /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
951
+ file_unique_id: string;
952
+ /** File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */
953
+ file_size?: number;
954
+ /** File path. Use `https://api.telegram.org/file/bot<token>/<file_path>` to get the file. */
955
+ file_path?: string;
956
+ }
957
+ /** This object represents a gift that can be sent by the bot. */
958
+ export interface Gift {
959
+ /** Unique identifier of the gift */
960
+ id: string;
961
+ /** The sticker that represents the gift */
962
+ sticker: Sticker;
963
+ /** The number of Telegram Stars that must be paid to send the sticker */
964
+ star_count: number;
965
+ /** The number of Telegram Stars that must be paid to upgrade the gift to a unique one */
966
+ upgrade_star_count?: number;
967
+ /** The total number of the gifts of this type that can be sent; for limited gifts only */
968
+ total_count?: number;
969
+ /** The number of remaining gifts of this type that can be sent; for limited gifts only */
970
+ remaining_count?: number;
971
+ /** Information about the chat that published the gift */
972
+ publisher_chat?: Chat;
973
+ }
974
+ /** This object represent a list of gifts. */
975
+ export interface Gifts {
976
+ /** The list of gifts */
977
+ gifts: Gift[];
978
+ }
979
+ /** This object describes the model of a unique gift. */
980
+ export interface UniqueGiftModel {
981
+ /** Name of the model */
982
+ name: string;
983
+ /** The sticker that represents the unique gift */
984
+ sticker: Sticker;
985
+ /** The number of unique gifts that receive this model for every 1000 gifts upgraded */
986
+ rarity_per_mille: number;
987
+ }
988
+ /** This object describes the symbol shown on the pattern of a unique gift. */
989
+ export interface UniqueGiftSymbol {
990
+ /** Name of the symbol */
991
+ name: string;
992
+ /** The sticker that represents the unique gift */
993
+ sticker: Sticker;
994
+ /** The number of unique gifts that receive this model for every 1000 gifts upgraded */
995
+ rarity_per_mille: number;
996
+ }
997
+ /** This object describes the colors of the backdrop of a unique gift. */
998
+ export interface UniqueGiftBackdropColors {
999
+ /** The color in the center of the backdrop in RGB format */
1000
+ center_color: number;
1001
+ /** The color on the edges of the backdrop in RGB format */
1002
+ edge_color: number;
1003
+ /** The color to be applied to the symbol in RGB format */
1004
+ symbol_color: number;
1005
+ /** The color for the text on the backdrop in RGB format */
1006
+ text_color: number;
1007
+ }
1008
+ /** This object describes the backdrop of a unique gift. */
1009
+ export interface UniqueGiftBackdrop {
1010
+ /** Name of the backdrop */
1011
+ name: string;
1012
+ /** Colors of the backdrop */
1013
+ colors: UniqueGiftBackdropColors;
1014
+ /** The number of unique gifts that receive this backdrop for every 1000 gifts upgraded */
1015
+ rarity_per_mille: number;
1016
+ }
1017
+ /** This object describes a unique gift that was upgraded from a regular gift. */
1018
+ export interface UniqueGift {
1019
+ /** Human-readable name of the regular gift from which this unique gift was upgraded */
1020
+ base_name: string;
1021
+ /** Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas */
1022
+ name: string;
1023
+ /** Unique number of the upgraded gift among gifts upgraded from the same regular gift */
1024
+ number: number;
1025
+ /** Model of the gift */
1026
+ model: UniqueGiftModel;
1027
+ /** Symbol of the gift */
1028
+ symbol: UniqueGiftSymbol;
1029
+ /** Backdrop of the gift */
1030
+ backdrop: UniqueGiftBackdrop;
1031
+ /** Information about the chat that published the gift */
1032
+ publisher_chat?: Chat;
1033
+ }
1034
+ /** This object describes a gift received and owned by a user or a chat. Currently, it can be one of
1035
+ * - OwnedGiftRegular
1036
+ * - OwnedGiftUnique. */
1037
+ export type OwnedGift = OwnedGiftRegular | OwnedGiftUnique;
1038
+ /** Describes a regular gift owned by a user or a chat. */
1039
+ export interface OwnedGiftRegular {
1040
+ /** Type of the gift, always “regular” */
1041
+ type: "regular";
1042
+ /** Information about the regular gift */
1043
+ gift: Gift;
1044
+ /** Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only */
1045
+ owned_gift_id?: string;
1046
+ /** Sender of the gift if it is a known user */
1047
+ sender_user?: User;
1048
+ /** Date the gift was sent in Unix time */
1049
+ send_date: number;
1050
+ /** Text of the message that was added to the gift */
1051
+ text?: string;
1052
+ /** Special entities that appear in the text */
1053
+ entities?: MessageEntity[];
1054
+ /** True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
1055
+ is_private?: boolean;
1056
+ /** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
1057
+ is_saved?: boolean;
1058
+ /** True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only */
1059
+ can_be_upgraded?: boolean;
1060
+ /** True, if the gift was refunded and isn't available anymore */
1061
+ was_refunded?: boolean;
1062
+ /** Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars */
1063
+ convert_star_count?: number;
1064
+ /** Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift */
1065
+ prepaid_upgrade_star_count?: number;
1066
+ }
1067
+ /** Describes a unique gift received and owned by a user or a chat. */
1068
+ export interface OwnedGiftUnique {
1069
+ /** Type of the gift, always “unique” */
1070
+ type: "unique";
1071
+ /** Information about the unique gift */
1072
+ gift: UniqueGift;
1073
+ /** Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only */
1074
+ owned_gift_id?: string;
1075
+ /** Sender of the gift if it is a known user */
1076
+ sender_user?: User;
1077
+ /** Date the gift was sent in Unix time */
1078
+ send_date: number;
1079
+ /** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
1080
+ is_saved?: boolean;
1081
+ /** True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only */
1082
+ can_be_transferred?: boolean;
1083
+ /** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
1084
+ transfer_star_count?: number;
1085
+ /** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
1086
+ next_transfer_date?: number;
1087
+ }
1088
+ /** Contains the list of gifts received and owned by a user or a chat. */
1089
+ export interface OwnedGifts {
1090
+ /** The total number of gifts owned by the user or the chat */
1091
+ total_count: number;
1092
+ /** The list of gifts */
1093
+ gifts: OwnedGift[];
1094
+ /** Offset for the next request. If empty, then there are no more results */
1095
+ next_offset?: string;
1096
+ }
1097
+ /** This object describes the types of gifts that can be gifted to a user or a chat. */
1098
+ export interface AcceptedGiftTypes {
1099
+ /** True, if unlimited regular gifts are accepted */
1100
+ unlimited_gifts: boolean;
1101
+ /** True, if limited regular gifts are accepted */
1102
+ limited_gifts: boolean;
1103
+ /** True, if unique gifts or gifts that can be upgraded to unique for free are accepted */
1104
+ unique_gifts: boolean;
1105
+ /** True, if a Telegram Premium subscription is accepted */
1106
+ premium_subscription: boolean;
1107
+ }
1108
+ /** Describes an amount of Telegram Stars. */
1109
+ export interface StarAmount {
1110
+ /** Integer amount of Telegram Stars, rounded to 0; can be negative */
1111
+ amount: number;
1112
+ /** Optional. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive */
1113
+ nanostar_amount?: number;
1114
+ }
1115
+ export {};