@leemour/max-cli 0.13.0 → 0.14.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.
Files changed (112) hide show
  1. package/README.md +53 -9
  2. package/dist/bot/auth.d.ts +23 -0
  3. package/dist/bot/auth.d.ts.map +1 -0
  4. package/dist/bot/auth.js +36 -0
  5. package/dist/bot/auth.js.map +1 -0
  6. package/dist/bot/client.d.ts +20 -0
  7. package/dist/bot/client.d.ts.map +1 -0
  8. package/dist/bot/client.js +91 -0
  9. package/dist/bot/client.js.map +1 -0
  10. package/dist/bot/generated/manifest.d.ts +3 -0
  11. package/dist/bot/generated/manifest.d.ts.map +1 -0
  12. package/dist/bot/generated/manifest.js +1232 -0
  13. package/dist/bot/generated/manifest.js.map +1 -0
  14. package/dist/bot/generated/schemas.d.ts +271 -0
  15. package/dist/bot/generated/schemas.d.ts.map +1 -0
  16. package/dist/bot/generated/schemas.js +869 -0
  17. package/dist/bot/generated/schemas.js.map +1 -0
  18. package/dist/bot/generated/types.d.ts +1088 -0
  19. package/dist/bot/generated/types.d.ts.map +1 -0
  20. package/dist/bot/generated/types.js +5 -0
  21. package/dist/bot/generated/types.js.map +1 -0
  22. package/dist/bot/input.d.ts +10 -0
  23. package/dist/bot/input.d.ts.map +1 -0
  24. package/dist/bot/input.js +88 -0
  25. package/dist/bot/input.js.map +1 -0
  26. package/dist/bot/map.d.ts +11 -0
  27. package/dist/bot/map.d.ts.map +1 -0
  28. package/dist/bot/map.js +76 -0
  29. package/dist/bot/map.js.map +1 -0
  30. package/dist/bot/permissions.d.ts +14 -0
  31. package/dist/bot/permissions.d.ts.map +1 -0
  32. package/dist/bot/permissions.js +53 -0
  33. package/dist/bot/permissions.js.map +1 -0
  34. package/dist/bot/registry.d.ts +27 -0
  35. package/dist/bot/registry.d.ts.map +1 -0
  36. package/dist/bot/registry.js +68 -0
  37. package/dist/bot/registry.js.map +1 -0
  38. package/dist/bot/russian-trusted-root.d.ts +8 -0
  39. package/dist/bot/russian-trusted-root.d.ts.map +1 -0
  40. package/dist/bot/russian-trusted-root.js +41 -0
  41. package/dist/bot/russian-trusted-root.js.map +1 -0
  42. package/dist/bot/transport.d.ts +41 -0
  43. package/dist/bot/transport.d.ts.map +1 -0
  44. package/dist/bot/transport.js +200 -0
  45. package/dist/bot/transport.js.map +1 -0
  46. package/dist/client.d.ts +23 -2
  47. package/dist/client.d.ts.map +1 -1
  48. package/dist/client.js +120 -12
  49. package/dist/client.js.map +1 -1
  50. package/dist/commands/bot-context.d.ts +21 -0
  51. package/dist/commands/bot-context.d.ts.map +1 -0
  52. package/dist/commands/bot-context.js +59 -0
  53. package/dist/commands/bot-context.js.map +1 -0
  54. package/dist/commands/bot-reads.d.ts +7 -0
  55. package/dist/commands/bot-reads.d.ts.map +1 -0
  56. package/dist/commands/bot-reads.js +103 -0
  57. package/dist/commands/bot-reads.js.map +1 -0
  58. package/dist/commands/bot-sends.d.ts +12 -0
  59. package/dist/commands/bot-sends.d.ts.map +1 -0
  60. package/dist/commands/bot-sends.js +225 -0
  61. package/dist/commands/bot-sends.js.map +1 -0
  62. package/dist/commands/bot.d.ts +3 -0
  63. package/dist/commands/bot.d.ts.map +1 -0
  64. package/dist/commands/bot.js +145 -0
  65. package/dist/commands/bot.js.map +1 -0
  66. package/dist/commands/chats.d.ts.map +1 -1
  67. package/dist/commands/chats.js +65 -1
  68. package/dist/commands/chats.js.map +1 -1
  69. package/dist/commands/context.d.ts +10 -1
  70. package/dist/commands/context.d.ts.map +1 -1
  71. package/dist/commands/context.js.map +1 -1
  72. package/dist/commands/review.d.ts.map +1 -1
  73. package/dist/commands/review.js +17 -1
  74. package/dist/commands/review.js.map +1 -1
  75. package/dist/commands/rules.d.ts +7 -0
  76. package/dist/commands/rules.d.ts.map +1 -0
  77. package/dist/commands/rules.js +69 -0
  78. package/dist/commands/rules.js.map +1 -0
  79. package/dist/domain/map.d.ts +6 -1
  80. package/dist/domain/map.d.ts.map +1 -1
  81. package/dist/domain/map.js +34 -1
  82. package/dist/domain/map.js.map +1 -1
  83. package/dist/domain/models.d.ts +51 -0
  84. package/dist/domain/models.d.ts.map +1 -1
  85. package/dist/domain/models.js.map +1 -1
  86. package/dist/generated/operations.generated.d.ts +3 -1
  87. package/dist/generated/operations.generated.d.ts.map +1 -1
  88. package/dist/mcp/tools.d.ts.map +1 -1
  89. package/dist/mcp/tools.js +10 -2
  90. package/dist/mcp/tools.js.map +1 -1
  91. package/dist/moderation/rules.d.ts +56 -0
  92. package/dist/moderation/rules.d.ts.map +1 -0
  93. package/dist/moderation/rules.js +138 -0
  94. package/dist/moderation/rules.js.map +1 -0
  95. package/dist/program.d.ts.map +1 -1
  96. package/dist/program.js +18 -3
  97. package/dist/program.js.map +1 -1
  98. package/dist/protocol/connection.d.ts.map +1 -1
  99. package/dist/protocol/connection.js +12 -1
  100. package/dist/protocol/connection.js.map +1 -1
  101. package/dist/review.d.ts +23 -2
  102. package/dist/review.d.ts.map +1 -1
  103. package/dist/review.js +58 -3
  104. package/dist/review.js.map +1 -1
  105. package/dist/spec/operations/chats.d.ts +4 -1
  106. package/dist/spec/operations/chats.d.ts.map +1 -1
  107. package/dist/spec/operations/chats.js +10 -4
  108. package/dist/spec/operations/chats.js.map +1 -1
  109. package/dist/version.d.ts +1 -1
  110. package/dist/version.js +1 -1
  111. package/package.json +14 -6
  112. package/skills/max-cli/SKILL.md +15 -1
