@skroz/telegram-bot 1.0.29 → 1.1.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/dist/FileUpload.d.ts +14 -0
- package/dist/FileUpload.d.ts.map +1 -0
- package/dist/FileUpload.js +3 -0
- package/dist/FileUpload.js.map +1 -0
- package/dist/ResultAndDescription.d.ts +6 -0
- package/dist/ResultAndDescription.d.ts.map +1 -0
- package/dist/ResultAndDescription.js +6 -0
- package/dist/ResultAndDescription.js.map +1 -0
- package/dist/TelegramTypes.d.ts +885 -0
- package/dist/TelegramTypes.d.ts.map +1 -0
- package/dist/TelegramTypes.js +3 -0
- package/dist/TelegramTypes.js.map +1 -0
- package/dist/index.d.ts +22 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +178 -95
- package/dist/index.js.map +1 -1
- package/dist/index_backup.d.ts +3 -0
- package/dist/index_backup.d.ts.map +1 -0
- package/dist/index_backup.js +433 -0
- package/dist/index_backup.js.map +1 -0
- package/package.json +2 -5
- package/src/FileUpload.ts +13 -0
- package/src/ResultAndDescription.ts +7 -0
- package/src/TelegramTypes.ts +1161 -0
- package/src/index.ts +245 -107
- package/src/index_backup.ts +430 -0
|
@@ -0,0 +1,885 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { FileUpload } from './FileUpload';
|
|
3
|
+
export type TG_ParseMode = 'Markdown' | 'MarkdownV2' | 'HTML';
|
|
4
|
+
export type TG_MessageEntityType = 'mention' | 'hashtag' | 'cashtag' | 'bot_command' | 'url' | 'email' | 'phone_number' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'blockquote' | 'code' | 'pre' | 'text_link' | 'text_mention' | 'custom_emoji';
|
|
5
|
+
export type TG_ChatType = 'private' | 'group' | 'supergroup' | 'channel';
|
|
6
|
+
export type TG_InputMediaType = 'photo' | 'video' | 'animation' | 'audio' | 'document';
|
|
7
|
+
export type TG_PollType = 'regular' | 'quiz';
|
|
8
|
+
export type TG_DiceEmoji = '🎲' | '🎯' | '🏀' | '⚽' | '🎳' | '🎰';
|
|
9
|
+
export type TG_EncryptedPassportElementType = 'personal_details' | 'passport' | 'driver_license' | 'identity_card' | 'internal_passport' | 'address' | 'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration' | 'phone_number' | 'email';
|
|
10
|
+
interface TG_Response {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
error_code?: number;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TG_User {
|
|
16
|
+
id: number;
|
|
17
|
+
is_bot: boolean;
|
|
18
|
+
first_name: string;
|
|
19
|
+
last_name?: string;
|
|
20
|
+
username?: string;
|
|
21
|
+
language_code?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TG_ChatLocation {
|
|
24
|
+
location: Location;
|
|
25
|
+
address: string;
|
|
26
|
+
}
|
|
27
|
+
export interface TG_ChatPhoto {
|
|
28
|
+
small_file_id: string;
|
|
29
|
+
small_file_unique_id: string;
|
|
30
|
+
big_file_id: string;
|
|
31
|
+
big_file_unique_id: string;
|
|
32
|
+
}
|
|
33
|
+
export interface TG_File {
|
|
34
|
+
file_id: string;
|
|
35
|
+
file_unique_id?: string;
|
|
36
|
+
file_size?: number;
|
|
37
|
+
file_path?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface TG_ChatPermissions {
|
|
40
|
+
can_send_messages?: boolean;
|
|
41
|
+
can_send_media_messages?: boolean;
|
|
42
|
+
can_send_polls?: boolean;
|
|
43
|
+
can_send_other_messages?: boolean;
|
|
44
|
+
can_add_web_page_previews?: boolean;
|
|
45
|
+
can_change_info?: boolean;
|
|
46
|
+
can_invite_users?: boolean;
|
|
47
|
+
can_pin_messages?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface TG_Chat {
|
|
50
|
+
id: number;
|
|
51
|
+
type: TG_ChatType;
|
|
52
|
+
title?: string;
|
|
53
|
+
username?: string;
|
|
54
|
+
first_name?: string;
|
|
55
|
+
last_name?: string;
|
|
56
|
+
photo?: TG_ChatPhoto;
|
|
57
|
+
description?: string;
|
|
58
|
+
invite_link?: string;
|
|
59
|
+
pinned_message?: TG_Message;
|
|
60
|
+
permissions?: TG_ChatPermissions;
|
|
61
|
+
slow_mode_delay?: number;
|
|
62
|
+
sticker_set_name?: string;
|
|
63
|
+
can_set_sticker_set?: boolean;
|
|
64
|
+
linked_chat_id?: number;
|
|
65
|
+
location?: TG_ChatLocation;
|
|
66
|
+
}
|
|
67
|
+
export interface TG_Location {
|
|
68
|
+
latitude: number;
|
|
69
|
+
longitude: number;
|
|
70
|
+
horizontal_accuracy?: number;
|
|
71
|
+
live_period?: number;
|
|
72
|
+
heading?: number;
|
|
73
|
+
proximity_alert_radius?: number;
|
|
74
|
+
}
|
|
75
|
+
export interface TG_MessageEntity {
|
|
76
|
+
type: TG_MessageEntityType;
|
|
77
|
+
offset: number;
|
|
78
|
+
length: number;
|
|
79
|
+
url?: string;
|
|
80
|
+
user?: TG_User;
|
|
81
|
+
}
|
|
82
|
+
export interface TG_PhotoSize {
|
|
83
|
+
file_id: string;
|
|
84
|
+
width: number;
|
|
85
|
+
height: number;
|
|
86
|
+
file_size?: number;
|
|
87
|
+
}
|
|
88
|
+
export interface TG_Animation {
|
|
89
|
+
file_id: string;
|
|
90
|
+
width: number;
|
|
91
|
+
height: number;
|
|
92
|
+
duration: number;
|
|
93
|
+
thumb?: TG_PhotoSize;
|
|
94
|
+
file_name?: string;
|
|
95
|
+
mime_type?: string;
|
|
96
|
+
file_size?: number;
|
|
97
|
+
}
|
|
98
|
+
export interface TG_Game {
|
|
99
|
+
title: string;
|
|
100
|
+
description: string;
|
|
101
|
+
photo: TG_PhotoSize[];
|
|
102
|
+
text?: string;
|
|
103
|
+
text_entities?: TG_MessageEntity[];
|
|
104
|
+
animation?: TG_Animation;
|
|
105
|
+
}
|
|
106
|
+
export interface TG_Audio {
|
|
107
|
+
file_id: string;
|
|
108
|
+
duration: number;
|
|
109
|
+
performer?: string;
|
|
110
|
+
title?: string;
|
|
111
|
+
mime_type?: string;
|
|
112
|
+
file_size?: number;
|
|
113
|
+
}
|
|
114
|
+
export interface TG_Document {
|
|
115
|
+
file_id: string;
|
|
116
|
+
thumb?: TG_PhotoSize;
|
|
117
|
+
file_name?: string;
|
|
118
|
+
mime_type?: string;
|
|
119
|
+
file_size?: number;
|
|
120
|
+
}
|
|
121
|
+
export interface TG_Sticker {
|
|
122
|
+
file_id: string;
|
|
123
|
+
width: number;
|
|
124
|
+
height: number;
|
|
125
|
+
thumb?: TG_PhotoSize;
|
|
126
|
+
emoji?: string;
|
|
127
|
+
file_size?: number;
|
|
128
|
+
}
|
|
129
|
+
export interface TG_Video {
|
|
130
|
+
file_id: string;
|
|
131
|
+
width: number;
|
|
132
|
+
height: number;
|
|
133
|
+
duration: number;
|
|
134
|
+
thumb?: TG_PhotoSize;
|
|
135
|
+
mime_type?: string;
|
|
136
|
+
file_size?: number;
|
|
137
|
+
}
|
|
138
|
+
export interface TG_Voice {
|
|
139
|
+
file_id: string;
|
|
140
|
+
duration: number;
|
|
141
|
+
mime_type?: string;
|
|
142
|
+
file_size?: number;
|
|
143
|
+
}
|
|
144
|
+
export interface TG_VideoNote {
|
|
145
|
+
file_id: string;
|
|
146
|
+
length: number;
|
|
147
|
+
duration: number;
|
|
148
|
+
thumb?: TG_PhotoSize;
|
|
149
|
+
file_size?: number;
|
|
150
|
+
}
|
|
151
|
+
export interface TG_Contact {
|
|
152
|
+
phone_number: string;
|
|
153
|
+
first_name: string;
|
|
154
|
+
last_name?: string;
|
|
155
|
+
user_id?: number;
|
|
156
|
+
vcard?: string;
|
|
157
|
+
}
|
|
158
|
+
export interface TG_Venue {
|
|
159
|
+
location: TG_Location;
|
|
160
|
+
title: string;
|
|
161
|
+
address: string;
|
|
162
|
+
foursquare_id?: string;
|
|
163
|
+
foursquare_type?: string;
|
|
164
|
+
}
|
|
165
|
+
export interface TG_PollOption {
|
|
166
|
+
text: string;
|
|
167
|
+
voter_count: number;
|
|
168
|
+
}
|
|
169
|
+
export interface TG_Poll {
|
|
170
|
+
id: string;
|
|
171
|
+
question: string;
|
|
172
|
+
options: TG_PollOption[];
|
|
173
|
+
is_closed: boolean;
|
|
174
|
+
is_anonymous: boolean;
|
|
175
|
+
type?: TG_PollType;
|
|
176
|
+
allows_multiple_answers?: boolean;
|
|
177
|
+
correct_option_id?: number;
|
|
178
|
+
explanation?: string;
|
|
179
|
+
explanation_entities?: TG_MessageEntity[];
|
|
180
|
+
open_period?: number;
|
|
181
|
+
close_date?: number;
|
|
182
|
+
}
|
|
183
|
+
export interface TG_PollAnswer {
|
|
184
|
+
poll_id: string;
|
|
185
|
+
user: TG_User;
|
|
186
|
+
option_ids: number[];
|
|
187
|
+
}
|
|
188
|
+
export interface TG_Dice {
|
|
189
|
+
emoji: TG_DiceEmoji;
|
|
190
|
+
value: number;
|
|
191
|
+
}
|
|
192
|
+
export interface TG_Invoice {
|
|
193
|
+
title: string;
|
|
194
|
+
description: string;
|
|
195
|
+
start_parameter: string;
|
|
196
|
+
currency: string;
|
|
197
|
+
total_amount: number;
|
|
198
|
+
}
|
|
199
|
+
export interface TG_MessageOriginUser {
|
|
200
|
+
type: 'user';
|
|
201
|
+
date: number;
|
|
202
|
+
sender_user: TG_User;
|
|
203
|
+
}
|
|
204
|
+
export interface TG_MessageOriginHiddenUser {
|
|
205
|
+
type: 'hidden_user';
|
|
206
|
+
date: number;
|
|
207
|
+
sender_user_name: string;
|
|
208
|
+
}
|
|
209
|
+
export interface TG_MessageOriginChat {
|
|
210
|
+
type: 'chat';
|
|
211
|
+
date: number;
|
|
212
|
+
sender_chat: TG_Chat;
|
|
213
|
+
author_signature?: string;
|
|
214
|
+
}
|
|
215
|
+
export interface TG_MessageOriginChannel {
|
|
216
|
+
type: 'channel';
|
|
217
|
+
date: number;
|
|
218
|
+
chat: TG_Chat;
|
|
219
|
+
message_id: number;
|
|
220
|
+
author_signature?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface TG_Story {
|
|
223
|
+
chat: TG_Chat;
|
|
224
|
+
id: number;
|
|
225
|
+
}
|
|
226
|
+
export interface TG_Giveaway {
|
|
227
|
+
chats: TG_Chat[];
|
|
228
|
+
winners_selection_date: number;
|
|
229
|
+
winner_count: number;
|
|
230
|
+
only_new_members?: boolean;
|
|
231
|
+
has_public_winners?: boolean;
|
|
232
|
+
prize_description?: string;
|
|
233
|
+
country_codes?: string[];
|
|
234
|
+
premium_subscription_month_count?: number;
|
|
235
|
+
}
|
|
236
|
+
export interface TG_GiveawayWinners {
|
|
237
|
+
chat: TG_Chat;
|
|
238
|
+
giveaway_message_id: number;
|
|
239
|
+
winners_selection_date: number;
|
|
240
|
+
winner_count: number;
|
|
241
|
+
winners: TG_User[];
|
|
242
|
+
additional_chat_count?: number;
|
|
243
|
+
premium_subscription_month_count?: number;
|
|
244
|
+
unclaimed_prize_count?: number;
|
|
245
|
+
only_new_members?: boolean;
|
|
246
|
+
was_refunded?: boolean;
|
|
247
|
+
prize_description?: string;
|
|
248
|
+
}
|
|
249
|
+
export interface TG_GiveawayCompleted {
|
|
250
|
+
winner_count: number;
|
|
251
|
+
unclaimed_prize_count?: number;
|
|
252
|
+
giveaway_message?: TG_Message;
|
|
253
|
+
}
|
|
254
|
+
export interface TG_ExternalReplyInfo {
|
|
255
|
+
origin: TG_MessageOrigin;
|
|
256
|
+
chat?: TG_Chat;
|
|
257
|
+
message_id?: number;
|
|
258
|
+
link_preview_options?: TG_LinkPreviewOptions;
|
|
259
|
+
animation?: TG_Animation;
|
|
260
|
+
audio?: TG_Audio;
|
|
261
|
+
document?: Document;
|
|
262
|
+
photo?: TG_PhotoSize[];
|
|
263
|
+
sticker?: TG_Sticker;
|
|
264
|
+
story?: TG_Story;
|
|
265
|
+
video?: TG_Video;
|
|
266
|
+
video_note?: TG_VideoNote;
|
|
267
|
+
voice?: TG_Voice;
|
|
268
|
+
has_media_spoiler?: boolean;
|
|
269
|
+
contact?: TG_Contact;
|
|
270
|
+
dice?: TG_Dice;
|
|
271
|
+
game?: TG_Game;
|
|
272
|
+
giveaway?: TG_Giveaway;
|
|
273
|
+
giveaway_winners?: TG_GiveawayWinners;
|
|
274
|
+
invoice?: TG_Invoice;
|
|
275
|
+
location?: TG_Location;
|
|
276
|
+
poll?: TG_Poll;
|
|
277
|
+
venue?: TG_Venue;
|
|
278
|
+
}
|
|
279
|
+
export interface TG_TextQuote {
|
|
280
|
+
text: string;
|
|
281
|
+
entities?: TG_MessageEntity[];
|
|
282
|
+
position: number;
|
|
283
|
+
is_manual?: boolean;
|
|
284
|
+
}
|
|
285
|
+
type TG_MessageOrigin = TG_MessageOriginUser | TG_MessageOriginHiddenUser | TG_MessageOriginChat | TG_MessageOriginChannel;
|
|
286
|
+
export interface TG_InaccessibleMessage {
|
|
287
|
+
chat: TG_Chat;
|
|
288
|
+
message_id: number;
|
|
289
|
+
date: 0;
|
|
290
|
+
}
|
|
291
|
+
type TG_MaybeInaccessibleMessage = TG_Message | TG_InaccessibleMessage;
|
|
292
|
+
export interface TG_SuccessfulPayment {
|
|
293
|
+
currency: string;
|
|
294
|
+
total_amount: number;
|
|
295
|
+
invoice_payload: string;
|
|
296
|
+
shipping_option_id?: string;
|
|
297
|
+
order_info?: TG_OrderInfo;
|
|
298
|
+
telegram_payment_charge_id: string;
|
|
299
|
+
provider_payment_charge_id: string;
|
|
300
|
+
}
|
|
301
|
+
export interface TG_SharedUser {
|
|
302
|
+
user_id: number;
|
|
303
|
+
first_name?: string;
|
|
304
|
+
last_name?: string;
|
|
305
|
+
username?: string;
|
|
306
|
+
photo?: TG_PhotoSize[];
|
|
307
|
+
}
|
|
308
|
+
export interface TG_UsersShared {
|
|
309
|
+
request_id: number;
|
|
310
|
+
users: TG_SharedUser[];
|
|
311
|
+
}
|
|
312
|
+
export interface TG_ChatShared {
|
|
313
|
+
request_id: number;
|
|
314
|
+
chat_id: number;
|
|
315
|
+
title?: string;
|
|
316
|
+
username?: string;
|
|
317
|
+
photo?: TG_PhotoSize[];
|
|
318
|
+
}
|
|
319
|
+
export interface TG_WriteAccessAllowed {
|
|
320
|
+
from_request?: boolean;
|
|
321
|
+
web_app_name?: string;
|
|
322
|
+
from_attachment_menu?: boolean;
|
|
323
|
+
}
|
|
324
|
+
export interface TG_PassportData {
|
|
325
|
+
data: TG_EncryptedPassportElement[];
|
|
326
|
+
credentials: TG_EncryptedCredentials;
|
|
327
|
+
}
|
|
328
|
+
export interface TG_PassportFile {
|
|
329
|
+
file_id: string;
|
|
330
|
+
file_unique_id: string;
|
|
331
|
+
file_size: number;
|
|
332
|
+
file_date: number;
|
|
333
|
+
}
|
|
334
|
+
export interface TG_EncryptedPassportElement {
|
|
335
|
+
type: TG_EncryptedPassportElementType;
|
|
336
|
+
data?: string;
|
|
337
|
+
phone_number?: string;
|
|
338
|
+
email?: string;
|
|
339
|
+
files?: TG_PassportFile[];
|
|
340
|
+
front_side?: TG_PassportFile;
|
|
341
|
+
reverse_side?: TG_PassportFile;
|
|
342
|
+
selfie?: TG_PassportFile;
|
|
343
|
+
translation?: TG_PassportFile[];
|
|
344
|
+
hash: string;
|
|
345
|
+
}
|
|
346
|
+
export interface TG_ProximityAlertTriggered {
|
|
347
|
+
traveler: TG_User;
|
|
348
|
+
watcher: TG_User;
|
|
349
|
+
distance: number;
|
|
350
|
+
}
|
|
351
|
+
export interface TG_MessageAutoDeleteTimerChanged {
|
|
352
|
+
message_auto_delete_time: number;
|
|
353
|
+
}
|
|
354
|
+
export interface TG_ChatBoostAdded {
|
|
355
|
+
boost_count: number;
|
|
356
|
+
}
|
|
357
|
+
export interface TG_ForumTopicCreated {
|
|
358
|
+
name: string;
|
|
359
|
+
icon_color: number;
|
|
360
|
+
icon_custom_emoji_id?: string;
|
|
361
|
+
}
|
|
362
|
+
export interface TG_ForumTopicClosed {
|
|
363
|
+
}
|
|
364
|
+
export interface TG_ForumTopicEdited {
|
|
365
|
+
name?: string;
|
|
366
|
+
icon_custom_emoji_id?: string;
|
|
367
|
+
}
|
|
368
|
+
export interface TG_ForumTopicReopened {
|
|
369
|
+
}
|
|
370
|
+
export interface TG_GeneralForumTopicHidden {
|
|
371
|
+
}
|
|
372
|
+
export interface TG_GeneralForumTopicUnhidden {
|
|
373
|
+
}
|
|
374
|
+
export interface TG_EncryptedCredentials {
|
|
375
|
+
data: string;
|
|
376
|
+
hash: string;
|
|
377
|
+
secret: string;
|
|
378
|
+
}
|
|
379
|
+
export interface TG_GiveawayCreated {
|
|
380
|
+
}
|
|
381
|
+
export interface TG_VideoChatScheduled {
|
|
382
|
+
start_date: number;
|
|
383
|
+
}
|
|
384
|
+
export interface TG_VideoChatStarted {
|
|
385
|
+
}
|
|
386
|
+
export interface TG_VideoChatEnded {
|
|
387
|
+
duration: number;
|
|
388
|
+
}
|
|
389
|
+
export interface TG_VideoChatParticipantsInvited {
|
|
390
|
+
users: TG_User[];
|
|
391
|
+
}
|
|
392
|
+
export interface TG_WebAppData {
|
|
393
|
+
data: string;
|
|
394
|
+
button_text?: string;
|
|
395
|
+
}
|
|
396
|
+
export interface TG_Message {
|
|
397
|
+
message_id: number;
|
|
398
|
+
message_thread_id?: number;
|
|
399
|
+
from?: TG_User;
|
|
400
|
+
sender_chat?: TG_Chat;
|
|
401
|
+
sender_boost_count?: number;
|
|
402
|
+
sender_business_bot?: TG_User;
|
|
403
|
+
date: number;
|
|
404
|
+
business_connection_id?: string;
|
|
405
|
+
chat: TG_Chat;
|
|
406
|
+
forward_origin?: TG_MessageOrigin;
|
|
407
|
+
is_topic_message?: boolean;
|
|
408
|
+
is_automatic_forward?: boolean;
|
|
409
|
+
reply_to_message?: TG_Message;
|
|
410
|
+
external_reply?: TG_ExternalReplyInfo;
|
|
411
|
+
quote?: TG_TextQuote;
|
|
412
|
+
reply_to_story?: TG_Story;
|
|
413
|
+
via_bot?: TG_User;
|
|
414
|
+
edit_date?: number;
|
|
415
|
+
has_protected_content?: boolean;
|
|
416
|
+
is_from_offline?: boolean;
|
|
417
|
+
media_group_id?: string;
|
|
418
|
+
author_signature?: string;
|
|
419
|
+
text?: string;
|
|
420
|
+
entities?: TG_MessageEntity[];
|
|
421
|
+
link_preview_options?: TG_LinkPreviewOptions;
|
|
422
|
+
animation?: TG_Animation;
|
|
423
|
+
audio?: TG_Audio;
|
|
424
|
+
document?: TG_Document;
|
|
425
|
+
photo?: TG_PhotoSize[];
|
|
426
|
+
sticker?: TG_Sticker;
|
|
427
|
+
story?: TG_Story;
|
|
428
|
+
video?: TG_Video;
|
|
429
|
+
video_note?: TG_VideoNote;
|
|
430
|
+
voice?: TG_Voice;
|
|
431
|
+
caption?: string;
|
|
432
|
+
caption_entities?: TG_MessageEntity[];
|
|
433
|
+
has_media_spoiler?: boolean;
|
|
434
|
+
contact?: TG_Contact;
|
|
435
|
+
dice?: TG_Dice;
|
|
436
|
+
game?: TG_Game;
|
|
437
|
+
poll?: TG_Poll;
|
|
438
|
+
venue?: TG_Venue;
|
|
439
|
+
location?: TG_Location;
|
|
440
|
+
new_chat_members?: TG_User[];
|
|
441
|
+
left_chat_member?: TG_User;
|
|
442
|
+
new_chat_title?: string;
|
|
443
|
+
new_chat_photo?: TG_PhotoSize[];
|
|
444
|
+
delete_chat_photo?: boolean;
|
|
445
|
+
group_chat_created?: boolean;
|
|
446
|
+
supergroup_chat_created?: boolean;
|
|
447
|
+
channel_chat_created?: boolean;
|
|
448
|
+
message_auto_delete_timer_changed?: TG_MessageAutoDeleteTimerChanged;
|
|
449
|
+
migrate_to_chat_id?: number;
|
|
450
|
+
migrate_from_chat_id?: number;
|
|
451
|
+
pinned_message?: TG_MaybeInaccessibleMessage;
|
|
452
|
+
invoice?: TG_Invoice;
|
|
453
|
+
successful_payment?: TG_SuccessfulPayment;
|
|
454
|
+
users_shared?: TG_UsersShared;
|
|
455
|
+
chat_shared?: TG_ChatShared;
|
|
456
|
+
connected_website?: string;
|
|
457
|
+
write_access_allowed?: TG_WriteAccessAllowed;
|
|
458
|
+
passport_data?: TG_PassportData;
|
|
459
|
+
proximity_alert_triggered?: TG_ProximityAlertTriggered;
|
|
460
|
+
boost_added?: TG_ChatBoostAdded;
|
|
461
|
+
forum_topic_created?: TG_ForumTopicCreated;
|
|
462
|
+
forum_topic_edited?: TG_ForumTopicEdited;
|
|
463
|
+
forum_topic_closed?: TG_ForumTopicClosed;
|
|
464
|
+
forum_topic_reopened?: TG_ForumTopicReopened;
|
|
465
|
+
general_forum_topic_hidden?: TG_GeneralForumTopicHidden;
|
|
466
|
+
general_forum_topic_unhidden?: TG_GeneralForumTopicUnhidden;
|
|
467
|
+
giveaway_created?: TG_GiveawayCreated;
|
|
468
|
+
giveaway?: TG_Giveaway;
|
|
469
|
+
giveaway_winners?: TG_GiveawayWinners;
|
|
470
|
+
giveaway_completed?: TG_GiveawayCompleted;
|
|
471
|
+
video_chat_scheduled?: TG_VideoChatScheduled;
|
|
472
|
+
video_chat_started?: TG_VideoChatStarted;
|
|
473
|
+
video_chat_ended?: TG_VideoChatEnded;
|
|
474
|
+
video_chat_participants_invited?: TG_VideoChatParticipantsInvited;
|
|
475
|
+
web_app_data?: TG_WebAppData;
|
|
476
|
+
reply_markup?: TG_InlineKeyboardMarkup;
|
|
477
|
+
}
|
|
478
|
+
export interface TG_InlineQuery {
|
|
479
|
+
id: string;
|
|
480
|
+
from: TG_User;
|
|
481
|
+
query: string;
|
|
482
|
+
offset: string;
|
|
483
|
+
location?: TG_Location;
|
|
484
|
+
}
|
|
485
|
+
export interface TG_ChosenInlineResult {
|
|
486
|
+
result_id: string;
|
|
487
|
+
from: TG_User;
|
|
488
|
+
query: string;
|
|
489
|
+
inline_message_id?: string;
|
|
490
|
+
location?: TG_Location;
|
|
491
|
+
inline_message_text?: string;
|
|
492
|
+
}
|
|
493
|
+
export interface TG_CallbackQuery {
|
|
494
|
+
id: string;
|
|
495
|
+
from: TG_User;
|
|
496
|
+
message?: TG_Message;
|
|
497
|
+
inline_message_id?: string;
|
|
498
|
+
chat_instance: string;
|
|
499
|
+
data?: string;
|
|
500
|
+
game_short_name?: string;
|
|
501
|
+
}
|
|
502
|
+
export interface TG_ShippingAddress {
|
|
503
|
+
country_code: string;
|
|
504
|
+
state: string;
|
|
505
|
+
city: string;
|
|
506
|
+
street_line1: string;
|
|
507
|
+
street_line2: string;
|
|
508
|
+
post_code: string;
|
|
509
|
+
}
|
|
510
|
+
export interface TG_ShippingQuery {
|
|
511
|
+
id: string;
|
|
512
|
+
from: TG_User;
|
|
513
|
+
invoice_payload: string;
|
|
514
|
+
shipping_address: TG_ShippingAddress;
|
|
515
|
+
}
|
|
516
|
+
export interface TG_OrderInfo {
|
|
517
|
+
name?: string;
|
|
518
|
+
phone_number?: string;
|
|
519
|
+
email?: string;
|
|
520
|
+
shipping_address?: TG_ShippingAddress;
|
|
521
|
+
}
|
|
522
|
+
export interface TG_PreCheckoutQuery {
|
|
523
|
+
id: string;
|
|
524
|
+
from: TG_User;
|
|
525
|
+
currency: string;
|
|
526
|
+
total_amount: number;
|
|
527
|
+
invoice_payload: string;
|
|
528
|
+
shipping_option_id?: string;
|
|
529
|
+
order_info?: TG_OrderInfo;
|
|
530
|
+
}
|
|
531
|
+
export interface TG_Update {
|
|
532
|
+
update_id: number;
|
|
533
|
+
message?: TG_Message;
|
|
534
|
+
edited_message?: TG_Message;
|
|
535
|
+
channel_post?: TG_Message;
|
|
536
|
+
edited_channel_post?: TG_Message;
|
|
537
|
+
inline_query?: TG_InlineQuery;
|
|
538
|
+
chosen_inline_result?: TG_ChosenInlineResult;
|
|
539
|
+
callback_query?: TG_CallbackQuery;
|
|
540
|
+
shipping_query?: TG_ShippingQuery;
|
|
541
|
+
pre_checkout_query?: TG_PreCheckoutQuery;
|
|
542
|
+
poll?: TG_Poll;
|
|
543
|
+
poll_answer?: TG_PollAnswer;
|
|
544
|
+
}
|
|
545
|
+
export interface TG_ChatResponse extends TG_Response {
|
|
546
|
+
result?: TG_Chat;
|
|
547
|
+
}
|
|
548
|
+
export interface TG_BotCommand {
|
|
549
|
+
command: string;
|
|
550
|
+
description: string | null;
|
|
551
|
+
}
|
|
552
|
+
export interface TG_SetMyCommandsResponse extends TG_Response {
|
|
553
|
+
result?: boolean;
|
|
554
|
+
}
|
|
555
|
+
export interface TG_GetMeResponse extends TG_Response {
|
|
556
|
+
result?: TG_User;
|
|
557
|
+
}
|
|
558
|
+
export interface TG_SendMessageResponse extends TG_Response {
|
|
559
|
+
result?: TG_Message;
|
|
560
|
+
}
|
|
561
|
+
export interface TG_GetUpdatesResponse extends TG_Response {
|
|
562
|
+
result?: TG_Update[];
|
|
563
|
+
}
|
|
564
|
+
export interface TG_GetFileResponse extends TG_Response {
|
|
565
|
+
result?: TG_File;
|
|
566
|
+
}
|
|
567
|
+
export interface TG_InputMediaAudio {
|
|
568
|
+
type: 'audio';
|
|
569
|
+
media: string;
|
|
570
|
+
thumbnail?: FileUpload | string;
|
|
571
|
+
caption?: string;
|
|
572
|
+
parse_mode?: TG_ParseMode;
|
|
573
|
+
caption_entities?: TG_MessageEntity[];
|
|
574
|
+
duration?: number;
|
|
575
|
+
performer?: string;
|
|
576
|
+
title?: string;
|
|
577
|
+
}
|
|
578
|
+
export interface TG_InputMediaDocument {
|
|
579
|
+
type: 'document';
|
|
580
|
+
media: string;
|
|
581
|
+
thumbnail?: FileUpload | string;
|
|
582
|
+
caption?: string;
|
|
583
|
+
parse_mode?: TG_ParseMode;
|
|
584
|
+
caption_entities?: TG_MessageEntity[];
|
|
585
|
+
disable_content_type_detection?: boolean;
|
|
586
|
+
}
|
|
587
|
+
export interface TG_InputMediaPhoto {
|
|
588
|
+
type: 'photo';
|
|
589
|
+
media: string;
|
|
590
|
+
caption?: string;
|
|
591
|
+
parse_mode?: TG_ParseMode;
|
|
592
|
+
caption_entities?: TG_MessageEntity[];
|
|
593
|
+
has_spoiler?: boolean;
|
|
594
|
+
}
|
|
595
|
+
export interface TG_InputMediaVideo {
|
|
596
|
+
type: 'video';
|
|
597
|
+
media: string;
|
|
598
|
+
thumbnail?: FileUpload | string;
|
|
599
|
+
caption?: string;
|
|
600
|
+
parse_mode?: TG_ParseMode;
|
|
601
|
+
caption_entities?: TG_MessageEntity[];
|
|
602
|
+
width?: number;
|
|
603
|
+
height?: number;
|
|
604
|
+
duration?: number;
|
|
605
|
+
supports_streaming?: boolean;
|
|
606
|
+
has_spoiler?: boolean;
|
|
607
|
+
}
|
|
608
|
+
export interface TG_ReplyParameters {
|
|
609
|
+
message_id: number;
|
|
610
|
+
chat_id?: number | string;
|
|
611
|
+
allow_sending_without_reply?: boolean;
|
|
612
|
+
quote?: string;
|
|
613
|
+
quote_parse_mode?: TG_ParseMode;
|
|
614
|
+
quote_entities?: TG_MessageEntity[];
|
|
615
|
+
quote_position?: number;
|
|
616
|
+
}
|
|
617
|
+
export interface TG_SendMediaGroupInput {
|
|
618
|
+
business_connection_id?: string;
|
|
619
|
+
chat_id: number | string;
|
|
620
|
+
message_thread_id?: number;
|
|
621
|
+
media: (TG_InputMediaAudio | TG_InputMediaDocument | TG_InputMediaPhoto | TG_InputMediaVideo)[];
|
|
622
|
+
disable_notification?: boolean;
|
|
623
|
+
protect_content?: boolean;
|
|
624
|
+
reply_parameters?: TG_ReplyParameters;
|
|
625
|
+
}
|
|
626
|
+
export type TG_Action = 'typing' | 'upload_photo' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_document' | 'choose_sticker' | 'find_location' | 'record_video_note' | 'upload_video_note';
|
|
627
|
+
export interface TG_SendActionInput {
|
|
628
|
+
business_connection_id?: string;
|
|
629
|
+
chat_id: number | string;
|
|
630
|
+
message_thread_id?: number;
|
|
631
|
+
action: TG_Action;
|
|
632
|
+
}
|
|
633
|
+
export interface TG_SendMediaGroupResponse extends TG_Response {
|
|
634
|
+
result?: TG_Message[];
|
|
635
|
+
}
|
|
636
|
+
export interface TG_LinkPreviewOptions {
|
|
637
|
+
is_disabled?: boolean;
|
|
638
|
+
url?: string;
|
|
639
|
+
prefer_small_media?: boolean;
|
|
640
|
+
prefer_large_media?: boolean;
|
|
641
|
+
show_above_text?: boolean;
|
|
642
|
+
}
|
|
643
|
+
export interface TG_WebAppInfo {
|
|
644
|
+
url: string;
|
|
645
|
+
}
|
|
646
|
+
export interface TG_LoginUrl {
|
|
647
|
+
url: string;
|
|
648
|
+
forward_text?: string;
|
|
649
|
+
bot_username?: string;
|
|
650
|
+
request_write_access?: boolean;
|
|
651
|
+
}
|
|
652
|
+
export interface TG_SwitchInlineQueryChosenChat {
|
|
653
|
+
query?: string;
|
|
654
|
+
allow_user_chats?: boolean;
|
|
655
|
+
allow_bot_chats?: boolean;
|
|
656
|
+
allow_group_chats?: boolean;
|
|
657
|
+
allow_channel_chats?: boolean;
|
|
658
|
+
}
|
|
659
|
+
export interface TG_InlineKeyboardButton {
|
|
660
|
+
text: string;
|
|
661
|
+
url?: string;
|
|
662
|
+
callback_data?: string;
|
|
663
|
+
web_app?: TG_WebAppInfo;
|
|
664
|
+
login_url?: TG_LoginUrl;
|
|
665
|
+
switch_inline_query?: string;
|
|
666
|
+
switch_inline_query_current_chat?: string;
|
|
667
|
+
switch_inline_query_chosen_chat?: TG_SwitchInlineQueryChosenChat;
|
|
668
|
+
pay?: boolean;
|
|
669
|
+
}
|
|
670
|
+
export interface TG_InlineKeyboardMarkup {
|
|
671
|
+
inline_keyboard: TG_InlineKeyboardButton[][];
|
|
672
|
+
}
|
|
673
|
+
export interface TG_KeyboardButtonRequestUsers {
|
|
674
|
+
request_id: number;
|
|
675
|
+
user_is_bot?: boolean;
|
|
676
|
+
user_is_premium?: boolean;
|
|
677
|
+
max_quantity?: number;
|
|
678
|
+
request_name?: boolean;
|
|
679
|
+
request_username?: boolean;
|
|
680
|
+
request_photo?: boolean;
|
|
681
|
+
}
|
|
682
|
+
export interface TG_ChatAdministratorRights {
|
|
683
|
+
is_anonymous: boolean;
|
|
684
|
+
can_manage_chat: boolean;
|
|
685
|
+
can_delete_messages: boolean;
|
|
686
|
+
can_manage_video_chats: boolean;
|
|
687
|
+
can_restrict_members: boolean;
|
|
688
|
+
can_promote_members: boolean;
|
|
689
|
+
can_change_info: boolean;
|
|
690
|
+
can_invite_users: boolean;
|
|
691
|
+
can_post_stories: boolean;
|
|
692
|
+
can_edit_stories: boolean;
|
|
693
|
+
can_delete_stories: boolean;
|
|
694
|
+
can_post_messages?: boolean;
|
|
695
|
+
can_edit_messages?: boolean;
|
|
696
|
+
can_pin_messages?: boolean;
|
|
697
|
+
can_manage_topics?: boolean;
|
|
698
|
+
}
|
|
699
|
+
export interface TG_KeyboardButtonRequestChat {
|
|
700
|
+
request_id: number;
|
|
701
|
+
chat_is_channel: boolean;
|
|
702
|
+
chat_is_forum?: boolean;
|
|
703
|
+
chat_has_username?: boolean;
|
|
704
|
+
chat_is_created?: boolean;
|
|
705
|
+
user_administrator_rights?: TG_ChatAdministratorRights;
|
|
706
|
+
bot_administrator_rights?: TG_ChatAdministratorRights;
|
|
707
|
+
bot_is_member?: boolean;
|
|
708
|
+
request_title?: boolean;
|
|
709
|
+
request_username?: boolean;
|
|
710
|
+
request_photo?: boolean;
|
|
711
|
+
}
|
|
712
|
+
export interface TG_KeyboardButtonPollType {
|
|
713
|
+
type?: 'quiz' | 'regular';
|
|
714
|
+
}
|
|
715
|
+
export interface TG_KeyboardButton {
|
|
716
|
+
text: string;
|
|
717
|
+
request_users?: TG_KeyboardButtonRequestUsers;
|
|
718
|
+
request_chat?: TG_KeyboardButtonRequestChat;
|
|
719
|
+
request_contact?: boolean;
|
|
720
|
+
request_location?: boolean;
|
|
721
|
+
request_poll?: TG_KeyboardButtonPollType;
|
|
722
|
+
web_app?: TG_WebAppInfo;
|
|
723
|
+
}
|
|
724
|
+
export interface TG_ReplyKeyboardMarkup {
|
|
725
|
+
keyboard: TG_KeyboardButton[][];
|
|
726
|
+
is_persistent?: boolean;
|
|
727
|
+
resize_keyboard?: boolean;
|
|
728
|
+
one_time_keyboard?: boolean;
|
|
729
|
+
input_field_placeholder?: string;
|
|
730
|
+
selective?: boolean;
|
|
731
|
+
}
|
|
732
|
+
export interface TG_ReplyKeyboardRemove {
|
|
733
|
+
remove_keyboard: true;
|
|
734
|
+
selective?: boolean;
|
|
735
|
+
}
|
|
736
|
+
export interface TG_ForceReply {
|
|
737
|
+
force_reply: true;
|
|
738
|
+
input_field_placeholder?: string;
|
|
739
|
+
selective?: boolean;
|
|
740
|
+
}
|
|
741
|
+
export interface TG_SendMessageInput {
|
|
742
|
+
business_connection_id?: string;
|
|
743
|
+
chat_id: number | string;
|
|
744
|
+
message_thread_id?: number;
|
|
745
|
+
text: string;
|
|
746
|
+
parse_mode?: TG_ParseMode;
|
|
747
|
+
entities?: TG_MessageEntity[];
|
|
748
|
+
link_preview_options?: TG_LinkPreviewOptions;
|
|
749
|
+
disable_notification?: boolean;
|
|
750
|
+
protect_content?: boolean;
|
|
751
|
+
reply_parameters?: TG_ReplyParameters;
|
|
752
|
+
reply_markup?: TG_InlineKeyboardMarkup | TG_ReplyKeyboardMarkup | TG_ReplyKeyboardRemove | TG_ForceReply;
|
|
753
|
+
}
|
|
754
|
+
export interface TG_EditMessageTextInput {
|
|
755
|
+
chat_id?: number | string;
|
|
756
|
+
message_id?: number;
|
|
757
|
+
inline_message_id?: string;
|
|
758
|
+
text: string;
|
|
759
|
+
parse_mode?: TG_ParseMode;
|
|
760
|
+
disable_web_page_preview?: boolean;
|
|
761
|
+
reply_markup?: any;
|
|
762
|
+
}
|
|
763
|
+
export interface TG_SendPhotoInput {
|
|
764
|
+
business_connection_id?: string;
|
|
765
|
+
chat_id: number | string;
|
|
766
|
+
message_thread_id?: number;
|
|
767
|
+
photo: FileUpload | string;
|
|
768
|
+
caption?: string;
|
|
769
|
+
parse_mode?: TG_ParseMode;
|
|
770
|
+
caption_entities?: TG_MessageEntity[];
|
|
771
|
+
has_spoiler?: boolean;
|
|
772
|
+
disable_notification?: boolean;
|
|
773
|
+
protect_content?: boolean;
|
|
774
|
+
reply_parameters?: TG_ReplyParameters;
|
|
775
|
+
reply_markup?: TG_InlineKeyboardMarkup | TG_ReplyKeyboardMarkup | TG_ReplyKeyboardRemove | TG_ForceReply;
|
|
776
|
+
}
|
|
777
|
+
export interface TG_SendVideoInput {
|
|
778
|
+
business_connection_id?: string;
|
|
779
|
+
chat_id: number | string;
|
|
780
|
+
message_thread_id?: number;
|
|
781
|
+
video: FileUpload | string;
|
|
782
|
+
duration?: number;
|
|
783
|
+
width?: number;
|
|
784
|
+
height?: number;
|
|
785
|
+
thumbnail?: FileUpload | string;
|
|
786
|
+
caption?: string;
|
|
787
|
+
parse_mode?: TG_ParseMode;
|
|
788
|
+
caption_entities?: TG_MessageEntity[];
|
|
789
|
+
has_spoiler?: boolean;
|
|
790
|
+
supports_streaming?: boolean;
|
|
791
|
+
disable_notification?: boolean;
|
|
792
|
+
protect_content?: boolean;
|
|
793
|
+
reply_parameters?: TG_ReplyParameters;
|
|
794
|
+
reply_markup?: TG_InlineKeyboardMarkup | TG_ReplyKeyboardMarkup | TG_ReplyKeyboardRemove | TG_ForceReply;
|
|
795
|
+
}
|
|
796
|
+
export interface TG_EditMessageMediaInput {
|
|
797
|
+
chat_id?: number | string;
|
|
798
|
+
message_id?: number;
|
|
799
|
+
inline_message_id?: string;
|
|
800
|
+
media: {
|
|
801
|
+
type: TG_InputMediaType;
|
|
802
|
+
media: string;
|
|
803
|
+
caption?: string;
|
|
804
|
+
parse_mode?: TG_ParseMode;
|
|
805
|
+
};
|
|
806
|
+
reply_markup?: any;
|
|
807
|
+
}
|
|
808
|
+
export interface TG_EditMessageCaptionInput {
|
|
809
|
+
chat_id?: number | string;
|
|
810
|
+
message_id?: number;
|
|
811
|
+
inline_message_id?: string;
|
|
812
|
+
caption?: string;
|
|
813
|
+
parse_mode?: TG_ParseMode;
|
|
814
|
+
caption_entities?: Array<{
|
|
815
|
+
type: string;
|
|
816
|
+
offset: number;
|
|
817
|
+
length: number;
|
|
818
|
+
url?: string;
|
|
819
|
+
user?: any;
|
|
820
|
+
language?: string;
|
|
821
|
+
}>;
|
|
822
|
+
reply_markup?: any;
|
|
823
|
+
}
|
|
824
|
+
export interface TG_SendDocumentInput {
|
|
825
|
+
business_connection_id?: string;
|
|
826
|
+
chat_id: number | string;
|
|
827
|
+
message_thread_id?: number;
|
|
828
|
+
document: File | Buffer | string;
|
|
829
|
+
thumbnail?: File | string;
|
|
830
|
+
caption?: string;
|
|
831
|
+
parse_mode?: TG_ParseMode;
|
|
832
|
+
caption_entities?: TG_MessageEntity[];
|
|
833
|
+
disable_content_type_detection?: boolean;
|
|
834
|
+
disable_notification?: boolean;
|
|
835
|
+
protect_content?: boolean;
|
|
836
|
+
allow_paid_broadcast?: boolean;
|
|
837
|
+
message_effect_id?: string;
|
|
838
|
+
reply_parameters?: TG_ReplyParameters;
|
|
839
|
+
reply_markup?: TG_InlineKeyboardMarkup | TG_ReplyKeyboardMarkup | TG_ReplyKeyboardRemove | TG_ForceReply;
|
|
840
|
+
}
|
|
841
|
+
export interface TG_DeleteMessageInput {
|
|
842
|
+
chat_id: number | string;
|
|
843
|
+
message_id: number;
|
|
844
|
+
}
|
|
845
|
+
export interface TG_LabeledPrice {
|
|
846
|
+
label: string;
|
|
847
|
+
amount: number;
|
|
848
|
+
}
|
|
849
|
+
export interface TG_CreateInvoiceInput {
|
|
850
|
+
business_connection_id?: string;
|
|
851
|
+
title: string;
|
|
852
|
+
description: string;
|
|
853
|
+
payload: string;
|
|
854
|
+
provider_token?: string;
|
|
855
|
+
currency: string;
|
|
856
|
+
prices: TG_LabeledPrice[];
|
|
857
|
+
subscription_period?: number;
|
|
858
|
+
max_tip_amount?: number;
|
|
859
|
+
suggested_tip_amounts?: number[];
|
|
860
|
+
provider_data?: string;
|
|
861
|
+
photo_url?: string;
|
|
862
|
+
photo_size?: number;
|
|
863
|
+
photo_width?: number;
|
|
864
|
+
photo_height?: number;
|
|
865
|
+
need_name?: boolean;
|
|
866
|
+
need_phone_number?: boolean;
|
|
867
|
+
need_email?: boolean;
|
|
868
|
+
need_shipping_address?: boolean;
|
|
869
|
+
send_phone_number_to_provider?: boolean;
|
|
870
|
+
send_email_to_provider?: boolean;
|
|
871
|
+
is_flexible?: boolean;
|
|
872
|
+
}
|
|
873
|
+
export interface TG_AnswerPreCheckoutQueryInput {
|
|
874
|
+
pre_checkout_query_id: string;
|
|
875
|
+
ok: boolean;
|
|
876
|
+
error_message?: string;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Ответ Telegram API на метод answerPreCheckoutQuery.
|
|
880
|
+
*/
|
|
881
|
+
export interface TG_AnswerPreCheckoutQueryResponse extends TG_Response {
|
|
882
|
+
result?: boolean;
|
|
883
|
+
}
|
|
884
|
+
export {};
|
|
885
|
+
//# sourceMappingURL=TelegramTypes.d.ts.map
|