@zero-bot.net/tg-bot-api 1.1.0 → 1.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/lib/telegram.d.ts +4929 -0
- package/lib/telegram.js +75 -1
- package/package.json +2 -1
- package/src/telegram.d.ts +4929 -0
- package/src/telegram.js +110 -1
|
@@ -0,0 +1,4929 @@
|
|
|
1
|
+
// Type definitions for @zero-bot.net/tg-bot-api
|
|
2
|
+
// Bot API 7.0 through 10.3
|
|
3
|
+
|
|
4
|
+
import { EventEmitter } from 'events';
|
|
5
|
+
import { Stream } from 'stream';
|
|
6
|
+
import { IncomingMessage } from 'http';
|
|
7
|
+
import * as https from 'https';
|
|
8
|
+
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// TELEGRAM BOT API TYPES (Bot API 7.0 – 10.3)
|
|
11
|
+
// ============================================================================
|
|
12
|
+
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Basic Types
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
/** Integer type */
|
|
18
|
+
export type Integer = number;
|
|
19
|
+
|
|
20
|
+
/** Float type */
|
|
21
|
+
export type Float = number;
|
|
22
|
+
|
|
23
|
+
/** This object represents a Telegram user or bot. */
|
|
24
|
+
export interface User {
|
|
25
|
+
id: Integer;
|
|
26
|
+
is_bot: boolean;
|
|
27
|
+
first_name: string;
|
|
28
|
+
last_name?: string;
|
|
29
|
+
username?: string;
|
|
30
|
+
language_code?: string;
|
|
31
|
+
is_premium?: boolean;
|
|
32
|
+
added_to_attachment_menu?: boolean;
|
|
33
|
+
can_join_groups?: boolean;
|
|
34
|
+
can_read_all_group_messages?: boolean;
|
|
35
|
+
supports_inline_queries?: boolean;
|
|
36
|
+
can_connect_to_business?: boolean;
|
|
37
|
+
has_main_web_app?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** This object represents info about the user's bot. */
|
|
41
|
+
export interface BotInfo {
|
|
42
|
+
username: string;
|
|
43
|
+
first_name: string;
|
|
44
|
+
can_join_groups: boolean;
|
|
45
|
+
can_read_all_group_messages: boolean;
|
|
46
|
+
supports_inline_queries: boolean;
|
|
47
|
+
can_connect_to_business: boolean;
|
|
48
|
+
has_main_web_app: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** This object represents one special entity in a text message entity. */
|
|
52
|
+
export interface MessageEntity {
|
|
53
|
+
type: string;
|
|
54
|
+
offset: Integer;
|
|
55
|
+
length: Integer;
|
|
56
|
+
url?: string;
|
|
57
|
+
user?: User;
|
|
58
|
+
language?: string;
|
|
59
|
+
custom_emoji_id?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** This object represents one size of a photo or a file/sticker thumbnail. */
|
|
63
|
+
export interface PhotoSize {
|
|
64
|
+
file_id: string;
|
|
65
|
+
file_unique_id: string;
|
|
66
|
+
width: Integer;
|
|
67
|
+
height: Integer;
|
|
68
|
+
file_size?: Integer;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */
|
|
72
|
+
export interface Animation {
|
|
73
|
+
file_id: string;
|
|
74
|
+
file_unique_id: string;
|
|
75
|
+
width: Integer;
|
|
76
|
+
height: Integer;
|
|
77
|
+
duration: Integer;
|
|
78
|
+
thumbnail?: PhotoSize;
|
|
79
|
+
file_name?: string;
|
|
80
|
+
mime_type?: string;
|
|
81
|
+
file_size?: Integer;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** This object represents an audio file. */
|
|
85
|
+
export interface Audio {
|
|
86
|
+
file_id: string;
|
|
87
|
+
file_unique_id: string;
|
|
88
|
+
duration: Integer;
|
|
89
|
+
performer?: string;
|
|
90
|
+
title?: string;
|
|
91
|
+
file_name?: string;
|
|
92
|
+
mime_type?: string;
|
|
93
|
+
file_size?: Integer;
|
|
94
|
+
thumbnail?: PhotoSize;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** This object represents a general file (as opposed to photos, voice messages, audio files, etc.). */
|
|
98
|
+
export interface Document {
|
|
99
|
+
file_id: string;
|
|
100
|
+
file_unique_id: string;
|
|
101
|
+
thumbnail?: PhotoSize;
|
|
102
|
+
file_name?: string;
|
|
103
|
+
mime_type?: string;
|
|
104
|
+
file_size?: Integer;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** This object represents a video file. */
|
|
108
|
+
export interface Video {
|
|
109
|
+
file_id: string;
|
|
110
|
+
file_unique_id: string;
|
|
111
|
+
width: Integer;
|
|
112
|
+
height: Integer;
|
|
113
|
+
duration: Integer;
|
|
114
|
+
thumbnail?: PhotoSize;
|
|
115
|
+
file_name?: string;
|
|
116
|
+
mime_type?: string;
|
|
117
|
+
file_size?: Integer;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** This object represents a video message. */
|
|
121
|
+
export interface VideoNote {
|
|
122
|
+
file_id: string;
|
|
123
|
+
file_unique_id: string;
|
|
124
|
+
length: Integer;
|
|
125
|
+
duration: Integer;
|
|
126
|
+
thumbnail?: PhotoSize;
|
|
127
|
+
file_size?: Integer;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** This object represents a voice message. */
|
|
131
|
+
export interface Voice {
|
|
132
|
+
file_id: string;
|
|
133
|
+
file_unique_id: string;
|
|
134
|
+
duration: Integer;
|
|
135
|
+
mime_type?: string;
|
|
136
|
+
file_size?: Integer;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** This object represents a phone contact. */
|
|
140
|
+
export interface Contact {
|
|
141
|
+
phone_number: string;
|
|
142
|
+
first_name: string;
|
|
143
|
+
last_name?: string;
|
|
144
|
+
user_id?: Integer;
|
|
145
|
+
vcard?: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** This object represents an incoming inline query. */
|
|
149
|
+
export interface InlineQuery {
|
|
150
|
+
id: string;
|
|
151
|
+
from: User;
|
|
152
|
+
query: string;
|
|
153
|
+
offset: string;
|
|
154
|
+
chat_type?: string;
|
|
155
|
+
location?: Location;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** This object represents one result of an inline query. */
|
|
159
|
+
export interface InlineQueryResult {
|
|
160
|
+
type: string;
|
|
161
|
+
id: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface InlineQueryResultArticle extends InlineQueryResult {
|
|
165
|
+
type: 'article';
|
|
166
|
+
title: string;
|
|
167
|
+
input_message_content: InputMessageContent;
|
|
168
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
169
|
+
url?: string;
|
|
170
|
+
hide_url?: boolean;
|
|
171
|
+
description?: string;
|
|
172
|
+
thumb_url?: string;
|
|
173
|
+
thumb_width?: Integer;
|
|
174
|
+
thumb_height?: Integer;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface InlineQueryResultPhoto extends InlineQueryResult {
|
|
178
|
+
type: 'photo';
|
|
179
|
+
photo_url: string;
|
|
180
|
+
thumbnail_url: string;
|
|
181
|
+
photo_width?: Integer;
|
|
182
|
+
photo_height?: Integer;
|
|
183
|
+
title?: string;
|
|
184
|
+
description?: string;
|
|
185
|
+
caption?: string;
|
|
186
|
+
parse_mode?: string;
|
|
187
|
+
caption_entities?: MessageEntity[];
|
|
188
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
189
|
+
input_message_content?: InputMessageContent;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface InlineQueryResultGif extends InlineQueryResult {
|
|
193
|
+
type: 'gif';
|
|
194
|
+
gif_url: string;
|
|
195
|
+
gif_width?: Integer;
|
|
196
|
+
gif_height?: Integer;
|
|
197
|
+
gif_duration?: Integer;
|
|
198
|
+
thumbnail_url: string;
|
|
199
|
+
title?: string;
|
|
200
|
+
caption?: string;
|
|
201
|
+
parse_mode?: string;
|
|
202
|
+
caption_entities?: MessageEntity[];
|
|
203
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
204
|
+
input_message_content?: InputMessageContent;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface InlineQueryResultMpeg4Gif extends InlineQueryResult {
|
|
208
|
+
type: 'mpeg4_gif';
|
|
209
|
+
mpeg4_url: string;
|
|
210
|
+
mpeg4_width?: Integer;
|
|
211
|
+
mpeg4_height?: Integer;
|
|
212
|
+
mpeg4_duration?: Integer;
|
|
213
|
+
thumbnail_url: string;
|
|
214
|
+
title?: string;
|
|
215
|
+
caption?: string;
|
|
216
|
+
parse_mode?: string;
|
|
217
|
+
caption_entities?: MessageEntity[];
|
|
218
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
219
|
+
input_message_content?: InputMessageContent;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface InlineQueryResultVideo extends InlineQueryResult {
|
|
223
|
+
type: 'video';
|
|
224
|
+
video_url: string;
|
|
225
|
+
mime_type: string;
|
|
226
|
+
thumbnail_url: string;
|
|
227
|
+
title: string;
|
|
228
|
+
caption?: string;
|
|
229
|
+
parse_mode?: string;
|
|
230
|
+
caption_entities?: MessageEntity[];
|
|
231
|
+
video_width?: Integer;
|
|
232
|
+
video_height?: Integer;
|
|
233
|
+
video_duration?: Integer;
|
|
234
|
+
description?: string;
|
|
235
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
236
|
+
input_message_content?: InputMessageContent;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface InlineQueryResultAudio extends InlineQueryResult {
|
|
240
|
+
type: 'audio';
|
|
241
|
+
audio_url: string;
|
|
242
|
+
title: string;
|
|
243
|
+
caption?: string;
|
|
244
|
+
parse_mode?: string;
|
|
245
|
+
caption_entities?: MessageEntity[];
|
|
246
|
+
performer?: string;
|
|
247
|
+
audio_duration?: Integer;
|
|
248
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
249
|
+
input_message_content?: InputMessageContent;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface InlineQueryResultVoice extends InlineQueryResult {
|
|
253
|
+
type: 'voice';
|
|
254
|
+
voice_url: string;
|
|
255
|
+
title: string;
|
|
256
|
+
caption?: string;
|
|
257
|
+
parse_mode?: string;
|
|
258
|
+
caption_entities?: MessageEntity[];
|
|
259
|
+
voice_duration?: Integer;
|
|
260
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
261
|
+
input_message_content?: InputMessageContent;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface InlineQueryResultDocument extends InlineQueryResult {
|
|
265
|
+
type: 'document';
|
|
266
|
+
title: string;
|
|
267
|
+
caption?: string;
|
|
268
|
+
parse_mode?: string;
|
|
269
|
+
caption_entities?: MessageEntity[];
|
|
270
|
+
document_url: string;
|
|
271
|
+
mime_type: string;
|
|
272
|
+
description?: string;
|
|
273
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
274
|
+
input_message_content?: InputMessageContent;
|
|
275
|
+
thumbnail_url?: string;
|
|
276
|
+
thumbnail_width?: Integer;
|
|
277
|
+
thumbnail_height?: Integer;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export interface InlineQueryResultLocation extends InlineQueryResult {
|
|
281
|
+
type: 'location';
|
|
282
|
+
latitude: Float;
|
|
283
|
+
longitude: Float;
|
|
284
|
+
title: string;
|
|
285
|
+
live_period?: Integer;
|
|
286
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
287
|
+
input_message_content?: InputMessageContent;
|
|
288
|
+
thumbnail_url?: string;
|
|
289
|
+
thumbnail_width?: Integer;
|
|
290
|
+
thumbnail_height?: Integer;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export interface InlineQueryResultVenue extends InlineQueryResult {
|
|
294
|
+
type: 'venue';
|
|
295
|
+
latitude: Float;
|
|
296
|
+
longitude: Float;
|
|
297
|
+
title: string;
|
|
298
|
+
address: string;
|
|
299
|
+
foursquare_id?: string;
|
|
300
|
+
foursquare_type?: string;
|
|
301
|
+
google_place_id?: string;
|
|
302
|
+
google_place_type?: string;
|
|
303
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
304
|
+
input_message_content?: InputMessageContent;
|
|
305
|
+
thumbnail_url?: string;
|
|
306
|
+
thumbnail_width?: Integer;
|
|
307
|
+
thumbnail_height?: Integer;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export interface InlineQueryResultContact extends InlineQueryResult {
|
|
311
|
+
type: 'contact';
|
|
312
|
+
phone_number: string;
|
|
313
|
+
first_name: string;
|
|
314
|
+
last_name?: string;
|
|
315
|
+
vcard?: string;
|
|
316
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
317
|
+
input_message_content?: InputMessageContent;
|
|
318
|
+
thumbnail_url?: string;
|
|
319
|
+
thumbnail_width?: Integer;
|
|
320
|
+
thumbnail_height?: Integer;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export interface InlineQueryResultGame extends InlineQueryResult {
|
|
324
|
+
type: 'game';
|
|
325
|
+
game_short_name: string;
|
|
326
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export interface InlineQueryResultCachedPhoto extends InlineQueryResult {
|
|
330
|
+
type: 'photo';
|
|
331
|
+
photo_file_id: string;
|
|
332
|
+
title?: string;
|
|
333
|
+
description?: string;
|
|
334
|
+
caption?: string;
|
|
335
|
+
parse_mode?: string;
|
|
336
|
+
caption_entities?: MessageEntity[];
|
|
337
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
338
|
+
input_message_content?: InputMessageContent;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export interface InlineQueryResultCachedGif extends InlineQueryResult {
|
|
342
|
+
type: 'gif';
|
|
343
|
+
id: string;
|
|
344
|
+
gif_file_id: string;
|
|
345
|
+
title?: string;
|
|
346
|
+
caption?: string;
|
|
347
|
+
parse_mode?: string;
|
|
348
|
+
caption_entities?: MessageEntity[];
|
|
349
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
350
|
+
input_message_content?: InputMessageContent;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export interface InlineQueryResultCachedMpeg4Gif extends InlineQueryResult {
|
|
354
|
+
type: 'mpeg4_gif';
|
|
355
|
+
mpeg4_file_id: string;
|
|
356
|
+
title?: string;
|
|
357
|
+
caption?: string;
|
|
358
|
+
parse_mode?: string;
|
|
359
|
+
caption_entities?: MessageEntity[];
|
|
360
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
361
|
+
input_message_content?: InputMessageContent;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export interface InlineQueryResultCachedSticker extends InlineQueryResult {
|
|
365
|
+
type: 'sticker';
|
|
366
|
+
sticker_file_id: string;
|
|
367
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
368
|
+
input_message_content?: InputMessageContent;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export interface InlineQueryResultCachedDocument extends InlineQueryResult {
|
|
372
|
+
type: 'document';
|
|
373
|
+
title: string;
|
|
374
|
+
document_file_id: string;
|
|
375
|
+
description?: string;
|
|
376
|
+
caption?: string;
|
|
377
|
+
parse_mode?: string;
|
|
378
|
+
caption_entities?: MessageEntity[];
|
|
379
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
380
|
+
input_message_content?: InputMessageContent;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export interface InlineQueryResultCachedVideo extends InlineQueryResult {
|
|
384
|
+
type: 'video';
|
|
385
|
+
video_file_id: string;
|
|
386
|
+
title: string;
|
|
387
|
+
description?: string;
|
|
388
|
+
caption?: string;
|
|
389
|
+
parse_mode?: string;
|
|
390
|
+
caption_entities?: MessageEntity[];
|
|
391
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
392
|
+
input_message_content?: InputMessageContent;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export interface InlineQueryResultCachedVoice extends InlineQueryResult {
|
|
396
|
+
type: 'voice';
|
|
397
|
+
voice_file_id: string;
|
|
398
|
+
title: string;
|
|
399
|
+
caption?: string;
|
|
400
|
+
parse_mode?: string;
|
|
401
|
+
caption_entities?: MessageEntity[];
|
|
402
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
403
|
+
input_message_content?: InputMessageContent;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export interface InlineQueryResultCachedAudio extends InlineQueryResult {
|
|
407
|
+
type: 'audio';
|
|
408
|
+
audio_file_id: string;
|
|
409
|
+
caption?: string;
|
|
410
|
+
parse_mode?: string;
|
|
411
|
+
caption_entities?: MessageEntity[];
|
|
412
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
413
|
+
input_message_content?: InputMessageContent;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/** Describes the content of a message to be sent as a result of an inline query. */
|
|
417
|
+
export type InputMessageContent =
|
|
418
|
+
| InputTextMessageContent
|
|
419
|
+
| InputLocationMessageContent
|
|
420
|
+
| InputVenueMessageContent
|
|
421
|
+
| InputContactMessageContent
|
|
422
|
+
| InputInvoiceMessageContent;
|
|
423
|
+
|
|
424
|
+
export interface InputTextMessageContent {
|
|
425
|
+
message_text: string;
|
|
426
|
+
parse_mode?: string;
|
|
427
|
+
entities?: MessageEntity[];
|
|
428
|
+
link_preview_options?: LinkPreviewOptions;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export interface InputLocationMessageContent {
|
|
432
|
+
latitude: Float;
|
|
433
|
+
longitude: Float;
|
|
434
|
+
live_period?: Integer;
|
|
435
|
+
horizontal_accuracy?: Float;
|
|
436
|
+
heading?: Integer;
|
|
437
|
+
proximity_alert_radius?: Integer;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export interface InputVenueMessageContent {
|
|
441
|
+
latitude: Float;
|
|
442
|
+
longitude: Float;
|
|
443
|
+
title: string;
|
|
444
|
+
address: string;
|
|
445
|
+
foursquare_id?: string;
|
|
446
|
+
foursquare_type?: string;
|
|
447
|
+
google_place_id?: string;
|
|
448
|
+
google_place_type?: string;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export interface InputContactMessageContent {
|
|
452
|
+
phone_number: string;
|
|
453
|
+
first_name: string;
|
|
454
|
+
last_name?: string;
|
|
455
|
+
vcard?: string;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export interface InputInvoiceMessageContent {
|
|
459
|
+
title: string;
|
|
460
|
+
description: string;
|
|
461
|
+
payload: string;
|
|
462
|
+
provider_token?: string;
|
|
463
|
+
currency: string;
|
|
464
|
+
prices: LabeledPrice[];
|
|
465
|
+
max_tip_amount?: Integer;
|
|
466
|
+
suggested_tip_amounts?: Integer[];
|
|
467
|
+
provider_data?: string;
|
|
468
|
+
photo_url?: string;
|
|
469
|
+
photo_size?: Integer;
|
|
470
|
+
photo_width?: Integer;
|
|
471
|
+
photo_height?: Integer;
|
|
472
|
+
need_name?: boolean;
|
|
473
|
+
need_phone_number?: boolean;
|
|
474
|
+
need_email?: boolean;
|
|
475
|
+
need_shipping_address?: boolean;
|
|
476
|
+
send_phone_number_to_provider?: boolean;
|
|
477
|
+
send_email_to_provider?: boolean;
|
|
478
|
+
is_flexible?: boolean;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/** This object represents one result of an inline query that was chosen by the user and sent to their chat partner. */
|
|
482
|
+
export interface ChosenInlineResult {
|
|
483
|
+
result_id: string;
|
|
484
|
+
from: User;
|
|
485
|
+
query: string;
|
|
486
|
+
inline_message_id?: string;
|
|
487
|
+
location?: Location;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/** This object represents the content of a successful payment. */
|
|
491
|
+
export interface SuccessfulPayment {
|
|
492
|
+
currency: string;
|
|
493
|
+
total_amount: Integer;
|
|
494
|
+
invoice_payload: string;
|
|
495
|
+
shipping_option_id?: string;
|
|
496
|
+
order_info?: OrderInfo;
|
|
497
|
+
telegram_payment_charge_id: string;
|
|
498
|
+
provider_payment_charge_id: string;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/** This object contains information about an incoming pre-checkout query. */
|
|
502
|
+
export interface PreCheckoutQuery {
|
|
503
|
+
id: string;
|
|
504
|
+
from: User;
|
|
505
|
+
currency: string;
|
|
506
|
+
total_amount: Integer;
|
|
507
|
+
invoice_payload: string;
|
|
508
|
+
shipping_option_id?: string;
|
|
509
|
+
order_info?: OrderInfo;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/** This object represents one shipping option. */
|
|
513
|
+
export interface ShippingOption {
|
|
514
|
+
id: string;
|
|
515
|
+
title: string;
|
|
516
|
+
prices: LabeledPrice[];
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/** This object represents a shipping address. */
|
|
520
|
+
export interface ShippingAddress {
|
|
521
|
+
country_code: string;
|
|
522
|
+
state: string;
|
|
523
|
+
city: string;
|
|
524
|
+
street_line1: string;
|
|
525
|
+
street_line2: string;
|
|
526
|
+
post_code: string;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/** This object represents information about an order. */
|
|
530
|
+
export interface OrderInfo {
|
|
531
|
+
name?: string;
|
|
532
|
+
phone_number?: string;
|
|
533
|
+
email?: string;
|
|
534
|
+
shipping_address?: ShippingAddress;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/** This object represents a price. */
|
|
538
|
+
export interface LabeledPrice {
|
|
539
|
+
label: string;
|
|
540
|
+
amount: Integer;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/** This object represents one shipping query. */
|
|
544
|
+
export interface ShippingQuery {
|
|
545
|
+
id: string;
|
|
546
|
+
from: User;
|
|
547
|
+
invoice_payload: string;
|
|
548
|
+
shipping_address: ShippingAddress;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/** This object represents a poll. */
|
|
552
|
+
export interface Poll {
|
|
553
|
+
id: string;
|
|
554
|
+
question: string;
|
|
555
|
+
options: PollOption[];
|
|
556
|
+
total_voter_count: Integer;
|
|
557
|
+
is_closed: boolean;
|
|
558
|
+
is_anonymous: boolean;
|
|
559
|
+
type: string;
|
|
560
|
+
allows_multiple_answers: boolean;
|
|
561
|
+
correct_option_id?: Integer;
|
|
562
|
+
explanation?: string;
|
|
563
|
+
explanation_entities?: MessageEntity[];
|
|
564
|
+
open_period?: Integer;
|
|
565
|
+
close_date?: Integer;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/** This object represents one answer of a user from a poll. */
|
|
569
|
+
export interface PollAnswer {
|
|
570
|
+
poll_id: string;
|
|
571
|
+
voter_chat?: Chat;
|
|
572
|
+
user?: User;
|
|
573
|
+
option_ids: Integer[];
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/** This object represents an answer of a user in a non-anonymous poll. */
|
|
577
|
+
export interface PollOption {
|
|
578
|
+
text: string;
|
|
579
|
+
voter_count: Integer;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/** This object contains information about a user that was added to a chat. */
|
|
583
|
+
export interface ChatMemberUpdated {
|
|
584
|
+
chat: Chat;
|
|
585
|
+
from: User;
|
|
586
|
+
date: Integer;
|
|
587
|
+
old_chat_member: ChatMember;
|
|
588
|
+
new_chat_member: ChatMember;
|
|
589
|
+
invite_link?: ChatInviteLink;
|
|
590
|
+
via_join_request?: boolean;
|
|
591
|
+
via_chat_folder_invite_link?: boolean;
|
|
592
|
+
via_business_bot?: boolean;
|
|
593
|
+
old_chat_member_is_direct?: boolean;
|
|
594
|
+
new_chat_member_is_direct?: boolean;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/** This object represents a chat join request. */
|
|
598
|
+
export interface ChatJoinRequest {
|
|
599
|
+
chat: Chat;
|
|
600
|
+
from: User;
|
|
601
|
+
user_chat_id: Integer;
|
|
602
|
+
date: Integer;
|
|
603
|
+
bio?: string;
|
|
604
|
+
invite_link?: ChatInviteLink;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/** This object contains information about one member of a chat. */
|
|
608
|
+
export type ChatMember =
|
|
609
|
+
| ChatMemberOwner
|
|
610
|
+
| ChatMemberAdministrator
|
|
611
|
+
| ChatMemberMember
|
|
612
|
+
| ChatMemberRestricted
|
|
613
|
+
| ChatMemberLeft
|
|
614
|
+
| ChatMemberBanned;
|
|
615
|
+
|
|
616
|
+
export interface ChatMemberOwner {
|
|
617
|
+
status: 'creator';
|
|
618
|
+
user: User;
|
|
619
|
+
is_anonymous: boolean;
|
|
620
|
+
custom_title?: string;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export interface ChatMemberAdministrator {
|
|
624
|
+
status: 'administrator';
|
|
625
|
+
user: User;
|
|
626
|
+
can_be_edited: boolean;
|
|
627
|
+
can_manage_chat: boolean;
|
|
628
|
+
can_delete_messages: boolean;
|
|
629
|
+
can_manage_video_chats: boolean;
|
|
630
|
+
can_restrict_members: boolean;
|
|
631
|
+
can_promote_members: boolean;
|
|
632
|
+
can_change_info: boolean;
|
|
633
|
+
can_invite_users: boolean;
|
|
634
|
+
can_post_messages?: boolean;
|
|
635
|
+
can_edit_messages?: boolean;
|
|
636
|
+
can_pin_messages?: boolean;
|
|
637
|
+
can_manage_topics?: boolean;
|
|
638
|
+
is_anonymous?: boolean;
|
|
639
|
+
custom_title?: string;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export interface ChatMemberMember {
|
|
643
|
+
status: 'member';
|
|
644
|
+
user: User;
|
|
645
|
+
until_date?: Integer;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export interface ChatMemberRestricted {
|
|
649
|
+
status: 'restricted';
|
|
650
|
+
user: User;
|
|
651
|
+
is_member: boolean;
|
|
652
|
+
can_send_messages: boolean;
|
|
653
|
+
can_send_audios: boolean;
|
|
654
|
+
can_send_documents: boolean;
|
|
655
|
+
can_send_photos: boolean;
|
|
656
|
+
can_send_videos: boolean;
|
|
657
|
+
can_send_video_notes: boolean;
|
|
658
|
+
can_send_voice_notes: boolean;
|
|
659
|
+
can_send_polls: boolean;
|
|
660
|
+
can_send_other_messages: boolean;
|
|
661
|
+
can_add_web_page_previews: boolean;
|
|
662
|
+
can_change_info: boolean;
|
|
663
|
+
can_invite_users: boolean;
|
|
664
|
+
can_pin_messages: boolean;
|
|
665
|
+
can_manage_topics: boolean;
|
|
666
|
+
until_date: Integer;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
export interface ChatMemberLeft {
|
|
670
|
+
status: 'left';
|
|
671
|
+
user: User;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
export interface ChatMemberBanned {
|
|
675
|
+
status: 'kicked';
|
|
676
|
+
user: User;
|
|
677
|
+
until_date: Integer;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/** This object represents a chat photo. */
|
|
681
|
+
export interface ChatPhoto {
|
|
682
|
+
small_file_id: string;
|
|
683
|
+
small_file_unique_id: string;
|
|
684
|
+
big_file_id: string;
|
|
685
|
+
big_file_unique_id: string;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/** This object represents an invite link for a chat. */
|
|
689
|
+
export interface ChatInviteLink {
|
|
690
|
+
invite_link: string;
|
|
691
|
+
creator: User;
|
|
692
|
+
creates_join_request: boolean;
|
|
693
|
+
is_primary: boolean;
|
|
694
|
+
is_revoked: boolean;
|
|
695
|
+
name?: string;
|
|
696
|
+
expire_date?: Integer;
|
|
697
|
+
member_limit?: Integer;
|
|
698
|
+
pending_join_request_count?: Integer;
|
|
699
|
+
subscription_period?: Integer;
|
|
700
|
+
subscription_price?: Integer;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/** This object contains information about a chat boost. */
|
|
704
|
+
export interface ChatBoost {
|
|
705
|
+
boost_id: string;
|
|
706
|
+
add_date: Integer;
|
|
707
|
+
expiration_date: Integer;
|
|
708
|
+
source: ChatBoostSource;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/** Describes the source of a chat boost. */
|
|
712
|
+
export type ChatBoostSource = ChatBoostSourcePremium | ChatBoostSourceGiftCode | ChatBoostSourceGiveaway;
|
|
713
|
+
|
|
714
|
+
export interface ChatBoostSourcePremium {
|
|
715
|
+
source: 'premium';
|
|
716
|
+
user: User;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export interface ChatBoostSourceGiftCode {
|
|
720
|
+
source: 'gift_code';
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
export interface ChatBoostSourceGiveaway {
|
|
724
|
+
source: 'giveaway';
|
|
725
|
+
giveaway_message_id: Integer;
|
|
726
|
+
user?: User;
|
|
727
|
+
is_unclaimed?: boolean;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/** This object describes a chat's membership in a chat subscription. */
|
|
731
|
+
export interface ChatSubscription {
|
|
732
|
+
subscription_id: Integer;
|
|
733
|
+
subscription_period: Integer;
|
|
734
|
+
subscription_price: Integer;
|
|
735
|
+
invite_link: string;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/** Represents the rights of an administrator in a chat. */
|
|
739
|
+
export interface ChatAdministratorRights {
|
|
740
|
+
is_anonymous: boolean;
|
|
741
|
+
can_manage_chat: boolean;
|
|
742
|
+
can_delete_messages: boolean;
|
|
743
|
+
can_manage_video_chats: boolean;
|
|
744
|
+
can_restrict_members: boolean;
|
|
745
|
+
can_promote_members: boolean;
|
|
746
|
+
can_change_info: boolean;
|
|
747
|
+
can_invite_users: boolean;
|
|
748
|
+
can_post_messages?: boolean;
|
|
749
|
+
can_edit_messages?: boolean;
|
|
750
|
+
can_pin_messages?: boolean;
|
|
751
|
+
can_manage_topics?: boolean;
|
|
752
|
+
can_post_stories?: boolean;
|
|
753
|
+
can_edit_stories?: boolean;
|
|
754
|
+
can_delete_stories?: boolean;
|
|
755
|
+
can_manage_direct_messages?: boolean;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/** This object represents the permissions of a default chat administrator in a chat. */
|
|
759
|
+
export interface ChatPermissions {
|
|
760
|
+
can_send_messages?: boolean;
|
|
761
|
+
can_send_audios?: boolean;
|
|
762
|
+
can_send_documents?: boolean;
|
|
763
|
+
can_send_photos?: boolean;
|
|
764
|
+
can_send_videos?: boolean;
|
|
765
|
+
can_send_video_notes?: boolean;
|
|
766
|
+
can_send_voice_notes?: boolean;
|
|
767
|
+
can_send_polls?: boolean;
|
|
768
|
+
can_send_other_messages?: boolean;
|
|
769
|
+
can_add_web_page_previews?: boolean;
|
|
770
|
+
can_change_info?: boolean;
|
|
771
|
+
can_invite_users?: boolean;
|
|
772
|
+
can_pin_messages?: boolean;
|
|
773
|
+
can_manage_topics?: boolean;
|
|
774
|
+
can_change_gift_settings?: boolean;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/** This object represents a forum topic. */
|
|
778
|
+
export interface ForumTopic {
|
|
779
|
+
message_thread_id: Integer;
|
|
780
|
+
name: string;
|
|
781
|
+
icon_color: Integer;
|
|
782
|
+
icon_custom_emoji_id?: string;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/** This object describes a bot's menu button in a private chat. */
|
|
786
|
+
export type MenuButton = MenuButtonCommands | MenuButtonWebApp | MenuButtonDefault;
|
|
787
|
+
|
|
788
|
+
export interface MenuButtonCommands {
|
|
789
|
+
type: 'commands';
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
export interface MenuButtonWebApp {
|
|
793
|
+
type: 'web_app';
|
|
794
|
+
text: string;
|
|
795
|
+
web_app: WebAppInfo;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
export interface MenuButtonDefault {
|
|
799
|
+
type: 'default';
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
/** This object represents a file ready to be downloaded. */
|
|
803
|
+
export interface File {
|
|
804
|
+
file_id: string;
|
|
805
|
+
file_unique_id: string;
|
|
806
|
+
file_size?: Integer;
|
|
807
|
+
file_path?: string;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/** This object represents a user's profile pictures. */
|
|
811
|
+
export interface UserProfilePhotos {
|
|
812
|
+
total_count: Integer;
|
|
813
|
+
photos: PhotoSize[][];
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/** This object represents an area on a map. */
|
|
817
|
+
export interface Location {
|
|
818
|
+
longitude: Float;
|
|
819
|
+
latitude: Float;
|
|
820
|
+
horizontal_accuracy?: Float;
|
|
821
|
+
live_period?: Integer;
|
|
822
|
+
heading?: Integer;
|
|
823
|
+
proximity_alert_radius?: Integer;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/** This object represents a venue. */
|
|
827
|
+
export interface Venue {
|
|
828
|
+
location: Location;
|
|
829
|
+
title: string;
|
|
830
|
+
address: string;
|
|
831
|
+
foursquare_id?: string;
|
|
832
|
+
foursquare_type?: string;
|
|
833
|
+
google_place_id?: string;
|
|
834
|
+
google_place_type?: string;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/** Describes data sent from a Web App to the bot. */
|
|
838
|
+
export interface WebAppData {
|
|
839
|
+
data: string;
|
|
840
|
+
button_text: string;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/** Describes a Web App. */
|
|
844
|
+
export interface WebAppInfo {
|
|
845
|
+
url: string;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/** This object describes the origin of a story. */
|
|
849
|
+
export interface StoryOrigin {
|
|
850
|
+
type: string;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
export interface StoryOriginMessageForwardedFromChannel extends StoryOrigin {
|
|
854
|
+
type: 'message_forwarded_from_channel';
|
|
855
|
+
chat: Chat;
|
|
856
|
+
message_id: Integer;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export interface StoryOriginMessageEditedPost extends StoryOrigin {
|
|
860
|
+
type: 'message_edited_post';
|
|
861
|
+
chat: Chat;
|
|
862
|
+
message_id: Integer;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/** This object describes the source of a story. */
|
|
866
|
+
export interface Story {
|
|
867
|
+
id: Integer;
|
|
868
|
+
from: User;
|
|
869
|
+
owner_chat?: Chat;
|
|
870
|
+
caption?: string;
|
|
871
|
+
entities?: MessageEntity[];
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/** Represents the rights of a story poster. */
|
|
875
|
+
export interface StoryAreaPosition {
|
|
876
|
+
x_percentage: Float;
|
|
877
|
+
y_percentage: Float;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/** This object describes a story area. */
|
|
881
|
+
export type StoryAreaType =
|
|
882
|
+
| StoryAreaTypeLocation
|
|
883
|
+
| StoryAreaTypeVenue
|
|
884
|
+
| StoryAreaTypeReaction
|
|
885
|
+
| StoryAreaTypeLink
|
|
886
|
+
| StoryAreaTypeSuggestedReaction;
|
|
887
|
+
|
|
888
|
+
export interface StoryAreaTypeLocation {
|
|
889
|
+
type: 'location';
|
|
890
|
+
location: Location;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
export interface StoryAreaTypeVenue {
|
|
894
|
+
type: 'venue';
|
|
895
|
+
venue: Venue;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export interface StoryAreaTypeReaction {
|
|
899
|
+
type: 'reaction';
|
|
900
|
+
reaction_type: ReactionType;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
export interface StoryAreaTypeLink {
|
|
904
|
+
type: 'link';
|
|
905
|
+
url: string;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
export interface StoryAreaTypeSuggestedReaction {
|
|
909
|
+
type: 'suggested_reaction';
|
|
910
|
+
reaction_type: ReactionType;
|
|
911
|
+
is_dark?: boolean;
|
|
912
|
+
is_flipped?: boolean;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export interface StoryArea {
|
|
916
|
+
position: StoryAreaPosition;
|
|
917
|
+
type: StoryAreaType;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/** This object describes the paid media content to be sent. */
|
|
921
|
+
export interface PaidMediaInfo {
|
|
922
|
+
star_count: Integer;
|
|
923
|
+
media: PaidMedia[];
|
|
924
|
+
caption?: string;
|
|
925
|
+
parse_mode?: string;
|
|
926
|
+
caption_entities?: MessageEntity[];
|
|
927
|
+
payload?: string;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/** This object describes paid media content. */
|
|
931
|
+
export type PaidMedia = PaidMediaPhoto | PaidMediaVideo;
|
|
932
|
+
|
|
933
|
+
export interface PaidMediaPhoto {
|
|
934
|
+
type: 'photo';
|
|
935
|
+
photo: PhotoSize[];
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export interface PaidMediaVideo {
|
|
939
|
+
type: 'video';
|
|
940
|
+
video: Video;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
/** This object describes a paid media video. */
|
|
944
|
+
export interface PaidMediaPreview {
|
|
945
|
+
width?: Integer;
|
|
946
|
+
height?: Integer;
|
|
947
|
+
duration?: Integer;
|
|
948
|
+
thumbnail?: PhotoSize;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/** This object describes a paid media sticker set. */
|
|
952
|
+
export interface StarTransaction {
|
|
953
|
+
id: string;
|
|
954
|
+
source: TransactionParticipant;
|
|
955
|
+
receiver: TransactionParticipant;
|
|
956
|
+
amount: Integer;
|
|
957
|
+
date: Integer;
|
|
958
|
+
nanostar?: Integer;
|
|
959
|
+
voucher_code?: string;
|
|
960
|
+
invoice_payload?: string;
|
|
961
|
+
subscription_period?: Integer;
|
|
962
|
+
gift?: Gift;
|
|
963
|
+
unique_gift?: UniqueGift;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/** Describes a transaction participant. */
|
|
967
|
+
export type TransactionParticipant =
|
|
968
|
+
| TransactionParticipantUser
|
|
969
|
+
| TransactionParticipantChat
|
|
970
|
+
| TransactionParticipantChannel
|
|
971
|
+
| TransactionParticipantFragmentServer
|
|
972
|
+
| TransactionParticipantOther;
|
|
973
|
+
|
|
974
|
+
export interface TransactionParticipantUser {
|
|
975
|
+
type: 'user';
|
|
976
|
+
user: User;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
export interface TransactionParticipantChat {
|
|
980
|
+
type: 'chat';
|
|
981
|
+
chat: Chat;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
export interface TransactionParticipantChannel {
|
|
985
|
+
type: 'channel';
|
|
986
|
+
chat: Chat;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
export interface TransactionParticipantFragmentServer {
|
|
990
|
+
type: 'fragment_server';
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
export interface TransactionParticipantOther {
|
|
994
|
+
type: 'other';
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/** This object represents a gift. */
|
|
998
|
+
export interface Gift {
|
|
999
|
+
id: string;
|
|
1000
|
+
sticker: Sticker;
|
|
1001
|
+
star_count: Integer;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/** This object represents a unique gift. */
|
|
1005
|
+
export interface UniqueGift {
|
|
1006
|
+
name: string;
|
|
1007
|
+
number: Integer;
|
|
1008
|
+
model: UniqueGiftModel;
|
|
1009
|
+
pattern: UniqueGiftPattern;
|
|
1010
|
+
backdrop: UniqueGiftBackdrop;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/** This object describes the model of a unique gift. */
|
|
1014
|
+
export interface UniqueGiftModel {
|
|
1015
|
+
name: string;
|
|
1016
|
+
sticker: Sticker;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/** This object describes the pattern of a unique gift. */
|
|
1020
|
+
export interface UniqueGiftPattern {
|
|
1021
|
+
name: string;
|
|
1022
|
+
sticker: Sticker;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/** This object describes the backdrop of a unique gift. */
|
|
1026
|
+
export interface UniqueGiftBackdrop {
|
|
1027
|
+
name: string;
|
|
1028
|
+
sticker: Sticker;
|
|
1029
|
+
center_color: Integer;
|
|
1030
|
+
edge_color: Integer;
|
|
1031
|
+
pattern_color: Integer;
|
|
1032
|
+
pattern_text_color: Integer;
|
|
1033
|
+
text_color: Integer;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/** This object represents an owned gift. */
|
|
1037
|
+
export type OwnedGift = OwnedGiftRegular | OwnedGiftUnique;
|
|
1038
|
+
|
|
1039
|
+
export interface OwnedGiftRegular {
|
|
1040
|
+
gift: Gift;
|
|
1041
|
+
owned_gift_id: string;
|
|
1042
|
+
sender_user?: User;
|
|
1043
|
+
send_date: Integer;
|
|
1044
|
+
is_birthday?: boolean;
|
|
1045
|
+
is_saved?: boolean;
|
|
1046
|
+
can_be_transferred?: boolean;
|
|
1047
|
+
transfer_star_count?: Integer;
|
|
1048
|
+
text?: string;
|
|
1049
|
+
entities?: MessageEntity[];
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
export interface OwnedGiftUnique {
|
|
1053
|
+
gift: UniqueGift;
|
|
1054
|
+
owned_gift_id: string;
|
|
1055
|
+
sender_user?: User;
|
|
1056
|
+
send_date: Integer;
|
|
1057
|
+
is_birthday?: boolean;
|
|
1058
|
+
is_saved?: boolean;
|
|
1059
|
+
can_be_transferred?: boolean;
|
|
1060
|
+
transfer_star_count?: Integer;
|
|
1061
|
+
is_upgraded?: boolean;
|
|
1062
|
+
text?: string;
|
|
1063
|
+
entities?: MessageEntity[];
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
/** This object contains a gift received and owned by a user or a chat. */
|
|
1067
|
+
export interface ReceivedGift {
|
|
1068
|
+
gift?: Gift;
|
|
1069
|
+
unique_gift?: UniqueGift;
|
|
1070
|
+
owned_gift_id?: string;
|
|
1071
|
+
sender_user?: User;
|
|
1072
|
+
send_date?: Integer;
|
|
1073
|
+
is_birthday?: boolean;
|
|
1074
|
+
text?: string;
|
|
1075
|
+
entities?: MessageEntity[];
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/** This object contains the balance of Telegram Stars. */
|
|
1079
|
+
export interface StarAmount {
|
|
1080
|
+
star_amount: Integer;
|
|
1081
|
+
nanostar_amount?: Integer;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/** This object describes a sticker. */
|
|
1085
|
+
export interface Sticker {
|
|
1086
|
+
file_id: string;
|
|
1087
|
+
file_unique_id: string;
|
|
1088
|
+
type: string;
|
|
1089
|
+
width: Integer;
|
|
1090
|
+
height: Integer;
|
|
1091
|
+
is_animated: boolean;
|
|
1092
|
+
is_video: boolean;
|
|
1093
|
+
thumbnail?: PhotoSize;
|
|
1094
|
+
set_name?: string;
|
|
1095
|
+
premium_animation?: Animation;
|
|
1096
|
+
mask_position?: MaskPosition;
|
|
1097
|
+
custom_emoji_id?: string;
|
|
1098
|
+
needs_repainting?: boolean;
|
|
1099
|
+
file_size?: Integer;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
/** This object represents a sticker set. */
|
|
1103
|
+
export interface StickerSet {
|
|
1104
|
+
name: string;
|
|
1105
|
+
title: string;
|
|
1106
|
+
sticker_type: string;
|
|
1107
|
+
is_animated: boolean;
|
|
1108
|
+
is_video: boolean;
|
|
1109
|
+
stickers: Sticker[];
|
|
1110
|
+
thumbnail?: PhotoSize;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
/** This object describes the position on the face where the mask is placed. */
|
|
1114
|
+
export interface MaskPosition {
|
|
1115
|
+
point: string;
|
|
1116
|
+
x_shift: Float;
|
|
1117
|
+
y_shift: Float;
|
|
1118
|
+
scale: Float;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
/** This object represents a custom emoji. */
|
|
1122
|
+
export interface CustomEmoji {
|
|
1123
|
+
custom_emoji_id: string;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
/** Describes a reaction to a message. */
|
|
1127
|
+
export type ReactionType =
|
|
1128
|
+
| ReactionTypeEmoji
|
|
1129
|
+
| ReactionTypeCustomEmoji
|
|
1130
|
+
| ReactionTypePaid;
|
|
1131
|
+
|
|
1132
|
+
export interface ReactionTypeEmoji {
|
|
1133
|
+
type: 'emoji';
|
|
1134
|
+
emoji: string;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export interface ReactionTypeCustomEmoji {
|
|
1138
|
+
type: 'custom_emoji';
|
|
1139
|
+
custom_emoji_id: string;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
export interface ReactionTypePaid {
|
|
1143
|
+
type: 'paid';
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
/** Describes the reactions added to a message. */
|
|
1147
|
+
export interface MessageReactionUpdated {
|
|
1148
|
+
chat: Chat;
|
|
1149
|
+
message_id: Integer;
|
|
1150
|
+
date: Integer;
|
|
1151
|
+
old_reaction: ReactionType[];
|
|
1152
|
+
new_reaction: ReactionType[];
|
|
1153
|
+
user?: User;
|
|
1154
|
+
actor_chat?: Chat;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/** This object represents a reaction added to a message along with the number of times it was added. */
|
|
1158
|
+
export interface ReactionCount {
|
|
1159
|
+
type: ReactionType;
|
|
1160
|
+
total_count: Integer;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/** This object represents a message reaction count in a chat. */
|
|
1164
|
+
export interface MessageReactionCountUpdated {
|
|
1165
|
+
chat: Chat;
|
|
1166
|
+
message_id: Integer;
|
|
1167
|
+
date: Integer;
|
|
1168
|
+
reactions: ReactionCount[];
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
/** This object describes a message to be sent as a result of an inline query. */
|
|
1172
|
+
export interface InlineQueryResultsButton {
|
|
1173
|
+
text: string;
|
|
1174
|
+
start_parameter?: string;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
/** This object represents the result of an inline query that was chosen by the user. */
|
|
1178
|
+
export interface SentWebAppMessage {
|
|
1179
|
+
inline_message_id?: string;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/** Describes a message sent on behalf of a business account. */
|
|
1183
|
+
export interface BusinessConnection {
|
|
1184
|
+
id: string;
|
|
1185
|
+
user_chat_id: Integer;
|
|
1186
|
+
user: User;
|
|
1187
|
+
date: Integer;
|
|
1188
|
+
is_enabled: boolean;
|
|
1189
|
+
can_reply?: boolean;
|
|
1190
|
+
is_deleted?: boolean;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/** Describes the connection of the bot with a business account. */
|
|
1194
|
+
export interface BusinessIntro {
|
|
1195
|
+
title?: string;
|
|
1196
|
+
message?: string;
|
|
1197
|
+
sticker?: Sticker;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
/** Describes the business opening hours of a chat. */
|
|
1201
|
+
export interface BusinessOpeningHours {
|
|
1202
|
+
opening_hours: BusinessOpeningHoursInterval[];
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
/** Describes an interval of time during which a chat is open. */
|
|
1206
|
+
export interface BusinessOpeningHoursInterval {
|
|
1207
|
+
opening_minute: Integer;
|
|
1208
|
+
closing_minute: Integer;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/** This object contains information about the boost added to a chat. */
|
|
1212
|
+
export interface ChatBoostAdded {
|
|
1213
|
+
boost_count: Integer;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
/** Describes the source of a transaction. */
|
|
1217
|
+
export type TransactionPartner =
|
|
1218
|
+
| TransactionPartnerUser
|
|
1219
|
+
| TransactionPartnerChat
|
|
1220
|
+
| TransactionPartnerChannel
|
|
1221
|
+
| TransactionPartnerFragmentServer
|
|
1222
|
+
| TransactionPartnerTelegramAds
|
|
1223
|
+
| TransactionPartnerOther;
|
|
1224
|
+
|
|
1225
|
+
export interface TransactionPartnerUser {
|
|
1226
|
+
type: 'user';
|
|
1227
|
+
user: User;
|
|
1228
|
+
invoice_payload?: string;
|
|
1229
|
+
paid_media?: PaidMediaPayload;
|
|
1230
|
+
gift?: Gift;
|
|
1231
|
+
unique_gift?: UniqueGift;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
export interface TransactionPartnerChat {
|
|
1235
|
+
type: 'chat';
|
|
1236
|
+
chat: Chat;
|
|
1237
|
+
invoice_payload?: string;
|
|
1238
|
+
paid_media?: PaidMediaPayload;
|
|
1239
|
+
gift?: Gift;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
export interface TransactionPartnerChannel {
|
|
1243
|
+
type: 'channel';
|
|
1244
|
+
chat: Chat;
|
|
1245
|
+
message_interaction_id?: Integer;
|
|
1246
|
+
paid_media?: PaidMediaPayload;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
export interface TransactionPartnerFragmentServer {
|
|
1250
|
+
type: 'fragment_server';
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
export interface TransactionPartnerTelegramAds {
|
|
1254
|
+
type: 'telegram_ads';
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
export interface TransactionPartnerOther {
|
|
1258
|
+
type: 'other';
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
/** Describes paid media payload. */
|
|
1262
|
+
export interface PaidMediaPayload {
|
|
1263
|
+
star_count: Integer;
|
|
1264
|
+
paid_media: PaidMedia[];
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
/** Describes a stored file. */
|
|
1268
|
+
|
|
1269
|
+
/** Describes the location of a chat. */
|
|
1270
|
+
export interface BusinessLocation {
|
|
1271
|
+
address: string;
|
|
1272
|
+
location?: Location;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/** This object represents a topic of a message. */
|
|
1276
|
+
export interface GiftPremiumParameters {
|
|
1277
|
+
month_count: Integer;
|
|
1278
|
+
star_count: Integer;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
/** This object contains the number of requests and chats a bot has received in a business connection. */
|
|
1282
|
+
export interface BusinessBotRights {
|
|
1283
|
+
can_reply: boolean;
|
|
1284
|
+
can_read_messages?: boolean;
|
|
1285
|
+
can_delete_messages?: boolean;
|
|
1286
|
+
can_edit_name?: boolean;
|
|
1287
|
+
can_edit_username?: boolean;
|
|
1288
|
+
can_edit_bio?: boolean;
|
|
1289
|
+
can_edit_profile_photo?: boolean;
|
|
1290
|
+
can_edit_gift_settings?: boolean;
|
|
1291
|
+
can_view_gifts_and_stars?: boolean;
|
|
1292
|
+
can_convert_gifts_to_stars?: boolean;
|
|
1293
|
+
can_upgraded_gifts?: boolean;
|
|
1294
|
+
can_transfer_stars?: boolean;
|
|
1295
|
+
can_transfer_gifts?: boolean;
|
|
1296
|
+
can_post_stories?: boolean;
|
|
1297
|
+
can_edit_stories?: boolean;
|
|
1298
|
+
can_delete_stories?: boolean;
|
|
1299
|
+
can_manage_stories?: boolean;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
/** This object contains information about the bot's current access settings for managed bots. */
|
|
1303
|
+
export interface ManagedBotAccessSettings {
|
|
1304
|
+
has_access_to_messages?: boolean;
|
|
1305
|
+
restricted_channels?: Chat[];
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/** This object contains information about a managed bot token. */
|
|
1309
|
+
export interface ManagedBotToken {
|
|
1310
|
+
bot: User;
|
|
1311
|
+
token: string;
|
|
1312
|
+
last_used?: Integer;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
/** This object contains information about a prepared keyboard button. */
|
|
1316
|
+
export interface PreparedKeyboardButton {
|
|
1317
|
+
button_id: string;
|
|
1318
|
+
button: KeyboardButton;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/** This object contains information about a prepared inline message. */
|
|
1322
|
+
export interface PreparedInlineMessage {
|
|
1323
|
+
id: string;
|
|
1324
|
+
expiration_date: Integer;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
/** This object contains information about a checklist. */
|
|
1328
|
+
export interface Checklist {
|
|
1329
|
+
title: string;
|
|
1330
|
+
tasks: ChecklistTask[];
|
|
1331
|
+
others_can_add_tasks?: boolean;
|
|
1332
|
+
others_can_mark_tasks_as_done?: boolean;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
/** This object contains information about a checklist task. */
|
|
1336
|
+
export interface ChecklistTask {
|
|
1337
|
+
id: Integer;
|
|
1338
|
+
text: string;
|
|
1339
|
+
completed_by_user?: User;
|
|
1340
|
+
completed_in_chat_message_id?: Integer;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
/** This object contains information about a rich message. */
|
|
1344
|
+
export interface RichMessageContent {
|
|
1345
|
+
type: string;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
export interface RichMessageProductInfo extends RichMessageContent {
|
|
1349
|
+
type: 'product_info';
|
|
1350
|
+
title: string;
|
|
1351
|
+
description?: string;
|
|
1352
|
+
photo?: PhotoSize[];
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/** This object describes ephemeral message parameters. */
|
|
1356
|
+
export interface EphemeralMessageParameters {
|
|
1357
|
+
is_persistent?: boolean;
|
|
1358
|
+
period: Integer;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
/** Describes an input profile photo. */
|
|
1362
|
+
export type InputProfilePhoto = InputProfilePhotoStatic | InputProfilePhotoAnimated | InputProfilePhotoVideo;
|
|
1363
|
+
|
|
1364
|
+
export interface InputProfilePhotoStatic {
|
|
1365
|
+
type: 'static';
|
|
1366
|
+
photo: InputFile;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
export interface InputProfilePhotoAnimated {
|
|
1370
|
+
type: 'animated';
|
|
1371
|
+
animation: InputFile;
|
|
1372
|
+
main_frame_timestamp?: Float;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
export interface InputProfilePhotoVideo {
|
|
1376
|
+
type: 'video';
|
|
1377
|
+
animation: InputFile;
|
|
1378
|
+
main_frame_timestamp?: Float;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/** Describes the content of a story to be posted (for API input). */
|
|
1382
|
+
export type InputStoryContent =
|
|
1383
|
+
| InputStoryContentPhoto
|
|
1384
|
+
| InputStoryContentVideo;
|
|
1385
|
+
|
|
1386
|
+
export interface InputStoryContentPhoto {
|
|
1387
|
+
type: 'photo';
|
|
1388
|
+
photo: InputFile;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
export interface InputStoryContentVideo {
|
|
1392
|
+
type: 'video';
|
|
1393
|
+
video: InputFile;
|
|
1394
|
+
duration: Float;
|
|
1395
|
+
cover_frame_timestamp?: Float;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
/** This object represents the content of a live photo. */
|
|
1399
|
+
export interface LivePhoto {
|
|
1400
|
+
static: PhotoSize;
|
|
1401
|
+
video: Video;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
/** Describes the rights of a post owner. */
|
|
1405
|
+
export interface PostOwnerRights {
|
|
1406
|
+
can_manage_chat?: boolean;
|
|
1407
|
+
can_delete_messages?: boolean;
|
|
1408
|
+
can_manage_video_chats?: boolean;
|
|
1409
|
+
can_restrict_members?: boolean;
|
|
1410
|
+
can_promote_members?: boolean;
|
|
1411
|
+
can_change_info?: boolean;
|
|
1412
|
+
can_invite_users?: boolean;
|
|
1413
|
+
can_post_messages?: boolean;
|
|
1414
|
+
can_edit_messages?: boolean;
|
|
1415
|
+
can_pin_messages?: boolean;
|
|
1416
|
+
can_manage_topics?: boolean;
|
|
1417
|
+
can_post_stories?: boolean;
|
|
1418
|
+
can_edit_stories?: boolean;
|
|
1419
|
+
can_delete_stories?: boolean;
|
|
1420
|
+
can_manage_direct_messages?: boolean;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
/** Describes the reactions that can be added to messages in a chat. */
|
|
1424
|
+
export interface ChatReactionType {
|
|
1425
|
+
type: string;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
export interface ChatReactionTypeEmoji extends ChatReactionType {
|
|
1429
|
+
type: 'emoji';
|
|
1430
|
+
emoji: string;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
export interface ChatReactionTypeCustomEmoji extends ChatReactionType {
|
|
1434
|
+
type: 'custom_emoji';
|
|
1435
|
+
custom_emoji_id: string;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
/** Describes the reaction options available in a chat. */
|
|
1439
|
+
export interface ChatReactions {
|
|
1440
|
+
type: string;
|
|
1441
|
+
is_enabled?: boolean;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
export interface ChatReactionsAll extends ChatReactions {
|
|
1445
|
+
type: 'all';
|
|
1446
|
+
are_reactions_allowed?: boolean;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
export interface ChatReactionsSome extends ChatReactions {
|
|
1450
|
+
type: 'some';
|
|
1451
|
+
reactions: ChatReactionType[];
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
/** This object describes a checklist task for sending. */
|
|
1455
|
+
export interface ChecklistTaskInput {
|
|
1456
|
+
id?: Integer;
|
|
1457
|
+
text: string;
|
|
1458
|
+
parse_mode?: string;
|
|
1459
|
+
text_entities?: MessageEntity[];
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
/** Describes a community. */
|
|
1463
|
+
export interface Community {
|
|
1464
|
+
id: Integer;
|
|
1465
|
+
name: string;
|
|
1466
|
+
description?: string;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
// ---------------------------------------------------------------------------
|
|
1470
|
+
// Chat Types
|
|
1471
|
+
// ---------------------------------------------------------------------------
|
|
1472
|
+
|
|
1473
|
+
/** This object represents a chat. */
|
|
1474
|
+
export interface Chat {
|
|
1475
|
+
id: Integer;
|
|
1476
|
+
type: string;
|
|
1477
|
+
title?: string;
|
|
1478
|
+
username?: string;
|
|
1479
|
+
first_name?: string;
|
|
1480
|
+
last_name?: string;
|
|
1481
|
+
is_forum?: boolean;
|
|
1482
|
+
photo?: ChatPhoto;
|
|
1483
|
+
active_usernames?: string[];
|
|
1484
|
+
expiration_date?: Integer;
|
|
1485
|
+
business_intro?: BusinessIntro;
|
|
1486
|
+
business_location?: BusinessLocation;
|
|
1487
|
+
business_opening_hours?: BusinessOpeningHours;
|
|
1488
|
+
can_set_sticker_set?: boolean;
|
|
1489
|
+
can_manage_video_chats?: boolean;
|
|
1490
|
+
can_read_stories?: boolean;
|
|
1491
|
+
can_post_stories?: boolean;
|
|
1492
|
+
can_edit_stories?: boolean;
|
|
1493
|
+
can_delete_stories?: boolean;
|
|
1494
|
+
emoji_status_expiration_date?: Integer;
|
|
1495
|
+
emoji_status_custom_emoji_id?: string;
|
|
1496
|
+
emoji_status_needs_uploading?: boolean;
|
|
1497
|
+
sticker_set_name?: string;
|
|
1498
|
+
join_to_send_messages?: boolean;
|
|
1499
|
+
join_by_request?: boolean;
|
|
1500
|
+
description?: string;
|
|
1501
|
+
invite_link?: string;
|
|
1502
|
+
pinned_message?: Message;
|
|
1503
|
+
permissions?: ChatPermissions;
|
|
1504
|
+
slow_mode_delay?: Integer;
|
|
1505
|
+
message_auto_delete_time?: Integer;
|
|
1506
|
+
has_hidden_members?: boolean;
|
|
1507
|
+
has_protected_content?: boolean;
|
|
1508
|
+
has_restricted_voice_and_video_messages?: boolean;
|
|
1509
|
+
has_scheduled_messages?: boolean;
|
|
1510
|
+
has_been_forwarded?: boolean;
|
|
1511
|
+
has_forum_topics?: boolean;
|
|
1512
|
+
reaction_type?: ChatReactions;
|
|
1513
|
+
subscription_period?: Integer;
|
|
1514
|
+
subscription_price?: Integer;
|
|
1515
|
+
location?: ChatLocation;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/** Extended information about the chat. */
|
|
1519
|
+
export interface ChatFullInfo {
|
|
1520
|
+
id: Integer;
|
|
1521
|
+
type: string;
|
|
1522
|
+
title?: string;
|
|
1523
|
+
username?: string;
|
|
1524
|
+
first_name?: string;
|
|
1525
|
+
last_name?: string;
|
|
1526
|
+
is_forum?: boolean;
|
|
1527
|
+
photo?: ChatPhoto;
|
|
1528
|
+
active_usernames?: string[];
|
|
1529
|
+
expiration_date?: Integer;
|
|
1530
|
+
business_intro?: BusinessIntro;
|
|
1531
|
+
business_location?: BusinessLocation;
|
|
1532
|
+
business_opening_hours?: BusinessOpeningHours;
|
|
1533
|
+
has_aggressive_anti_spam_enabled?: boolean;
|
|
1534
|
+
has_hidden_members?: boolean;
|
|
1535
|
+
has_protected_content?: boolean;
|
|
1536
|
+
has_restricted_voice_and_video_messages?: boolean;
|
|
1537
|
+
emoji_status_expiration_date?: Integer;
|
|
1538
|
+
emoji_status_custom_emoji_id?: string;
|
|
1539
|
+
emoji_status_needs_uploading?: boolean;
|
|
1540
|
+
sticker_set_name?: string;
|
|
1541
|
+
can_set_sticker_set?: boolean;
|
|
1542
|
+
has_intro_sticker?: boolean;
|
|
1543
|
+
join_to_send_messages?: boolean;
|
|
1544
|
+
join_by_request?: boolean;
|
|
1545
|
+
description?: string;
|
|
1546
|
+
invite_link?: string;
|
|
1547
|
+
pinned_message?: Message;
|
|
1548
|
+
permissions?: ChatPermissions;
|
|
1549
|
+
slow_mode_delay?: Integer;
|
|
1550
|
+
message_auto_delete_time?: Integer;
|
|
1551
|
+
has_been_forwarded?: boolean;
|
|
1552
|
+
has_forum_topics?: boolean;
|
|
1553
|
+
can_manage_chat?: boolean;
|
|
1554
|
+
can_delete_messages?: boolean;
|
|
1555
|
+
can_manage_video_chats?: boolean;
|
|
1556
|
+
can_restrict_members?: boolean;
|
|
1557
|
+
can_promote_members?: boolean;
|
|
1558
|
+
can_change_info?: boolean;
|
|
1559
|
+
can_invite_users?: boolean;
|
|
1560
|
+
can_post_messages?: boolean;
|
|
1561
|
+
can_edit_messages?: boolean;
|
|
1562
|
+
can_pin_messages?: boolean;
|
|
1563
|
+
can_manage_topics?: boolean;
|
|
1564
|
+
can_post_stories?: boolean;
|
|
1565
|
+
can_edit_stories?: boolean;
|
|
1566
|
+
can_delete_stories?: boolean;
|
|
1567
|
+
can_manage_direct_messages?: boolean;
|
|
1568
|
+
is_anonymous?: boolean;
|
|
1569
|
+
custom_title?: string;
|
|
1570
|
+
supergroup_group_description?: string;
|
|
1571
|
+
supergroup_group_username?: string;
|
|
1572
|
+
can_have_sponsored_messages?: boolean;
|
|
1573
|
+
user_chat_boost_count?: Integer;
|
|
1574
|
+
location?: ChatLocation;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
/** This object represents a location to which a chat is connected. */
|
|
1578
|
+
export interface ChatLocation {
|
|
1579
|
+
location: Location;
|
|
1580
|
+
address: string;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
/** This object contains information about a chat subscription. */
|
|
1584
|
+
|
|
1585
|
+
// ---------------------------------------------------------------------------
|
|
1586
|
+
// Message Types
|
|
1587
|
+
// ---------------------------------------------------------------------------
|
|
1588
|
+
|
|
1589
|
+
/** This object represents a message. */
|
|
1590
|
+
export interface Message {
|
|
1591
|
+
message_id: Integer;
|
|
1592
|
+
message_thread_id?: Integer;
|
|
1593
|
+
from?: User;
|
|
1594
|
+
sender_chat?: Chat;
|
|
1595
|
+
date: Integer;
|
|
1596
|
+
chat: Chat;
|
|
1597
|
+
forward_from?: User;
|
|
1598
|
+
forward_from_chat?: Chat;
|
|
1599
|
+
forward_from_message_id?: Integer;
|
|
1600
|
+
forward_signature?: string;
|
|
1601
|
+
forward_origin?: MessageOrigin;
|
|
1602
|
+
is_topic_message?: boolean;
|
|
1603
|
+
is_from_offline?: boolean;
|
|
1604
|
+
is_scheduled?: boolean;
|
|
1605
|
+
has_media_spoiler?: boolean;
|
|
1606
|
+
media_group_id?: string;
|
|
1607
|
+
linked_chat_id?: Integer;
|
|
1608
|
+
via_bot?: User;
|
|
1609
|
+
via_business_bot?: User;
|
|
1610
|
+
via_chat_folder_invite_link?: boolean;
|
|
1611
|
+
via_join_request?: boolean;
|
|
1612
|
+
via_join_link?: boolean;
|
|
1613
|
+
date_unixtime?: string;
|
|
1614
|
+
|
|
1615
|
+
reply_to_message?: Message;
|
|
1616
|
+
reply_to_story?: Story;
|
|
1617
|
+
reply_to_checklist_message_id?: Integer;
|
|
1618
|
+
reply_to_checklist_task_id?: Integer;
|
|
1619
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1620
|
+
|
|
1621
|
+
text?: string;
|
|
1622
|
+
entities?: MessageEntity[];
|
|
1623
|
+
caption?: string;
|
|
1624
|
+
caption_entities?: MessageEntity[];
|
|
1625
|
+
show_caption_above_media?: boolean;
|
|
1626
|
+
new_chat_photo?: PhotoSize[];
|
|
1627
|
+
photo?: PhotoSize[];
|
|
1628
|
+
audio?: Audio;
|
|
1629
|
+
document?: Document;
|
|
1630
|
+
animation?: Animation;
|
|
1631
|
+
video?: Video;
|
|
1632
|
+
voice?: Voice;
|
|
1633
|
+
video_note?: VideoNote;
|
|
1634
|
+
sticker?: Sticker;
|
|
1635
|
+
sticker_set_name?: string;
|
|
1636
|
+
sticker_set_title?: string;
|
|
1637
|
+
story?: Story;
|
|
1638
|
+
game?: Game;
|
|
1639
|
+
poll?: Poll;
|
|
1640
|
+
dice?: Dice;
|
|
1641
|
+
venue?: Venue;
|
|
1642
|
+
location?: Location;
|
|
1643
|
+
contact?: Contact;
|
|
1644
|
+
users_shared?: UsersShared;
|
|
1645
|
+
chat_shared?: ChatShared;
|
|
1646
|
+
invoices?: Invoice[];
|
|
1647
|
+
|
|
1648
|
+
new_chat_members?: User[];
|
|
1649
|
+
new_chat_member?: User;
|
|
1650
|
+
left_chat_member?: User;
|
|
1651
|
+
new_chat_title?: string;
|
|
1652
|
+
delete_chat_photo?: boolean;
|
|
1653
|
+
group_chat_created?: boolean;
|
|
1654
|
+
supergroup_chat_created?: boolean;
|
|
1655
|
+
channel_chat_created?: boolean;
|
|
1656
|
+
message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged;
|
|
1657
|
+
pinned_message?: MessageOrInaccessibleMessage;
|
|
1658
|
+
invoice?: Invoice;
|
|
1659
|
+
successful_payment?: SuccessfulPayment;
|
|
1660
|
+
refunded_payment?: RefundedPayment;
|
|
1661
|
+
passport_data?: PassportData;
|
|
1662
|
+
quote?: TextQuote;
|
|
1663
|
+
story_board?: StoryBoard;
|
|
1664
|
+
giveaway_created?: GiveawayCreated;
|
|
1665
|
+
giveaway?: Giveaway;
|
|
1666
|
+
giveaway_winners?: GiveawayWinners;
|
|
1667
|
+
completed_payment_discount?: TransactionPartner;
|
|
1668
|
+
|
|
1669
|
+
video_chat_started?: VideoChatStarted;
|
|
1670
|
+
video_chat_ended?: VideoChatEnded;
|
|
1671
|
+
video_chat_participants_invited?: VideoChatParticipantsInvited;
|
|
1672
|
+
video_chat_scheduled?: VideoChatScheduled;
|
|
1673
|
+
chat_background_set?: ChatBackground;
|
|
1674
|
+
chat_boost_added?: ChatBoostAdded;
|
|
1675
|
+
chat_shared_folder_added?: boolean;
|
|
1676
|
+
chat_shared_folder_deleted?: boolean;
|
|
1677
|
+
|
|
1678
|
+
service_message?: ServiceMessage;
|
|
1679
|
+
video_message?: VideoNote;
|
|
1680
|
+
web_app_data?: WebAppData;
|
|
1681
|
+
general_forum_topic_hidden?: boolean;
|
|
1682
|
+
general_forum_topic_unhidden?: boolean;
|
|
1683
|
+
write_access_allowed?: WriteAccessAllowed;
|
|
1684
|
+
chat_boost?: ChatBoost;
|
|
1685
|
+
removed_chat_boost?: ChatBoost;
|
|
1686
|
+
|
|
1687
|
+
boost?: MessageBoost;
|
|
1688
|
+
paid_media?: PaidMedia;
|
|
1689
|
+
pass_data?: PassportData;
|
|
1690
|
+
|
|
1691
|
+
story_origin?: StoryOrigin;
|
|
1692
|
+
story_sender_name?: string;
|
|
1693
|
+
|
|
1694
|
+
rich_message?: RichMessageContent;
|
|
1695
|
+
ephemeral_message?: Message;
|
|
1696
|
+
ephemeral_message_id?: string;
|
|
1697
|
+
ephemeral_period?: Integer;
|
|
1698
|
+
|
|
1699
|
+
live_photo?: LivePhoto;
|
|
1700
|
+
checklist?: Checklist;
|
|
1701
|
+
suggested_post_approved?: boolean;
|
|
1702
|
+
suggested_post_declined?: boolean;
|
|
1703
|
+
suggested_post_info?: SuggestedPostInfo;
|
|
1704
|
+
|
|
1705
|
+
from_shared_folder?: boolean;
|
|
1706
|
+
to_shared_folder?: boolean;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
/** Describes the origin of a message. */
|
|
1710
|
+
export type MessageOrigin =
|
|
1711
|
+
| MessageOriginUser
|
|
1712
|
+
| MessageOriginHiddenUser
|
|
1713
|
+
| MessageOriginChat
|
|
1714
|
+
| MessageOriginChannel;
|
|
1715
|
+
|
|
1716
|
+
export interface MessageOriginUser {
|
|
1717
|
+
type: 'user';
|
|
1718
|
+
date: Integer;
|
|
1719
|
+
from_user: User;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
export interface MessageOriginHiddenUser {
|
|
1723
|
+
type: 'hidden_user';
|
|
1724
|
+
date: Integer;
|
|
1725
|
+
sender_user_name: string;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
export interface MessageOriginChat {
|
|
1729
|
+
type: 'chat';
|
|
1730
|
+
date: Integer;
|
|
1731
|
+
sender_chat: Chat;
|
|
1732
|
+
author_signature?: string;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
export interface MessageOriginChannel {
|
|
1736
|
+
type: 'channel';
|
|
1737
|
+
date: Integer;
|
|
1738
|
+
chat: Chat;
|
|
1739
|
+
message_id: Integer;
|
|
1740
|
+
author_signature?: string;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
/** This object describes a message boost. */
|
|
1744
|
+
export interface MessageBoost {
|
|
1745
|
+
boost_id: string;
|
|
1746
|
+
add_date: Integer;
|
|
1747
|
+
expiration_date: Integer;
|
|
1748
|
+
source: ChatBoostSource;
|
|
1749
|
+
count: Integer;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
/** Describes an invoice message. */
|
|
1753
|
+
export interface Invoice {
|
|
1754
|
+
title: string;
|
|
1755
|
+
description: string;
|
|
1756
|
+
start_parameter?: string;
|
|
1757
|
+
currency: string;
|
|
1758
|
+
total_amount: Integer;
|
|
1759
|
+
is_test: boolean;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
/** This object contains a detailed description of a game. */
|
|
1763
|
+
export interface Game {
|
|
1764
|
+
title: string;
|
|
1765
|
+
description: string;
|
|
1766
|
+
photo: PhotoSize[];
|
|
1767
|
+
text?: string;
|
|
1768
|
+
text_entities?: MessageEntity[];
|
|
1769
|
+
animation?: Animation;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
/** This object represents an animated dice. */
|
|
1773
|
+
export interface Dice {
|
|
1774
|
+
emoji: string;
|
|
1775
|
+
value: Integer;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
/** This object represents a message that was deleted. */
|
|
1779
|
+
export interface InaccessibleMessage {
|
|
1780
|
+
chat: Chat;
|
|
1781
|
+
message_id: Integer;
|
|
1782
|
+
date: Integer;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
/** This object represents a message or an inaccessible message. */
|
|
1786
|
+
export type MessageOrInaccessibleMessage = Message | InaccessibleMessage;
|
|
1787
|
+
|
|
1788
|
+
/** This object describes a paid media extended. */
|
|
1789
|
+
export interface ExtendedMediaPreview {
|
|
1790
|
+
source: string;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
/** Describes an inline message sent via a bot. */
|
|
1794
|
+
export interface ExternalReplyInfo {
|
|
1795
|
+
type: string;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
export interface TextQuote {
|
|
1799
|
+
text: string;
|
|
1800
|
+
entities?: MessageEntity[];
|
|
1801
|
+
position?: Integer;
|
|
1802
|
+
is_manual?: boolean;
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
export interface MessageAutoDeleteTimerChanged {
|
|
1806
|
+
message_auto_delete_time: Integer;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
export interface VideoChatStarted {
|
|
1810
|
+
duration?: Integer;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
export interface VideoChatEnded {
|
|
1814
|
+
duration: Integer;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
export interface VideoChatParticipantsInvited {
|
|
1818
|
+
users?: User[];
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
export interface VideoChatScheduled {
|
|
1822
|
+
start_date: Integer;
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
export interface WriteAccessAllowed {
|
|
1826
|
+
from_request?: boolean;
|
|
1827
|
+
web_app_name?: string;
|
|
1828
|
+
from_attachment_menu?: boolean;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
export interface UsersShared {
|
|
1832
|
+
users: User[];
|
|
1833
|
+
button_id: Integer;
|
|
1834
|
+
button_name?: string;
|
|
1835
|
+
user_is_bot?: boolean;
|
|
1836
|
+
button_request_id?: string;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
export interface ChatShared {
|
|
1840
|
+
chat_id: Integer;
|
|
1841
|
+
title?: string;
|
|
1842
|
+
username?: string;
|
|
1843
|
+
photo?: ChatPhoto;
|
|
1844
|
+
button_id?: Integer;
|
|
1845
|
+
button_name?: string;
|
|
1846
|
+
button_request_id?: string;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
export interface RefundedPayment {
|
|
1850
|
+
currency: string;
|
|
1851
|
+
total_amount: Integer;
|
|
1852
|
+
invoice_payload: string;
|
|
1853
|
+
telegram_payment_charge_id: string;
|
|
1854
|
+
provider_payment_charge_id?: string;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
export interface GiveawayCreated {
|
|
1858
|
+
prize_star_count?: Integer;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
export interface Giveaway {
|
|
1862
|
+
chats: Chat[];
|
|
1863
|
+
winners_selection_date: Integer;
|
|
1864
|
+
winner_count: Integer;
|
|
1865
|
+
only_new_members?: boolean;
|
|
1866
|
+
has_public_winners?: boolean;
|
|
1867
|
+
prize_description?: string;
|
|
1868
|
+
country_codes?: string[];
|
|
1869
|
+
prize_star_count?: Integer;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
export interface GiveawayWinners {
|
|
1873
|
+
chat: Chat;
|
|
1874
|
+
giveaway_message_id: Integer;
|
|
1875
|
+
winners_selection_date: Integer;
|
|
1876
|
+
winner_count: Integer;
|
|
1877
|
+
winners?: User[];
|
|
1878
|
+
additional_chat_count?: Integer;
|
|
1879
|
+
prize_star_count?: Integer;
|
|
1880
|
+
prize_description?: string;
|
|
1881
|
+
unclaimed_prize_count?: Integer;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
export interface ChatBackground {
|
|
1885
|
+
background: ChatBackgroundType;
|
|
1886
|
+
restore_date?: Integer;
|
|
1887
|
+
is_unmoving?: boolean;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
export type ChatBackgroundType =
|
|
1891
|
+
| ChatBackgroundTypeFill
|
|
1892
|
+
| ChatBackgroundTypeWallpaper
|
|
1893
|
+
| ChatBackgroundTypeTheme;
|
|
1894
|
+
|
|
1895
|
+
export interface ChatBackgroundTypeFill {
|
|
1896
|
+
type: 'fill';
|
|
1897
|
+
fill: BackgroundFill;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
export interface ChatBackgroundTypeWallpaper {
|
|
1901
|
+
type: 'wallpaper';
|
|
1902
|
+
wallpaper: ChatBackgroundType;
|
|
1903
|
+
is_blurred?: boolean;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
export interface ChatBackgroundTypeTheme {
|
|
1907
|
+
type: 'theme';
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
export type BackgroundFill =
|
|
1911
|
+
| BackgroundFillSolid
|
|
1912
|
+
| BackgroundFillGradient
|
|
1913
|
+
| BackgroundFillFreeformGradient;
|
|
1914
|
+
|
|
1915
|
+
export interface BackgroundFillSolid {
|
|
1916
|
+
color: Integer;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
export interface BackgroundFillGradient {
|
|
1920
|
+
top_color: Integer;
|
|
1921
|
+
bottom_color: Integer;
|
|
1922
|
+
rotation_angle: Integer;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
export interface BackgroundFillFreeformGradient {
|
|
1926
|
+
colors: Integer[];
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
export interface SuggestedPostInfo {
|
|
1930
|
+
schedule_date?: Integer;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
export interface StoryBoard {
|
|
1934
|
+
cover: StoryBoardCover;
|
|
1935
|
+
stories: StoryBoardStory[];
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
export interface StoryBoardCover {
|
|
1939
|
+
file: Document;
|
|
1940
|
+
width: Integer;
|
|
1941
|
+
height: Integer;
|
|
1942
|
+
position: StoryBoardPosition;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
export interface StoryBoardStory {
|
|
1946
|
+
file: Document;
|
|
1947
|
+
duration: Float;
|
|
1948
|
+
width: Integer;
|
|
1949
|
+
height: Integer;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
export interface StoryBoardPosition {
|
|
1953
|
+
x: Float;
|
|
1954
|
+
y: Float;
|
|
1955
|
+
scale: Float;
|
|
1956
|
+
rotation: Float;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
export interface ServiceMessage {
|
|
1960
|
+
type: string;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
// ---------------------------------------------------------------------------
|
|
1964
|
+
// Keyboard Types
|
|
1965
|
+
// ---------------------------------------------------------------------------
|
|
1966
|
+
|
|
1967
|
+
/** This object represents an inline keyboard. */
|
|
1968
|
+
export interface InlineKeyboardMarkup {
|
|
1969
|
+
inline_keyboard: InlineKeyboardButton[][];
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
/** This object represents one button of an inline keyboard. */
|
|
1973
|
+
export interface InlineKeyboardButton {
|
|
1974
|
+
text: string;
|
|
1975
|
+
url?: string;
|
|
1976
|
+
callback_data?: string;
|
|
1977
|
+
web_app?: WebAppInfo;
|
|
1978
|
+
login_url?: LoginUrl;
|
|
1979
|
+
switch_inline_query?: string;
|
|
1980
|
+
switch_inline_query_current_chat?: string;
|
|
1981
|
+
switch_inline_query_chosen_chat?: SwitchInlineQueryChosenChat;
|
|
1982
|
+
pay?: boolean;
|
|
1983
|
+
copy_text?: CopyTextButton;
|
|
1984
|
+
callback_game?: CallbackGame;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
/** This object represents a custom keyboard. */
|
|
1988
|
+
export interface ReplyKeyboardMarkup {
|
|
1989
|
+
keyboard: KeyboardButton[][];
|
|
1990
|
+
is_persistent?: boolean;
|
|
1991
|
+
resize_keyboard?: boolean;
|
|
1992
|
+
one_time_keyboard?: boolean;
|
|
1993
|
+
input_field_placeholder?: string;
|
|
1994
|
+
selective?: boolean;
|
|
1995
|
+
is_custom_keyboard?: boolean;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
/** This object represents one button of the reply keyboard. */
|
|
1999
|
+
export interface KeyboardButton {
|
|
2000
|
+
text: string;
|
|
2001
|
+
request_users?: KeyboardButtonRequestUsers;
|
|
2002
|
+
request_chat?: KeyboardButtonRequestChat;
|
|
2003
|
+
request_contact?: boolean;
|
|
2004
|
+
request_location?: boolean;
|
|
2005
|
+
request_poll?: KeyboardButtonRequestPoll;
|
|
2006
|
+
web_app?: WebAppInfo;
|
|
2007
|
+
request_user?: KeyboardButtonRequestUsers;
|
|
2008
|
+
request_chat_is_channel?: boolean;
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
export interface KeyboardButtonRequestUsers {
|
|
2012
|
+
request_id: Integer;
|
|
2013
|
+
user_is_bot?: boolean;
|
|
2014
|
+
user_is_premium?: boolean;
|
|
2015
|
+
max_quantity?: Integer;
|
|
2016
|
+
request_name?: boolean;
|
|
2017
|
+
request_username?: boolean;
|
|
2018
|
+
request_photo?: boolean;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
export interface KeyboardButtonRequestChat {
|
|
2022
|
+
request_id: Integer;
|
|
2023
|
+
chat_is_channel?: boolean;
|
|
2024
|
+
chat_is_group?: boolean;
|
|
2025
|
+
chat_is_supergroup?: boolean;
|
|
2026
|
+
chat_is_created?: boolean;
|
|
2027
|
+
user_administrator_rights?: ChatAdministratorRights;
|
|
2028
|
+
bot_administrator_rights?: ChatAdministratorRights;
|
|
2029
|
+
request_name?: boolean;
|
|
2030
|
+
request_username?: boolean;
|
|
2031
|
+
request_photo?: boolean;
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
export interface KeyboardButtonRequestPoll {
|
|
2035
|
+
request_id: Integer;
|
|
2036
|
+
question?: string;
|
|
2037
|
+
question_parse_mode?: string;
|
|
2038
|
+
question_entities?: MessageEntity[];
|
|
2039
|
+
is_anonymous?: boolean;
|
|
2040
|
+
allowed_poll_types?: string[];
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
/** This object describes the source of a login URL. */
|
|
2044
|
+
export interface LoginUrl {
|
|
2045
|
+
url: string;
|
|
2046
|
+
forward_text?: string;
|
|
2047
|
+
bot_username?: string;
|
|
2048
|
+
request_write_access?: boolean;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
/** This object represents one button of an inline keyboard that switches the current user to inline mode in a chosen chat with an appropriate configuration. */
|
|
2052
|
+
export interface SwitchInlineQueryChosenChat {
|
|
2053
|
+
query?: string;
|
|
2054
|
+
allow_user_chats?: boolean;
|
|
2055
|
+
allow_bot_chats?: boolean;
|
|
2056
|
+
allow_group_chats?: boolean;
|
|
2057
|
+
allow_channel_chats?: boolean;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
/** This object represents an inline keyboard button that copies specified text to the clipboard. */
|
|
2061
|
+
export interface CopyTextButton {
|
|
2062
|
+
text: string;
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
/** This object, by default, describes one button of the message reply markup. */
|
|
2066
|
+
export type ReplyMarkup =
|
|
2067
|
+
| InlineKeyboardMarkup
|
|
2068
|
+
| ReplyKeyboardMarkup
|
|
2069
|
+
| ReplyKeyboardRemove
|
|
2070
|
+
| ForceReply;
|
|
2071
|
+
|
|
2072
|
+
/** This object represents a Telegram Web App. */
|
|
2073
|
+
export interface CallbackGame {}
|
|
2074
|
+
|
|
2075
|
+
/** Upon pressing a user-defined key, the client will send the bot the data from the callback_query field. */
|
|
2076
|
+
export interface CallbackQuery {
|
|
2077
|
+
id: string;
|
|
2078
|
+
from: User;
|
|
2079
|
+
message?: Message;
|
|
2080
|
+
chat_instance: string;
|
|
2081
|
+
data?: string;
|
|
2082
|
+
game_short_name?: string;
|
|
2083
|
+
inline_message_id?: string;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
/** This object represents an incoming callback query from a callback button in an inline keyboard. */
|
|
2087
|
+
|
|
2088
|
+
/** This object represents a forced reply. */
|
|
2089
|
+
export interface ForceReply {
|
|
2090
|
+
force_reply: boolean;
|
|
2091
|
+
selective?: boolean;
|
|
2092
|
+
input_field_placeholder?: string;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
/** This object represents an object used to remove the reply keyboard. */
|
|
2096
|
+
export interface ReplyKeyboardRemove {
|
|
2097
|
+
remove_keyboard: boolean;
|
|
2098
|
+
selective?: boolean;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
/** This object contains information about a link preview. */
|
|
2102
|
+
export interface LinkPreviewOptions {
|
|
2103
|
+
is_disabled?: boolean;
|
|
2104
|
+
url?: string;
|
|
2105
|
+
prefer_small_media?: boolean;
|
|
2106
|
+
prefer_large_media?: boolean;
|
|
2107
|
+
show_above_text?: boolean;
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
// ---------------------------------------------------------------------------
|
|
2111
|
+
// Update Types
|
|
2112
|
+
// ---------------------------------------------------------------------------
|
|
2113
|
+
|
|
2114
|
+
/** This object represents an incoming update. */
|
|
2115
|
+
export interface Update {
|
|
2116
|
+
update_id: Integer;
|
|
2117
|
+
message?: Message;
|
|
2118
|
+
edited_message?: Message;
|
|
2119
|
+
channel_post?: Message;
|
|
2120
|
+
edited_channel_post?: Message;
|
|
2121
|
+
business_connection?: BusinessConnection;
|
|
2122
|
+
business_message?: Message;
|
|
2123
|
+
edited_business_message?: Message;
|
|
2124
|
+
deleted_business_messages?: InaccessibleMessage[];
|
|
2125
|
+
message_reaction?: MessageReactionUpdated;
|
|
2126
|
+
message_reaction_count?: MessageReactionCountUpdated;
|
|
2127
|
+
inline_query?: InlineQuery;
|
|
2128
|
+
chosen_inline_result?: ChosenInlineResult;
|
|
2129
|
+
callback_query?: CallbackQuery;
|
|
2130
|
+
shipping_query?: ShippingQuery;
|
|
2131
|
+
pre_checkout_query?: PreCheckoutQuery;
|
|
2132
|
+
poll?: Poll;
|
|
2133
|
+
poll_answer?: PollAnswer;
|
|
2134
|
+
my_chat_member?: ChatMemberUpdated;
|
|
2135
|
+
chat_member?: ChatMemberUpdated;
|
|
2136
|
+
chat_join_request?: ChatJoinRequest;
|
|
2137
|
+
chat_boost?: ChatBoost;
|
|
2138
|
+
removed_chat_boost?: ChatBoost;
|
|
2139
|
+
purchased_paid_media?: SuccessfulPayment;
|
|
2140
|
+
gift?: OwnedGift;
|
|
2141
|
+
gift_non_added?: OwnedGift;
|
|
2142
|
+
subscription?: ChatSubscription;
|
|
2143
|
+
managed_bot?: ManagedBotToken;
|
|
2144
|
+
verified_checks?: VerifiedChecks;
|
|
2145
|
+
stopped_message_generation?: StoppedMessageGeneration;
|
|
2146
|
+
guest_message?: GuestMessage;
|
|
2147
|
+
reaction?: ReactionType;
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
export interface StoppedMessageGeneration {
|
|
2151
|
+
chat: Chat;
|
|
2152
|
+
message_id: Integer;
|
|
2153
|
+
chat_instance: string;
|
|
2154
|
+
data?: string;
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
export interface GuestMessage {
|
|
2158
|
+
chat: Chat;
|
|
2159
|
+
guest_query_id: string;
|
|
2160
|
+
text: string;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
export interface VerifiedChecks {
|
|
2164
|
+
checks: VerifiedCheck[];
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
export interface VerifiedCheck {
|
|
2168
|
+
date: Integer;
|
|
2169
|
+
status: string;
|
|
2170
|
+
source: string;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
// ---------------------------------------------------------------------------
|
|
2174
|
+
// Input Types
|
|
2175
|
+
// ---------------------------------------------------------------------------
|
|
2176
|
+
|
|
2177
|
+
/** This object represents the contents of a file to be uploaded. */
|
|
2178
|
+
export type InputFile =
|
|
2179
|
+
| string
|
|
2180
|
+
| Buffer
|
|
2181
|
+
| Stream;
|
|
2182
|
+
|
|
2183
|
+
/** This object represents one result of an inline query. */
|
|
2184
|
+
export type InputMedia =
|
|
2185
|
+
| InputMediaAnimation
|
|
2186
|
+
| InputMediaDocument
|
|
2187
|
+
| InputMediaAudio
|
|
2188
|
+
| InputMediaPhoto
|
|
2189
|
+
| InputMediaVideo;
|
|
2190
|
+
|
|
2191
|
+
export interface InputMediaAnimation {
|
|
2192
|
+
type: 'animation';
|
|
2193
|
+
media: InputFile;
|
|
2194
|
+
thumbnail?: InputFile;
|
|
2195
|
+
caption?: string;
|
|
2196
|
+
parse_mode?: string;
|
|
2197
|
+
caption_entities?: MessageEntity[];
|
|
2198
|
+
show_caption_above_media?: boolean;
|
|
2199
|
+
width?: Integer;
|
|
2200
|
+
height?: Integer;
|
|
2201
|
+
duration?: Integer;
|
|
2202
|
+
has_spoiler?: boolean;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
export interface InputMediaDocument {
|
|
2206
|
+
type: 'document';
|
|
2207
|
+
media: InputFile;
|
|
2208
|
+
thumbnail?: InputFile;
|
|
2209
|
+
caption?: string;
|
|
2210
|
+
parse_mode?: string;
|
|
2211
|
+
caption_entities?: MessageEntity[];
|
|
2212
|
+
show_caption_above_media?: boolean;
|
|
2213
|
+
disable_content_type_detection?: boolean;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
export interface InputMediaAudio {
|
|
2217
|
+
type: 'audio';
|
|
2218
|
+
media: InputFile;
|
|
2219
|
+
thumbnail?: InputFile;
|
|
2220
|
+
caption?: string;
|
|
2221
|
+
parse_mode?: string;
|
|
2222
|
+
caption_entities?: MessageEntity[];
|
|
2223
|
+
duration?: Integer;
|
|
2224
|
+
performer?: string;
|
|
2225
|
+
title?: string;
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
export interface InputMediaPhoto {
|
|
2229
|
+
type: 'photo';
|
|
2230
|
+
media: InputFile;
|
|
2231
|
+
thumbnail?: InputFile;
|
|
2232
|
+
caption?: string;
|
|
2233
|
+
parse_mode?: string;
|
|
2234
|
+
caption_entities?: MessageEntity[];
|
|
2235
|
+
show_caption_above_media?: boolean;
|
|
2236
|
+
has_spoiler?: boolean;
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
export interface InputMediaVideo {
|
|
2240
|
+
type: 'video';
|
|
2241
|
+
media: InputFile;
|
|
2242
|
+
thumbnail?: InputFile;
|
|
2243
|
+
caption?: string;
|
|
2244
|
+
parse_mode?: string;
|
|
2245
|
+
caption_entities?: MessageEntity[];
|
|
2246
|
+
show_caption_above_media?: boolean;
|
|
2247
|
+
width?: Integer;
|
|
2248
|
+
height?: Integer;
|
|
2249
|
+
duration?: Integer;
|
|
2250
|
+
supports_streaming?: boolean;
|
|
2251
|
+
has_spoiler?: boolean;
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
/** Describes the paid media to be sent. */
|
|
2255
|
+
export type InputPaidMedia =
|
|
2256
|
+
| InputPaidMediaPhoto
|
|
2257
|
+
| InputPaidMediaVideo;
|
|
2258
|
+
|
|
2259
|
+
export interface InputPaidMediaPhoto {
|
|
2260
|
+
type: 'photo';
|
|
2261
|
+
media: InputFile;
|
|
2262
|
+
thumbnail?: InputFile;
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
export interface InputPaidMediaVideo {
|
|
2266
|
+
type: 'video';
|
|
2267
|
+
media: InputFile;
|
|
2268
|
+
thumbnail?: InputFile;
|
|
2269
|
+
cover?: InputFile;
|
|
2270
|
+
start_timestamp?: Integer;
|
|
2271
|
+
caption?: string;
|
|
2272
|
+
parse_mode?: string;
|
|
2273
|
+
caption_entities?: MessageEntity[];
|
|
2274
|
+
show_caption_above_media?: boolean;
|
|
2275
|
+
supports_streaming?: boolean;
|
|
2276
|
+
duration?: Integer;
|
|
2277
|
+
width?: Integer;
|
|
2278
|
+
height?: Integer;
|
|
2279
|
+
has_spoiler?: boolean;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
/** Describes the input content of a rich message. */
|
|
2283
|
+
export type InputRichMessageContent = InputRichMessageContentProductInfo;
|
|
2284
|
+
|
|
2285
|
+
export interface InputRichMessageContentProductInfo {
|
|
2286
|
+
type: 'product_info';
|
|
2287
|
+
title: string;
|
|
2288
|
+
description?: string;
|
|
2289
|
+
photo?: InputFile;
|
|
2290
|
+
parse_mode?: string;
|
|
2291
|
+
entities?: MessageEntity[];
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
/** Describes the input content of a story to be posted. */
|
|
2295
|
+
export type InputStoryContentLocal =
|
|
2296
|
+
| InputStoryContentLocalPhoto
|
|
2297
|
+
| InputStoryContentLocalVideo;
|
|
2298
|
+
|
|
2299
|
+
export interface InputStoryContentLocalPhoto {
|
|
2300
|
+
type: 'photo';
|
|
2301
|
+
photo: InputFile;
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
export interface InputStoryContentLocalVideo {
|
|
2305
|
+
type: 'video';
|
|
2306
|
+
video: InputFile;
|
|
2307
|
+
duration: Float;
|
|
2308
|
+
cover_frame_timestamp?: Float;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
/** Describes the input content of a paid media. */
|
|
2312
|
+
export type InputChecklistTask = {
|
|
2313
|
+
id?: Integer;
|
|
2314
|
+
text: string;
|
|
2315
|
+
parse_mode?: string;
|
|
2316
|
+
text_entities?: MessageEntity[];
|
|
2317
|
+
};
|
|
2318
|
+
|
|
2319
|
+
/** Describes a sticker to be set. */
|
|
2320
|
+
export type InputSticker = {
|
|
2321
|
+
sticker: InputFile;
|
|
2322
|
+
format: string;
|
|
2323
|
+
emoji_list: string[];
|
|
2324
|
+
mask_position?: MaskPosition;
|
|
2325
|
+
keywords?: string[];
|
|
2326
|
+
custom_emoji_id?: string;
|
|
2327
|
+
};
|
|
2328
|
+
|
|
2329
|
+
/** Describes a reaction type to be set. */
|
|
2330
|
+
export type InputStoryAreaType =
|
|
2331
|
+
| InputStoryAreaTypeLocation
|
|
2332
|
+
| InputStoryAreaTypeVenue
|
|
2333
|
+
| InputStoryAreaTypeReaction
|
|
2334
|
+
| InputStoryAreaTypeLink;
|
|
2335
|
+
|
|
2336
|
+
export interface InputStoryAreaTypeLocation {
|
|
2337
|
+
type: 'location';
|
|
2338
|
+
latitude: Float;
|
|
2339
|
+
longitude: Float;
|
|
2340
|
+
zoom?: Integer;
|
|
2341
|
+
horizontal_accuracy?: Float;
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
export interface InputStoryAreaTypeVenue {
|
|
2345
|
+
type: 'venue';
|
|
2346
|
+
venue_id: string;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
export interface InputStoryAreaTypeReaction {
|
|
2350
|
+
type: 'reaction';
|
|
2351
|
+
reaction_type: ReactionType;
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
export interface InputStoryAreaTypeLink {
|
|
2355
|
+
type: 'link';
|
|
2356
|
+
url: string;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
/** Describes an input story area. */
|
|
2360
|
+
export interface InputStoryArea {
|
|
2361
|
+
position: StoryAreaPosition;
|
|
2362
|
+
type: InputStoryAreaType;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
// ---------------------------------------------------------------------------
|
|
2366
|
+
// Passport Types
|
|
2367
|
+
// ---------------------------------------------------------------------------
|
|
2368
|
+
|
|
2369
|
+
/** Describes Telegram Passport data shared with the bot by the user. */
|
|
2370
|
+
export interface PassportData {
|
|
2371
|
+
data: EncryptedPassportElement[];
|
|
2372
|
+
credentials: EncryptedCredentials;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
/** Describes documents or other Telegram Passport elements shared with the bot. */
|
|
2376
|
+
export interface EncryptedPassportElement {
|
|
2377
|
+
type: string;
|
|
2378
|
+
data?: string;
|
|
2379
|
+
phone_number?: string;
|
|
2380
|
+
email?: string;
|
|
2381
|
+
files?: PassportFile[];
|
|
2382
|
+
translation?: PassportFile[];
|
|
2383
|
+
selfie?: PassportFile;
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
/** Describes a file uploaded to Telegram Passport. */
|
|
2387
|
+
export interface PassportFile {
|
|
2388
|
+
file_id: string;
|
|
2389
|
+
file_unique_id: string;
|
|
2390
|
+
file_date: Integer;
|
|
2391
|
+
file_size: Integer;
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
/** Describes the data decrypting with credentials. */
|
|
2395
|
+
export interface EncryptedCredentials {
|
|
2396
|
+
data: string;
|
|
2397
|
+
hash: string;
|
|
2398
|
+
secret: string;
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
// ---------------------------------------------------------------------------
|
|
2402
|
+
// Payments Types
|
|
2403
|
+
// ---------------------------------------------------------------------------
|
|
2404
|
+
|
|
2405
|
+
/** Describes Telegram Stars transactions. */
|
|
2406
|
+
export interface StarTransactions {
|
|
2407
|
+
star_transactions: StarTransaction[];
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
/** Describes a gift. */
|
|
2411
|
+
export interface Gifts {
|
|
2412
|
+
gifts: Gift[];
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
// ---------------------------------------------------------------------------
|
|
2416
|
+
// ChatBoost Types
|
|
2417
|
+
// ---------------------------------------------------------------------------
|
|
2418
|
+
|
|
2419
|
+
/** Describes boosts obtained by a user. */
|
|
2420
|
+
export interface UserChatBoosts {
|
|
2421
|
+
boosts: ChatBoost[];
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
// ============================================================================
|
|
2425
|
+
// OPTIONS INTERFACES (method parameters)
|
|
2426
|
+
// ============================================================================
|
|
2427
|
+
|
|
2428
|
+
/** Options for the TelegramBot constructor. */
|
|
2429
|
+
export interface TelegramBotOptions {
|
|
2430
|
+
/** Set to true to enable polling, or an object with polling options. */
|
|
2431
|
+
polling?: boolean | PollingOptions;
|
|
2432
|
+
/** Set to true to enable WebHook, or an object with WebHook options. */
|
|
2433
|
+
webHook?: boolean | WebHookOptions;
|
|
2434
|
+
/** Set to true to use the test environment. */
|
|
2435
|
+
testEnvironment?: boolean;
|
|
2436
|
+
/** Set to true to stop after the first regex match. */
|
|
2437
|
+
onlyFirstMatch?: boolean;
|
|
2438
|
+
/** Options added to every request to the Telegram API. */
|
|
2439
|
+
request?: Record<string, unknown>;
|
|
2440
|
+
/** API Base URL. Useful for proxying and testing. Default: 'https://api.telegram.org'. */
|
|
2441
|
+
baseApiUrl?: string;
|
|
2442
|
+
/** Allow passing file paths as arguments when sending files. Default: true. */
|
|
2443
|
+
filepath?: boolean;
|
|
2444
|
+
/** Set to true for forward-compatibility on unhandled rejections. */
|
|
2445
|
+
badRejection?: boolean;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
/** Polling options. */
|
|
2449
|
+
export interface PollingOptions {
|
|
2450
|
+
/** Timeout in seconds for long polling. */
|
|
2451
|
+
timeout?: number | string;
|
|
2452
|
+
/** Interval between requests in milliseconds. Default: 300. */
|
|
2453
|
+
interval?: number | string;
|
|
2454
|
+
/** Start polling immediately. Default: true. */
|
|
2455
|
+
autoStart?: boolean;
|
|
2456
|
+
/** Parameters sent in polling API requests. */
|
|
2457
|
+
params?: PollingParams;
|
|
2458
|
+
/** Restart polling on consecutive calls. Default: true. */
|
|
2459
|
+
restart?: boolean;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
/** Polling API request parameters. */
|
|
2463
|
+
export interface PollingParams {
|
|
2464
|
+
timeout?: number;
|
|
2465
|
+
limit?: number;
|
|
2466
|
+
offset?: number;
|
|
2467
|
+
allowed_updates?: string[];
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
/** WebHook options. */
|
|
2471
|
+
export interface WebHookOptions {
|
|
2472
|
+
/** Host to bind to. Default: '0.0.0.0'. */
|
|
2473
|
+
host?: string;
|
|
2474
|
+
/** Port to bind to. Default: 8443. */
|
|
2475
|
+
port?: number;
|
|
2476
|
+
/** Path to file with PEM private key. */
|
|
2477
|
+
key?: string;
|
|
2478
|
+
/** Path to file with PEM certificate (public). */
|
|
2479
|
+
cert?: string;
|
|
2480
|
+
/** Path to file with PFX private key and certificate chain. */
|
|
2481
|
+
pfx?: string;
|
|
2482
|
+
/** Open webhook immediately. Default: true. */
|
|
2483
|
+
autoOpen?: boolean;
|
|
2484
|
+
/** Options passed to `https.createServer()`. */
|
|
2485
|
+
https?: https.ServerOptions;
|
|
2486
|
+
/** An endpoint for health checks that always responds with 200 OK. Default: '/healthz'. */
|
|
2487
|
+
healthEndpoint?: string;
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
/** Common query options passed to most API methods. */
|
|
2491
|
+
export interface FormQueryOptions {
|
|
2492
|
+
/** Additional query parameters (snake_case keys sent as form data). */
|
|
2493
|
+
[key: string]: unknown;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
// ============================================================================
|
|
2497
|
+
// REPLY OPTIONS
|
|
2498
|
+
// ============================================================================
|
|
2499
|
+
|
|
2500
|
+
/** Options for message sending methods that support reply_markup. */
|
|
2501
|
+
export interface SendMessageOptions extends FormQueryOptions {
|
|
2502
|
+
message_thread_id?: Integer;
|
|
2503
|
+
reply_parameters?: ReplyParameters;
|
|
2504
|
+
parse_mode?: string;
|
|
2505
|
+
entities?: MessageEntity[];
|
|
2506
|
+
link_preview_options?: LinkPreviewOptions;
|
|
2507
|
+
disable_notification?: boolean;
|
|
2508
|
+
protect_content?: boolean;
|
|
2509
|
+
allow_paid_broadcast?: boolean;
|
|
2510
|
+
message_effect_id?: string;
|
|
2511
|
+
business_connection_id?: string;
|
|
2512
|
+
reply_markup?: ReplyMarkup;
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
/** Options for sendPhoto. */
|
|
2516
|
+
export interface SendPhotoOptions extends FormQueryOptions {
|
|
2517
|
+
business_connection_id?: string;
|
|
2518
|
+
message_thread_id?: Integer;
|
|
2519
|
+
caption?: string;
|
|
2520
|
+
parse_mode?: string;
|
|
2521
|
+
caption_entities?: MessageEntity[];
|
|
2522
|
+
show_caption_above_media?: boolean;
|
|
2523
|
+
has_spoiler?: boolean;
|
|
2524
|
+
disable_notification?: boolean;
|
|
2525
|
+
protect_content?: boolean;
|
|
2526
|
+
allow_paid_broadcast?: boolean;
|
|
2527
|
+
message_effect_id?: string;
|
|
2528
|
+
reply_parameters?: ReplyParameters;
|
|
2529
|
+
reply_markup?: ReplyMarkup;
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
/** Options for sendAudio. */
|
|
2533
|
+
export interface SendAudioOptions extends FormQueryOptions {
|
|
2534
|
+
business_connection_id?: string;
|
|
2535
|
+
message_thread_id?: Integer;
|
|
2536
|
+
caption?: string;
|
|
2537
|
+
parse_mode?: string;
|
|
2538
|
+
caption_entities?: MessageEntity[];
|
|
2539
|
+
duration?: Integer;
|
|
2540
|
+
performer?: string;
|
|
2541
|
+
title?: string;
|
|
2542
|
+
thumbnail?: InputFile;
|
|
2543
|
+
disable_notification?: boolean;
|
|
2544
|
+
protect_content?: boolean;
|
|
2545
|
+
allow_paid_broadcast?: boolean;
|
|
2546
|
+
message_effect_id?: string;
|
|
2547
|
+
reply_parameters?: ReplyParameters;
|
|
2548
|
+
reply_markup?: ReplyMarkup;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
/** Options for sendDocument. */
|
|
2552
|
+
export interface SendDocumentOptions extends FormQueryOptions {
|
|
2553
|
+
business_connection_id?: string;
|
|
2554
|
+
message_thread_id?: Integer;
|
|
2555
|
+
caption?: string;
|
|
2556
|
+
parse_mode?: string;
|
|
2557
|
+
caption_entities?: MessageEntity[];
|
|
2558
|
+
disable_content_type_detection?: boolean;
|
|
2559
|
+
thumbnail?: InputFile;
|
|
2560
|
+
disable_notification?: boolean;
|
|
2561
|
+
protect_content?: boolean;
|
|
2562
|
+
allow_paid_broadcast?: boolean;
|
|
2563
|
+
message_effect_id?: string;
|
|
2564
|
+
reply_parameters?: ReplyParameters;
|
|
2565
|
+
reply_markup?: ReplyMarkup;
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
/** Options for sendVideo. */
|
|
2569
|
+
export interface SendVideoOptions extends FormQueryOptions {
|
|
2570
|
+
business_connection_id?: string;
|
|
2571
|
+
message_thread_id?: Integer;
|
|
2572
|
+
caption?: string;
|
|
2573
|
+
parse_mode?: string;
|
|
2574
|
+
caption_entities?: MessageEntity[];
|
|
2575
|
+
show_caption_above_media?: boolean;
|
|
2576
|
+
duration?: Integer;
|
|
2577
|
+
width?: Integer;
|
|
2578
|
+
height?: Integer;
|
|
2579
|
+
thumbnail?: InputFile;
|
|
2580
|
+
supports_streaming?: boolean;
|
|
2581
|
+
has_spoiler?: boolean;
|
|
2582
|
+
disable_notification?: boolean;
|
|
2583
|
+
protect_content?: boolean;
|
|
2584
|
+
allow_paid_broadcast?: boolean;
|
|
2585
|
+
message_effect_id?: string;
|
|
2586
|
+
reply_parameters?: ReplyParameters;
|
|
2587
|
+
reply_markup?: ReplyMarkup;
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
/** Options for sendAnimation. */
|
|
2591
|
+
export interface SendAnimationOptions extends FormQueryOptions {
|
|
2592
|
+
business_connection_id?: string;
|
|
2593
|
+
message_thread_id?: Integer;
|
|
2594
|
+
caption?: string;
|
|
2595
|
+
parse_mode?: string;
|
|
2596
|
+
caption_entities?: MessageEntity[];
|
|
2597
|
+
show_caption_above_media?: boolean;
|
|
2598
|
+
width?: Integer;
|
|
2599
|
+
height?: Integer;
|
|
2600
|
+
duration?: Integer;
|
|
2601
|
+
thumbnail?: InputFile;
|
|
2602
|
+
has_spoiler?: boolean;
|
|
2603
|
+
disable_notification?: boolean;
|
|
2604
|
+
protect_content?: boolean;
|
|
2605
|
+
allow_paid_broadcast?: boolean;
|
|
2606
|
+
message_effect_id?: string;
|
|
2607
|
+
reply_parameters?: ReplyParameters;
|
|
2608
|
+
reply_markup?: ReplyMarkup;
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
/** Options for sendVoice. */
|
|
2612
|
+
export interface SendVoiceOptions extends FormQueryOptions {
|
|
2613
|
+
business_connection_id?: string;
|
|
2614
|
+
message_thread_id?: Integer;
|
|
2615
|
+
caption?: string;
|
|
2616
|
+
parse_mode?: string;
|
|
2617
|
+
caption_entities?: MessageEntity[];
|
|
2618
|
+
duration?: Integer;
|
|
2619
|
+
disable_notification?: boolean;
|
|
2620
|
+
protect_content?: boolean;
|
|
2621
|
+
allow_paid_broadcast?: boolean;
|
|
2622
|
+
message_effect_id?: string;
|
|
2623
|
+
reply_parameters?: ReplyParameters;
|
|
2624
|
+
reply_markup?: ReplyMarkup;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
/** Options for sendVideoNote. */
|
|
2628
|
+
export interface SendVideoNoteOptions extends FormQueryOptions {
|
|
2629
|
+
business_connection_id?: string;
|
|
2630
|
+
message_thread_id?: Integer;
|
|
2631
|
+
duration?: Integer;
|
|
2632
|
+
length?: Integer;
|
|
2633
|
+
thumbnail?: InputFile;
|
|
2634
|
+
disable_notification?: boolean;
|
|
2635
|
+
protect_content?: boolean;
|
|
2636
|
+
allow_paid_broadcast?: boolean;
|
|
2637
|
+
message_effect_id?: string;
|
|
2638
|
+
reply_parameters?: ReplyParameters;
|
|
2639
|
+
reply_markup?: ReplyMarkup;
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
/** Options for sendSticker. */
|
|
2643
|
+
export interface SendStickerOptions extends FormQueryOptions {
|
|
2644
|
+
business_connection_id?: string;
|
|
2645
|
+
message_thread_id?: Integer;
|
|
2646
|
+
emoji?: string;
|
|
2647
|
+
disable_notification?: boolean;
|
|
2648
|
+
protect_content?: boolean;
|
|
2649
|
+
allow_paid_broadcast?: boolean;
|
|
2650
|
+
message_effect_id?: string;
|
|
2651
|
+
reply_parameters?: ReplyParameters;
|
|
2652
|
+
reply_markup?: ReplyMarkup;
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
/** Options for sendLocation. */
|
|
2656
|
+
export interface SendLocationOptions extends FormQueryOptions {
|
|
2657
|
+
business_connection_id?: string;
|
|
2658
|
+
message_thread_id?: Integer;
|
|
2659
|
+
horizontal_accuracy?: Float;
|
|
2660
|
+
heading?: Integer;
|
|
2661
|
+
proximity_alert_radius?: Integer;
|
|
2662
|
+
live_period?: Integer;
|
|
2663
|
+
disable_notification?: boolean;
|
|
2664
|
+
protect_content?: boolean;
|
|
2665
|
+
allow_paid_broadcast?: boolean;
|
|
2666
|
+
message_effect_id?: string;
|
|
2667
|
+
reply_parameters?: ReplyParameters;
|
|
2668
|
+
reply_markup?: ReplyMarkup;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
/** Options for sendVenue. */
|
|
2672
|
+
export interface SendVenueOptions extends FormQueryOptions {
|
|
2673
|
+
business_connection_id?: string;
|
|
2674
|
+
message_thread_id?: Integer;
|
|
2675
|
+
foursquare_id?: string;
|
|
2676
|
+
foursquare_type?: string;
|
|
2677
|
+
google_place_id?: string;
|
|
2678
|
+
google_place_type?: string;
|
|
2679
|
+
disable_notification?: boolean;
|
|
2680
|
+
protect_content?: boolean;
|
|
2681
|
+
allow_paid_broadcast?: boolean;
|
|
2682
|
+
message_effect_id?: string;
|
|
2683
|
+
reply_parameters?: ReplyParameters;
|
|
2684
|
+
reply_markup?: ReplyMarkup;
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
/** Options for sendContact. */
|
|
2688
|
+
export interface SendContactOptions extends FormQueryOptions {
|
|
2689
|
+
business_connection_id?: string;
|
|
2690
|
+
message_thread_id?: Integer;
|
|
2691
|
+
last_name?: string;
|
|
2692
|
+
vcard?: string;
|
|
2693
|
+
disable_notification?: boolean;
|
|
2694
|
+
protect_content?: boolean;
|
|
2695
|
+
allow_paid_broadcast?: boolean;
|
|
2696
|
+
message_effect_id?: string;
|
|
2697
|
+
reply_parameters?: ReplyParameters;
|
|
2698
|
+
reply_markup?: ReplyMarkup;
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
/** Options for sendPoll. */
|
|
2702
|
+
export interface SendPollOptions extends FormQueryOptions {
|
|
2703
|
+
business_connection_id?: string;
|
|
2704
|
+
message_thread_id?: Integer;
|
|
2705
|
+
question_parse_mode?: string;
|
|
2706
|
+
question_entities?: MessageEntity[];
|
|
2707
|
+
is_anonymous?: boolean;
|
|
2708
|
+
type?: string;
|
|
2709
|
+
allows_multiple_answers?: boolean;
|
|
2710
|
+
correct_option_id?: Integer;
|
|
2711
|
+
explanation?: string;
|
|
2712
|
+
explanation_parse_mode?: string;
|
|
2713
|
+
explanation_entities?: MessageEntity[];
|
|
2714
|
+
open_period?: Integer;
|
|
2715
|
+
close_date?: Integer;
|
|
2716
|
+
is_closed?: boolean;
|
|
2717
|
+
disable_notification?: boolean;
|
|
2718
|
+
protect_content?: boolean;
|
|
2719
|
+
allow_paid_broadcast?: boolean;
|
|
2720
|
+
message_effect_id?: string;
|
|
2721
|
+
reply_parameters?: ReplyParameters;
|
|
2722
|
+
reply_markup?: ReplyMarkup;
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
/** Options for sendDice. */
|
|
2726
|
+
export interface SendDiceOptions extends FormQueryOptions {
|
|
2727
|
+
business_connection_id?: string;
|
|
2728
|
+
message_thread_id?: Integer;
|
|
2729
|
+
emoji?: string;
|
|
2730
|
+
disable_notification?: boolean;
|
|
2731
|
+
protect_content?: boolean;
|
|
2732
|
+
allow_paid_broadcast?: boolean;
|
|
2733
|
+
message_effect_id?: string;
|
|
2734
|
+
reply_parameters?: ReplyParameters;
|
|
2735
|
+
reply_markup?: ReplyMarkup;
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
/** Options for sendChatAction. */
|
|
2739
|
+
export interface SendChatActionOptions extends FormQueryOptions {
|
|
2740
|
+
business_connection_id?: string;
|
|
2741
|
+
message_thread_id?: Integer;
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
/** Options for sendGame. */
|
|
2745
|
+
export interface SendGameOptions extends FormQueryOptions {
|
|
2746
|
+
business_connection_id?: string;
|
|
2747
|
+
message_thread_id?: Integer;
|
|
2748
|
+
disable_notification?: boolean;
|
|
2749
|
+
protect_content?: boolean;
|
|
2750
|
+
allow_paid_broadcast?: boolean;
|
|
2751
|
+
message_effect_id?: string;
|
|
2752
|
+
reply_parameters?: ReplyParameters;
|
|
2753
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
/** Options for sendInvoice. */
|
|
2757
|
+
export interface SendInvoiceOptions extends FormQueryOptions {
|
|
2758
|
+
max_tip_amount?: Integer;
|
|
2759
|
+
suggested_tip_amounts?: Integer[];
|
|
2760
|
+
start_parameter?: string;
|
|
2761
|
+
provider_data?: string;
|
|
2762
|
+
photo_url?: string;
|
|
2763
|
+
photo_size?: Integer;
|
|
2764
|
+
photo_width?: Integer;
|
|
2765
|
+
photo_height?: Integer;
|
|
2766
|
+
need_name?: boolean;
|
|
2767
|
+
need_phone_number?: boolean;
|
|
2768
|
+
need_email?: boolean;
|
|
2769
|
+
need_shipping_address?: boolean;
|
|
2770
|
+
send_phone_number_to_provider?: boolean;
|
|
2771
|
+
send_email_to_provider?: boolean;
|
|
2772
|
+
is_flexible?: boolean;
|
|
2773
|
+
disable_notification?: boolean;
|
|
2774
|
+
protect_content?: boolean;
|
|
2775
|
+
allow_paid_broadcast?: boolean;
|
|
2776
|
+
message_effect_id?: string;
|
|
2777
|
+
reply_parameters?: ReplyParameters;
|
|
2778
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
2779
|
+
message_thread_id?: Integer;
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
/** Options for sendPaidMedia. */
|
|
2783
|
+
export interface SendPaidMediaOptions extends FormQueryOptions {
|
|
2784
|
+
business_connection_id?: string;
|
|
2785
|
+
message_thread_id?: Integer;
|
|
2786
|
+
caption?: string;
|
|
2787
|
+
parse_mode?: string;
|
|
2788
|
+
caption_entities?: MessageEntity[];
|
|
2789
|
+
show_caption_above_media?: boolean;
|
|
2790
|
+
payload?: string;
|
|
2791
|
+
disable_notification?: boolean;
|
|
2792
|
+
protect_content?: boolean;
|
|
2793
|
+
allow_paid_broadcast?: boolean;
|
|
2794
|
+
reply_parameters?: ReplyParameters;
|
|
2795
|
+
reply_markup?: ReplyMarkup;
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
/** Options for sendDice. */
|
|
2799
|
+
export interface SetMessageReactionOptions extends FormQueryOptions {
|
|
2800
|
+
is_big?: boolean;
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
/** Parameters for reply_parameters. */
|
|
2804
|
+
export interface ReplyParameters {
|
|
2805
|
+
message_id: Integer;
|
|
2806
|
+
chat_id?: Integer | string;
|
|
2807
|
+
allow_sending_without_reply?: boolean;
|
|
2808
|
+
quote?: string;
|
|
2809
|
+
quote_parse_mode?: string;
|
|
2810
|
+
quote_entities?: MessageEntity[];
|
|
2811
|
+
quote_position?: Integer;
|
|
2812
|
+
is_quote?: boolean;
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
/** Parameters for setMessageReaction. */
|
|
2816
|
+
|
|
2817
|
+
// ============================================================================
|
|
2818
|
+
// BOT CLASS
|
|
2819
|
+
// ============================================================================
|
|
2820
|
+
|
|
2821
|
+
// Error classes
|
|
2822
|
+
export class BaseError extends Error {
|
|
2823
|
+
code: string;
|
|
2824
|
+
constructor(code: string, message: string);
|
|
2825
|
+
toJSON(): { code: string; message: string };
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
export class FatalError extends BaseError {
|
|
2829
|
+
constructor(data: string | Error);
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
export class ParseError extends BaseError {
|
|
2833
|
+
response: IncomingMessage;
|
|
2834
|
+
constructor(message: string, response: IncomingMessage);
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
export class TelegramError extends BaseError {
|
|
2838
|
+
response: IncomingMessage;
|
|
2839
|
+
constructor(message: string, response: IncomingMessage);
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
export default class TelegramBot extends EventEmitter {
|
|
2843
|
+
constructor(token: string, options?: TelegramBotOptions);
|
|
2844
|
+
|
|
2845
|
+
/** The bot token. */
|
|
2846
|
+
readonly token: string;
|
|
2847
|
+
|
|
2848
|
+
/** The bot options. */
|
|
2849
|
+
readonly options: TelegramBotOptions;
|
|
2850
|
+
|
|
2851
|
+
/** The different errors the library uses. */
|
|
2852
|
+
static errors: {
|
|
2853
|
+
BaseError: typeof BaseError;
|
|
2854
|
+
FatalError: typeof FatalError;
|
|
2855
|
+
ParseError: typeof ParseError;
|
|
2856
|
+
TelegramError: typeof TelegramError;
|
|
2857
|
+
};
|
|
2858
|
+
|
|
2859
|
+
/** The types of message updates the library handles. */
|
|
2860
|
+
static messageTypes: string[];
|
|
2861
|
+
|
|
2862
|
+
// --- Event Overloads --------------------------------------------------------
|
|
2863
|
+
|
|
2864
|
+
on(event: 'message', listener: (message: Message, metadata: { type?: string }) => void): this;
|
|
2865
|
+
on(event: 'edited_message', listener: (message: Message) => void): this;
|
|
2866
|
+
on(event: 'edited_message_text', listener: (message: Message) => void): this;
|
|
2867
|
+
on(event: 'edited_message_caption', listener: (message: Message) => void): this;
|
|
2868
|
+
on(event: 'channel_post', listener: (message: Message) => void): this;
|
|
2869
|
+
on(event: 'edited_channel_post', listener: (message: Message) => void): this;
|
|
2870
|
+
on(event: 'edited_channel_post_text', listener: (message: Message) => void): this;
|
|
2871
|
+
on(event: 'edited_channel_post_caption', listener: (message: Message) => void): this;
|
|
2872
|
+
on(event: 'business_connection', listener: (connection: BusinessConnection) => void): this;
|
|
2873
|
+
on(event: 'business_message', listener: (message: Message) => void): this;
|
|
2874
|
+
on(event: 'edited_business_message', listener: (message: Message) => void): this;
|
|
2875
|
+
on(event: 'deleted_business_messages', listener: (messages: InaccessibleMessage[]) => void): this;
|
|
2876
|
+
on(event: 'message_reaction', listener: (update: MessageReactionUpdated) => void): this;
|
|
2877
|
+
on(event: 'message_reaction_count', listener: (update: MessageReactionCountUpdated) => void): this;
|
|
2878
|
+
on(event: 'inline_query', listener: (query: InlineQuery) => void): this;
|
|
2879
|
+
on(event: 'chosen_inline_result', listener: (result: ChosenInlineResult) => void): this;
|
|
2880
|
+
on(event: 'callback_query', listener: (query: CallbackQuery) => void): this;
|
|
2881
|
+
on(event: 'shipping_query', listener: (query: ShippingQuery) => void): this;
|
|
2882
|
+
on(event: 'pre_checkout_query', listener: (query: PreCheckoutQuery) => void): this;
|
|
2883
|
+
on(event: 'poll', listener: (poll: Poll) => void): this;
|
|
2884
|
+
on(event: 'poll_answer', listener: (answer: PollAnswer) => void): this;
|
|
2885
|
+
on(event: 'chat_member', listener: (update: ChatMemberUpdated) => void): this;
|
|
2886
|
+
on(event: 'my_chat_member', listener: (update: ChatMemberUpdated) => void): this;
|
|
2887
|
+
on(event: 'chat_join_request', listener: (request: ChatJoinRequest) => void): this;
|
|
2888
|
+
on(event: 'chat_boost', listener: (boost: ChatBoost) => void): this;
|
|
2889
|
+
on(event: 'removed_chat_boost', listener: (boost: ChatBoost) => void): this;
|
|
2890
|
+
on(event: 'text', listener: (message: Message) => void): this;
|
|
2891
|
+
on(event: 'animation', listener: (message: Message) => void): this;
|
|
2892
|
+
on(event: 'audio', listener: (message: Message) => void): this;
|
|
2893
|
+
on(event: 'contact', listener: (message: Message) => void): this;
|
|
2894
|
+
on(event: 'dice', listener: (message: Message) => void): this;
|
|
2895
|
+
on(event: 'document', listener: (message: Message) => void): this;
|
|
2896
|
+
on(event: 'game', listener: (message: Message) => void): this;
|
|
2897
|
+
on(event: 'invoice', listener: (message: Message) => void): this;
|
|
2898
|
+
on(event: 'location', listener: (message: Message) => void): this;
|
|
2899
|
+
on(event: 'photo', listener: (message: Message) => void): this;
|
|
2900
|
+
on(event: 'pinned_message', listener: (message: Message) => void): this;
|
|
2901
|
+
on(event: 'poll', listener: (message: Message) => void): this;
|
|
2902
|
+
on(event: 'sticker', listener: (message: Message) => void): this;
|
|
2903
|
+
on(event: 'successful_payment', listener: (message: Message) => void): this;
|
|
2904
|
+
on(event: 'video', listener: (message: Message) => void): this;
|
|
2905
|
+
on(event: 'video_note', listener: (message: Message) => void): this;
|
|
2906
|
+
on(event: 'voice', listener: (message: Message) => void): this;
|
|
2907
|
+
on(event: 'video_chat_started', listener: (message: Message) => void): this;
|
|
2908
|
+
on(event: 'video_chat_ended', listener: (message: Message) => void): this;
|
|
2909
|
+
on(event: 'video_chat_participants_invited', listener: (message: Message) => void): this;
|
|
2910
|
+
on(event: 'video_chat_scheduled', listener: (message: Message) => void): this;
|
|
2911
|
+
on(event: 'message_auto_delete_timer_changed', listener: (message: Message) => void): this;
|
|
2912
|
+
on(event: 'chat_invite_link', listener: (message: Message) => void): this;
|
|
2913
|
+
on(event: 'chat_member_updated', listener: (message: Message) => void): this;
|
|
2914
|
+
on(event: 'web_app_data', listener: (message: Message) => void): this;
|
|
2915
|
+
on(event: 'passport_data', listener: (message: Message) => void): this;
|
|
2916
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
2917
|
+
|
|
2918
|
+
// --- Polling / WebHook ------------------------------------------------------
|
|
2919
|
+
|
|
2920
|
+
/** Start polling. Rejects returned promise if a WebHook is being used. */
|
|
2921
|
+
startPolling(options?: { restart?: boolean }): Promise<void>;
|
|
2922
|
+
|
|
2923
|
+
/** Deprecated alias for startPolling(). */
|
|
2924
|
+
initPolling(): Promise<void>;
|
|
2925
|
+
|
|
2926
|
+
/** Stops polling after the last polling request resolves. */
|
|
2927
|
+
stopPolling(options?: { cancel?: boolean; reason?: string }): Promise<void>;
|
|
2928
|
+
|
|
2929
|
+
/** Return true if polling. Otherwise, false. */
|
|
2930
|
+
isPolling(): boolean;
|
|
2931
|
+
|
|
2932
|
+
/** Open webhook. Rejects returned promise if polling is being used. */
|
|
2933
|
+
openWebHook(): Promise<void>;
|
|
2934
|
+
|
|
2935
|
+
/** Close webhook after closing all current connections. */
|
|
2936
|
+
closeWebHook(): Promise<void>;
|
|
2937
|
+
|
|
2938
|
+
/** Return true if using webhook and it is open. */
|
|
2939
|
+
hasOpenWebHook(): boolean;
|
|
2940
|
+
|
|
2941
|
+
// --- File Helpers -----------------------------------------------------------
|
|
2942
|
+
|
|
2943
|
+
/**
|
|
2944
|
+
* Get link for file. Link will be valid for 1 hour.
|
|
2945
|
+
* @param fileId File identifier
|
|
2946
|
+
* @param form Additional query options
|
|
2947
|
+
*/
|
|
2948
|
+
getFileLink(fileId: string, form?: FormQueryOptions): Promise<string>;
|
|
2949
|
+
|
|
2950
|
+
/**
|
|
2951
|
+
* Return a readable stream for file.
|
|
2952
|
+
* @param fileId File identifier
|
|
2953
|
+
* @param form Additional query options
|
|
2954
|
+
*/
|
|
2955
|
+
getFileStream(fileId: string, form?: FormQueryOptions): Stream;
|
|
2956
|
+
|
|
2957
|
+
/**
|
|
2958
|
+
* Downloads file to the specified folder.
|
|
2959
|
+
* @param fileId File identifier
|
|
2960
|
+
* @param downloadDir Absolute path to the folder
|
|
2961
|
+
* @param form Additional query options
|
|
2962
|
+
*/
|
|
2963
|
+
downloadFile(fileId: string, downloadDir: string, form?: FormQueryOptions): Promise<string>;
|
|
2964
|
+
|
|
2965
|
+
// --- Text/Reply Listeners ---------------------------------------------------
|
|
2966
|
+
|
|
2967
|
+
/** Register a RegExp to test against an incoming text message. */
|
|
2968
|
+
onText(regexp: RegExp, callback: (msg: Message, match: RegExpExecArray | null) => void): void;
|
|
2969
|
+
|
|
2970
|
+
/** Remove a listener registered with onText(). */
|
|
2971
|
+
removeTextListener(regexp: RegExp): { regexp: RegExp; callback: Function } | null;
|
|
2972
|
+
|
|
2973
|
+
/** Remove all listeners registered with onText(). */
|
|
2974
|
+
clearTextListeners(): void;
|
|
2975
|
+
|
|
2976
|
+
/** Register a reply to wait for a message response. */
|
|
2977
|
+
onReplyToMessage(chatId: number | string, messageId: number, callback: (msg: Message) => void): number;
|
|
2978
|
+
|
|
2979
|
+
/** Remove a reply listener. */
|
|
2980
|
+
removeReplyListener(replyListenerId: number): { id: number; chatId: number | string; messageId: number; callback: Function } | null;
|
|
2981
|
+
|
|
2982
|
+
/** Remove all reply listeners. */
|
|
2983
|
+
clearReplyListeners(): void;
|
|
2984
|
+
|
|
2985
|
+
// --- Process Update ---------------------------------------------------------
|
|
2986
|
+
|
|
2987
|
+
/**
|
|
2988
|
+
* Process an update; emitting the proper events and executing regexp callbacks.
|
|
2989
|
+
* @param update Telegram Update object
|
|
2990
|
+
*/
|
|
2991
|
+
processUpdate(update: Update): void;
|
|
2992
|
+
|
|
2993
|
+
// ==========================================================================
|
|
2994
|
+
// TELEGRAM BOT API METHODS
|
|
2995
|
+
// ==========================================================================
|
|
2996
|
+
|
|
2997
|
+
// --- Getting Updates --------------------------------------------------------
|
|
2998
|
+
|
|
2999
|
+
/**
|
|
3000
|
+
* Use this method to receive incoming updates using long polling.
|
|
3001
|
+
* @see https://core.telegram.org/bots/api#getupdates
|
|
3002
|
+
*/
|
|
3003
|
+
getUpdates(form?: {
|
|
3004
|
+
offset?: Integer;
|
|
3005
|
+
limit?: Integer;
|
|
3006
|
+
timeout?: Integer;
|
|
3007
|
+
allowed_updates?: string[];
|
|
3008
|
+
}): Promise<Update[]>;
|
|
3009
|
+
|
|
3010
|
+
/**
|
|
3011
|
+
* Specify a URL to receive incoming updates via an outgoing WebHook.
|
|
3012
|
+
* @see https://core.telegram.org/bots/api#setwebhook
|
|
3013
|
+
*/
|
|
3014
|
+
setWebHook(
|
|
3015
|
+
url: string,
|
|
3016
|
+
options?: {
|
|
3017
|
+
certificate?: InputFile;
|
|
3018
|
+
ip_address?: string;
|
|
3019
|
+
max_connections?: Integer;
|
|
3020
|
+
allowed_updates?: string[];
|
|
3021
|
+
drop_pending_updates?: boolean;
|
|
3022
|
+
secret_token?: string;
|
|
3023
|
+
},
|
|
3024
|
+
fileOptions?: FormQueryOptions,
|
|
3025
|
+
): Promise<boolean>;
|
|
3026
|
+
|
|
3027
|
+
/**
|
|
3028
|
+
* Remove webhook integration.
|
|
3029
|
+
* @see https://core.telegram.org/bots/api#deletewebhook
|
|
3030
|
+
*/
|
|
3031
|
+
deleteWebHook(form?: { drop_pending_updates?: boolean }): Promise<boolean>;
|
|
3032
|
+
|
|
3033
|
+
/**
|
|
3034
|
+
* Get current webhook status.
|
|
3035
|
+
* @see https://core.telegram.org/bots/api#getwebhookinfo
|
|
3036
|
+
*/
|
|
3037
|
+
getWebHookInfo(form?: FormQueryOptions): Promise<{
|
|
3038
|
+
url: string;
|
|
3039
|
+
has_custom_certificate: boolean;
|
|
3040
|
+
pending_update_count: Integer;
|
|
3041
|
+
ip_address?: string;
|
|
3042
|
+
last_error_date?: Integer;
|
|
3043
|
+
last_error_message?: string;
|
|
3044
|
+
last_synchronization_error_date?: Integer;
|
|
3045
|
+
max_connections?: Integer;
|
|
3046
|
+
allowed_updates?: string[];
|
|
3047
|
+
}>;
|
|
3048
|
+
|
|
3049
|
+
// --- Basic Info -------------------------------------------------------------
|
|
3050
|
+
|
|
3051
|
+
/** A simple method for testing your bot's authentication token. */
|
|
3052
|
+
getMe(form?: FormQueryOptions): Promise<User>;
|
|
3053
|
+
|
|
3054
|
+
/** Log out from the cloud Bot API server. */
|
|
3055
|
+
logOut(form?: FormQueryOptions): Promise<boolean>;
|
|
3056
|
+
|
|
3057
|
+
/** Close the bot instance before moving it from one local server to another. */
|
|
3058
|
+
close(form?: FormQueryOptions): Promise<boolean>;
|
|
3059
|
+
|
|
3060
|
+
// --- Sending Messages -------------------------------------------------------
|
|
3061
|
+
|
|
3062
|
+
/**
|
|
3063
|
+
* Send text message.
|
|
3064
|
+
* @see https://core.telegram.org/bots/api#sendmessage
|
|
3065
|
+
*/
|
|
3066
|
+
sendMessage(
|
|
3067
|
+
chatId: number | string,
|
|
3068
|
+
text: string,
|
|
3069
|
+
form?: SendMessageOptions,
|
|
3070
|
+
): Promise<Message>;
|
|
3071
|
+
|
|
3072
|
+
/**
|
|
3073
|
+
* Forward messages of any kind.
|
|
3074
|
+
* @see https://core.telegram.org/bots/api#forwardmessage
|
|
3075
|
+
*/
|
|
3076
|
+
forwardMessage(
|
|
3077
|
+
chatId: number | string,
|
|
3078
|
+
fromChatId: number | string,
|
|
3079
|
+
messageId: number,
|
|
3080
|
+
form?: {
|
|
3081
|
+
disable_notification?: boolean;
|
|
3082
|
+
protect_content?: boolean;
|
|
3083
|
+
message_effect_id?: string;
|
|
3084
|
+
},
|
|
3085
|
+
): Promise<Message>;
|
|
3086
|
+
|
|
3087
|
+
/**
|
|
3088
|
+
* Forward multiple messages of any kind.
|
|
3089
|
+
* @see https://core.telegram.org/bots/api#forwardmessages
|
|
3090
|
+
*/
|
|
3091
|
+
forwardMessages(
|
|
3092
|
+
chatId: number | string,
|
|
3093
|
+
fromChatId: number | string,
|
|
3094
|
+
messageIds: number[],
|
|
3095
|
+
form?: {
|
|
3096
|
+
disable_notification?: boolean;
|
|
3097
|
+
protect_content?: boolean;
|
|
3098
|
+
},
|
|
3099
|
+
): Promise<MessageId[]>;
|
|
3100
|
+
|
|
3101
|
+
/**
|
|
3102
|
+
* Copy messages of any kind.
|
|
3103
|
+
* @see https://core.telegram.org/bots/api#copymessage
|
|
3104
|
+
*/
|
|
3105
|
+
copyMessage(
|
|
3106
|
+
chatId: number | string,
|
|
3107
|
+
fromChatId: number | string,
|
|
3108
|
+
messageId: number,
|
|
3109
|
+
form?: {
|
|
3110
|
+
message_thread_id?: Integer;
|
|
3111
|
+
caption?: string;
|
|
3112
|
+
parse_mode?: string;
|
|
3113
|
+
caption_entities?: MessageEntity[];
|
|
3114
|
+
show_caption_above_media?: boolean;
|
|
3115
|
+
disable_notification?: boolean;
|
|
3116
|
+
protect_content?: boolean;
|
|
3117
|
+
allow_paid_broadcast?: boolean;
|
|
3118
|
+
reply_parameters?: ReplyParameters;
|
|
3119
|
+
reply_markup?: ReplyMarkup;
|
|
3120
|
+
},
|
|
3121
|
+
): Promise<{ message_id: Integer }>;
|
|
3122
|
+
|
|
3123
|
+
/**
|
|
3124
|
+
* Copy messages of any kind.
|
|
3125
|
+
* @see https://core.telegram.org/bots/api#copymessages
|
|
3126
|
+
*/
|
|
3127
|
+
copyMessages(
|
|
3128
|
+
chatId: number | string,
|
|
3129
|
+
fromChatId: number | string,
|
|
3130
|
+
messageIds: number[],
|
|
3131
|
+
form?: {
|
|
3132
|
+
message_thread_id?: Integer;
|
|
3133
|
+
disable_notification?: boolean;
|
|
3134
|
+
protect_content?: boolean;
|
|
3135
|
+
remove_caption?: boolean;
|
|
3136
|
+
},
|
|
3137
|
+
): Promise<{ message_id: Integer }[]>;
|
|
3138
|
+
|
|
3139
|
+
/**
|
|
3140
|
+
* Send photo.
|
|
3141
|
+
* @see https://core.telegram.org/bots/api#sendphoto
|
|
3142
|
+
*/
|
|
3143
|
+
sendPhoto(
|
|
3144
|
+
chatId: number | string,
|
|
3145
|
+
photo: InputFile,
|
|
3146
|
+
options?: SendPhotoOptions,
|
|
3147
|
+
fileOptions?: FormQueryOptions,
|
|
3148
|
+
): Promise<Message>;
|
|
3149
|
+
|
|
3150
|
+
/**
|
|
3151
|
+
* Send audio.
|
|
3152
|
+
* @see https://core.telegram.org/bots/api#sendaudio
|
|
3153
|
+
*/
|
|
3154
|
+
sendAudio(
|
|
3155
|
+
chatId: number | string,
|
|
3156
|
+
audio: InputFile,
|
|
3157
|
+
options?: SendAudioOptions,
|
|
3158
|
+
fileOptions?: FormQueryOptions,
|
|
3159
|
+
): Promise<Message>;
|
|
3160
|
+
|
|
3161
|
+
/**
|
|
3162
|
+
* Send document.
|
|
3163
|
+
* @see https://core.telegram.org/bots/api#senddocument
|
|
3164
|
+
*/
|
|
3165
|
+
sendDocument(
|
|
3166
|
+
chatId: number | string,
|
|
3167
|
+
doc: InputFile,
|
|
3168
|
+
options?: SendDocumentOptions,
|
|
3169
|
+
fileOptions?: FormQueryOptions,
|
|
3170
|
+
): Promise<Message>;
|
|
3171
|
+
|
|
3172
|
+
/**
|
|
3173
|
+
* Send video.
|
|
3174
|
+
* @see https://core.telegram.org/bots/api#sendvideo
|
|
3175
|
+
*/
|
|
3176
|
+
sendVideo(
|
|
3177
|
+
chatId: number | string,
|
|
3178
|
+
video: InputFile,
|
|
3179
|
+
options?: SendVideoOptions,
|
|
3180
|
+
fileOptions?: FormQueryOptions,
|
|
3181
|
+
): Promise<Message>;
|
|
3182
|
+
|
|
3183
|
+
/**
|
|
3184
|
+
* Send animation (GIF or H.264/MPEG-4 AVC video without sound).
|
|
3185
|
+
* @see https://core.telegram.org/bots/api#sendanimation
|
|
3186
|
+
*/
|
|
3187
|
+
sendAnimation(
|
|
3188
|
+
chatId: number | string,
|
|
3189
|
+
animation: InputFile,
|
|
3190
|
+
options?: SendAnimationOptions,
|
|
3191
|
+
fileOptions?: FormQueryOptions,
|
|
3192
|
+
): Promise<Message>;
|
|
3193
|
+
|
|
3194
|
+
/**
|
|
3195
|
+
* Send voice message.
|
|
3196
|
+
* @see https://core.telegram.org/bots/api#sendvoice
|
|
3197
|
+
*/
|
|
3198
|
+
sendVoice(
|
|
3199
|
+
chatId: number | string,
|
|
3200
|
+
voice: InputFile,
|
|
3201
|
+
options?: SendVoiceOptions,
|
|
3202
|
+
fileOptions?: FormQueryOptions,
|
|
3203
|
+
): Promise<Message>;
|
|
3204
|
+
|
|
3205
|
+
/**
|
|
3206
|
+
* Send video note (round video).
|
|
3207
|
+
* @see https://core.telegram.org/bots/api#sendvideonote
|
|
3208
|
+
*/
|
|
3209
|
+
sendVideoNote(
|
|
3210
|
+
chatId: number | string,
|
|
3211
|
+
videoNote: InputFile,
|
|
3212
|
+
options?: SendVideoNoteOptions,
|
|
3213
|
+
fileOptions?: FormQueryOptions,
|
|
3214
|
+
): Promise<Message>;
|
|
3215
|
+
|
|
3216
|
+
/**
|
|
3217
|
+
* Send a group of photos or videos as an album.
|
|
3218
|
+
* @see https://core.telegram.org/bots/api#sendmediagroup
|
|
3219
|
+
*/
|
|
3220
|
+
sendMediaGroup(
|
|
3221
|
+
chatId: number | string,
|
|
3222
|
+
media: Array<InputMedia & { file_options?: FormQueryOptions }>,
|
|
3223
|
+
options?: FormQueryOptions,
|
|
3224
|
+
): Promise<Message[]>;
|
|
3225
|
+
|
|
3226
|
+
/**
|
|
3227
|
+
* Send paid media.
|
|
3228
|
+
* @see https://core.telegram.org/bots/api#sendpaidmedia
|
|
3229
|
+
*/
|
|
3230
|
+
sendPaidMedia(
|
|
3231
|
+
chatId: number | string,
|
|
3232
|
+
starCount: Integer,
|
|
3233
|
+
media: InputPaidMedia[],
|
|
3234
|
+
options?: SendPaidMediaOptions,
|
|
3235
|
+
): Promise<Message>;
|
|
3236
|
+
|
|
3237
|
+
/**
|
|
3238
|
+
* Send location.
|
|
3239
|
+
* @see https://core.telegram.org/bots/api#sendlocation
|
|
3240
|
+
*/
|
|
3241
|
+
sendLocation(
|
|
3242
|
+
chatId: number | string,
|
|
3243
|
+
latitude: Float,
|
|
3244
|
+
longitude: Float,
|
|
3245
|
+
options?: SendLocationOptions,
|
|
3246
|
+
): Promise<Message>;
|
|
3247
|
+
|
|
3248
|
+
/**
|
|
3249
|
+
* Edit live location messages sent by the bot.
|
|
3250
|
+
* @see https://core.telegram.org/bots/api#editmessagelivelocation
|
|
3251
|
+
*/
|
|
3252
|
+
editMessageLiveLocation(
|
|
3253
|
+
latitude: Float,
|
|
3254
|
+
longitude: Float,
|
|
3255
|
+
form?: {
|
|
3256
|
+
chat_id?: number | string;
|
|
3257
|
+
message_id?: number;
|
|
3258
|
+
inline_message_id?: string;
|
|
3259
|
+
horizontal_accuracy?: Float;
|
|
3260
|
+
heading?: Integer;
|
|
3261
|
+
proximity_alert_radius?: Integer;
|
|
3262
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
3263
|
+
},
|
|
3264
|
+
): Promise<Message | boolean>;
|
|
3265
|
+
|
|
3266
|
+
/**
|
|
3267
|
+
* Stop updating a live location message.
|
|
3268
|
+
* @see https://core.telegram.org/bots/api#stopmessagelivelocation
|
|
3269
|
+
*/
|
|
3270
|
+
stopMessageLiveLocation(form?: {
|
|
3271
|
+
chat_id?: number | string;
|
|
3272
|
+
message_id?: number;
|
|
3273
|
+
inline_message_id?: string;
|
|
3274
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
3275
|
+
}): Promise<Message | boolean>;
|
|
3276
|
+
|
|
3277
|
+
/**
|
|
3278
|
+
* Send venue.
|
|
3279
|
+
* @see https://core.telegram.org/bots/api#sendvenue
|
|
3280
|
+
*/
|
|
3281
|
+
sendVenue(
|
|
3282
|
+
chatId: number | string,
|
|
3283
|
+
latitude: Float,
|
|
3284
|
+
longitude: Float,
|
|
3285
|
+
title: string,
|
|
3286
|
+
address: string,
|
|
3287
|
+
options?: SendVenueOptions,
|
|
3288
|
+
): Promise<Message>;
|
|
3289
|
+
|
|
3290
|
+
/**
|
|
3291
|
+
* Send contact.
|
|
3292
|
+
* @see https://core.telegram.org/bots/api#sendcontact
|
|
3293
|
+
*/
|
|
3294
|
+
sendContact(
|
|
3295
|
+
chatId: number | string,
|
|
3296
|
+
phoneNumber: string,
|
|
3297
|
+
firstName: string,
|
|
3298
|
+
options?: SendContactOptions,
|
|
3299
|
+
): Promise<Message>;
|
|
3300
|
+
|
|
3301
|
+
/**
|
|
3302
|
+
* Send poll.
|
|
3303
|
+
* @see https://core.telegram.org/bots/api#sendpoll
|
|
3304
|
+
*/
|
|
3305
|
+
sendPoll(
|
|
3306
|
+
chatId: number | string,
|
|
3307
|
+
question: string,
|
|
3308
|
+
pollOptions: string[] | Array<{ text: string }>,
|
|
3309
|
+
options?: SendPollOptions,
|
|
3310
|
+
): Promise<Message>;
|
|
3311
|
+
|
|
3312
|
+
/**
|
|
3313
|
+
* Send animated emoji that will display a random value.
|
|
3314
|
+
* @see https://core.telegram.org/bots/api#senddice
|
|
3315
|
+
*/
|
|
3316
|
+
sendDice(
|
|
3317
|
+
chatId: number | string,
|
|
3318
|
+
options?: SendDiceOptions,
|
|
3319
|
+
): Promise<Message>;
|
|
3320
|
+
|
|
3321
|
+
/**
|
|
3322
|
+
* Send chat action.
|
|
3323
|
+
* @see https://core.telegram.org/bots/api#sendchataction
|
|
3324
|
+
*/
|
|
3325
|
+
sendChatAction(
|
|
3326
|
+
chatId: number | string,
|
|
3327
|
+
action: string,
|
|
3328
|
+
form?: SendChatActionOptions,
|
|
3329
|
+
): Promise<boolean>;
|
|
3330
|
+
|
|
3331
|
+
/**
|
|
3332
|
+
* Change the chosen reactions on a message.
|
|
3333
|
+
* @see https://core.telegram.org/bots/api#setmessagereaction
|
|
3334
|
+
*/
|
|
3335
|
+
setMessageReaction(
|
|
3336
|
+
chatId: number | string,
|
|
3337
|
+
messageId: number,
|
|
3338
|
+
form?: {
|
|
3339
|
+
reaction?: ReactionType[];
|
|
3340
|
+
is_big?: boolean;
|
|
3341
|
+
},
|
|
3342
|
+
): Promise<boolean>;
|
|
3343
|
+
|
|
3344
|
+
// --- User Info --------------------------------------------------------------
|
|
3345
|
+
|
|
3346
|
+
/**
|
|
3347
|
+
* Get a list of profile pictures for a user.
|
|
3348
|
+
* @see https://core.telegram.org/bots/api#getuserprofilephotos
|
|
3349
|
+
*/
|
|
3350
|
+
getUserProfilePhotos(
|
|
3351
|
+
userId: number,
|
|
3352
|
+
form?: { offset?: Integer; limit?: Integer },
|
|
3353
|
+
): Promise<UserProfilePhotos>;
|
|
3354
|
+
|
|
3355
|
+
// --- Files ------------------------------------------------------------------
|
|
3356
|
+
|
|
3357
|
+
/**
|
|
3358
|
+
* Get basic info about a file and prepare it for downloading.
|
|
3359
|
+
* @see https://core.telegram.org/bots/api#getfile
|
|
3360
|
+
*/
|
|
3361
|
+
getFile(fileId: string, form?: FormQueryOptions): Promise<File>;
|
|
3362
|
+
|
|
3363
|
+
// --- Chat Management --------------------------------------------------------
|
|
3364
|
+
|
|
3365
|
+
/**
|
|
3366
|
+
* Ban a user in a group, supergroup or channel.
|
|
3367
|
+
* @see https://core.telegram.org/bots/api#banchatmember
|
|
3368
|
+
*/
|
|
3369
|
+
banChatMember(
|
|
3370
|
+
chatId: number | string,
|
|
3371
|
+
userId: number,
|
|
3372
|
+
form?: { until_date?: Integer; revoke_messages?: boolean },
|
|
3373
|
+
): Promise<boolean>;
|
|
3374
|
+
|
|
3375
|
+
/**
|
|
3376
|
+
* Unban a previously kicked user in a supergroup.
|
|
3377
|
+
* @see https://core.telegram.org/bots/api#unbanchatmember
|
|
3378
|
+
*/
|
|
3379
|
+
unbanChatMember(
|
|
3380
|
+
chatId: number | string,
|
|
3381
|
+
userId: number,
|
|
3382
|
+
form?: { only_if_banned?: boolean },
|
|
3383
|
+
): Promise<boolean>;
|
|
3384
|
+
|
|
3385
|
+
/**
|
|
3386
|
+
* Restrict a user in a supergroup.
|
|
3387
|
+
* @see https://core.telegram.org/bots/api#restrictchatmember
|
|
3388
|
+
*/
|
|
3389
|
+
restrictChatMember(
|
|
3390
|
+
chatId: number | string,
|
|
3391
|
+
userId: number,
|
|
3392
|
+
form?: { permissions: ChatPermissions; use_independent_chat_permissions?: boolean; until_date?: Integer },
|
|
3393
|
+
): Promise<boolean>;
|
|
3394
|
+
|
|
3395
|
+
/**
|
|
3396
|
+
* Promote or demote a user in a supergroup or channel.
|
|
3397
|
+
* @see https://core.telegram.org/bots/api#promotechatmember
|
|
3398
|
+
*/
|
|
3399
|
+
promoteChatMember(
|
|
3400
|
+
chatId: number | string,
|
|
3401
|
+
userId: number,
|
|
3402
|
+
form?: {
|
|
3403
|
+
is_anonymous?: boolean;
|
|
3404
|
+
can_manage_chat?: boolean;
|
|
3405
|
+
can_delete_messages?: boolean;
|
|
3406
|
+
can_manage_video_chats?: boolean;
|
|
3407
|
+
can_restrict_members?: boolean;
|
|
3408
|
+
can_promote_members?: boolean;
|
|
3409
|
+
can_change_info?: boolean;
|
|
3410
|
+
can_invite_users?: boolean;
|
|
3411
|
+
can_post_messages?: boolean;
|
|
3412
|
+
can_edit_messages?: boolean;
|
|
3413
|
+
can_pin_messages?: boolean;
|
|
3414
|
+
can_manage_topics?: boolean;
|
|
3415
|
+
can_post_stories?: boolean;
|
|
3416
|
+
can_edit_stories?: boolean;
|
|
3417
|
+
can_delete_stories?: boolean;
|
|
3418
|
+
can_manage_direct_messages?: boolean;
|
|
3419
|
+
},
|
|
3420
|
+
): Promise<boolean>;
|
|
3421
|
+
|
|
3422
|
+
/**
|
|
3423
|
+
* Set a custom title for an administrator in a supergroup.
|
|
3424
|
+
* @see https://core.telegram.org/bots/api#setchatadministratorcustomtitle
|
|
3425
|
+
*/
|
|
3426
|
+
setChatAdministratorCustomTitle(
|
|
3427
|
+
chatId: number | string,
|
|
3428
|
+
userId: number,
|
|
3429
|
+
customTitle: string,
|
|
3430
|
+
form?: FormQueryOptions,
|
|
3431
|
+
): Promise<boolean>;
|
|
3432
|
+
|
|
3433
|
+
/**
|
|
3434
|
+
* Ban a channel chat in a supergroup or channel.
|
|
3435
|
+
* @see https://core.telegram.org/bots/api#banchatsenderchat
|
|
3436
|
+
*/
|
|
3437
|
+
banChatSenderChat(
|
|
3438
|
+
chatId: number | string,
|
|
3439
|
+
senderChatId: number,
|
|
3440
|
+
form?: FormQueryOptions,
|
|
3441
|
+
): Promise<boolean>;
|
|
3442
|
+
|
|
3443
|
+
/**
|
|
3444
|
+
* Unban a previously banned channel chat.
|
|
3445
|
+
* @see https://core.telegram.org/bots/api#unbanchatsenderchat
|
|
3446
|
+
*/
|
|
3447
|
+
unbanChatSenderChat(
|
|
3448
|
+
chatId: number | string,
|
|
3449
|
+
senderChatId: number,
|
|
3450
|
+
form?: FormQueryOptions,
|
|
3451
|
+
): Promise<boolean>;
|
|
3452
|
+
|
|
3453
|
+
/**
|
|
3454
|
+
* Set default chat permissions for all members.
|
|
3455
|
+
* @see https://core.telegram.org/bots/api#setchatpermissions
|
|
3456
|
+
*/
|
|
3457
|
+
setChatPermissions(
|
|
3458
|
+
chatId: number | string,
|
|
3459
|
+
chatPermissions: ChatPermissions,
|
|
3460
|
+
form?: { use_independent_chat_permissions?: boolean },
|
|
3461
|
+
): Promise<boolean>;
|
|
3462
|
+
|
|
3463
|
+
/**
|
|
3464
|
+
* Generate a new primary invite link for a chat.
|
|
3465
|
+
* @see https://core.telegram.org/bots/api#exportchatinvitelink
|
|
3466
|
+
*/
|
|
3467
|
+
exportChatInviteLink(chatId: number | string, form?: FormQueryOptions): Promise<string>;
|
|
3468
|
+
|
|
3469
|
+
/**
|
|
3470
|
+
* Create an additional invite link for a chat.
|
|
3471
|
+
* @see https://core.telegram.org/bots/api#createchatinvitelink
|
|
3472
|
+
*/
|
|
3473
|
+
createChatInviteLink(
|
|
3474
|
+
chatId: number | string,
|
|
3475
|
+
form?: {
|
|
3476
|
+
name?: string;
|
|
3477
|
+
expire_date?: Integer;
|
|
3478
|
+
member_limit?: Integer;
|
|
3479
|
+
creates_join_request?: boolean;
|
|
3480
|
+
},
|
|
3481
|
+
): Promise<ChatInviteLink>;
|
|
3482
|
+
|
|
3483
|
+
/**
|
|
3484
|
+
* Edit a non-primary invite link created by the bot.
|
|
3485
|
+
* @see https://core.telegram.org/bots/api#editchatinvitelink
|
|
3486
|
+
*/
|
|
3487
|
+
editChatInviteLink(
|
|
3488
|
+
chatId: number | string,
|
|
3489
|
+
inviteLink: string,
|
|
3490
|
+
form?: {
|
|
3491
|
+
name?: string;
|
|
3492
|
+
expire_date?: Integer;
|
|
3493
|
+
member_limit?: Integer;
|
|
3494
|
+
creates_join_request?: boolean;
|
|
3495
|
+
},
|
|
3496
|
+
): Promise<ChatInviteLink>;
|
|
3497
|
+
|
|
3498
|
+
/**
|
|
3499
|
+
* Revoke an invite link created by the bot.
|
|
3500
|
+
* @see https://core.telegram.org/bots/api#revokechatinvitelink
|
|
3501
|
+
*/
|
|
3502
|
+
revokeChatInviteLink(chatId: number | string, inviteLink: string, form?: FormQueryOptions): Promise<ChatInviteLink>;
|
|
3503
|
+
|
|
3504
|
+
/**
|
|
3505
|
+
* Approve a chat join request.
|
|
3506
|
+
* @see https://core.telegram.org/bots/api#approvechatjoinrequest
|
|
3507
|
+
*/
|
|
3508
|
+
approveChatJoinRequest(chatId: number | string, userId: number, form?: FormQueryOptions): Promise<boolean>;
|
|
3509
|
+
|
|
3510
|
+
/**
|
|
3511
|
+
* Decline a chat join request.
|
|
3512
|
+
* @see https://core.telegram.org/bots/api#declinechatjoinrequest
|
|
3513
|
+
*/
|
|
3514
|
+
declineChatJoinRequest(chatId: number | string, userId: number, form?: FormQueryOptions): Promise<boolean>;
|
|
3515
|
+
|
|
3516
|
+
/**
|
|
3517
|
+
* Set a new profile photo for the chat.
|
|
3518
|
+
* @see https://core.telegram.org/bots/api#setchatphoto
|
|
3519
|
+
*/
|
|
3520
|
+
setChatPhoto(
|
|
3521
|
+
chatId: number | string,
|
|
3522
|
+
photo: InputFile,
|
|
3523
|
+
options?: FormQueryOptions,
|
|
3524
|
+
fileOptions?: FormQueryOptions,
|
|
3525
|
+
): Promise<boolean>;
|
|
3526
|
+
|
|
3527
|
+
/**
|
|
3528
|
+
* Delete a chat photo.
|
|
3529
|
+
* @see https://core.telegram.org/bots/api#deletechatphoto
|
|
3530
|
+
*/
|
|
3531
|
+
deleteChatPhoto(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
3532
|
+
|
|
3533
|
+
/**
|
|
3534
|
+
* Change the title of a chat.
|
|
3535
|
+
* @see https://core.telegram.org/bots/api#setchattitle
|
|
3536
|
+
*/
|
|
3537
|
+
setChatTitle(chatId: number | string, title: string, form?: FormQueryOptions): Promise<boolean>;
|
|
3538
|
+
|
|
3539
|
+
/**
|
|
3540
|
+
* Change the description of a group, supergroup or channel.
|
|
3541
|
+
* @see https://core.telegram.org/bots/api#setchatdescription
|
|
3542
|
+
*/
|
|
3543
|
+
setChatDescription(chatId: number | string, description: string, form?: FormQueryOptions): Promise<boolean>;
|
|
3544
|
+
|
|
3545
|
+
/**
|
|
3546
|
+
* Pin a message in a supergroup.
|
|
3547
|
+
* @see https://core.telegram.org/bots/api#pinchatmessage
|
|
3548
|
+
*/
|
|
3549
|
+
pinChatMessage(
|
|
3550
|
+
chatId: number | string,
|
|
3551
|
+
messageId: number,
|
|
3552
|
+
form?: { disable_notification?: boolean; business_connection_id?: string },
|
|
3553
|
+
): Promise<boolean>;
|
|
3554
|
+
|
|
3555
|
+
/**
|
|
3556
|
+
* Remove a message from the list of pinned messages in a chat.
|
|
3557
|
+
* @see https://core.telegram.org/bots/api#unpinchatmessage
|
|
3558
|
+
*/
|
|
3559
|
+
unpinChatMessage(
|
|
3560
|
+
chatId: number | string,
|
|
3561
|
+
form?: { message_id?: Integer; business_connection_id?: string },
|
|
3562
|
+
): Promise<boolean>;
|
|
3563
|
+
|
|
3564
|
+
/**
|
|
3565
|
+
* Clear the list of pinned messages in a chat.
|
|
3566
|
+
* @see https://core.telegram.org/bots/api#unpinallchatmessages
|
|
3567
|
+
*/
|
|
3568
|
+
unpinAllChatMessages(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
3569
|
+
|
|
3570
|
+
/**
|
|
3571
|
+
* Leave a group, supergroup or channel.
|
|
3572
|
+
* @see https://core.telegram.org/bots/api#leavechat
|
|
3573
|
+
*/
|
|
3574
|
+
leaveChat(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
3575
|
+
|
|
3576
|
+
/**
|
|
3577
|
+
* Get up to date information about the chat.
|
|
3578
|
+
* @see https://core.telegram.org/bots/api#getchat
|
|
3579
|
+
*/
|
|
3580
|
+
getChat(chatId: number | string, form?: FormQueryOptions): Promise<ChatFullInfo>;
|
|
3581
|
+
|
|
3582
|
+
/**
|
|
3583
|
+
* Get a list of administrators in a chat.
|
|
3584
|
+
* @see https://core.telegram.org/bots/api#getchatadministrators
|
|
3585
|
+
*/
|
|
3586
|
+
getChatAdministrators(chatId: number | string, form?: FormQueryOptions): Promise<ChatMember[]>;
|
|
3587
|
+
|
|
3588
|
+
/**
|
|
3589
|
+
* Get the number of members in a chat.
|
|
3590
|
+
* @see https://core.telegram.org/bots/api#getchatmembercount
|
|
3591
|
+
*/
|
|
3592
|
+
getChatMemberCount(chatId: number | string, form?: FormQueryOptions): Promise<Integer>;
|
|
3593
|
+
|
|
3594
|
+
/**
|
|
3595
|
+
* Get information about a member of a chat.
|
|
3596
|
+
* @see https://core.telegram.org/bots/api#getchatmember
|
|
3597
|
+
*/
|
|
3598
|
+
getChatMember(chatId: number | string, userId: number, form?: FormQueryOptions): Promise<ChatMember>;
|
|
3599
|
+
|
|
3600
|
+
/**
|
|
3601
|
+
* Set a new group sticker set for a supergroup.
|
|
3602
|
+
* @see https://core.telegram.org/bots/api#setchatstickerset
|
|
3603
|
+
*/
|
|
3604
|
+
setChatStickerSet(chatId: number | string, stickerSetName: string, form?: FormQueryOptions): Promise<boolean>;
|
|
3605
|
+
|
|
3606
|
+
/**
|
|
3607
|
+
* Delete a group sticker set from a supergroup.
|
|
3608
|
+
* @see https://core.telegram.org/bots/api#deletechatstickerset
|
|
3609
|
+
*/
|
|
3610
|
+
deleteChatStickerSet(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
3611
|
+
|
|
3612
|
+
// --- Forum Topics ------------------------------------------------------------
|
|
3613
|
+
|
|
3614
|
+
/**
|
|
3615
|
+
* Get custom emoji stickers for forum topic icons.
|
|
3616
|
+
* @see https://core.telegram.org/bots/api#getforumtopiciconstickers
|
|
3617
|
+
*/
|
|
3618
|
+
getForumTopicIconStickers(chatId?: number | string, form?: FormQueryOptions): Promise<Sticker[]>;
|
|
3619
|
+
|
|
3620
|
+
/**
|
|
3621
|
+
* Create a topic in a forum supergroup chat.
|
|
3622
|
+
* @see https://core.telegram.org/bots/api#createforumtopic
|
|
3623
|
+
*/
|
|
3624
|
+
createForumTopic(
|
|
3625
|
+
chatId: number | string,
|
|
3626
|
+
name: string,
|
|
3627
|
+
form?: { icon_color?: Integer; icon_custom_emoji_id?: string },
|
|
3628
|
+
): Promise<ForumTopic>;
|
|
3629
|
+
|
|
3630
|
+
/**
|
|
3631
|
+
* Edit name and icon of a topic in a forum supergroup chat.
|
|
3632
|
+
* @see https://core.telegram.org/bots/api#editforumtopic
|
|
3633
|
+
*/
|
|
3634
|
+
editForumTopic(
|
|
3635
|
+
chatId: number | string,
|
|
3636
|
+
messageThreadId: number,
|
|
3637
|
+
form?: { name?: string; icon_custom_emoji_id?: string },
|
|
3638
|
+
): Promise<boolean>;
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* Close an open topic in a forum supergroup chat.
|
|
3642
|
+
* @see https://core.telegram.org/bots/api#closeforumtopic
|
|
3643
|
+
*/
|
|
3644
|
+
closeForumTopic(chatId: number | string, messageThreadId: number, form?: FormQueryOptions): Promise<boolean>;
|
|
3645
|
+
|
|
3646
|
+
/**
|
|
3647
|
+
* Reopen a closed topic in a forum supergroup chat.
|
|
3648
|
+
* @see https://core.telegram.org/bots/api#reopenforumtopic
|
|
3649
|
+
*/
|
|
3650
|
+
reopenForumTopic(chatId: number | string, messageThreadId: number, form?: FormQueryOptions): Promise<boolean>;
|
|
3651
|
+
|
|
3652
|
+
/**
|
|
3653
|
+
* Delete a forum topic along with all its messages.
|
|
3654
|
+
* @see https://core.telegram.org/bots/api#deleteforumtopic
|
|
3655
|
+
*/
|
|
3656
|
+
deleteForumTopic(chatId: number | string, messageThreadId: number, form?: FormQueryOptions): Promise<boolean>;
|
|
3657
|
+
|
|
3658
|
+
/**
|
|
3659
|
+
* Clear the list of pinned messages in a forum topic.
|
|
3660
|
+
* @see https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
|
3661
|
+
*/
|
|
3662
|
+
unpinAllForumTopicMessages(chatId: number | string, messageThreadId: number, form?: FormQueryOptions): Promise<boolean>;
|
|
3663
|
+
|
|
3664
|
+
/**
|
|
3665
|
+
* Edit the name of the 'General' topic in a forum supergroup chat.
|
|
3666
|
+
* @see https://core.telegram.org/bots/api#editgeneralforumtopic
|
|
3667
|
+
*/
|
|
3668
|
+
editGeneralForumTopic(chatId: number | string, name: string, form?: FormQueryOptions): Promise<boolean>;
|
|
3669
|
+
|
|
3670
|
+
/**
|
|
3671
|
+
* Close an open 'General' topic in a forum supergroup chat.
|
|
3672
|
+
* @see https://core.telegram.org/bots/api#closegeneralforumtopic
|
|
3673
|
+
*/
|
|
3674
|
+
closeGeneralForumTopic(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
3675
|
+
|
|
3676
|
+
/**
|
|
3677
|
+
* Reopen a closed 'General' topic in a forum supergroup chat.
|
|
3678
|
+
* @see https://core.telegram.org/bots/api#reopengeneralforumtopic
|
|
3679
|
+
*/
|
|
3680
|
+
reopenGeneralForumTopic(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
3681
|
+
|
|
3682
|
+
/**
|
|
3683
|
+
* Hide the 'General' topic in a forum supergroup chat.
|
|
3684
|
+
* @see https://core.telegram.org/bots/api#hidegeneralforumtopic
|
|
3685
|
+
*/
|
|
3686
|
+
hideGeneralForumTopic(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
3687
|
+
|
|
3688
|
+
/**
|
|
3689
|
+
* Unhide the 'General' topic in a forum supergroup chat.
|
|
3690
|
+
* @see https://core.telegram.org/bots/api#unhidegeneralforumtopic
|
|
3691
|
+
*/
|
|
3692
|
+
unhideGeneralForumTopic(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
3693
|
+
|
|
3694
|
+
/**
|
|
3695
|
+
* Clear the list of pinned messages in a General forum topic.
|
|
3696
|
+
* @see https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
|
|
3697
|
+
*/
|
|
3698
|
+
unpinAllGeneralForumTopicMessages(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
3699
|
+
|
|
3700
|
+
// --- Callback Queries -------------------------------------------------------
|
|
3701
|
+
|
|
3702
|
+
/**
|
|
3703
|
+
* Send answers to callback queries.
|
|
3704
|
+
* @see https://core.telegram.org/bots/api#answercallbackquery
|
|
3705
|
+
*/
|
|
3706
|
+
answerCallbackQuery(
|
|
3707
|
+
callbackQueryId: string,
|
|
3708
|
+
form?: { text?: string; show_alert?: boolean; url?: string; cache_time?: Integer },
|
|
3709
|
+
): Promise<boolean>;
|
|
3710
|
+
|
|
3711
|
+
/**
|
|
3712
|
+
* Get the list of boosts added to a chat by a user.
|
|
3713
|
+
* @see https://core.telegram.org/bots/api#getuserchatboosts
|
|
3714
|
+
*/
|
|
3715
|
+
getUserChatBoosts(chatId: number | string, userId: number, form?: FormQueryOptions): Promise<UserChatBoosts>;
|
|
3716
|
+
|
|
3717
|
+
/**
|
|
3718
|
+
* Get information about the connection of the bot with a business account.
|
|
3719
|
+
* @see https://core.telegram.org/bots/api#getbusinessconnection
|
|
3720
|
+
*/
|
|
3721
|
+
getBusinessConnection(businessConnectionId: string, form?: FormQueryOptions): Promise<BusinessConnection>;
|
|
3722
|
+
|
|
3723
|
+
// --- Bot Commands -----------------------------------------------------------
|
|
3724
|
+
|
|
3725
|
+
/**
|
|
3726
|
+
* Change the list of the bot's commands.
|
|
3727
|
+
* @see https://core.telegram.org/bots/api#setmycommands
|
|
3728
|
+
*/
|
|
3729
|
+
setMyCommands(
|
|
3730
|
+
commands: Array<{ command: string; description: string }>,
|
|
3731
|
+
form?: {
|
|
3732
|
+
scope?: BotCommandScope;
|
|
3733
|
+
language_code?: string;
|
|
3734
|
+
},
|
|
3735
|
+
): Promise<boolean>;
|
|
3736
|
+
|
|
3737
|
+
/**
|
|
3738
|
+
* Delete the list of the bot's commands for the given scope and user language.
|
|
3739
|
+
* @see https://core.telegram.org/bots/api#deletemycommands
|
|
3740
|
+
*/
|
|
3741
|
+
deleteMyCommands(form?: {
|
|
3742
|
+
scope?: BotCommandScope;
|
|
3743
|
+
language_code?: string;
|
|
3744
|
+
}): Promise<boolean>;
|
|
3745
|
+
|
|
3746
|
+
/**
|
|
3747
|
+
* Get the current list of the bot's commands for the given scope and user language.
|
|
3748
|
+
* @see https://core.telegram.org/bots/api#getmycommands
|
|
3749
|
+
*/
|
|
3750
|
+
getMyCommands(form?: {
|
|
3751
|
+
scope?: BotCommandScope;
|
|
3752
|
+
language_code?: string;
|
|
3753
|
+
}): Promise<Array<{ command: string; description: string }>>;
|
|
3754
|
+
|
|
3755
|
+
/**
|
|
3756
|
+
* Change the bot's name.
|
|
3757
|
+
* @see https://core.telegram.org/bots/api#setmyname
|
|
3758
|
+
*/
|
|
3759
|
+
setMyName(form?: { name?: string; language_code?: string }): Promise<boolean>;
|
|
3760
|
+
|
|
3761
|
+
/**
|
|
3762
|
+
* Get the current bot name for the given user language.
|
|
3763
|
+
* @see https://core.telegram.org/bots/api#getmyname
|
|
3764
|
+
*/
|
|
3765
|
+
getMyName(form?: { language_code?: string }): Promise<{ name: string }>;
|
|
3766
|
+
|
|
3767
|
+
/**
|
|
3768
|
+
* Change the bot's description.
|
|
3769
|
+
* @see https://core.telegram.org/bots/api#setmydescription
|
|
3770
|
+
*/
|
|
3771
|
+
setMyDescription(form?: { description?: string; language_code?: string }): Promise<boolean>;
|
|
3772
|
+
|
|
3773
|
+
/**
|
|
3774
|
+
* Get the current bot description for the given user language.
|
|
3775
|
+
* @see https://core.telegram.org/bots/api#getmydescription
|
|
3776
|
+
*/
|
|
3777
|
+
getMyDescription(form?: { language_code?: string }): Promise<{ description: string }>;
|
|
3778
|
+
|
|
3779
|
+
/**
|
|
3780
|
+
* Change the bot's short description.
|
|
3781
|
+
* @see https://core.telegram.org/bots/api#setmyshortdescription
|
|
3782
|
+
*/
|
|
3783
|
+
setMyShortDescription(form?: { short_description?: string; language_code?: string }): Promise<boolean>;
|
|
3784
|
+
|
|
3785
|
+
/**
|
|
3786
|
+
* Get the current bot short description for the given user language.
|
|
3787
|
+
* @see https://core.telegram.org/bots/api#getmyshortdescription
|
|
3788
|
+
*/
|
|
3789
|
+
getMyShortDescription(form?: { language_code?: string }): Promise<{ short_description: string }>;
|
|
3790
|
+
|
|
3791
|
+
// --- Menu Button / Admin Rights ---------------------------------------------
|
|
3792
|
+
|
|
3793
|
+
/**
|
|
3794
|
+
* Change the bot's menu button in a private chat, or the default menu button.
|
|
3795
|
+
* @see https://core.telegram.org/bots/api#setchatmenubutton
|
|
3796
|
+
*/
|
|
3797
|
+
setChatMenuButton(form?: { chat_id?: number | string; menu_button?: MenuButton }): Promise<boolean>;
|
|
3798
|
+
|
|
3799
|
+
/**
|
|
3800
|
+
* Get the current value of the bot's menu button in a private chat, or the default menu button.
|
|
3801
|
+
* @see https://core.telegram.org/bots/api#getchatmenubutton
|
|
3802
|
+
*/
|
|
3803
|
+
getChatMenuButton(form?: { chat_id?: number | string }): Promise<MenuButton>;
|
|
3804
|
+
|
|
3805
|
+
/**
|
|
3806
|
+
* Change the default administrator rights requested by the bot when it's added as an administrator.
|
|
3807
|
+
* @see https://core.telegram.org/bots/api#setmydefaultadministratorrights
|
|
3808
|
+
*/
|
|
3809
|
+
setMyDefaultAdministratorRights(form?: {
|
|
3810
|
+
rights?: ChatAdministratorRights;
|
|
3811
|
+
for_channels?: boolean;
|
|
3812
|
+
}): Promise<boolean>;
|
|
3813
|
+
|
|
3814
|
+
/**
|
|
3815
|
+
* Get the current default administrator rights of the bot.
|
|
3816
|
+
* @see https://core.telegram.org/bots/api#getmydefaultadministratorrights
|
|
3817
|
+
*/
|
|
3818
|
+
getMyDefaultAdministratorRights(form?: { for_channels?: boolean }): Promise<ChatAdministratorRights>;
|
|
3819
|
+
|
|
3820
|
+
// --- Editing Messages -------------------------------------------------------
|
|
3821
|
+
|
|
3822
|
+
/**
|
|
3823
|
+
* Edit text or game messages sent by the bot or via the bot.
|
|
3824
|
+
* @see https://core.telegram.org/bots/api#editmessagetext
|
|
3825
|
+
*/
|
|
3826
|
+
editMessageText(
|
|
3827
|
+
text: string,
|
|
3828
|
+
form?: {
|
|
3829
|
+
chat_id?: number | string;
|
|
3830
|
+
message_id?: number;
|
|
3831
|
+
inline_message_id?: string;
|
|
3832
|
+
parse_mode?: string;
|
|
3833
|
+
entities?: MessageEntity[];
|
|
3834
|
+
link_preview_options?: LinkPreviewOptions;
|
|
3835
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
3836
|
+
},
|
|
3837
|
+
): Promise<Message | boolean>;
|
|
3838
|
+
|
|
3839
|
+
/**
|
|
3840
|
+
* Edit captions of messages sent by the bot or via the bot.
|
|
3841
|
+
* @see https://core.telegram.org/bots/api#editmessagecaption
|
|
3842
|
+
*/
|
|
3843
|
+
editMessageCaption(
|
|
3844
|
+
caption: string | undefined,
|
|
3845
|
+
form?: {
|
|
3846
|
+
chat_id?: number | string;
|
|
3847
|
+
message_id?: number;
|
|
3848
|
+
inline_message_id?: string;
|
|
3849
|
+
parse_mode?: string;
|
|
3850
|
+
caption_entities?: MessageEntity[];
|
|
3851
|
+
show_caption_above_media?: boolean;
|
|
3852
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
3853
|
+
},
|
|
3854
|
+
): Promise<Message | boolean>;
|
|
3855
|
+
|
|
3856
|
+
/**
|
|
3857
|
+
* Edit animation, audio, document, photo, or video messages.
|
|
3858
|
+
* @see https://core.telegram.org/bots/api#editmessagemedia
|
|
3859
|
+
*/
|
|
3860
|
+
editMessageMedia(
|
|
3861
|
+
media: InputMedia,
|
|
3862
|
+
form?: {
|
|
3863
|
+
chat_id?: number | string;
|
|
3864
|
+
message_id?: number;
|
|
3865
|
+
inline_message_id?: string;
|
|
3866
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
3867
|
+
},
|
|
3868
|
+
): Promise<Message | boolean>;
|
|
3869
|
+
|
|
3870
|
+
/**
|
|
3871
|
+
* Edit only the reply markup of messages sent by the bot.
|
|
3872
|
+
* @see https://core.telegram.org/bots/api#editmessagereplymarkup
|
|
3873
|
+
*/
|
|
3874
|
+
editMessageReplyMarkup(
|
|
3875
|
+
replyMarkup: InlineKeyboardMarkup | undefined,
|
|
3876
|
+
form?: {
|
|
3877
|
+
chat_id?: number | string;
|
|
3878
|
+
message_id?: number;
|
|
3879
|
+
inline_message_id?: string;
|
|
3880
|
+
},
|
|
3881
|
+
): Promise<Message | boolean>;
|
|
3882
|
+
|
|
3883
|
+
/**
|
|
3884
|
+
* Stop a poll which was sent by the bot.
|
|
3885
|
+
* @see https://core.telegram.org/bots/api#stoppoll
|
|
3886
|
+
*/
|
|
3887
|
+
stopPoll(
|
|
3888
|
+
chatId: number | string,
|
|
3889
|
+
pollId: number,
|
|
3890
|
+
form?: {
|
|
3891
|
+
message_thread_id?: Integer;
|
|
3892
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
3893
|
+
},
|
|
3894
|
+
): Promise<Poll>;
|
|
3895
|
+
|
|
3896
|
+
// --- Stickers ----------------------------------------------------------------
|
|
3897
|
+
|
|
3898
|
+
/**
|
|
3899
|
+
* Send static, animated, or video stickers.
|
|
3900
|
+
* @see https://core.telegram.org/bots/api#sendsticker
|
|
3901
|
+
*/
|
|
3902
|
+
sendSticker(
|
|
3903
|
+
chatId: number | string,
|
|
3904
|
+
sticker: InputFile,
|
|
3905
|
+
options?: SendStickerOptions,
|
|
3906
|
+
fileOptions?: FormQueryOptions,
|
|
3907
|
+
): Promise<Message>;
|
|
3908
|
+
|
|
3909
|
+
/**
|
|
3910
|
+
* Get a sticker set.
|
|
3911
|
+
* @see https://core.telegram.org/bots/api#getstickerset
|
|
3912
|
+
*/
|
|
3913
|
+
getStickerSet(name: string, form?: FormQueryOptions): Promise<StickerSet>;
|
|
3914
|
+
|
|
3915
|
+
/**
|
|
3916
|
+
* Get information about custom emoji stickers by their identifiers.
|
|
3917
|
+
* @see https://core.telegram.org/bots/api#getcustomemojistickers
|
|
3918
|
+
*/
|
|
3919
|
+
getCustomEmojiStickers(customEmojiIds: string[], form?: FormQueryOptions): Promise<Sticker[]>;
|
|
3920
|
+
|
|
3921
|
+
/**
|
|
3922
|
+
* Upload a file with a sticker for later use in createNewStickerSet and addStickerToSet.
|
|
3923
|
+
* @see https://core.telegram.org/bots/api#uploadstickerfile
|
|
3924
|
+
*/
|
|
3925
|
+
uploadStickerFile(
|
|
3926
|
+
userId: number,
|
|
3927
|
+
sticker: InputFile,
|
|
3928
|
+
stickerFormat?: string,
|
|
3929
|
+
options?: FormQueryOptions,
|
|
3930
|
+
fileOptions?: FormQueryOptions,
|
|
3931
|
+
): Promise<File>;
|
|
3932
|
+
|
|
3933
|
+
/**
|
|
3934
|
+
* Create new sticker set owned by a user.
|
|
3935
|
+
* @see https://core.telegram.org/bots/api#createnewstickerset
|
|
3936
|
+
*/
|
|
3937
|
+
createNewStickerSet(
|
|
3938
|
+
userId: number,
|
|
3939
|
+
name: string,
|
|
3940
|
+
title: string,
|
|
3941
|
+
pngSticker: InputFile,
|
|
3942
|
+
emojis: string,
|
|
3943
|
+
options?: {
|
|
3944
|
+
sticker_type?: string;
|
|
3945
|
+
needs_repainting?: boolean;
|
|
3946
|
+
mask_position?: MaskPosition;
|
|
3947
|
+
},
|
|
3948
|
+
fileOptions?: FormQueryOptions,
|
|
3949
|
+
): Promise<boolean>;
|
|
3950
|
+
|
|
3951
|
+
/**
|
|
3952
|
+
* Add a new sticker to a set created by the bot.
|
|
3953
|
+
* @see https://core.telegram.org/bots/api#addstickertoset
|
|
3954
|
+
*/
|
|
3955
|
+
addStickerToSet(
|
|
3956
|
+
userId: number,
|
|
3957
|
+
name: string,
|
|
3958
|
+
sticker: InputFile,
|
|
3959
|
+
emojis: string,
|
|
3960
|
+
stickerType?: string,
|
|
3961
|
+
options?: {
|
|
3962
|
+
mask_position?: MaskPosition;
|
|
3963
|
+
},
|
|
3964
|
+
fileOptions?: FormQueryOptions,
|
|
3965
|
+
): Promise<boolean>;
|
|
3966
|
+
|
|
3967
|
+
/**
|
|
3968
|
+
* Move a sticker in a set to a specific position.
|
|
3969
|
+
* @see https://core.telegram.org/bots/api#setstickerpositioninset
|
|
3970
|
+
*/
|
|
3971
|
+
setStickerPositionInSet(sticker: string, position: Integer, form?: FormQueryOptions): Promise<boolean>;
|
|
3972
|
+
|
|
3973
|
+
/**
|
|
3974
|
+
* Delete a sticker from a set created by the bot.
|
|
3975
|
+
* @see https://core.telegram.org/bots/api#deletestickerfromset
|
|
3976
|
+
*/
|
|
3977
|
+
deleteStickerFromSet(sticker: string, form?: FormQueryOptions): Promise<boolean>;
|
|
3978
|
+
|
|
3979
|
+
/**
|
|
3980
|
+
* Replace an existing sticker in a sticker set with a new one.
|
|
3981
|
+
* @see https://core.telegram.org/bots/api#replacestickerinset
|
|
3982
|
+
*/
|
|
3983
|
+
replaceStickerInSet(userId: number, name: string, oldSticker: string, form?: FormQueryOptions): Promise<boolean>;
|
|
3984
|
+
|
|
3985
|
+
/**
|
|
3986
|
+
* Change the list of emoji assigned to a regular or custom emoji sticker.
|
|
3987
|
+
* @see https://core.telegram.org/bots/api#setstickeremojilist
|
|
3988
|
+
*/
|
|
3989
|
+
setStickerEmojiList(sticker: string, emojiList: string[], form?: FormQueryOptions): Promise<boolean>;
|
|
3990
|
+
|
|
3991
|
+
/**
|
|
3992
|
+
* Change the keywords of a regular or custom emoji sticker.
|
|
3993
|
+
* @see https://core.telegram.org/bots/api#setstickerkeywords
|
|
3994
|
+
*/
|
|
3995
|
+
setStickerKeywords(sticker: string, form?: { keywords?: string[] }): Promise<boolean>;
|
|
3996
|
+
|
|
3997
|
+
/**
|
|
3998
|
+
* Change the mask position of a mask sticker.
|
|
3999
|
+
* @see https://core.telegram.org/bots/api#setstickermaskposition
|
|
4000
|
+
*/
|
|
4001
|
+
setStickerMaskPosition(sticker: string, form?: { mask_position?: MaskPosition }): Promise<boolean>;
|
|
4002
|
+
|
|
4003
|
+
/**
|
|
4004
|
+
* Set the title of a created sticker set.
|
|
4005
|
+
* @see https://core.telegram.org/bots/api#setstickersettitle
|
|
4006
|
+
*/
|
|
4007
|
+
setStickerSetTitle(name: string, title: string, form?: FormQueryOptions): Promise<boolean>;
|
|
4008
|
+
|
|
4009
|
+
/**
|
|
4010
|
+
* Set the thumbnail of a sticker set.
|
|
4011
|
+
* @see https://core.telegram.org/bots/api#setstickersetthumbnail
|
|
4012
|
+
*/
|
|
4013
|
+
setStickerSetThumbnail(
|
|
4014
|
+
userId: number,
|
|
4015
|
+
name: string,
|
|
4016
|
+
thumbnail: InputFile | null,
|
|
4017
|
+
options?: { format: string },
|
|
4018
|
+
fileOptions?: FormQueryOptions,
|
|
4019
|
+
): Promise<boolean>;
|
|
4020
|
+
|
|
4021
|
+
/**
|
|
4022
|
+
* Set the thumbnail of a custom emoji sticker set.
|
|
4023
|
+
* @see https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
|
|
4024
|
+
*/
|
|
4025
|
+
setCustomEmojiStickerSetThumbnail(name: string, form?: { custom_emoji_id?: string }): Promise<boolean>;
|
|
4026
|
+
|
|
4027
|
+
/**
|
|
4028
|
+
* Delete a sticker set that was created by the bot.
|
|
4029
|
+
* @see https://core.telegram.org/bots/api#deletestickerset
|
|
4030
|
+
*/
|
|
4031
|
+
deleteStickerSet(name: string, form?: FormQueryOptions): Promise<boolean>;
|
|
4032
|
+
|
|
4033
|
+
// --- Inline Mode ------------------------------------------------------------
|
|
4034
|
+
|
|
4035
|
+
/**
|
|
4036
|
+
* Send answers to an inline query.
|
|
4037
|
+
* @see https://core.telegram.org/bots/api#answerinlinequery
|
|
4038
|
+
*/
|
|
4039
|
+
answerInlineQuery(
|
|
4040
|
+
inlineQueryId: string,
|
|
4041
|
+
results: InlineQueryResult[],
|
|
4042
|
+
form?: {
|
|
4043
|
+
cache_time?: Integer;
|
|
4044
|
+
is_personal?: boolean;
|
|
4045
|
+
next_offset?: string;
|
|
4046
|
+
button?: InlineQueryResultsButton;
|
|
4047
|
+
},
|
|
4048
|
+
): Promise<boolean>;
|
|
4049
|
+
|
|
4050
|
+
/**
|
|
4051
|
+
* Set the result of an interaction with a Web App.
|
|
4052
|
+
* @see https://core.telegram.org/bots/api#answerwebappquery
|
|
4053
|
+
*/
|
|
4054
|
+
answerWebAppQuery(
|
|
4055
|
+
webAppQueryId: string,
|
|
4056
|
+
result: InlineQueryResult,
|
|
4057
|
+
form?: FormQueryOptions,
|
|
4058
|
+
): Promise<SentWebAppMessage>;
|
|
4059
|
+
|
|
4060
|
+
// --- Payments ----------------------------------------------------------------
|
|
4061
|
+
|
|
4062
|
+
/**
|
|
4063
|
+
* Send an invoice.
|
|
4064
|
+
* @see https://core.telegram.org/bots/api#sendinvoice
|
|
4065
|
+
*/
|
|
4066
|
+
sendInvoice(
|
|
4067
|
+
chatId: number | string,
|
|
4068
|
+
title: string,
|
|
4069
|
+
description: string,
|
|
4070
|
+
payload: string,
|
|
4071
|
+
providerToken: string,
|
|
4072
|
+
currency: string,
|
|
4073
|
+
prices: LabeledPrice[],
|
|
4074
|
+
form?: SendInvoiceOptions,
|
|
4075
|
+
): Promise<Message>;
|
|
4076
|
+
|
|
4077
|
+
/**
|
|
4078
|
+
* Create a link for an invoice.
|
|
4079
|
+
* @see https://core.telegram.org/bots/api#createinvoicelink
|
|
4080
|
+
*/
|
|
4081
|
+
createInvoiceLink(
|
|
4082
|
+
title: string,
|
|
4083
|
+
description: string,
|
|
4084
|
+
payload: string,
|
|
4085
|
+
providerToken: string,
|
|
4086
|
+
currency: string,
|
|
4087
|
+
prices: LabeledPrice[],
|
|
4088
|
+
form?: {
|
|
4089
|
+
max_tip_amount?: Integer;
|
|
4090
|
+
suggested_tip_amounts?: Integer[];
|
|
4091
|
+
provider_data?: string;
|
|
4092
|
+
photo_url?: string;
|
|
4093
|
+
photo_size?: Integer;
|
|
4094
|
+
photo_width?: Integer;
|
|
4095
|
+
photo_height?: Integer;
|
|
4096
|
+
need_name?: boolean;
|
|
4097
|
+
need_phone_number?: boolean;
|
|
4098
|
+
need_email?: boolean;
|
|
4099
|
+
need_shipping_address?: boolean;
|
|
4100
|
+
send_phone_number_to_provider?: boolean;
|
|
4101
|
+
send_email_to_provider?: boolean;
|
|
4102
|
+
is_flexible?: boolean;
|
|
4103
|
+
subscription_period?: Integer;
|
|
4104
|
+
business_connection_id?: string;
|
|
4105
|
+
},
|
|
4106
|
+
): Promise<string>;
|
|
4107
|
+
|
|
4108
|
+
/**
|
|
4109
|
+
* Reply to shipping queries.
|
|
4110
|
+
* @see https://core.telegram.org/bots/api#answershippingquery
|
|
4111
|
+
*/
|
|
4112
|
+
answerShippingQuery(
|
|
4113
|
+
shippingQueryId: string,
|
|
4114
|
+
ok: boolean,
|
|
4115
|
+
form?: { shipping_options?: ShippingOptions; error_message?: string },
|
|
4116
|
+
): Promise<boolean>;
|
|
4117
|
+
|
|
4118
|
+
/**
|
|
4119
|
+
* Respond to pre-checkout queries.
|
|
4120
|
+
* @see https://core.telegram.org/bots/api#answerprecheckoutquery
|
|
4121
|
+
*/
|
|
4122
|
+
answerPreCheckoutQuery(
|
|
4123
|
+
preCheckoutQueryId: string,
|
|
4124
|
+
ok: boolean,
|
|
4125
|
+
form?: { error_message?: string },
|
|
4126
|
+
): Promise<boolean>;
|
|
4127
|
+
|
|
4128
|
+
// --- Games -------------------------------------------------------------------
|
|
4129
|
+
|
|
4130
|
+
/**
|
|
4131
|
+
* Send a game.
|
|
4132
|
+
* @see https://core.telegram.org/bots/api#sendgame
|
|
4133
|
+
*/
|
|
4134
|
+
sendGame(
|
|
4135
|
+
chatId: number | string,
|
|
4136
|
+
gameShortName: string,
|
|
4137
|
+
form?: SendGameOptions,
|
|
4138
|
+
): Promise<Message>;
|
|
4139
|
+
|
|
4140
|
+
/**
|
|
4141
|
+
* Set the score of the specified user in a game message.
|
|
4142
|
+
* @see https://core.telegram.org/bots/api#setgamescore
|
|
4143
|
+
*/
|
|
4144
|
+
setGameScore(
|
|
4145
|
+
userId: number,
|
|
4146
|
+
score: number,
|
|
4147
|
+
form?: {
|
|
4148
|
+
force?: boolean;
|
|
4149
|
+
disable_edit_message?: boolean;
|
|
4150
|
+
chat_id?: number | string;
|
|
4151
|
+
message_id?: number;
|
|
4152
|
+
inline_message_id?: string;
|
|
4153
|
+
},
|
|
4154
|
+
): Promise<Message | boolean>;
|
|
4155
|
+
|
|
4156
|
+
/**
|
|
4157
|
+
* Get data for high score tables.
|
|
4158
|
+
* @see https://core.telegram.org/bots/api#getgamehighscores
|
|
4159
|
+
*/
|
|
4160
|
+
getGameHighScores(
|
|
4161
|
+
userId: number,
|
|
4162
|
+
form?: {
|
|
4163
|
+
chat_id?: number | string;
|
|
4164
|
+
message_id?: number;
|
|
4165
|
+
inline_message_id?: string;
|
|
4166
|
+
},
|
|
4167
|
+
): Promise<GameHighScore[]>;
|
|
4168
|
+
|
|
4169
|
+
// --- Deleting Messages ------------------------------------------------------
|
|
4170
|
+
|
|
4171
|
+
/**
|
|
4172
|
+
* Delete a message.
|
|
4173
|
+
* @see https://core.telegram.org/bots/api#deletemessage
|
|
4174
|
+
*/
|
|
4175
|
+
deleteMessage(chatId: number | string, messageId: number, form?: FormQueryOptions): Promise<boolean>;
|
|
4176
|
+
|
|
4177
|
+
/**
|
|
4178
|
+
* Delete multiple messages simultaneously.
|
|
4179
|
+
* @see https://core.telegram.org/bots/api#deletemessages
|
|
4180
|
+
*/
|
|
4181
|
+
deleteMessages(chatId: number | string, messageIds: number[], form?: FormQueryOptions): Promise<boolean>;
|
|
4182
|
+
|
|
4183
|
+
// ==========================================================================
|
|
4184
|
+
// Bot API 7.4+: Telegram Stars
|
|
4185
|
+
// ==========================================================================
|
|
4186
|
+
|
|
4187
|
+
/**
|
|
4188
|
+
* Issue a refund for a payment made via Telegram Stars.
|
|
4189
|
+
* @see https://core.telegram.org/bots/api#refundstarpayment
|
|
4190
|
+
*/
|
|
4191
|
+
refundStarPayment(
|
|
4192
|
+
userId: number,
|
|
4193
|
+
telegramPaymentChargeId: string,
|
|
4194
|
+
form?: FormQueryOptions,
|
|
4195
|
+
): Promise<boolean>;
|
|
4196
|
+
|
|
4197
|
+
/**
|
|
4198
|
+
* Get the current status of the balance of Telegram Stars.
|
|
4199
|
+
* @see https://core.telegram.org/bots/api#getstartransactions
|
|
4200
|
+
*/
|
|
4201
|
+
getStarTransactions(form?: {
|
|
4202
|
+
offset?: Integer;
|
|
4203
|
+
limit?: Integer;
|
|
4204
|
+
}): Promise<StarTransactions>;
|
|
4205
|
+
|
|
4206
|
+
// ==========================================================================
|
|
4207
|
+
// Bot API 7.9+: Chat Subscription Invite Links
|
|
4208
|
+
// ==========================================================================
|
|
4209
|
+
|
|
4210
|
+
/**
|
|
4211
|
+
* Create a subscription invite link for a channel chat.
|
|
4212
|
+
* @see https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
|
|
4213
|
+
*/
|
|
4214
|
+
createChatSubscriptionInviteLink(
|
|
4215
|
+
chatId: number | string,
|
|
4216
|
+
form?: {
|
|
4217
|
+
name?: string;
|
|
4218
|
+
subscription_period: Integer;
|
|
4219
|
+
subscription_price: Integer;
|
|
4220
|
+
},
|
|
4221
|
+
): Promise<ChatInviteLink>;
|
|
4222
|
+
|
|
4223
|
+
/**
|
|
4224
|
+
* Edit a subscription invite link created by the bot.
|
|
4225
|
+
* @see https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
|
|
4226
|
+
*/
|
|
4227
|
+
editChatSubscriptionInviteLink(
|
|
4228
|
+
chatId: number | string,
|
|
4229
|
+
inviteLink: string,
|
|
4230
|
+
form?: { name?: string },
|
|
4231
|
+
): Promise<ChatInviteLink>;
|
|
4232
|
+
|
|
4233
|
+
// ==========================================================================
|
|
4234
|
+
// Bot API 8.0+: Gifts
|
|
4235
|
+
// ==========================================================================
|
|
4236
|
+
|
|
4237
|
+
/**
|
|
4238
|
+
* Get the list of gifts that can be sent by the bot.
|
|
4239
|
+
* @see https://core.telegram.org/bots/api#getavailablegifts
|
|
4240
|
+
*/
|
|
4241
|
+
getAvailableGifts(form?: FormQueryOptions): Promise<Gifts>;
|
|
4242
|
+
|
|
4243
|
+
/**
|
|
4244
|
+
* Send a gift to a user.
|
|
4245
|
+
* @see https://core.telegram.org/bots/api#sendgift
|
|
4246
|
+
*/
|
|
4247
|
+
sendGift(
|
|
4248
|
+
userId: number,
|
|
4249
|
+
giftId: string,
|
|
4250
|
+
form?: { text?: string; text_parse_mode?: string; text_entities?: MessageEntity[]; pay_for_upgrade?: boolean },
|
|
4251
|
+
): Promise<boolean>;
|
|
4252
|
+
|
|
4253
|
+
/**
|
|
4254
|
+
* Edit a subscription paid through Telegram Stars.
|
|
4255
|
+
* @see https://core.telegram.org/bots/api#edituserstarsubscription
|
|
4256
|
+
*/
|
|
4257
|
+
editUserStarSubscription(
|
|
4258
|
+
userId: number,
|
|
4259
|
+
telegramPaymentChargeId: string,
|
|
4260
|
+
isCanceled: boolean,
|
|
4261
|
+
form?: FormQueryOptions,
|
|
4262
|
+
): Promise<boolean>;
|
|
4263
|
+
|
|
4264
|
+
/**
|
|
4265
|
+
* Store an inline message that can be sent on behalf of a user.
|
|
4266
|
+
* @see https://core.telegram.org/bots/api#savepreparedinlinemessage
|
|
4267
|
+
*/
|
|
4268
|
+
savePreparedInlineMessage(
|
|
4269
|
+
userId: number,
|
|
4270
|
+
result: InlineQueryResult,
|
|
4271
|
+
form?: { allow_user_chats?: boolean; allow_bot_chats?: boolean; allow_group_chats?: boolean; allow_channel_chats?: boolean },
|
|
4272
|
+
): Promise<PreparedInlineMessage>;
|
|
4273
|
+
|
|
4274
|
+
// ==========================================================================
|
|
4275
|
+
// Bot API 8.2+: Verification
|
|
4276
|
+
// ==========================================================================
|
|
4277
|
+
|
|
4278
|
+
/**
|
|
4279
|
+
* Verify a user that is managed by the bot.
|
|
4280
|
+
* @see https://core.telegram.org/bots/api#verifyuser
|
|
4281
|
+
*/
|
|
4282
|
+
verifyUser(userId: number, form?: { custom_description?: string }): Promise<boolean>;
|
|
4283
|
+
|
|
4284
|
+
/**
|
|
4285
|
+
* Verify a chat that is managed by the bot.
|
|
4286
|
+
* @see https://core.telegram.org/bots/api#verifychat
|
|
4287
|
+
*/
|
|
4288
|
+
verifyChat(chatId: number | string, form?: { custom_description?: string }): Promise<boolean>;
|
|
4289
|
+
|
|
4290
|
+
/**
|
|
4291
|
+
* Remove verification for a user that is managed by the bot.
|
|
4292
|
+
* @see https://core.telegram.org/bots/api#removeuserverification
|
|
4293
|
+
*/
|
|
4294
|
+
removeUserVerification(userId: number, form?: FormQueryOptions): Promise<boolean>;
|
|
4295
|
+
|
|
4296
|
+
/**
|
|
4297
|
+
* Remove verification for a chat that is managed by the bot.
|
|
4298
|
+
* @see https://core.telegram.org/bots/api#removechatverification
|
|
4299
|
+
*/
|
|
4300
|
+
removeChatVerification(chatId: number | string, form?: FormQueryOptions): Promise<boolean>;
|
|
4301
|
+
|
|
4302
|
+
// ==========================================================================
|
|
4303
|
+
// Bot API 9.0: Business Accounts
|
|
4304
|
+
// ==========================================================================
|
|
4305
|
+
|
|
4306
|
+
/**
|
|
4307
|
+
* Mark incoming messages as read on behalf of a business account.
|
|
4308
|
+
* @see https://core.telegram.org/bots/api#readbusinessmessage
|
|
4309
|
+
*/
|
|
4310
|
+
readBusinessMessage(businessConnectionId: string, messageId: Integer, form?: FormQueryOptions): Promise<boolean>;
|
|
4311
|
+
|
|
4312
|
+
/**
|
|
4313
|
+
* Delete messages on behalf of a business account.
|
|
4314
|
+
* @see https://core.telegram.org/bots/api#deletebusinessmessages
|
|
4315
|
+
*/
|
|
4316
|
+
deleteBusinessMessages(businessConnectionId: string, messageIds: Integer[], form?: FormQueryOptions): Promise<boolean>;
|
|
4317
|
+
|
|
4318
|
+
/**
|
|
4319
|
+
* Change the first and last name of a managed business account.
|
|
4320
|
+
* @see https://core.telegram.org/bots/api#setbusinessaccountname
|
|
4321
|
+
*/
|
|
4322
|
+
setBusinessAccountName(businessConnectionId: string, form?: { first_name?: string; last_name?: string }): Promise<boolean>;
|
|
4323
|
+
|
|
4324
|
+
/**
|
|
4325
|
+
* Change the username of a managed business account.
|
|
4326
|
+
* @see https://core.telegram.org/bots/api#setbusinessaccountusername
|
|
4327
|
+
*/
|
|
4328
|
+
setBusinessAccountUsername(businessConnectionId: string, form?: { username?: string }): Promise<boolean>;
|
|
4329
|
+
|
|
4330
|
+
/**
|
|
4331
|
+
* Change the bio of a managed business account.
|
|
4332
|
+
* @see https://core.telegram.org/bots/api#setbusinessaccountbio
|
|
4333
|
+
*/
|
|
4334
|
+
setBusinessAccountBio(businessConnectionId: string, form?: { bio?: string }): Promise<boolean>;
|
|
4335
|
+
|
|
4336
|
+
/**
|
|
4337
|
+
* Change the profile photo of a managed business account.
|
|
4338
|
+
* @see https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
|
|
4339
|
+
*/
|
|
4340
|
+
setBusinessAccountProfilePhoto(
|
|
4341
|
+
businessConnectionId: string,
|
|
4342
|
+
photo: InputProfilePhoto,
|
|
4343
|
+
form?: { is_public?: boolean },
|
|
4344
|
+
): Promise<boolean>;
|
|
4345
|
+
|
|
4346
|
+
/**
|
|
4347
|
+
* Remove the profile photo of a managed business account.
|
|
4348
|
+
* @see https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
|
|
4349
|
+
*/
|
|
4350
|
+
removeBusinessAccountProfilePhoto(businessConnectionId: string, form?: { is_public?: boolean }): Promise<boolean>;
|
|
4351
|
+
|
|
4352
|
+
/**
|
|
4353
|
+
* Change the gift settings of a managed business account.
|
|
4354
|
+
* @see https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
|
|
4355
|
+
*/
|
|
4356
|
+
setBusinessAccountGiftSettings(
|
|
4357
|
+
businessConnectionId: string,
|
|
4358
|
+
form?: {
|
|
4359
|
+
accepted_gift_types?: {
|
|
4360
|
+
unlimited_gifts?: boolean;
|
|
4361
|
+
limited_gifts?: boolean;
|
|
4362
|
+
unique_gifts?: boolean;
|
|
4363
|
+
premium_subscription?: boolean;
|
|
4364
|
+
};
|
|
4365
|
+
},
|
|
4366
|
+
): Promise<boolean>;
|
|
4367
|
+
|
|
4368
|
+
/**
|
|
4369
|
+
* Get the current Star balance of a managed business account.
|
|
4370
|
+
* @see https://core.telegram.org/bots/api#getbusinessaccountstarbalance
|
|
4371
|
+
*/
|
|
4372
|
+
getBusinessAccountStarBalance(businessConnectionId: string, form?: FormQueryOptions): Promise<StarAmount>;
|
|
4373
|
+
|
|
4374
|
+
/**
|
|
4375
|
+
* Transfer Stars from the business account balance to the bot owner's balance.
|
|
4376
|
+
* @see https://core.telegram.org/bots/api#transferbusinessaccountstars
|
|
4377
|
+
*/
|
|
4378
|
+
transferBusinessAccountStars(businessConnectionId: string, starCount: Integer, form?: FormQueryOptions): Promise<StarAmount>;
|
|
4379
|
+
|
|
4380
|
+
/**
|
|
4381
|
+
* Get the list of gifts received by a managed business account.
|
|
4382
|
+
* @see https://core.telegram.org/bots/api#getbusinessaccountgifts
|
|
4383
|
+
*/
|
|
4384
|
+
getBusinessAccountGifts(
|
|
4385
|
+
businessConnectionId: string,
|
|
4386
|
+
form?: { exclude_unsaved?: boolean; exclude_saved?: boolean; exclude_unlimited?: boolean; exclude_limited?: boolean; exclude_unique?: boolean; sort_by_price?: boolean; offset?: Integer; limit?: Integer },
|
|
4387
|
+
): Promise<OwnedGift[]>;
|
|
4388
|
+
|
|
4389
|
+
/**
|
|
4390
|
+
* Convert a given regular gift to Telegram Stars.
|
|
4391
|
+
* @see https://core.telegram.org/bots/api#convertgifttostars
|
|
4392
|
+
*/
|
|
4393
|
+
convertGiftToStars(businessConnectionId: string, ownedGiftId: string, form?: FormQueryOptions): Promise<StarAmount>;
|
|
4394
|
+
|
|
4395
|
+
/**
|
|
4396
|
+
* Upgrade a regular gift to a unique gift.
|
|
4397
|
+
* @see https://core.telegram.org/bots/api#upgradegift
|
|
4398
|
+
*/
|
|
4399
|
+
upgradeGift(
|
|
4400
|
+
businessConnectionId: string,
|
|
4401
|
+
ownedGiftId: string,
|
|
4402
|
+
form?: { keep_original_details?: boolean; star_count?: Integer },
|
|
4403
|
+
): Promise<OwnedGift>;
|
|
4404
|
+
|
|
4405
|
+
/**
|
|
4406
|
+
* Transfer a regular gift to another user.
|
|
4407
|
+
* @see https://core.telegram.org/bots/api#transfergift
|
|
4408
|
+
*/
|
|
4409
|
+
transferGift(
|
|
4410
|
+
businessConnectionId: string,
|
|
4411
|
+
ownedGiftId: string,
|
|
4412
|
+
newOwnerChatId: number | string,
|
|
4413
|
+
form?: { star_count?: Integer },
|
|
4414
|
+
): Promise<boolean>;
|
|
4415
|
+
|
|
4416
|
+
/**
|
|
4417
|
+
* Post a story on behalf of a managed business account.
|
|
4418
|
+
* @see https://core.telegram.org/bots/api#poststory
|
|
4419
|
+
*/
|
|
4420
|
+
postStory(
|
|
4421
|
+
businessConnectionId: string,
|
|
4422
|
+
content: InputStoryContent,
|
|
4423
|
+
form?: {
|
|
4424
|
+
active_period?: Integer;
|
|
4425
|
+
caption?: string;
|
|
4426
|
+
parse_mode?: string;
|
|
4427
|
+
caption_entities?: MessageEntity[];
|
|
4428
|
+
areas?: InputStoryArea[];
|
|
4429
|
+
post_to_chat_page?: boolean;
|
|
4430
|
+
protect_content?: boolean;
|
|
4431
|
+
},
|
|
4432
|
+
): Promise<Story>;
|
|
4433
|
+
|
|
4434
|
+
/**
|
|
4435
|
+
* Edit a story previously posted on behalf of a managed business account.
|
|
4436
|
+
* @see https://core.telegram.org/bots/api#editstory
|
|
4437
|
+
*/
|
|
4438
|
+
editStory(
|
|
4439
|
+
businessConnectionId: string,
|
|
4440
|
+
storyId: Integer,
|
|
4441
|
+
form?: {
|
|
4442
|
+
content?: InputStoryContent;
|
|
4443
|
+
caption?: string;
|
|
4444
|
+
parse_mode?: string;
|
|
4445
|
+
caption_entities?: MessageEntity[];
|
|
4446
|
+
areas?: InputStoryArea[];
|
|
4447
|
+
},
|
|
4448
|
+
): Promise<Story>;
|
|
4449
|
+
|
|
4450
|
+
/**
|
|
4451
|
+
* Delete a story previously posted on behalf of a managed business account.
|
|
4452
|
+
* @see https://core.telegram.org/bots/api#deletestory
|
|
4453
|
+
*/
|
|
4454
|
+
deleteStory(businessConnectionId: string, storyId: Integer, form?: FormQueryOptions): Promise<boolean>;
|
|
4455
|
+
|
|
4456
|
+
/**
|
|
4457
|
+
* Gift a Telegram Premium subscription to a user.
|
|
4458
|
+
* @see https://core.telegram.org/bots/api#giftpremiumsubscription
|
|
4459
|
+
*/
|
|
4460
|
+
giftPremiumSubscription(
|
|
4461
|
+
userId: number,
|
|
4462
|
+
monthCount: Integer,
|
|
4463
|
+
starCount: Integer,
|
|
4464
|
+
form?: { text?: string; text_parse_mode?: string; text_entities?: MessageEntity[] },
|
|
4465
|
+
): Promise<Gift>;
|
|
4466
|
+
|
|
4467
|
+
/**
|
|
4468
|
+
* Set the emoji status of a user.
|
|
4469
|
+
* @see https://core.telegram.org/bots/api#setuseremojistatus
|
|
4470
|
+
*/
|
|
4471
|
+
setUserEmojiStatus(
|
|
4472
|
+
userId: number,
|
|
4473
|
+
form?: { emoji_status_custom_emoji_id?: string; emoji_status_expiration_date?: Integer },
|
|
4474
|
+
): Promise<boolean>;
|
|
4475
|
+
|
|
4476
|
+
// ==========================================================================
|
|
4477
|
+
// Bot API 9.1: Checklists
|
|
4478
|
+
// ==========================================================================
|
|
4479
|
+
|
|
4480
|
+
/**
|
|
4481
|
+
* Send a checklist on behalf of a managed business account.
|
|
4482
|
+
* @see https://core.telegram.org/bots/api#sendchecklist
|
|
4483
|
+
*/
|
|
4484
|
+
sendChecklist(
|
|
4485
|
+
businessConnectionId: string,
|
|
4486
|
+
title: string,
|
|
4487
|
+
tasks: InputChecklistTask[],
|
|
4488
|
+
form?: {
|
|
4489
|
+
others_can_add_tasks?: boolean;
|
|
4490
|
+
others_can_mark_tasks_as_done?: boolean;
|
|
4491
|
+
business_connection_id?: string;
|
|
4492
|
+
message_thread_id?: Integer;
|
|
4493
|
+
disable_notification?: boolean;
|
|
4494
|
+
protect_content?: boolean;
|
|
4495
|
+
reply_parameters?: ReplyParameters;
|
|
4496
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
4497
|
+
},
|
|
4498
|
+
): Promise<Message>;
|
|
4499
|
+
|
|
4500
|
+
/**
|
|
4501
|
+
* Edit a checklist message on behalf of a managed business account.
|
|
4502
|
+
* @see https://core.telegram.org/bots/api#editmessagechecklist
|
|
4503
|
+
*/
|
|
4504
|
+
editMessageChecklist(
|
|
4505
|
+
businessConnectionId: string,
|
|
4506
|
+
messageId: Integer,
|
|
4507
|
+
form?: {
|
|
4508
|
+
title?: string;
|
|
4509
|
+
tasks?: InputChecklistTask[];
|
|
4510
|
+
others_can_add_tasks?: boolean;
|
|
4511
|
+
others_can_mark_tasks_as_done?: boolean;
|
|
4512
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
4513
|
+
},
|
|
4514
|
+
): Promise<Message>;
|
|
4515
|
+
|
|
4516
|
+
/**
|
|
4517
|
+
* Get the current number of Telegram Stars owned by the bot.
|
|
4518
|
+
* @see https://core.telegram.org/bots/api#getmystarbalance
|
|
4519
|
+
*/
|
|
4520
|
+
getMyStarBalance(form?: FormQueryOptions): Promise<StarAmount>;
|
|
4521
|
+
|
|
4522
|
+
// ==========================================================================
|
|
4523
|
+
// Bot API 9.2: Suggested Posts
|
|
4524
|
+
// ==========================================================================
|
|
4525
|
+
|
|
4526
|
+
/**
|
|
4527
|
+
* Approve a suggested post in a channel chat.
|
|
4528
|
+
* @see https://core.telegram.org/bots/api#approvesuggestedpost
|
|
4529
|
+
*/
|
|
4530
|
+
approveSuggestedPost(businessConnectionId: string, messageId: Integer, form?: { schedule_date?: Integer }): Promise<boolean>;
|
|
4531
|
+
|
|
4532
|
+
/**
|
|
4533
|
+
* Decline a suggested post in a channel chat.
|
|
4534
|
+
* @see https://core.telegram.org/bots/api#declinesuggestedpost
|
|
4535
|
+
*/
|
|
4536
|
+
declineSuggestedPost(businessConnectionId: string, messageId: Integer, form?: FormQueryOptions): Promise<boolean>;
|
|
4537
|
+
|
|
4538
|
+
// ==========================================================================
|
|
4539
|
+
// Bot API 9.3: Draft Messages, Gifts, Stories
|
|
4540
|
+
// ==========================================================================
|
|
4541
|
+
|
|
4542
|
+
/**
|
|
4543
|
+
* Send a draft message to the bot's user in private chat.
|
|
4544
|
+
* @see https://core.telegram.org/bots/api#sendmessagedraft
|
|
4545
|
+
*/
|
|
4546
|
+
sendMessageDraft(
|
|
4547
|
+
chatId: number | string,
|
|
4548
|
+
text: string,
|
|
4549
|
+
form?: {
|
|
4550
|
+
parse_mode?: string;
|
|
4551
|
+
entities?: MessageEntity[];
|
|
4552
|
+
link_preview_options?: LinkPreviewOptions;
|
|
4553
|
+
},
|
|
4554
|
+
): Promise<Message>;
|
|
4555
|
+
|
|
4556
|
+
/**
|
|
4557
|
+
* Get gifts received by a user in a private chat.
|
|
4558
|
+
* @see https://core.telegram.org/bots/api#getusergifts
|
|
4559
|
+
*/
|
|
4560
|
+
getUserGifts(
|
|
4561
|
+
userId: number,
|
|
4562
|
+
form?: {
|
|
4563
|
+
exclude_unsaved?: boolean;
|
|
4564
|
+
exclude_saved?: boolean;
|
|
4565
|
+
exclude_unlimited?: boolean;
|
|
4566
|
+
exclude_limited?: boolean;
|
|
4567
|
+
exclude_unique?: boolean;
|
|
4568
|
+
sort_by_price?: boolean;
|
|
4569
|
+
offset?: string;
|
|
4570
|
+
limit?: Integer;
|
|
4571
|
+
},
|
|
4572
|
+
): Promise<OwnedGift[]>;
|
|
4573
|
+
|
|
4574
|
+
/**
|
|
4575
|
+
* Get gifts received by a chat.
|
|
4576
|
+
* @see https://core.telegram.org/bots/api#getchatgifts
|
|
4577
|
+
*/
|
|
4578
|
+
getChatGifts(
|
|
4579
|
+
chatId: number | string,
|
|
4580
|
+
form?: {
|
|
4581
|
+
exclude_unsaved?: boolean;
|
|
4582
|
+
exclude_saved?: boolean;
|
|
4583
|
+
exclude_unlimited?: boolean;
|
|
4584
|
+
exclude_limited?: boolean;
|
|
4585
|
+
exclude_unique?: boolean;
|
|
4586
|
+
sort_by_price?: boolean;
|
|
4587
|
+
offset?: string;
|
|
4588
|
+
limit?: Integer;
|
|
4589
|
+
},
|
|
4590
|
+
): Promise<OwnedGift[]>;
|
|
4591
|
+
|
|
4592
|
+
/**
|
|
4593
|
+
* Repost a story on behalf of a managed business account.
|
|
4594
|
+
* @see https://core.telegram.org/bots/api#repoststory
|
|
4595
|
+
*/
|
|
4596
|
+
repostStory(
|
|
4597
|
+
businessConnectionId: string,
|
|
4598
|
+
storyId: Integer,
|
|
4599
|
+
targetBusinessConnectionIds: Array<number | string>,
|
|
4600
|
+
form?: FormQueryOptions,
|
|
4601
|
+
): Promise<Story[]>;
|
|
4602
|
+
|
|
4603
|
+
// ==========================================================================
|
|
4604
|
+
// Bot API 9.4: Profile Photos, Audio Stories
|
|
4605
|
+
// ==========================================================================
|
|
4606
|
+
|
|
4607
|
+
/**
|
|
4608
|
+
* Set the profile photo of the bot.
|
|
4609
|
+
* @see https://core.telegram.org/bots/api#setmyprofilephoto
|
|
4610
|
+
*/
|
|
4611
|
+
setMyProfilePhoto(photo: InputProfilePhoto, form?: { is_public?: boolean }): Promise<boolean>;
|
|
4612
|
+
|
|
4613
|
+
/**
|
|
4614
|
+
* Remove the profile photo of the bot.
|
|
4615
|
+
* @see https://core.telegram.org/bots/api#removemyprofilephoto
|
|
4616
|
+
*/
|
|
4617
|
+
removeMyProfilePhoto(form?: { is_public?: boolean }): Promise<boolean>;
|
|
4618
|
+
|
|
4619
|
+
/**
|
|
4620
|
+
* Get the profile audios of a user.
|
|
4621
|
+
* @see https://core.telegram.org/bots/api#getuserprofileaudios
|
|
4622
|
+
*/
|
|
4623
|
+
getUserProfileAudios(
|
|
4624
|
+
userId: number,
|
|
4625
|
+
form?: { offset?: string; limit?: Integer },
|
|
4626
|
+
): Promise<Audio[]>;
|
|
4627
|
+
|
|
4628
|
+
// ==========================================================================
|
|
4629
|
+
// Bot API 9.5: Chat Member Tags
|
|
4630
|
+
// ==========================================================================
|
|
4631
|
+
|
|
4632
|
+
/**
|
|
4633
|
+
* Set the tag that is applied to a specific user in a specific group chat.
|
|
4634
|
+
* @see https://core.telegram.org/bots/api#setchatmembertag
|
|
4635
|
+
*/
|
|
4636
|
+
setChatMemberTag(chatId: number | string, userId: number, form?: { tag?: string }): Promise<boolean>;
|
|
4637
|
+
|
|
4638
|
+
// ==========================================================================
|
|
4639
|
+
// Bot API 9.6: Managed Bot Tokens
|
|
4640
|
+
// ==========================================================================
|
|
4641
|
+
|
|
4642
|
+
/**
|
|
4643
|
+
* Get the current manageable bot token for the bot.
|
|
4644
|
+
* @see https://core.telegram.org/bots/api#getmanagedbottoken
|
|
4645
|
+
*/
|
|
4646
|
+
getManagedBotToken(botId: Integer, form?: FormQueryOptions): Promise<ManagedBotToken>;
|
|
4647
|
+
|
|
4648
|
+
/**
|
|
4649
|
+
* Replace the manageable bot token for the bot with a new one.
|
|
4650
|
+
* @see https://core.telegram.org/bots/api#replacemanagedbottoken
|
|
4651
|
+
*/
|
|
4652
|
+
replaceManagedBotToken(botId: Integer, form?: FormQueryOptions): Promise<ManagedBotToken>;
|
|
4653
|
+
|
|
4654
|
+
/**
|
|
4655
|
+
* Save a prepared keyboard button for later use.
|
|
4656
|
+
* @see https://core.telegram.org/bots/api#savepreparedkeyboardbutton
|
|
4657
|
+
*/
|
|
4658
|
+
savePreparedKeyboardButton(button: KeyboardButton, form?: FormQueryOptions): Promise<PreparedKeyboardButton>;
|
|
4659
|
+
|
|
4660
|
+
// ==========================================================================
|
|
4661
|
+
// Bot API 10.0: Guest Mode, Live Photos, Reactions
|
|
4662
|
+
// ==========================================================================
|
|
4663
|
+
|
|
4664
|
+
/**
|
|
4665
|
+
* Answer a guest query in a Telegram Web App.
|
|
4666
|
+
* @see https://core.telegram.org/bots/api#answerguestquery
|
|
4667
|
+
*/
|
|
4668
|
+
answerGuestQuery(guestQueryId: string, text: string, form?: FormQueryOptions): Promise<boolean>;
|
|
4669
|
+
|
|
4670
|
+
/**
|
|
4671
|
+
* Remove multiple reactions from a message.
|
|
4672
|
+
* @see https://core.telegram.org/bots/api#deletemessagereactions
|
|
4673
|
+
*/
|
|
4674
|
+
deleteAllMessageReactions(chatId: number | string, messageId: number, form?: FormQueryOptions): Promise<boolean>;
|
|
4675
|
+
|
|
4676
|
+
/**
|
|
4677
|
+
* Remove a reaction from a message.
|
|
4678
|
+
* @see https://core.telegram.org/bots/api#deletemessagereaction
|
|
4679
|
+
*/
|
|
4680
|
+
deleteMessageReaction(
|
|
4681
|
+
chatId: number | string,
|
|
4682
|
+
messageId: number,
|
|
4683
|
+
form?: { reaction_type?: ReactionType },
|
|
4684
|
+
): Promise<boolean>;
|
|
4685
|
+
|
|
4686
|
+
/**
|
|
4687
|
+
* Send a live photo.
|
|
4688
|
+
* @see https://core.telegram.org/bots/api#sendlivephoto
|
|
4689
|
+
*/
|
|
4690
|
+
sendLivePhoto(
|
|
4691
|
+
chatId: number | string,
|
|
4692
|
+
photo: InputFile,
|
|
4693
|
+
video: InputFile,
|
|
4694
|
+
options?: {
|
|
4695
|
+
business_connection_id?: string;
|
|
4696
|
+
message_thread_id?: Integer;
|
|
4697
|
+
caption?: string;
|
|
4698
|
+
parse_mode?: string;
|
|
4699
|
+
caption_entities?: MessageEntity[];
|
|
4700
|
+
show_caption_above_media?: boolean;
|
|
4701
|
+
has_spoiler?: boolean;
|
|
4702
|
+
disable_notification?: boolean;
|
|
4703
|
+
protect_content?: boolean;
|
|
4704
|
+
reply_parameters?: ReplyParameters;
|
|
4705
|
+
reply_markup?: ReplyMarkup;
|
|
4706
|
+
},
|
|
4707
|
+
fileOptions?: FormQueryOptions,
|
|
4708
|
+
): Promise<Message>;
|
|
4709
|
+
|
|
4710
|
+
/**
|
|
4711
|
+
* Get the current access settings of the bot for managed bots.
|
|
4712
|
+
* @see https://core.telegram.org/bots/api#getmanagedbotaccesssettings
|
|
4713
|
+
*/
|
|
4714
|
+
getManagedBotAccessSettings(form?: FormQueryOptions): Promise<ManagedBotAccessSettings>;
|
|
4715
|
+
|
|
4716
|
+
/**
|
|
4717
|
+
* Change the access settings of the bot for managed bots.
|
|
4718
|
+
* @see https://core.telegram.org/bots/api#setmanagedbotaccesssettings
|
|
4719
|
+
*/
|
|
4720
|
+
setManagedBotAccessSettings(form?: {
|
|
4721
|
+
has_access_to_messages?: boolean;
|
|
4722
|
+
restricted_channels?: Array<number | string>;
|
|
4723
|
+
}): Promise<boolean>;
|
|
4724
|
+
|
|
4725
|
+
/**
|
|
4726
|
+
* Get messages from a user's personal chat with the bot.
|
|
4727
|
+
* @see https://core.telegram.org/bots/api#getuserpersonalchatmessages
|
|
4728
|
+
*/
|
|
4729
|
+
getUserPersonalChatMessages(
|
|
4730
|
+
userId: number,
|
|
4731
|
+
form?: { offset?: Integer; limit?: Integer },
|
|
4732
|
+
): Promise<Message[]>;
|
|
4733
|
+
|
|
4734
|
+
// ==========================================================================
|
|
4735
|
+
// Bot API 10.1: Rich Messages, Join Request Queries
|
|
4736
|
+
// ==========================================================================
|
|
4737
|
+
|
|
4738
|
+
/**
|
|
4739
|
+
* Send a rich message.
|
|
4740
|
+
* @see https://core.telegram.org/bots/api#sendrichmessage
|
|
4741
|
+
*/
|
|
4742
|
+
sendRichMessage(
|
|
4743
|
+
chatId: number | string,
|
|
4744
|
+
content: InputRichMessageContent,
|
|
4745
|
+
form?: {
|
|
4746
|
+
business_connection_id?: string;
|
|
4747
|
+
message_thread_id?: Integer;
|
|
4748
|
+
disable_notification?: boolean;
|
|
4749
|
+
protect_content?: boolean;
|
|
4750
|
+
reply_parameters?: ReplyParameters;
|
|
4751
|
+
reply_markup?: ReplyMarkup;
|
|
4752
|
+
},
|
|
4753
|
+
): Promise<Message>;
|
|
4754
|
+
|
|
4755
|
+
/**
|
|
4756
|
+
* Send a rich message draft.
|
|
4757
|
+
* @see https://core.telegram.org/bots/api#sendrichmessagedraft
|
|
4758
|
+
*/
|
|
4759
|
+
sendRichMessageDraft(
|
|
4760
|
+
chatId: number | string,
|
|
4761
|
+
content: InputRichMessageContent,
|
|
4762
|
+
form?: {
|
|
4763
|
+
business_connection_id?: string;
|
|
4764
|
+
message_thread_id?: Integer;
|
|
4765
|
+
},
|
|
4766
|
+
): Promise<Message>;
|
|
4767
|
+
|
|
4768
|
+
/**
|
|
4769
|
+
* Answer a chat join request query.
|
|
4770
|
+
* @see https://core.telegram.org/bots/api#answerchatjoinrequestquery
|
|
4771
|
+
*/
|
|
4772
|
+
answerChatJoinRequestQuery(
|
|
4773
|
+
chatJoinRequestId: Integer,
|
|
4774
|
+
queryId: string,
|
|
4775
|
+
form?: {
|
|
4776
|
+
text?: string;
|
|
4777
|
+
parse_mode?: string;
|
|
4778
|
+
entities?: MessageEntity[];
|
|
4779
|
+
business_connection_id?: string;
|
|
4780
|
+
message_thread_id?: Integer;
|
|
4781
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
4782
|
+
},
|
|
4783
|
+
): Promise<boolean>;
|
|
4784
|
+
|
|
4785
|
+
/**
|
|
4786
|
+
* Send a Web App message to a chat join request.
|
|
4787
|
+
* @see https://core.telegram.org/bots/api#sendchatjoinrequestwebapp
|
|
4788
|
+
*/
|
|
4789
|
+
sendChatJoinRequestWebApp(
|
|
4790
|
+
chatJoinRequestId: Integer,
|
|
4791
|
+
webApp: SentWebAppMessage,
|
|
4792
|
+
form?: {
|
|
4793
|
+
business_connection_id?: string;
|
|
4794
|
+
message_thread_id?: Integer;
|
|
4795
|
+
disable_notification?: boolean;
|
|
4796
|
+
protect_content?: boolean;
|
|
4797
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
4798
|
+
},
|
|
4799
|
+
): Promise<boolean>;
|
|
4800
|
+
|
|
4801
|
+
// ==========================================================================
|
|
4802
|
+
// Bot API 10.2: Ephemeral Messages
|
|
4803
|
+
// ==========================================================================
|
|
4804
|
+
|
|
4805
|
+
/**
|
|
4806
|
+
* Edit the text of an ephemeral message.
|
|
4807
|
+
* @see https://core.telegram.org/bots/api#editephemeralmessagetext
|
|
4808
|
+
*/
|
|
4809
|
+
editEphemeralMessageText(
|
|
4810
|
+
chatId: number | string,
|
|
4811
|
+
ephemeralMessageId: string,
|
|
4812
|
+
text: string,
|
|
4813
|
+
form?: {
|
|
4814
|
+
parse_mode?: string;
|
|
4815
|
+
entities?: MessageEntity[];
|
|
4816
|
+
link_preview_options?: LinkPreviewOptions;
|
|
4817
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
4818
|
+
},
|
|
4819
|
+
): Promise<Message>;
|
|
4820
|
+
|
|
4821
|
+
/**
|
|
4822
|
+
* Edit the media of an ephemeral message.
|
|
4823
|
+
* @see https://core.telegram.org/bots/api#editephemeralmessagemedia
|
|
4824
|
+
*/
|
|
4825
|
+
editEphemeralMessageMedia(
|
|
4826
|
+
chatId: number | string,
|
|
4827
|
+
ephemeralMessageId: string,
|
|
4828
|
+
media: InputMedia,
|
|
4829
|
+
form?: {
|
|
4830
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
4831
|
+
},
|
|
4832
|
+
fileOptions?: FormQueryOptions,
|
|
4833
|
+
): Promise<Message>;
|
|
4834
|
+
|
|
4835
|
+
/**
|
|
4836
|
+
* Edit the caption of an ephemeral message.
|
|
4837
|
+
* @see https://core.telegram.org/bots/api#editephemeralmessagecaption
|
|
4838
|
+
*/
|
|
4839
|
+
editEphemeralMessageCaption(
|
|
4840
|
+
chatId: number | string,
|
|
4841
|
+
ephemeralMessageId: string,
|
|
4842
|
+
form?: {
|
|
4843
|
+
caption?: string;
|
|
4844
|
+
parse_mode?: string;
|
|
4845
|
+
caption_entities?: MessageEntity[];
|
|
4846
|
+
show_caption_above_media?: boolean;
|
|
4847
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
4848
|
+
},
|
|
4849
|
+
): Promise<Message>;
|
|
4850
|
+
|
|
4851
|
+
/**
|
|
4852
|
+
* Edit the reply markup of an ephemeral message.
|
|
4853
|
+
* @see https://core.telegram.org/bots/api#editephemeralmessagereplymarkup
|
|
4854
|
+
*/
|
|
4855
|
+
editEphemeralMessageReplyMarkup(
|
|
4856
|
+
chatId: number | string,
|
|
4857
|
+
ephemeralMessageId: string,
|
|
4858
|
+
form?: {
|
|
4859
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
4860
|
+
},
|
|
4861
|
+
): Promise<Message>;
|
|
4862
|
+
|
|
4863
|
+
/**
|
|
4864
|
+
* Delete an ephemeral message.
|
|
4865
|
+
* @see https://core.telegram.org/bots/api#deleteephemeralmessage
|
|
4866
|
+
*/
|
|
4867
|
+
deleteEphemeralMessage(chatId: number | string, ephemeralMessageId: string, form?: FormQueryOptions): Promise<boolean>;
|
|
4868
|
+
}
|
|
4869
|
+
|
|
4870
|
+
// ============================================================================
|
|
4871
|
+
// ADDITIONAL HELPER TYPES
|
|
4872
|
+
// ============================================================================
|
|
4873
|
+
|
|
4874
|
+
/** This object represents one special entity in a text message entity. */
|
|
4875
|
+
export interface BotCommandScope {
|
|
4876
|
+
type: string;
|
|
4877
|
+
}
|
|
4878
|
+
|
|
4879
|
+
export interface BotCommandScopeDefault extends BotCommandScope {
|
|
4880
|
+
type: 'default';
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4883
|
+
export interface BotCommandScopeAllPrivateChats extends BotCommandScope {
|
|
4884
|
+
type: 'all_private_chats';
|
|
4885
|
+
}
|
|
4886
|
+
|
|
4887
|
+
export interface BotCommandScopeAllGroupChats extends BotCommandScope {
|
|
4888
|
+
type: 'all_group_chats';
|
|
4889
|
+
}
|
|
4890
|
+
|
|
4891
|
+
export interface BotCommandScopeAllChatAdministrators extends BotCommandScope {
|
|
4892
|
+
type: 'all_chat_administrators';
|
|
4893
|
+
}
|
|
4894
|
+
|
|
4895
|
+
export interface BotCommandScopeChat extends BotCommandScope {
|
|
4896
|
+
type: 'chat';
|
|
4897
|
+
chat_id: number | string;
|
|
4898
|
+
}
|
|
4899
|
+
|
|
4900
|
+
export interface BotCommandScopeChatAdministrators extends BotCommandScope {
|
|
4901
|
+
type: 'chat_administrators';
|
|
4902
|
+
chat_id: number | string;
|
|
4903
|
+
}
|
|
4904
|
+
|
|
4905
|
+
export interface BotCommandScopeChatMember extends BotCommandScope {
|
|
4906
|
+
type: 'chat_member';
|
|
4907
|
+
chat_id: number | string;
|
|
4908
|
+
user_id: number;
|
|
4909
|
+
}
|
|
4910
|
+
|
|
4911
|
+
/** ShippingOptions type alias for shipping_query response. */
|
|
4912
|
+
export interface ShippingOptions {
|
|
4913
|
+
shipping_options: ShippingOption[];
|
|
4914
|
+
}
|
|
4915
|
+
|
|
4916
|
+
/** MessageId is returned by copyMessage and similar methods. */
|
|
4917
|
+
export interface MessageId {
|
|
4918
|
+
message_id: Integer;
|
|
4919
|
+
}
|
|
4920
|
+
|
|
4921
|
+
/** GameHighScore represents one row of a high scores table. */
|
|
4922
|
+
export interface GameHighScore {
|
|
4923
|
+
position: Integer;
|
|
4924
|
+
user: User;
|
|
4925
|
+
score: Integer;
|
|
4926
|
+
}
|
|
4927
|
+
|
|
4928
|
+
/** The errors module. */
|
|
4929
|
+
export as namespace TelegramBot;
|