@@ -0,0 +1,1088 @@
1
+ /** 64-bit integer identifier */
2
+ export type Bigint = string;
3
+ /** User identifier */
4
+ export type UserId = string;
5
+ /** Chat identifier */
6
+ export type ChatId = string;
7
+ /** Message identifier */
8
+ export type MessageId = string;
9
+ /** URL string */
10
+ export type Url = string;
11
+ /** URL of HTTPS-endpoint of your bot. Must starts with https:// */
12
+ export type SubscriptionUrl = string;
13
+ /** User object */
14
+ export type User = {
15
+ /** Users identifier */
16
+ user_id: UserId;
17
+ /** Users first name */
18
+ first_name: string;
19
+ /** Users last name */
20
+ last_name?: string | null;
21
+ /** Unique public user name. Can be `null` if user is not accessible or it is not set */
22
+ username?: string | null;
23
+ /** `true` if user is bot */
24
+ is_bot: boolean;
25
+ /** Time of last user activity in Max (Unix timestamp in milliseconds). Can be outdated if user disabled its "online" status in settings */
26
+ last_activity_time?: string | null;
27
+ };
28
+ /** User with description and avatar URLs */
29
+ export type UserWithPhoto = {
30
+ /** Users identifier */
31
+ user_id: UserId;
32
+ /** Users first name */
33
+ first_name: string;
34
+ /** Users last name */
35
+ last_name?: string | null;
36
+ /** Unique public user name. Can be `null` if user is not accessible or it is not set */
37
+ username?: string | null;
38
+ /** `true` if user is bot */
39
+ is_bot: boolean;
40
+ /** Time of last user activity in Max (Unix timestamp in milliseconds). Can be outdated if user disabled its "online" status in settings */
41
+ last_activity_time?: string | null;
42
+ /** User description. Can be `null` if user did not fill it out */
43
+ description?: string | null;
44
+ /** URL of avatar */
45
+ avatar_url?: string | null;
46
+ /** URL of avatar of a bigger size */
47
+ full_avatar_url?: string | null;
48
+ };
49
+ /** Bot information with commands and official status */
50
+ export type BotInfo = {
51
+ /** Users identifier */
52
+ user_id: UserId;
53
+ /** Users first name */
54
+ first_name: string;
55
+ /** Users last name */
56
+ last_name?: string | null;
57
+ /** Unique public user name. Can be `null` if user is not accessible or it is not set */
58
+ username?: string | null;
59
+ /** `true` if user is bot */
60
+ is_bot: boolean;
61
+ /** Time of last user activity in Max (Unix timestamp in milliseconds). Can be outdated if user disabled its "online" status in settings */
62
+ last_activity_time?: string | null;
63
+ /** User description. Can be `null` if user did not fill it out */
64
+ description?: string | null;
65
+ /** URL of avatar */
66
+ avatar_url?: string | null;
67
+ /** URL of avatar of a bigger size */
68
+ full_avatar_url?: string | null;
69
+ /** Commands supported by bot */
70
+ commands?: Array<BotCommand> | null;
71
+ };
72
+ /** Bot commands information */
73
+ export type BotCommandsInfo = {
74
+ /** Commands supported by bot */
75
+ commands?: Array<BotCommand> | null;
76
+ };
77
+ /** Patch object for updating bot commands */
78
+ export type BotCommandsPatch = {
79
+ /** Commands supported by bot */
80
+ commands?: Array<BotCommand>;
81
+ };
82
+ /** Bot command with name and description */
83
+ export type BotCommand = {
84
+ /** Command name */
85
+ name: string;
86
+ /** Optional command description */
87
+ description?: string | null;
88
+ };
89
+ /** Chat, channel or dialog object */
90
+ export type Chat = {
91
+ /** Chats identifier */
92
+ chat_id: ChatId;
93
+ /** Type of chat. One of: dialog, chat, channel */
94
+ type: ChatType;
95
+ /** Chat status. One of: - active: bot is active member of chat - removed: bot was kicked - left: bot intentionally left chat - closed: chat was closed - suspended: bot was stopped by user. *Only for dialogs* */
96
+ status: ChatStatus;
97
+ /** Visible title of chat. Can be null for dialogs */
98
+ title?: string | null;
99
+ /** Icon of chat */
100
+ icon?: Image | null;
101
+ /** Time of last event occurred in chat */
102
+ last_event_time: string;
103
+ /** Number of people in chat. Always 2 for `dialog` chat type */
104
+ participants_count: number;
105
+ /** Identifier of chat owner. Visible only for chat admins */
106
+ owner_id?: UserId | null;
107
+ /** Participants in chat with time of last activity. Can be *null* when you request list of chats. Visible for chat admins only */
108
+ participants?: Record<string, string> | null;
109
+ /** Is current chat publicly available. Always `false` for dialogs */
110
+ is_public: boolean;
111
+ /** Link on chat */
112
+ link?: string | null;
113
+ /** Chat description */
114
+ description?: string | null;
115
+ /** Another user in conversation. For `dialog` type chats only */
116
+ dialog_with_user?: UserWithPhoto | null;
117
+ /** Messages count in chat. Only for group chats and channels. **Not available** for dialogs */
118
+ messages_count?: number | null;
119
+ /** Pinned message in chat or channel. Returned only when single chat is requested */
120
+ pinned_message?: Message | null;
121
+ };
122
+ /** Type of chat. Dialog (one-on-one), chat or channel */
123
+ export type ChatType = "dialog" | "chat" | "channel";
124
+ /** Chat status for current bot */
125
+ export type ChatStatus = "active" | "removed" | "left" | "closed" | "suspended";
126
+ /** Paginated list of chats */
127
+ export type ChatList = {
128
+ /** List of requested chats */
129
+ chats: Array<Chat>;
130
+ /** Reference to the next page of requested chats */
131
+ marker?: string | null;
132
+ };
133
+ /** Patch object for updating chat info */
134
+ export type ChatPatch = {
135
+ icon?: PhotoAttachmentRequestPayload | null;
136
+ title?: string | null;
137
+ /** Chat description up to 16k characters long. Pass empty string to remove description */
138
+ description?: string | null;
139
+ /** Identifier of message to be pinned in chat. In case you want to remove pin, use /unpin method */
140
+ pin?: string | null;
141
+ /** By default, participants will be notified about change with system message in chat/channel */
142
+ notify?: boolean | null;
143
+ };
144
+ /** Chat or channel member with membership info */
145
+ export type ChatMember = {
146
+ /** Users identifier */
147
+ user_id: UserId;
148
+ /** Users first name */
149
+ first_name: string;
150
+ /** Users last name */
151
+ last_name?: string | null;
152
+ /** Unique public user name. Can be `null` if user is not accessible or it is not set */
153
+ username?: string | null;
154
+ /** `true` if user is bot */
155
+ is_bot: boolean;
156
+ /** Time of last user activity in Max (Unix timestamp in milliseconds). Can be outdated if user disabled its "online" status in settings */
157
+ last_activity_time?: string | null;
158
+ /** User description. Can be `null` if user did not fill it out */
159
+ description?: string | null;
160
+ /** URL of avatar */
161
+ avatar_url?: string | null;
162
+ /** URL of avatar of a bigger size */
163
+ full_avatar_url?: string | null;
164
+ /** User last activity time in chat or channel . Can be outdated for super chats and channels (equals to `join_time`) */
165
+ last_access_time: string;
166
+ is_owner: boolean;
167
+ is_admin: boolean;
168
+ join_time: string;
169
+ /** Permissions in chat if member is admin. `null` otherwise */
170
+ permissions?: Array<ChatAdminPermission> | null;
171
+ /** Alias in chat if member is admin. By default, `null` */
172
+ alias?: string | null;
173
+ };
174
+ /** Chat admin permissions */
175
+ export type ChatAdminPermission = "read_all_messages" | "add_remove_members" | "add_admins" | "change_chat_info" | "pin_message" | "edit_link" | "write" | "edit" | "delete" | "can_call" | "view_stats";
176
+ /** Paginated list of chat members */
177
+ export type ChatMembersList = {
178
+ /** Participants in chat with time of last activity */
179
+ members: Array<ChatMember>;
180
+ /** Pointer to the next data page */
181
+ marker?: string | null;
182
+ };
183
+ /** Generic schema describing image object */
184
+ export type Image = {
185
+ /** URL of image */
186
+ url: string;
187
+ };
188
+ /** Schema to describe WebHook subscription */
189
+ export type Subscription = {
190
+ /** Webhook URL */
191
+ url: string;
192
+ /** Unix-time when subscription was created */
193
+ time: string;
194
+ /** Update types bot subscribed for */
195
+ update_types?: Array<string> | null;
196
+ };
197
+ /** New message recipient. Could be user, chat or channel */
198
+ export type Recipient = {
199
+ /** Chat or channel identifier */
200
+ chat_id?: ChatId | null;
201
+ /** Chat type */
202
+ chat_type: ChatType;
203
+ /** User identifier, if message was sent to user */
204
+ user_id?: UserId | null;
205
+ /** Post identifier for comments */
206
+ post_id?: MessageId | null;
207
+ };
208
+ /** Message in chat */
209
+ export type Message = {
210
+ /** User who sent this message. Can be `null` if message has been posted on behalf of a channel */
211
+ sender?: User | null;
212
+ /** Message recipient. Could be user, chat or channel */
213
+ recipient: Recipient;
214
+ /** Unix-time when message was created */
215
+ timestamp: string;
216
+ /** Forwarded or replied message */
217
+ link?: LinkedMessage | null;
218
+ /** Body of created message. Text + attachments. Could be null if message contains only forwarded message */
219
+ body: MessageBody;
220
+ /** Message statistics. Available only for channels in getMessages method context */
221
+ stat?: MessageStat | null;
222
+ /** Message public URL. Can be `null` for dialogs or non-public chats/channels */
223
+ url?: string | null;
224
+ };
225
+ /** Comment message in chat. Unlike Message, has no public url and body has no attachments. */
226
+ export type CommentMessage = {
227
+ /** User who sent this comment. Can be `null` if message has been posted on behalf of a channel */
228
+ sender?: User | null;
229
+ /** Message recipient. Could be user or chat, for comments - only channel */
230
+ recipient: Recipient;
231
+ /** Unix-time when message was created */
232
+ timestamp: string;
233
+ /** Forwarded or replied message */
234
+ link?: CommentLinkedMessage | null;
235
+ /** Body of created comment. Text only, no attachments. */
236
+ body: CommentMessageBody;
237
+ /** Message statistics. Available only for channels in in getMessages method context */
238
+ stat?: MessageStat | null;
239
+ };
240
+ /** Message statistics */
241
+ export type MessageStat = {
242
+ views: number;
243
+ };
244
+ /** Schema representing body of message */
245
+ export type MessageBody = {
246
+ /** Unique identifier of message */
247
+ mid: MessageId;
248
+ /** Sequence identifier of message in chat */
249
+ seq: string;
250
+ /** Message text */
251
+ text?: string | null;
252
+ /** Message attachments. Could be one of `Attachment` type. See description of this schema */
253
+ attachments?: Array<Attachment> | null;
254
+ /** Message text markup. See formatting section in https://dev.max.ru/docs-api for more info */
255
+ markup?: Array<MarkupElement> | null;
256
+ };
257
+ /** Schema representing body of a comment message. Unlike MessageBody, attachments are not allowed. */
258
+ export type CommentMessageBody = {
259
+ /** Unique identifier of message */
260
+ mid: MessageId;
261
+ /** Sequence identifier of message in chat */
262
+ seq: string;
263
+ /** Message text */
264
+ text?: string | null;
265
+ /** Message text markup. See Formatting section in https://dev.max.ru/docs-api for more info */
266
+ markup?: Array<MarkupElement> | null;
267
+ };
268
+ /** Paginated list of messages */
269
+ export type MessageList = {
270
+ /** List of messages */
271
+ messages: Array<Message>;
272
+ };
273
+ /** Paginated list of comment messages */
274
+ export type CommentMessageList = {
275
+ /** List of comment messages */
276
+ messages: Array<CommentMessage>;
277
+ };
278
+ /** Message text format */
279
+ export type TextFormat = "markdown" | "html";
280
+ /** Body of a new message to send */
281
+ export type NewMessageBody = {
282
+ /** Message text */
283
+ text?: string | null;
284
+ /** Message attachments. See `AttachmentRequest` and it's inheritors for full information */
285
+ attachments?: Array<AttachmentRequest> | null;
286
+ /** Link to Message */
287
+ link?: NewMessageLink | null;
288
+ /** If false, chat participants would not be notified */
289
+ notify?: boolean;
290
+ /** If set, message text will be formatted according to given markup */
291
+ format?: TextFormat | null;
292
+ };
293
+ /** Body of a new comment to send. Unlike NewMessageBody, attachments are not allowed. */
294
+ export type NewCommentBody = {
295
+ /** Message text */
296
+ text?: string | null;
297
+ /** Link to Message */
298
+ link?: NewMessageLink | null;
299
+ /** If set, message text will be formatted according to given markup */
300
+ format?: TextFormat | null;
301
+ };
302
+ /** Link to a message for reply or forward */
303
+ export type NewMessageLink = {
304
+ /** Type of message link */
305
+ type: MessageLinkType;
306
+ /** Message identifier of original message */
307
+ mid: MessageId;
308
+ };
309
+ /** Forwarded or replied message */
310
+ export type LinkedMessage = {
311
+ /** Type of linked message */
312
+ type: MessageLinkType;
313
+ /** User sent this message. Can be `null` if message has been posted on behalf of a channel */
314
+ sender?: User | null;
315
+ /** Chat where message has been originally posted */
316
+ chat_id?: ChatId;
317
+ message: MessageBody;
318
+ };
319
+ /** Forwarded or replied comment. Unlike LinkedMessage, `message` is a CommentMessageBody (no attachments, as comments cannot have them) */
320
+ export type CommentLinkedMessage = {
321
+ /** Type of linked message */
322
+ type: MessageLinkType;
323
+ /** User sent this message. Can be `null` if message has been posted on behalf of a channel */
324
+ sender?: User | null;
325
+ /** Chat where message has been originally posted */
326
+ chat_id?: ChatId;
327
+ message: CommentMessageBody;
328
+ };
329
+ /** Result of sending a message */
330
+ export type SendMessageResult = {
331
+ message: Message;
332
+ };
333
+ /** Result of sending a comment */
334
+ export type SendCommentResult = {
335
+ message: CommentMessage;
336
+ };
337
+ /** Generic schema representing message attachment */
338
+ export type Attachment = PhotoAttachment | VideoAttachment | AudioAttachment | FileAttachment | StickerAttachment | ContactAttachment | InlineKeyboardAttachment | ShareAttachment | LocationAttachment;
339
+ /** Image attachment */
340
+ export type PhotoAttachment = {
341
+ type: "image";
342
+ payload: PhotoAttachmentPayload;
343
+ };
344
+ /** Payload of photo attachment containing image metadata */
345
+ export type PhotoAttachmentPayload = {
346
+ /** Unique identifier of this image */
347
+ photo_id: string;
348
+ token: string;
349
+ /** Image URL */
350
+ url: string;
351
+ };
352
+ /** Video attachment */
353
+ export type VideoAttachment = {
354
+ type: "video";
355
+ payload: MediaAttachmentPayload;
356
+ /** Video thumbnail */
357
+ thumbnail?: VideoThumbnail | null;
358
+ /** Video width */
359
+ width?: number | null;
360
+ /** Video height */
361
+ height?: number | null;
362
+ /** Video duration in seconds */
363
+ duration?: number | null;
364
+ };
365
+ /** Video thumbnail image */
366
+ export type VideoThumbnail = {
367
+ /** Image URL */
368
+ url: string;
369
+ };
370
+ /** Available video download and streaming URLs by resolution */
371
+ export type VideoUrls = {
372
+ /** Video URL in 1080p resolution, if available */
373
+ mp4_1080?: string | null;
374
+ /** Video URL in 720 resolution, if available */
375
+ mp4_720?: string | null;
376
+ /** Video URL in 480 resolution, if available */
377
+ mp4_480?: string | null;
378
+ /** Video URL in 360 resolution, if available */
379
+ mp4_360?: string | null;
380
+ /** Video URL in 240 resolution, if available */
381
+ mp4_240?: string | null;
382
+ /** Video URL in 144 resolution, if available */
383
+ mp4_144?: string | null;
384
+ /** Live streaming URL, if available */
385
+ hls?: string | null;
386
+ };
387
+ /** Detailed information about video attachment including direct URLs */
388
+ export type VideoAttachmentDetails = {
389
+ /** Video attachment token */
390
+ token: string;
391
+ /** URLs to download or play video. Can be null if video is unavailable */
392
+ urls?: VideoUrls | null;
393
+ /** Video thumbnail */
394
+ thumbnail?: PhotoAttachmentPayload | null;
395
+ /** Video width */
396
+ width: number;
397
+ /** Video height */
398
+ height: number;
399
+ /** Video duration in seconds */
400
+ duration: number;
401
+ };
402
+ /** Audio attachment */
403
+ export type AudioAttachment = {
404
+ type: "audio";
405
+ payload: MediaAttachmentPayload;
406
+ /** Audio transcription */
407
+ transcription?: string | null;
408
+ };
409
+ /** File attachment */
410
+ export type FileAttachment = {
411
+ type: "file";
412
+ payload: FileAttachmentPayload;
413
+ /** Uploaded file name */
414
+ filename: string;
415
+ /** File size in bytes */
416
+ size: string;
417
+ };
418
+ /** Base payload for message attachments containing media URL */
419
+ export type AttachmentPayload = {
420
+ /** Media attachment URL. For video attachments use getVideoAttachmentDetails method to obtain direct links. */
421
+ url: string;
422
+ };
423
+ /** Payload for media (video/audio) attachments with reuse token */
424
+ export type MediaAttachmentPayload = {
425
+ /** Media attachment URL. For video attachments use getVideoAttachmentDetails method to obtain direct links. */
426
+ url: string;
427
+ /** Use `token` in case when you are trying to reuse the same attachment in other message */
428
+ token: string;
429
+ };
430
+ /** Payload for file attachments with reuse token */
431
+ export type FileAttachmentPayload = {
432
+ /** Media attachment URL. For video attachments use getVideoAttachmentDetails method to obtain direct links. */
433
+ url: string;
434
+ /** Use `token` in case when you are trying to reuse the same attachment in other message */
435
+ token: string;
436
+ };
437
+ /** Contact attachment */
438
+ export type ContactAttachment = {
439
+ type: "contact";
440
+ payload: ContactAttachmentPayload;
441
+ };
442
+ /** Payload of contact attachment containing user contact info */
443
+ export type ContactAttachmentPayload = {
444
+ /** User info in VCF format */
445
+ vcf_info?: string | null;
446
+ /** User info in VCF format hash */
447
+ hash?: string | null;
448
+ /** User info */
449
+ max_info?: User | null;
450
+ };
451
+ /** Payload of sticker attachment */
452
+ export type StickerAttachmentPayload = {
453
+ /** Media attachment URL. For video attachments use getVideoAttachmentDetails method to obtain direct links. */
454
+ url: string;
455
+ /** Sticker identifier */
456
+ code: string;
457
+ };
458
+ /** Sticker attachment */
459
+ export type StickerAttachment = {
460
+ type: "sticker";
461
+ payload: StickerAttachmentPayload;
462
+ /** Sticker width */
463
+ width: number;
464
+ /** Sticker height */
465
+ height: number;
466
+ };
467
+ /** Payload of ShareAttachmentRequest */
468
+ export type ShareAttachmentPayload = {
469
+ /** URL attached to message as media preview */
470
+ url?: string | null;
471
+ /** Attachment token */
472
+ token?: string | null;
473
+ };
474
+ /** Link preview attachment with media */
475
+ export type ShareAttachment = {
476
+ type: "share";
477
+ payload: ShareAttachmentPayload;
478
+ /** Link preview title */
479
+ title?: string | null;
480
+ /** Link preview description */
481
+ description?: string | null;
482
+ /** Link preview image */
483
+ image_url?: string | null;
484
+ };
485
+ /** Geographic location attachment */
486
+ export type LocationAttachment = {
487
+ type: "location";
488
+ latitude: number;
489
+ longitude: number;
490
+ };
491
+ /** Buttons in messages */
492
+ export type InlineKeyboardAttachment = {
493
+ type: "inline_keyboard";
494
+ payload: Keyboard;
495
+ };
496
+ /** Keyboard is two-dimension array of buttons */
497
+ export type Keyboard = {
498
+ buttons: Array<Array<Button>>;
499
+ };
500
+ /** Inline keyboard button */
501
+ export type Button = CallbackButton | LinkButton | RequestGeoLocationButton | RequestContactButton | MessageButton | OpenAppButton | ClipboardButton;
502
+ /** After pressing this type of button client sends to server payload it contains */
503
+ export type CallbackButton = {
504
+ type: "callback";
505
+ /** Visible text of button */
506
+ text: string;
507
+ /** Button payload */
508
+ payload: string;
509
+ };
510
+ /** After pressing this type of button user follows the link it contains */
511
+ export type LinkButton = {
512
+ type: "link";
513
+ /** Visible text of button */
514
+ text: string;
515
+ url: string;
516
+ };
517
+ /** After pressing this type of button it sends message from user in chat */
518
+ export type MessageButton = {
519
+ type: "message";
520
+ /** Visible text of button */
521
+ text: string;
522
+ };
523
+ /** After pressing this type of button client sends new message with attachment of current user contact */
524
+ export type RequestContactButton = {
525
+ type: "request_contact";
526
+ /** Visible text of button */
527
+ text: string;
528
+ };
529
+ /** After pressing this type of button client sends new message with attachment of current user geo location */
530
+ export type RequestGeoLocationButton = {
531
+ type: "request_geo_location";
532
+ /** Visible text of button */
533
+ text: string;
534
+ /** If *true*, sends location without asking user's confirmation */
535
+ quick?: boolean;
536
+ };
537
+ /** After pressing this type of button client opens mini app */
538
+ export type OpenAppButton = {
539
+ type: "open_app";
540
+ /** Visible text of button */
541
+ text: string;
542
+ /** Button payload */
543
+ payload?: string | null;
544
+ /** Unique public name of the bot wired to the mini app */
545
+ web_app: string;
546
+ /** Unique identifier of the bot wired to the mini app */
547
+ contact_id?: UserId | null;
548
+ };
549
+ /** After pressing this type of button client copies payload data to clipboard */
550
+ export type ClipboardButton = {
551
+ type: "clipboard";
552
+ /** Visible text of button */
553
+ text: string;
554
+ /** Button payload */
555
+ payload: string;
556
+ };
557
+ /** Type of linked message */
558
+ export type MessageLinkType = "forward" | "reply";
559
+ /** Request to attach some data to message */
560
+ export type AttachmentRequest = PhotoAttachmentRequest | VideoAttachmentRequest | AudioAttachmentRequest | FileAttachmentRequest | StickerAttachmentRequest | ContactAttachmentRequest | InlineKeyboardAttachmentRequest | LocationAttachmentRequest | ShareAttachmentRequest;
561
+ /** Request to attach image to message */
562
+ export type PhotoAttachmentRequest = {
563
+ type: "image";
564
+ payload: PhotoAttachmentRequestPayload;
565
+ };
566
+ /** Request to attach image. All fields are mutually exclusive */
567
+ export type PhotoAttachmentRequestPayload = {
568
+ /** Any external image URL you want to attach */
569
+ url?: string | null;
570
+ /** Token of any existing attachment */
571
+ token?: string | null;
572
+ /** Tokens were obtained after uploading images */
573
+ photos?: Record<string, PhotoToken> | null;
574
+ };
575
+ /** Token representing an uploaded image */
576
+ export type PhotoToken = {
577
+ /** Encoded information of uploaded image */
578
+ token: string;
579
+ };
580
+ /** Request to attach video to message */
581
+ export type VideoAttachmentRequest = {
582
+ type: "video";
583
+ payload: UploadedInfo;
584
+ };
585
+ /** Request to attach audio to message. MUST be the only attachment in message */
586
+ export type AudioAttachmentRequest = {
587
+ type: "audio";
588
+ payload: UploadedInfo;
589
+ };
590
+ /** This is information you will receive as soon as audio/video is uploaded */
591
+ export type UploadedInfo = {
592
+ /** Token is unique uploaded media identifier */
593
+ token?: string;
594
+ };
595
+ /** Request to attach file to message. MUST be the only attachment in message */
596
+ export type FileAttachmentRequest = {
597
+ type: "file";
598
+ payload: UploadedInfo;
599
+ };
600
+ /** Type of file uploading */
601
+ export type UploadType = "image" | "video" | "audio" | "file";
602
+ /** Request to attach contact card to message. MUST be the only attachment in message */
603
+ export type ContactAttachmentRequest = {
604
+ type: "contact";
605
+ payload: ContactAttachmentRequestPayload;
606
+ };
607
+ /** Payload for contact attachment request */
608
+ export type ContactAttachmentRequestPayload = {
609
+ /** Contact name */
610
+ name?: string | null;
611
+ /** Contact identifier if it is registered Max user */
612
+ contact_id?: UserId | null;
613
+ /** Full information about contact in VCF format */
614
+ vcf_info?: string | null;
615
+ /** Contact phone in VCF format */
616
+ vcf_phone?: string | null;
617
+ };
618
+ /** Request to attach sticker. MUST be the only attachment request in message */
619
+ export type StickerAttachmentRequest = {
620
+ type: "sticker";
621
+ payload: StickerAttachmentRequestPayload;
622
+ };
623
+ /** Payload for sticker attachment request */
624
+ export type StickerAttachmentRequestPayload = {
625
+ /** Sticker code */
626
+ code: string;
627
+ };
628
+ /** Request to attach keyboard to message */
629
+ export type InlineKeyboardAttachmentRequest = {
630
+ type: "inline_keyboard";
631
+ payload: InlineKeyboardAttachmentRequestPayload;
632
+ };
633
+ /** Payload for inline keyboard attachment request */
634
+ export type InlineKeyboardAttachmentRequestPayload = {
635
+ /** Two-dimensional array of buttons */
636
+ buttons: Array<Array<Button>>;
637
+ };
638
+ /** Request to attach geographic location to message */
639
+ export type LocationAttachmentRequest = {
640
+ type: "location";
641
+ latitude: number;
642
+ longitude: number;
643
+ };
644
+ /** Request to attach media preview of any external URL */
645
+ export type ShareAttachmentRequest = {
646
+ type: "share";
647
+ payload: ShareAttachmentPayload;
648
+ };
649
+ /** Base type for text markup (formatting) elements */
650
+ export type MarkupElement = StrongMarkup | EmphasizedMarkup | MonospacedMarkup | LinkMarkup | StrikethroughMarkup | UnderlineMarkup | UserMentionMarkup | HeadingMarkup | HighlightedMarkup | QuoteMarkup;
651
+ /** Represents **bold** in text */
652
+ export type StrongMarkup = {
653
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
654
+ type: "strong";
655
+ /** Element start index (zero-based) in text */
656
+ from: number;
657
+ /** Length of the markup element */
658
+ length: number;
659
+ };
660
+ /** Represents *italic* in text */
661
+ export type EmphasizedMarkup = {
662
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
663
+ type: "emphasized";
664
+ /** Element start index (zero-based) in text */
665
+ from: number;
666
+ /** Length of the markup element */
667
+ length: number;
668
+ };
669
+ /** Represents `monospaced` or ```code``` block in text */
670
+ export type MonospacedMarkup = {
671
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
672
+ type: "monospaced";
673
+ /** Element start index (zero-based) in text */
674
+ from: number;
675
+ /** Length of the markup element */
676
+ length: number;
677
+ };
678
+ /** Represents link in text */
679
+ export type LinkMarkup = {
680
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
681
+ type: "link";
682
+ /** Element start index (zero-based) in text */
683
+ from: number;
684
+ /** Length of the markup element */
685
+ length: number;
686
+ /** Link's URL */
687
+ url: string;
688
+ };
689
+ /** Represents ~strikethrough~ block in text */
690
+ export type StrikethroughMarkup = {
691
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
692
+ type: "strikethrough";
693
+ /** Element start index (zero-based) in text */
694
+ from: number;
695
+ /** Length of the markup element */
696
+ length: number;
697
+ };
698
+ /** Represents ++underlined++ part of the text */
699
+ export type UnderlineMarkup = {
700
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
701
+ type: "underline";
702
+ /** Element start index (zero-based) in text */
703
+ from: number;
704
+ /** Length of the markup element */
705
+ length: number;
706
+ };
707
+ /** Represents header part of the text */
708
+ export type HeadingMarkup = {
709
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
710
+ type: "heading";
711
+ /** Element start index (zero-based) in text */
712
+ from: number;
713
+ /** Length of the markup element */
714
+ length: number;
715
+ };
716
+ /** Represents user mention in text. Mention can be both by user's username or ID if user doesn't have username */
717
+ export type UserMentionMarkup = {
718
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
719
+ type: "user_mention";
720
+ /** Element start index (zero-based) in text */
721
+ from: number;
722
+ /** Length of the markup element */
723
+ length: number;
724
+ /** `@username` of mentioned user */
725
+ user_link?: string | null;
726
+ /** Identifier of mentioned user without username */
727
+ user_id?: UserId | null;
728
+ };
729
+ /** Represents a highlighted piece of text */
730
+ export type HighlightedMarkup = {
731
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
732
+ type: "highlighted";
733
+ /** Element start index (zero-based) in text */
734
+ from: number;
735
+ /** Length of the markup element */
736
+ length: number;
737
+ };
738
+ /** Represents quote block in text */
739
+ export type QuoteMarkup = {
740
+ /** Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, highlighted, link, quote, header or user_mention */
741
+ type: "quote";
742
+ /** Element start index (zero-based) in text */
743
+ from: number;
744
+ /** Length of the markup element */
745
+ length: number;
746
+ };
747
+ /** Request to set up WebHook subscription */
748
+ export type SubscriptionRequestBody = {
749
+ url: SubscriptionUrl;
750
+ /** A secret to be sent in a header “X-Max-Bot-Api-Secret” in every webhook request, 5-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you. */
751
+ secret?: string;
752
+ /** List of update types your bot want to receive. See `Update` object for a complete list of types */
753
+ update_types?: Array<string>;
754
+ };
755
+ /** List of all WebHook subscriptions */
756
+ export type GetSubscriptionsResult = {
757
+ /** Current subscriptions */
758
+ subscriptions: Array<Subscription>;
759
+ };
760
+ /** Simple response to request */
761
+ export type SimpleQueryResult = {
762
+ /** `true` if request was successful. `false` otherwise */
763
+ success: boolean;
764
+ /** Explanatory message if the result is not successful */
765
+ message?: string;
766
+ };
767
+ /** Request body for pinning a message in chat */
768
+ export type PinMessageBody = {
769
+ /** Identifier of message to be pinned in chat */
770
+ message_id: MessageId;
771
+ /** If `true`, participants will be notified with system message in chat/channel */
772
+ notify?: boolean | null;
773
+ };
774
+ /** Result of getting pinned message in chat */
775
+ export type GetPinnedMessageResult = {
776
+ /** Pinned message. Can be `null` if no message pinned in chat */
777
+ message?: Message | null;
778
+ };
779
+ /** Object sent to bot when user presses button */
780
+ export type Callback = {
781
+ /** Unix-time when user pressed the button */
782
+ timestamp: string;
783
+ /** Current keyboard identifier */
784
+ callback_id: string;
785
+ /** Button payload */
786
+ payload?: string;
787
+ /** User pressed the button */
788
+ user: User;
789
+ };
790
+ /** Send this object when your bot wants to react to when a button is pressed */
791
+ export type CallbackAnswer = {
792
+ /** Fill this if you want to modify current message */
793
+ message?: NewMessageBody | null;
794
+ /** Fill this if you just want to send one-time notification to user */
795
+ notification?: string | null;
796
+ };
797
+ /** Server returns this if there was an exception to your request */
798
+ export type ApiError = {
799
+ /** Error */
800
+ error?: string;
801
+ /** Error code */
802
+ code: string;
803
+ /** Human-readable description */
804
+ message: string;
805
+ };
806
+ /** Endpoint you should upload to your binaries */
807
+ export type UploadEndpoint = {
808
+ /** URL to upload */
809
+ url: string;
810
+ /** Video or audio token for send message */
811
+ token?: string | null;
812
+ };
813
+ /** List of user identifiers */
814
+ export type UserIdsList = {
815
+ user_ids: Array<UserId>;
816
+ };
817
+ /** Request body for sending action to chat */
818
+ export type ActionRequestBody = {
819
+ action: SenderAction;
820
+ };
821
+ /** List of chat administrators with permissions */
822
+ export type ChatAdminsList = {
823
+ admins: Array<ChatAdmin>;
824
+ };
825
+ /** Administrator id with permissions */
826
+ export type ChatAdmin = {
827
+ user_id: UserId;
828
+ permissions: Array<ChatAdminPermission>;
829
+ /** Alias of the admin in chat. By default, `null` */
830
+ alias?: string | null;
831
+ };
832
+ /** Different actions to send to chat members */
833
+ export type SenderAction = "typing_on" | "sending_photo" | "sending_video" | "sending_audio" | "sending_file" | "mark_seen";
834
+ /** List of all updates in chats your bot participated in */
835
+ export type UpdateList = {
836
+ /** Page of updates */
837
+ updates: Array<Update>;
838
+ /** Pointer to the next data page */
839
+ marker?: string | null;
840
+ };
841
+ /** `Update` object represents different types of events that happened in chat. See its inheritors */
842
+ export type Update = MessageCreatedUpdate | MessageCallbackUpdate | MessageEditedUpdate | MessageRemovedUpdate | CommentCreatedUpdate | CommentEditedUpdate | CommentRemovedUpdate | BotAddedToChatUpdate | BotRemovedFromChatUpdate | UserAddedToChatUpdate | UserRemovedFromChatUpdate | BotStartedUpdate | BotStoppedUpdate | DialogClearedUpdate | DialogRemovedUpdate | DialogMutedUpdate | DialogUnmutedUpdate | ChatTitleChangedUpdate | BotAdminPermissionsChangedUpdate;
843
+ /** You will get this `update` as soon as user presses button */
844
+ export type MessageCallbackUpdate = {
845
+ update_type: "message_callback";
846
+ /** Unix-time when event has occurred */
847
+ timestamp: string;
848
+ callback: Callback;
849
+ /** Original message containing inline keyboard. Can be `null` in case it had been deleted by the moment a bot got this update */
850
+ message?: Message | null;
851
+ /** Current user locale in IETF BCP 47 format */
852
+ user_locale?: string | null;
853
+ };
854
+ /** You will get this `update` as soon as message is created. In group chats bot receives this update only if it is administrator with `read_all_messages` permission */
855
+ export type MessageCreatedUpdate = {
856
+ update_type: "message_created";
857
+ /** Unix-time when event has occurred */
858
+ timestamp: string;
859
+ /** Newly created message */
860
+ message: Message;
861
+ /** Current user locale in IETF BCP 47 format. Available only in dialogs */
862
+ user_locale?: string | null;
863
+ };
864
+ /** You will get this `update` as soon as message is removed. In group chats bot receives this update only if it is administrator with `read_all_messages` permission */
865
+ export type MessageRemovedUpdate = {
866
+ update_type: "message_removed";
867
+ /** Unix-time when event has occurred */
868
+ timestamp: string;
869
+ /** Identifier of removed message */
870
+ message_id: MessageId;
871
+ /** Chat identifier where message has been deleted */
872
+ chat_id: ChatId;
873
+ /** User who deleted this message */
874
+ user_id: UserId;
875
+ };
876
+ /** You will get this `update` as soon as message is edited. In group chats bot receives this update only if it is administrator with `read_all_messages` permission */
877
+ export type MessageEditedUpdate = {
878
+ update_type: "message_edited";
879
+ /** Unix-time when event has occurred */
880
+ timestamp: string;
881
+ /** Edited message */
882
+ message: Message;
883
+ };
884
+ /** You will get this `update` as soon as comment is created. Bot receives this update only if it is administrator of the channel with `read_all_messages` permission */
885
+ export type CommentCreatedUpdate = {
886
+ update_type: "comment_created";
887
+ /** Unix-time when event has occurred */
888
+ timestamp: string;
889
+ /** Newly created comment */
890
+ message: Message;
891
+ };
892
+ /** You will get this `update` as soon as comment is removed. Bot receives this update only if it is administrator of the channel with `read_all_messages` permission */
893
+ export type CommentRemovedUpdate = {
894
+ update_type: "comment_removed";
895
+ /** Unix-time when event has occurred */
896
+ timestamp: string;
897
+ /** Identifier of removed comment */
898
+ message_id: MessageId;
899
+ /** Chat identifier where comment has been deleted */
900
+ chat_id: ChatId;
901
+ /** User who deleted this comment */
902
+ user_id: UserId;
903
+ /** Post identifier */
904
+ post_id: MessageId;
905
+ };
906
+ /** You will get this `update` as soon as comment is edited. Bot receives this update only if it is administrator of the channel with `read_all_messages` permission */
907
+ export type CommentEditedUpdate = {
908
+ update_type: "comment_edited";
909
+ /** Unix-time when event has occurred */
910
+ timestamp: string;
911
+ /** Edited comment */
912
+ message: Message;
913
+ };
914
+ /** You will receive this update when bot has been added to chat */
915
+ export type BotAddedToChatUpdate = {
916
+ update_type: "bot_added";
917
+ /** Unix-time when event has occurred */
918
+ timestamp: string;
919
+ /** Chat id where bot was added */
920
+ chat_id: ChatId;
921
+ /** User who added bot to chat */
922
+ user: User;
923
+ /** Indicates whether bot has been added to channel or not */
924
+ is_channel: boolean;
925
+ };
926
+ /** You will receive this update when bot has been removed from chat */
927
+ export type BotRemovedFromChatUpdate = {
928
+ update_type: "bot_removed";
929
+ /** Unix-time when event has occurred */
930
+ timestamp: string;
931
+ /** Chat identifier bot removed from */
932
+ chat_id: ChatId;
933
+ /** User who removed bot from chat */
934
+ user: User;
935
+ /** Indicates whether bot has been removed from channel or not */
936
+ is_channel: boolean;
937
+ };
938
+ /** You will receive this update when user has been added to chat where bot is administrator with `read_all_messages` permission */
939
+ export type UserAddedToChatUpdate = {
940
+ update_type: "user_added";
941
+ /** Unix-time when event has occurred */
942
+ timestamp: string;
943
+ /** Chat identifier where event has occurred */
944
+ chat_id: ChatId;
945
+ /** User added to chat */
946
+ user: User;
947
+ /** User who added user to chat. Can be `null` in case when user joined chat by link */
948
+ inviter_id?: UserId | null;
949
+ /** Indicates whether user has been added to channel or not */
950
+ is_channel: boolean;
951
+ };
952
+ /** You will receive this update when user has been removed from chat where bot is administrator with `read_all_messages` permission */
953
+ export type UserRemovedFromChatUpdate = {
954
+ update_type: "user_removed";
955
+ /** Unix-time when event has occurred */
956
+ timestamp: string;
957
+ /** Chat identifier where event has occurred */
958
+ chat_id: ChatId;
959
+ /** User removed from chat */
960
+ user: User;
961
+ /** Administrator who removed user from chat. Can be `null` in case when user left chat */
962
+ admin_id?: UserId;
963
+ /** Indicates whether user has been removed from channel or not */
964
+ is_channel: boolean;
965
+ };
966
+ /** Bot gets this type of update as soon as user pressed `Start` button */
967
+ export type BotStartedUpdate = {
968
+ update_type: "bot_started";
969
+ /** Unix-time when event has occurred */
970
+ timestamp: string;
971
+ /** Dialog identifier where event has occurred */
972
+ chat_id: ChatId;
973
+ /** User pressed the 'Start' button */
974
+ user: User;
975
+ /** Additional data from deep-link passed on bot startup */
976
+ payload?: string | null;
977
+ /** Current user locale in IETF BCP 47 format */
978
+ user_locale?: string;
979
+ };
980
+ /** Bot gets this type of update as soon as bot has been stopped */
981
+ export type BotStoppedUpdate = {
982
+ update_type: "bot_stopped";
983
+ /** Unix-time when event has occurred */
984
+ timestamp: string;
985
+ /** Dialog identifier where event has occurred */
986
+ chat_id: ChatId;
987
+ /** User who stopped the bot */
988
+ user: User;
989
+ /** Current user locale in IETF BCP 47 format */
990
+ user_locale?: string;
991
+ };
992
+ /** Bot gets this type of update as soon as dialog history has been cleared */
993
+ export type DialogClearedUpdate = {
994
+ update_type: "dialog_cleared";
995
+ /** Unix-time when event has occurred */
996
+ timestamp: string;
997
+ /** Dialog identifier where event has occurred */
998
+ chat_id: ChatId;
999
+ /** User who cleared the dialog */
1000
+ user: User;
1001
+ /** Current user locale in IETF BCP 47 format */
1002
+ user_locale?: string;
1003
+ };
1004
+ /** Bot gets this type of update as soon as dialog has been removed */
1005
+ export type DialogRemovedUpdate = {
1006
+ update_type: "dialog_removed";
1007
+ /** Unix-time when event has occurred */
1008
+ timestamp: string;
1009
+ /** Dialog identifier where event has occurred */
1010
+ chat_id: ChatId;
1011
+ /** User who removed the dialog */
1012
+ user: User;
1013
+ /** Current user locale in IETF BCP 47 format */
1014
+ user_locale?: string;
1015
+ };
1016
+ /** Bot gets this type of update as soon as dialog has been muted */
1017
+ export type DialogMutedUpdate = {
1018
+ update_type: "dialog_muted";
1019
+ /** Unix-time when event has occurred */
1020
+ timestamp: string;
1021
+ /** Dialog identifier where event has occurred */
1022
+ chat_id: ChatId;
1023
+ /** User who muted the dialog */
1024
+ user: User;
1025
+ /** Unix-time until which the dialog was muted */
1026
+ muted_until: string;
1027
+ /** Current user locale in IETF BCP 47 format */
1028
+ user_locale?: string;
1029
+ };
1030
+ /** Bot gets this type of update as soon as dialog has been unmuted */
1031
+ export type DialogUnmutedUpdate = {
1032
+ update_type: "dialog_unmuted";
1033
+ /** Unix-time when event has occurred */
1034
+ timestamp: string;
1035
+ /** Dialog identifier where event has occurred */
1036
+ chat_id: ChatId;
1037
+ /** User who unmuted the dialog */
1038
+ user: User;
1039
+ /** Current user locale in IETF BCP 47 format */
1040
+ user_locale?: string;
1041
+ };
1042
+ /** Bot gets this type of update as soon as title has been changed in chat */
1043
+ export type ChatTitleChangedUpdate = {
1044
+ update_type: "chat_title_changed";
1045
+ /** Unix-time when event has occurred */
1046
+ timestamp: string;
1047
+ /** Chat identifier where event has occurred */
1048
+ chat_id: ChatId;
1049
+ /** User who changed title */
1050
+ user: User;
1051
+ /** New title */
1052
+ title: string;
1053
+ };
1054
+ /** Bot will get this update when bot admin permissions changed */
1055
+ export type BotAdminPermissionsChangedUpdate = {
1056
+ update_type: "bot_admin_permissions_changed";
1057
+ /** Unix-time when event has occurred */
1058
+ timestamp: string;
1059
+ /** Chat identifier where event has occurred */
1060
+ chat_id: ChatId;
1061
+ /** User or bot who changed bot admin permissions */
1062
+ user_id: UserId;
1063
+ /** Bot that admin permissions changed */
1064
+ bot_id: UserId;
1065
+ /** Indicates whether bot admin permissions has been changed in channel or not */
1066
+ is_channel: boolean;
1067
+ /** Indicates whether bot is admin in chat/channel or not */
1068
+ is_admin: boolean;
1069
+ permissions?: Array<ChatAdminPermission> | null;
1070
+ };
1071
+ /** Result of members list modification request */
1072
+ export type ModifyMembersResult = {
1073
+ /** `true` if request was successful. `false` otherwise */
1074
+ success: boolean;
1075
+ /** Explanatory message if the result is not successful */
1076
+ message?: string;
1077
+ /** List of user IDs failed to add or delete */
1078
+ failed_user_ids?: Array<UserId> | null;
1079
+ failed_user_details?: Array<FailedUserDetails> | null;
1080
+ };
1081
+ /** Detailed info about why a user cannot be added to the chat. */
1082
+ export type FailedUserDetails = {
1083
+ /** Code add.participant.privacy - Privacy errors while add participants. Code add.participant.not.found - Users to add not found */
1084
+ error_code: string;
1085
+ /** List of user IDs failed to add */
1086
+ user_ids: Array<UserId>;
1087
+ };
1088
+ //# sourceMappingURL=types.d.ts.map