tgplus 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +52 -0
  2. package/README.md +1512 -0
  3. package/dist/adapters.d.ts +46 -0
  4. package/dist/adapters.js +83 -0
  5. package/dist/adapters.js.map +1 -0
  6. package/dist/bot.d.ts +50 -0
  7. package/dist/bot.js +180 -0
  8. package/dist/bot.js.map +1 -0
  9. package/dist/client.d.ts +1139 -0
  10. package/dist/client.js +529 -0
  11. package/dist/client.js.map +1 -0
  12. package/dist/composer.d.ts +88 -0
  13. package/dist/composer.js +233 -0
  14. package/dist/composer.js.map +1 -0
  15. package/dist/context.d.ts +72 -0
  16. package/dist/context.js +149 -0
  17. package/dist/context.js.map +1 -0
  18. package/dist/decorators.d.ts +33 -0
  19. package/dist/decorators.js +39 -0
  20. package/dist/decorators.js.map +1 -0
  21. package/dist/filters.d.ts +19 -0
  22. package/dist/filters.js +81 -0
  23. package/dist/filters.js.map +1 -0
  24. package/dist/i18n.d.ts +30 -0
  25. package/dist/i18n.js +41 -0
  26. package/dist/i18n.js.map +1 -0
  27. package/dist/index.d.ts +16 -0
  28. package/dist/index.js +95 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/keyboard.d.ts +62 -0
  31. package/dist/keyboard.js +96 -0
  32. package/dist/keyboard.js.map +1 -0
  33. package/dist/rateLimit.d.ts +19 -0
  34. package/dist/rateLimit.js +32 -0
  35. package/dist/rateLimit.js.map +1 -0
  36. package/dist/richMessage.d.ts +111 -0
  37. package/dist/richMessage.js +221 -0
  38. package/dist/richMessage.js.map +1 -0
  39. package/dist/scenes.d.ts +57 -0
  40. package/dist/scenes.js +105 -0
  41. package/dist/scenes.js.map +1 -0
  42. package/dist/session-redis.d.ts +27 -0
  43. package/dist/session-redis.js +36 -0
  44. package/dist/session-redis.js.map +1 -0
  45. package/dist/session-sqlite.d.ts +29 -0
  46. package/dist/session-sqlite.js +34 -0
  47. package/dist/session-sqlite.js.map +1 -0
  48. package/dist/session.d.ts +30 -0
  49. package/dist/session.js +35 -0
  50. package/dist/session.js.map +1 -0
  51. package/dist/types.d.ts +2485 -0
  52. package/dist/types.js +11 -0
  53. package/dist/types.js.map +1 -0
  54. package/package.json +42 -0
@@ -0,0 +1,1139 @@
1
+ import * as T from "./types";
2
+ export declare class TelegramApiError extends Error {
3
+ method: string;
4
+ errorCode: number;
5
+ parameters?: {
6
+ retry_after?: number;
7
+ migrate_to_chat_id?: number;
8
+ } | undefined;
9
+ constructor(method: string, errorCode: number, description: string, parameters?: {
10
+ retry_after?: number;
11
+ migrate_to_chat_id?: number;
12
+ } | undefined);
13
+ }
14
+ export interface ClientOptions {
15
+ apiRoot?: string;
16
+ timeoutMs?: number;
17
+ floodControl?: {
18
+ maxRetries?: number;
19
+ };
20
+ minIntervalMs?: number;
21
+ }
22
+ export declare class Transport {
23
+ private token;
24
+ private root;
25
+ private maxRetries;
26
+ private minIntervalMs;
27
+ private queue;
28
+ constructor(token: string, opts?: ClientOptions);
29
+ private schedule;
30
+ call<TResult = unknown>(method: string, params?: object, attempt?: number): Promise<TResult>;
31
+ private performCall;
32
+ private callMultipart;
33
+ getFileDownloadUrl(filePath: string): string;
34
+ }
35
+ interface CommonSendOptions {
36
+ message_thread_id?: T.Integer;
37
+ disable_notification?: boolean;
38
+ protect_content?: boolean;
39
+ /** @deprecated use reply_parameters instead — kept only for pre-7.0 style code. */
40
+ reply_to_message_id?: T.Integer;
41
+ /** @deprecated use reply_parameters instead — kept only for pre-7.0 style code. */
42
+ allow_sending_without_reply?: boolean;
43
+ /** The real Bot API 7.0+ reply mechanism — supports quoting part of the original message, replying across chats, to poll options, checklist tasks, or ephemeral messages. */
44
+ reply_parameters?: T.ReplyParameters;
45
+ reply_markup?: T.ReplyMarkup;
46
+ business_connection_id?: string;
47
+ /** Bot API 7.4+: attach one of the message effects available in Telegram clients (e.g. confetti). */
48
+ message_effect_id?: string;
49
+ /** Bot API 9.2+: send to a specific Direct Messages topic in a channel's linked discussion supergroup. */
50
+ direct_messages_topic_id?: T.Integer;
51
+ /** Bot API 9.2+: turn this send into a suggested post awaiting approval, instead of posting immediately. */
52
+ suggested_post_parameters?: T.SuggestedPostParameters;
53
+ /** Bot API 7.11+: send even if it would exceed the free daily broadcast limit, paying with Stars. */
54
+ allow_paid_broadcast?: boolean;
55
+ /** Bot API 10.2+: make this message visible only to a specific user (Ephemeral Messages). */
56
+ ephemeral_message_parameters?: T.EphemeralMessageParameters;
57
+ /** @deprecated use ephemeral_message_parameters instead — kept for backward compatibility with 10.2 code. */
58
+ receiver_user_id?: T.Integer;
59
+ /** @deprecated use ephemeral_message_parameters instead — kept for backward compatibility with 10.2 code. */
60
+ callback_query_id?: string;
61
+ }
62
+ interface SendPollParams extends CommonSendOptions {
63
+ chat_id: T.ChatId;
64
+ question: string;
65
+ question_parse_mode?: T.ParseMode;
66
+ question_entities?: T.MessageEntity[];
67
+ options: (string | {
68
+ text: string;
69
+ text_parse_mode?: T.ParseMode;
70
+ text_entities?: T.MessageEntity[];
71
+ media?: T.PollMedia;
72
+ })[];
73
+ is_anonymous?: boolean;
74
+ type?: "regular" | "quiz";
75
+ allows_multiple_answers?: boolean;
76
+ /** Bot API 9.6+: plural — a quiz can now have more than one correct answer. */
77
+ correct_option_ids?: T.Integer[];
78
+ explanation?: string;
79
+ explanation_parse_mode?: T.ParseMode;
80
+ explanation_entities?: T.MessageEntity[];
81
+ open_period?: T.Integer;
82
+ close_date?: T.Integer;
83
+ is_closed?: boolean;
84
+ /** Bot API 9.6+ */
85
+ allows_revoting?: boolean;
86
+ shuffle_options?: boolean;
87
+ allow_adding_options?: boolean;
88
+ hide_results_until_closes?: boolean;
89
+ description?: string;
90
+ description_parse_mode?: T.ParseMode;
91
+ description_entities?: T.MessageEntity[];
92
+ /** Bot API 10.0+ */
93
+ members_only?: boolean;
94
+ country_codes?: string[];
95
+ media?: T.PollMedia;
96
+ }
97
+ export declare class Api {
98
+ private transport;
99
+ constructor(transport: Transport);
100
+ /** Escape hatch: call ANY method by name, typed or not. Always up to date. */
101
+ call<TResult = unknown>(method: string, params?: object): Promise<TResult>;
102
+ fileUrl(filePath: string): string;
103
+ getMe(): Promise<T.User>;
104
+ logOut(): Promise<true>;
105
+ close(): Promise<true>;
106
+ getUpdates(params?: {
107
+ offset?: T.Integer;
108
+ limit?: T.Integer;
109
+ timeout?: T.Integer;
110
+ allowed_updates?: string[];
111
+ }): Promise<T.Update[]>;
112
+ setWebhook(params: {
113
+ url: string;
114
+ secret_token?: string;
115
+ max_connections?: T.Integer;
116
+ allowed_updates?: string[];
117
+ drop_pending_updates?: boolean;
118
+ }): Promise<true>;
119
+ deleteWebhook(params?: {
120
+ drop_pending_updates?: boolean;
121
+ }): Promise<true>;
122
+ getWebhookInfo(): Promise<T.WebhookInfo>;
123
+ sendMessage(params: {
124
+ chat_id: T.ChatId;
125
+ text: string;
126
+ parse_mode?: T.ParseMode;
127
+ entities?: T.MessageEntity[];
128
+ link_preview_options?: T.LinkPreviewOptions;
129
+ } & CommonSendOptions): Promise<T.Message>;
130
+ /**
131
+ * Streams a partial plain-text message to a private chat while it's being
132
+ * generated — the plain-text sibling of sendRichMessageDraft. Ephemeral
133
+ * preview (not saved in the chat); call sendMessage with the final text
134
+ * once generation finishes. Modeled on sendRichMessageDraft's confirmed
135
+ * shape (draft_id, private-chat-only) since I could not independently
136
+ * verify sendMessageDraft's exact parameters beyond its existence and
137
+ * purpose in the official changelog.
138
+ */
139
+ sendMessageDraft(params: {
140
+ chat_id: T.Integer;
141
+ message_thread_id?: T.Integer;
142
+ draft_id: T.Integer;
143
+ text: string;
144
+ parse_mode?: T.ParseMode;
145
+ entities?: T.MessageEntity[]; /** Bot API 10.3+: whether the user can stop generation of this draft. */
146
+ can_stop?: boolean; /** Bot API 10.3+: whether to keep the draft visible after stopping. */
147
+ keep_on_stop?: boolean;
148
+ }): Promise<true>;
149
+ /** New in Bot API 10.1 — structured tables, checklists, blockquotes, inline media, streamed or not. */
150
+ sendRichMessage(params: {
151
+ chat_id: T.ChatId;
152
+ rich_message: T.InputRichMessage;
153
+ } & CommonSendOptions): Promise<T.Message>;
154
+ /**
155
+ * Streams a partial rich message to a private chat while it's being generated.
156
+ * The draft is ephemeral (a ~30s preview, not saved in the chat) — call
157
+ * sendRichMessage with the complete content once generation finishes.
158
+ * draft_id must be non-zero; repeated calls with the same draft_id animate
159
+ * between states. Private chats only (chat_id must be the numeric user id).
160
+ */
161
+ sendRichMessageDraft(params: {
162
+ chat_id: T.Integer;
163
+ message_thread_id?: T.Integer;
164
+ draft_id: T.Integer;
165
+ rich_message: T.InputRichMessage; /** Bot API 10.3+: whether the user can stop generation of this draft. */
166
+ can_stop?: boolean; /** Bot API 10.3+: whether to keep the draft visible after stopping. */
167
+ keep_on_stop?: boolean;
168
+ }): Promise<true>;
169
+ forwardMessage(params: {
170
+ chat_id: T.ChatId;
171
+ from_chat_id: T.ChatId;
172
+ message_id: T.Integer;
173
+ message_thread_id?: T.Integer;
174
+ disable_notification?: boolean;
175
+ protect_content?: boolean;
176
+ message_effect_id?: string;
177
+ video_start_timestamp?: T.Integer;
178
+ }): Promise<T.Message>;
179
+ forwardMessages(params: {
180
+ chat_id: T.ChatId;
181
+ from_chat_id: T.ChatId;
182
+ message_ids: T.Integer[];
183
+ message_thread_id?: T.Integer;
184
+ disable_notification?: boolean;
185
+ protect_content?: boolean;
186
+ }): Promise<T.MessageId[]>;
187
+ copyMessage(params: {
188
+ chat_id: T.ChatId;
189
+ from_chat_id: T.ChatId;
190
+ message_id: T.Integer;
191
+ caption?: string;
192
+ parse_mode?: T.ParseMode;
193
+ show_caption_above_media?: boolean;
194
+ video_start_timestamp?: T.Integer;
195
+ } & CommonSendOptions): Promise<T.MessageId>;
196
+ copyMessages(params: {
197
+ chat_id: T.ChatId;
198
+ from_chat_id: T.ChatId;
199
+ message_ids: T.Integer[];
200
+ remove_caption?: boolean;
201
+ }): Promise<T.MessageId[]>;
202
+ sendPhoto(params: {
203
+ chat_id: T.ChatId;
204
+ photo: T.InputFile;
205
+ caption?: string;
206
+ parse_mode?: T.ParseMode;
207
+ has_spoiler?: boolean;
208
+ show_caption_above_media?: boolean;
209
+ } & CommonSendOptions): Promise<T.Message>;
210
+ /** Bot API 10.2+: send a short looping "live photo" (discovered via the official changelog's parameter list, not independently field-verified beyond that — the LivePhoto receive type is a best-effort model). */
211
+ sendLivePhoto(params: {
212
+ chat_id: T.ChatId;
213
+ live_photo: T.InputFile;
214
+ caption?: string;
215
+ parse_mode?: T.ParseMode;
216
+ } & CommonSendOptions): Promise<T.Message>;
217
+ sendAudio(params: {
218
+ chat_id: T.ChatId;
219
+ audio: T.InputFile;
220
+ caption?: string;
221
+ duration?: T.Integer;
222
+ performer?: string;
223
+ title?: string;
224
+ } & CommonSendOptions): Promise<T.Message>;
225
+ sendDocument(params: {
226
+ chat_id: T.ChatId;
227
+ document: T.InputFile;
228
+ caption?: string;
229
+ parse_mode?: T.ParseMode;
230
+ } & CommonSendOptions): Promise<T.Message>;
231
+ sendVideo(params: {
232
+ chat_id: T.ChatId;
233
+ video: T.InputFile;
234
+ caption?: string;
235
+ parse_mode?: T.ParseMode;
236
+ width?: T.Integer;
237
+ height?: T.Integer;
238
+ duration?: T.Integer;
239
+ has_spoiler?: boolean;
240
+ show_caption_above_media?: boolean;
241
+ supports_streaming?: boolean;
242
+ cover?: T.InputFile;
243
+ start_timestamp?: T.Integer;
244
+ } & CommonSendOptions): Promise<T.Message>;
245
+ sendAnimation(params: {
246
+ chat_id: T.ChatId;
247
+ animation: T.InputFile;
248
+ caption?: string;
249
+ width?: T.Integer;
250
+ height?: T.Integer;
251
+ duration?: T.Integer;
252
+ has_spoiler?: boolean;
253
+ show_caption_above_media?: boolean;
254
+ } & CommonSendOptions): Promise<T.Message>;
255
+ /** Was missing entirely despite being one of the most common Bot API methods — found while auditing Context.replyWithSticker's fallback to the raw call() escape hatch. */
256
+ sendSticker(params: {
257
+ chat_id: T.ChatId;
258
+ sticker: T.InputFile;
259
+ emoji?: string;
260
+ } & CommonSendOptions): Promise<T.Message>;
261
+ sendVoice(params: {
262
+ chat_id: T.ChatId;
263
+ voice: T.InputFile;
264
+ caption?: string;
265
+ duration?: T.Integer;
266
+ } & CommonSendOptions): Promise<T.Message>;
267
+ sendVideoNote(params: {
268
+ chat_id: T.ChatId;
269
+ video_note: T.InputFile;
270
+ duration?: T.Integer;
271
+ length?: T.Integer;
272
+ } & CommonSendOptions): Promise<T.Message>;
273
+ sendMediaGroup(params: {
274
+ chat_id: T.ChatId;
275
+ media: T.InputMedia[];
276
+ } & Omit<CommonSendOptions, "reply_markup">): Promise<T.Message[]>;
277
+ /** Bot API 7.6+: send photos/videos that require the receiver to pay Stars to unlock. */
278
+ sendPaidMedia(params: {
279
+ chat_id: T.ChatId;
280
+ star_count: T.Integer;
281
+ media: T.InputPaidMedia[];
282
+ caption?: string;
283
+ parse_mode?: T.ParseMode;
284
+ payload?: string;
285
+ } & CommonSendOptions): Promise<T.Message>;
286
+ sendLocation(params: {
287
+ chat_id: T.ChatId;
288
+ latitude: number;
289
+ longitude: number;
290
+ horizontal_accuracy?: number;
291
+ live_period?: T.Integer;
292
+ heading?: T.Integer;
293
+ proximity_alert_radius?: T.Integer;
294
+ } & CommonSendOptions): Promise<T.Message>;
295
+ editMessageLiveLocation(params: {
296
+ chat_id?: T.ChatId;
297
+ message_id?: T.Integer;
298
+ inline_message_id?: string;
299
+ latitude: number;
300
+ longitude: number;
301
+ heading?: T.Integer;
302
+ proximity_alert_radius?: T.Integer;
303
+ reply_markup?: T.InlineKeyboardMarkup;
304
+ }): Promise<true | T.Message>;
305
+ stopMessageLiveLocation(params: {
306
+ chat_id?: T.ChatId;
307
+ message_id?: T.Integer;
308
+ inline_message_id?: string;
309
+ reply_markup?: T.InlineKeyboardMarkup;
310
+ }): Promise<true | T.Message>;
311
+ sendVenue(params: {
312
+ chat_id: T.ChatId;
313
+ latitude: number;
314
+ longitude: number;
315
+ title: string;
316
+ address: string;
317
+ foursquare_id?: string;
318
+ } & CommonSendOptions): Promise<T.Message>;
319
+ sendContact(params: {
320
+ chat_id: T.ChatId;
321
+ phone_number: string;
322
+ first_name: string;
323
+ last_name?: string;
324
+ vcard?: string;
325
+ } & CommonSendOptions): Promise<T.Message>;
326
+ sendPoll(params: SendPollParams): Promise<T.Message>;
327
+ /** Convenience: sendPoll with type "quiz" pre-filled, matching telegraf's sendQuiz. */
328
+ sendQuiz(params: Omit<SendPollParams, "type">): Promise<T.Message>;
329
+ sendDice(params: {
330
+ chat_id: T.ChatId;
331
+ emoji?: "🎲" | "🎯" | "🏀" | "⚽" | "🎳" | "🎰";
332
+ } & CommonSendOptions): Promise<T.Message>;
333
+ sendChatAction(params: {
334
+ chat_id: T.ChatId;
335
+ message_thread_id?: T.Integer;
336
+ action: "typing" | "upload_photo" | "record_video" | "upload_video" | "record_voice" | "upload_voice" | "upload_document" | "choose_sticker" | "find_location" | "record_video_note" | "upload_video_note";
337
+ }): Promise<true>;
338
+ editMessageText(params: {
339
+ chat_id?: T.ChatId;
340
+ message_id?: T.Integer;
341
+ inline_message_id?: string;
342
+ text?: string;
343
+ rich_message?: T.InputRichMessage;
344
+ parse_mode?: T.ParseMode;
345
+ entities?: T.MessageEntity[];
346
+ link_preview_options?: T.LinkPreviewOptions;
347
+ reply_markup?: T.InlineKeyboardMarkup;
348
+ }): Promise<true | T.Message>;
349
+ editMessageCaption(params: {
350
+ chat_id?: T.ChatId;
351
+ message_id?: T.Integer;
352
+ inline_message_id?: string;
353
+ caption?: string;
354
+ parse_mode?: T.ParseMode;
355
+ show_caption_above_media?: boolean;
356
+ reply_markup?: T.InlineKeyboardMarkup;
357
+ }): Promise<true | T.Message>;
358
+ editMessageMedia(params: {
359
+ chat_id?: T.ChatId;
360
+ message_id?: T.Integer;
361
+ inline_message_id?: string;
362
+ media: T.InputMedia;
363
+ reply_markup?: T.InlineKeyboardMarkup;
364
+ }): Promise<true | T.Message>;
365
+ editMessageReplyMarkup(params: {
366
+ chat_id?: T.ChatId;
367
+ message_id?: T.Integer;
368
+ inline_message_id?: string;
369
+ reply_markup?: T.InlineKeyboardMarkup;
370
+ }): Promise<true | T.Message>;
371
+ stopPoll(params: {
372
+ chat_id: T.ChatId;
373
+ message_id: T.Integer;
374
+ reply_markup?: T.InlineKeyboardMarkup;
375
+ }): Promise<T.Poll>;
376
+ deleteMessage(params: {
377
+ chat_id: T.ChatId;
378
+ message_id: T.Integer;
379
+ }): Promise<true>;
380
+ deleteMessages(params: {
381
+ chat_id: T.ChatId;
382
+ message_ids: T.Integer[];
383
+ }): Promise<true>;
384
+ editEphemeralMessageText(params: {
385
+ receiver_user_id: T.Integer;
386
+ chat_id?: T.ChatId;
387
+ ephemeral_message_id: T.Integer;
388
+ text: string;
389
+ parse_mode?: T.ParseMode;
390
+ entities?: T.MessageEntity[]; /** Bot API 10.3+: replace the text with a rich message instead. */
391
+ rich_message?: T.InputRichMessage;
392
+ reply_markup?: T.InlineKeyboardMarkup;
393
+ }): Promise<true | T.Message>;
394
+ editEphemeralMessageMedia(params: {
395
+ receiver_user_id: T.Integer;
396
+ chat_id?: T.ChatId;
397
+ ephemeral_message_id: T.Integer;
398
+ media: T.InputMedia;
399
+ reply_markup?: T.InlineKeyboardMarkup;
400
+ }): Promise<true | T.Message>;
401
+ editEphemeralMessageCaption(params: {
402
+ receiver_user_id: T.Integer;
403
+ chat_id?: T.ChatId;
404
+ ephemeral_message_id: T.Integer;
405
+ caption?: string;
406
+ parse_mode?: T.ParseMode; /** Bot API 10.3+: show caption above the media. */
407
+ show_caption_above_media?: boolean;
408
+ reply_markup?: T.InlineKeyboardMarkup;
409
+ }): Promise<true | T.Message>;
410
+ editEphemeralMessageReplyMarkup(params: {
411
+ receiver_user_id: T.Integer;
412
+ chat_id?: T.ChatId;
413
+ ephemeral_message_id: T.Integer;
414
+ reply_markup?: T.InlineKeyboardMarkup;
415
+ }): Promise<true | T.Message>;
416
+ deleteEphemeralMessage(params: {
417
+ receiver_user_id: T.Integer;
418
+ chat_id?: T.ChatId;
419
+ ephemeral_message_id: T.Integer;
420
+ }): Promise<true>;
421
+ getFile(params: {
422
+ file_id: T.FileId;
423
+ }): Promise<T.File>;
424
+ /** Convenience: resolve a file_id (or an already-fetched File) straight to a downloadable URL, calling getFile for you if needed. */
425
+ getFileLink(fileIdOrFile: T.FileId | T.File): Promise<string>;
426
+ getUserProfilePhotos(params: {
427
+ user_id: T.Integer;
428
+ offset?: T.Integer;
429
+ limit?: T.Integer;
430
+ }): Promise<T.UserProfilePhotos>;
431
+ /** Bot API 9.4+ */
432
+ getUserProfileAudios(params: {
433
+ user_id: T.Integer;
434
+ offset?: T.Integer;
435
+ limit?: T.Integer;
436
+ }): Promise<T.UserProfileAudios>;
437
+ banChatMember(params: {
438
+ chat_id: T.ChatId;
439
+ user_id: T.Integer;
440
+ until_date?: T.Integer;
441
+ revoke_messages?: boolean;
442
+ }): Promise<true>;
443
+ unbanChatMember(params: {
444
+ chat_id: T.ChatId;
445
+ user_id: T.Integer;
446
+ only_if_banned?: boolean;
447
+ }): Promise<true>;
448
+ restrictChatMember(params: {
449
+ chat_id: T.ChatId;
450
+ user_id: T.Integer;
451
+ permissions: T.ChatPermissions;
452
+ until_date?: T.Integer;
453
+ }): Promise<true>;
454
+ promoteChatMember(params: {
455
+ chat_id: T.ChatId;
456
+ user_id: T.Integer;
457
+ is_anonymous?: boolean;
458
+ can_manage_chat?: boolean;
459
+ can_delete_messages?: boolean;
460
+ can_manage_video_chats?: boolean;
461
+ can_restrict_members?: boolean;
462
+ can_promote_members?: boolean;
463
+ can_change_info?: boolean;
464
+ can_invite_users?: boolean;
465
+ can_post_messages?: boolean;
466
+ can_edit_messages?: boolean;
467
+ can_pin_messages?: boolean;
468
+ can_post_stories?: boolean;
469
+ can_edit_stories?: boolean;
470
+ can_delete_stories?: boolean;
471
+ can_manage_topics?: boolean;
472
+ can_manage_direct_messages?: boolean;
473
+ can_manage_tags?: boolean; /** Bot API 10.3+: whether the admin can send welcome messages to new members. */
474
+ can_send_welcome_messages?: boolean;
475
+ }): Promise<true>;
476
+ setChatAdministratorCustomTitle(params: {
477
+ chat_id: T.ChatId;
478
+ user_id: T.Integer;
479
+ custom_title: string;
480
+ }): Promise<true>;
481
+ /** Bot API 9.5+: set a member's tag, in chats that have tags enabled. */
482
+ setChatMemberTag(params: {
483
+ chat_id: T.ChatId;
484
+ user_id: T.Integer;
485
+ tag?: string;
486
+ }): Promise<true>;
487
+ banChatSenderChat(params: {
488
+ chat_id: T.ChatId;
489
+ sender_chat_id: T.Integer;
490
+ }): Promise<true>;
491
+ unbanChatSenderChat(params: {
492
+ chat_id: T.ChatId;
493
+ sender_chat_id: T.Integer;
494
+ }): Promise<true>;
495
+ setChatPermissions(params: {
496
+ chat_id: T.ChatId;
497
+ permissions: T.ChatPermissions;
498
+ }): Promise<true>;
499
+ exportChatInviteLink(params: {
500
+ chat_id: T.ChatId;
501
+ }): Promise<string>;
502
+ createChatInviteLink(params: {
503
+ chat_id: T.ChatId;
504
+ name?: string;
505
+ expire_date?: T.Integer;
506
+ member_limit?: T.Integer;
507
+ creates_join_request?: boolean;
508
+ }): Promise<T.ChatInviteLink>;
509
+ editChatInviteLink(params: {
510
+ chat_id: T.ChatId;
511
+ invite_link: string;
512
+ name?: string;
513
+ expire_date?: T.Integer;
514
+ member_limit?: T.Integer;
515
+ creates_join_request?: boolean;
516
+ }): Promise<T.ChatInviteLink>;
517
+ revokeChatInviteLink(params: {
518
+ chat_id: T.ChatId;
519
+ invite_link: string;
520
+ }): Promise<T.ChatInviteLink>;
521
+ approveChatJoinRequest(params: {
522
+ chat_id: T.ChatId;
523
+ user_id: T.Integer;
524
+ }): Promise<true>;
525
+ declineChatJoinRequest(params: {
526
+ chat_id: T.ChatId;
527
+ user_id: T.Integer;
528
+ }): Promise<true>;
529
+ /** Bot API 10.1+: respond to a join request raised as a query. */
530
+ answerChatJoinRequestQuery(params: {
531
+ query_id: string;
532
+ approve: boolean;
533
+ }): Promise<true>;
534
+ /** Bot API 10.1+: open a Web App from a chat join request to let the user complete additional steps before approval. */
535
+ sendChatJoinRequestWebApp(params: {
536
+ query_id: string;
537
+ web_app: T.WebAppInfo;
538
+ }): Promise<true>;
539
+ setChatPhoto(params: {
540
+ chat_id: T.ChatId;
541
+ photo: T.InputFile;
542
+ }): Promise<true>;
543
+ deleteChatPhoto(params: {
544
+ chat_id: T.ChatId;
545
+ }): Promise<true>;
546
+ setChatTitle(params: {
547
+ chat_id: T.ChatId;
548
+ title: string;
549
+ }): Promise<true>;
550
+ setChatDescription(params: {
551
+ chat_id: T.ChatId;
552
+ description?: string;
553
+ }): Promise<true>;
554
+ pinChatMessage(params: {
555
+ chat_id: T.ChatId;
556
+ message_id: T.Integer;
557
+ disable_notification?: boolean;
558
+ }): Promise<true>;
559
+ unpinChatMessage(params: {
560
+ chat_id: T.ChatId;
561
+ message_id?: T.Integer;
562
+ }): Promise<true>;
563
+ unpinAllChatMessages(params: {
564
+ chat_id: T.ChatId;
565
+ }): Promise<true>;
566
+ leaveChat(params: {
567
+ chat_id: T.ChatId;
568
+ }): Promise<true>;
569
+ getChat(params: {
570
+ chat_id: T.ChatId;
571
+ }): Promise<T.ChatFullInfo>;
572
+ getChatAdministrators(params: {
573
+ chat_id: T.ChatId;
574
+ return_bots?: boolean;
575
+ }): Promise<T.ChatMember[]>;
576
+ getChatMemberCount(params: {
577
+ chat_id: T.ChatId;
578
+ }): Promise<number>;
579
+ getChatMember(params: {
580
+ chat_id: T.ChatId;
581
+ user_id: T.Integer;
582
+ }): Promise<T.ChatMember>;
583
+ setChatStickerSet(params: {
584
+ chat_id: T.ChatId;
585
+ sticker_set_name: string;
586
+ }): Promise<true>;
587
+ deleteChatStickerSet(params: {
588
+ chat_id: T.ChatId;
589
+ }): Promise<true>;
590
+ /** React to a message with emoji/custom-emoji/paid reactions (Bot API 7.0+). */
591
+ setMessageReaction(params: {
592
+ chat_id: T.ChatId;
593
+ message_id: T.Integer;
594
+ reaction?: T.ReactionType[];
595
+ is_big?: boolean;
596
+ }): Promise<true>;
597
+ /** Bot API 10.0+ */
598
+ deleteAllMessageReactions(params: {
599
+ chat_id: T.ChatId;
600
+ message_id: T.Integer;
601
+ }): Promise<true>;
602
+ deleteMessageReaction(params: {
603
+ chat_id: T.ChatId;
604
+ message_id: T.Integer;
605
+ user_id: T.Integer;
606
+ }): Promise<true>;
607
+ getUserChatBoosts(params: {
608
+ chat_id: T.ChatId;
609
+ user_id: T.Integer;
610
+ }): Promise<T.UserChatBoosts>;
611
+ getForumTopicIconStickers(): Promise<T.Sticker[]>;
612
+ createForumTopic(params: {
613
+ chat_id: T.ChatId;
614
+ name: string;
615
+ icon_color?: T.Integer;
616
+ icon_custom_emoji_id?: string;
617
+ }): Promise<T.ForumTopic>;
618
+ editForumTopic(params: {
619
+ chat_id: T.ChatId;
620
+ message_thread_id: T.Integer;
621
+ name?: string;
622
+ icon_custom_emoji_id?: string;
623
+ }): Promise<true>;
624
+ closeForumTopic(params: {
625
+ chat_id: T.ChatId;
626
+ message_thread_id: T.Integer;
627
+ }): Promise<true>;
628
+ reopenForumTopic(params: {
629
+ chat_id: T.ChatId;
630
+ message_thread_id: T.Integer;
631
+ }): Promise<true>;
632
+ deleteForumTopic(params: {
633
+ chat_id: T.ChatId;
634
+ message_thread_id: T.Integer;
635
+ }): Promise<true>;
636
+ unpinAllForumTopicMessages(params: {
637
+ chat_id: T.ChatId;
638
+ message_thread_id: T.Integer;
639
+ }): Promise<true>;
640
+ editGeneralForumTopic(params: {
641
+ chat_id: T.ChatId;
642
+ name: string;
643
+ }): Promise<true>;
644
+ closeGeneralForumTopic(params: {
645
+ chat_id: T.ChatId;
646
+ }): Promise<true>;
647
+ reopenGeneralForumTopic(params: {
648
+ chat_id: T.ChatId;
649
+ }): Promise<true>;
650
+ hideGeneralForumTopic(params: {
651
+ chat_id: T.ChatId;
652
+ }): Promise<true>;
653
+ unhideGeneralForumTopic(params: {
654
+ chat_id: T.ChatId;
655
+ }): Promise<true>;
656
+ unpinAllGeneralForumTopicMessages(params: {
657
+ chat_id: T.ChatId;
658
+ }): Promise<true>;
659
+ setMyCommands(params: {
660
+ commands: T.BotCommand[];
661
+ scope?: T.BotCommandScope;
662
+ language_code?: string;
663
+ }): Promise<true>;
664
+ deleteMyCommands(params?: {
665
+ scope?: T.BotCommandScope;
666
+ language_code?: string;
667
+ }): Promise<true>;
668
+ getMyCommands(params?: {
669
+ scope?: T.BotCommandScope;
670
+ language_code?: string;
671
+ }): Promise<T.BotCommand[]>;
672
+ setChatMenuButton(params?: {
673
+ chat_id?: T.Integer;
674
+ menu_button?: T.MenuButton;
675
+ }): Promise<true>;
676
+ getChatMenuButton(params?: {
677
+ chat_id?: T.Integer;
678
+ }): Promise<T.MenuButton>;
679
+ setMyDefaultAdministratorRights(params?: {
680
+ rights?: T.ChatAdministratorRights;
681
+ for_channels?: boolean;
682
+ }): Promise<true>;
683
+ getMyDefaultAdministratorRights(params?: {
684
+ for_channels?: boolean;
685
+ }): Promise<T.ChatAdministratorRights>;
686
+ setMyName(params?: {
687
+ name?: string;
688
+ language_code?: string;
689
+ }): Promise<true>;
690
+ getMyName(params?: {
691
+ language_code?: string;
692
+ }): Promise<{
693
+ name: string;
694
+ }>;
695
+ setMyDescription(params?: {
696
+ description?: string;
697
+ language_code?: string;
698
+ }): Promise<true>;
699
+ getMyDescription(params?: {
700
+ language_code?: string;
701
+ }): Promise<{
702
+ description: string;
703
+ }>;
704
+ setMyShortDescription(params?: {
705
+ short_description?: string;
706
+ language_code?: string;
707
+ }): Promise<true>;
708
+ getMyShortDescription(params?: {
709
+ language_code?: string;
710
+ }): Promise<{
711
+ short_description: string;
712
+ }>;
713
+ /** Bot API 9.6+ */
714
+ setMyProfilePhoto(params: {
715
+ photo: T.InputProfilePhoto;
716
+ }): Promise<true>;
717
+ /** Bot API 8.0+: change a user's emoji status, if they've granted the bot permission via a Mini App. */
718
+ setUserEmojiStatus(params: {
719
+ user_id: T.Integer;
720
+ emoji_status_custom_emoji_id?: string;
721
+ emoji_status_expiration_date?: T.Integer;
722
+ }): Promise<true>;
723
+ removeMyProfilePhoto(): Promise<true>;
724
+ /** Telegram Passport: report validation errors on a user's submitted Passport data. */
725
+ setPassportDataErrors(params: {
726
+ user_id: T.Integer;
727
+ errors: T.PassportElementError[];
728
+ }): Promise<true>;
729
+ answerCallbackQuery(params: {
730
+ callback_query_id: string;
731
+ text?: string;
732
+ show_alert?: boolean;
733
+ url?: string;
734
+ cache_time?: T.Integer;
735
+ }): Promise<true>;
736
+ /** Same endpoint as answerCallbackQuery, but for opening a game's URL from a callback query. */
737
+ answerGameQuery(params: {
738
+ callback_query_id: string;
739
+ url: string;
740
+ }): Promise<true>;
741
+ answerInlineQuery(params: {
742
+ inline_query_id: string;
743
+ results: T.InlineQueryResult[];
744
+ cache_time?: T.Integer;
745
+ is_personal?: boolean;
746
+ next_offset?: string;
747
+ button?: T.InlineQueryResultsButton;
748
+ }): Promise<true>;
749
+ /** Set the result of an interaction with a Web App and send its corresponding message to the chat. */
750
+ answerWebAppQuery(params: {
751
+ web_app_query_id: string;
752
+ result: T.InlineQueryResult;
753
+ }): Promise<T.SentWebAppMessage>;
754
+ /** Bot API 8.0+: let a Mini App hand a pre-built inline result to the user to share, without leaving the app. */
755
+ savePreparedInlineMessage(params: {
756
+ user_id: T.Integer;
757
+ result: T.InlineQueryResult;
758
+ allow_user_chats?: boolean;
759
+ allow_bot_chats?: boolean;
760
+ allow_group_chats?: boolean;
761
+ allow_channel_chats?: boolean;
762
+ }): Promise<T.PreparedInlineMessage>;
763
+ /** Bot API 9.6+: prepares a keyboard button that a Mini App can show to let the user request creating a managed bot — distinct from savePreparedInlineMessage above. */
764
+ savePreparedKeyboardButton(params: {
765
+ user_id: T.Integer;
766
+ button: T.KeyboardButtonRequestManagedBot;
767
+ }): Promise<T.PreparedInlineMessage>;
768
+ sendInvoice(params: {
769
+ chat_id: T.ChatId;
770
+ title: string;
771
+ description: string;
772
+ payload: string;
773
+ provider_token?: string;
774
+ currency: string;
775
+ prices: T.LabeledPrice[];
776
+ max_tip_amount?: T.Integer;
777
+ suggested_tip_amounts?: T.Integer[];
778
+ start_parameter?: string;
779
+ provider_data?: string;
780
+ photo_url?: string;
781
+ photo_size?: T.Integer;
782
+ photo_width?: T.Integer;
783
+ photo_height?: T.Integer;
784
+ need_name?: boolean;
785
+ need_phone_number?: boolean;
786
+ need_email?: boolean;
787
+ need_shipping_address?: boolean;
788
+ send_phone_number_to_provider?: boolean;
789
+ send_email_to_provider?: boolean;
790
+ is_flexible?: boolean;
791
+ } & CommonSendOptions): Promise<T.Message>;
792
+ createInvoiceLink(params: {
793
+ business_connection_id?: string;
794
+ title: string;
795
+ description: string;
796
+ payload: string;
797
+ provider_token?: string;
798
+ currency: string;
799
+ prices: T.LabeledPrice[];
800
+ subscription_period?: T.Integer;
801
+ max_tip_amount?: T.Integer;
802
+ suggested_tip_amounts?: T.Integer[];
803
+ provider_data?: string;
804
+ photo_url?: string;
805
+ photo_size?: T.Integer;
806
+ photo_width?: T.Integer;
807
+ photo_height?: T.Integer;
808
+ need_name?: boolean;
809
+ need_phone_number?: boolean;
810
+ need_email?: boolean;
811
+ need_shipping_address?: boolean;
812
+ send_phone_number_to_provider?: boolean;
813
+ send_email_to_provider?: boolean;
814
+ is_flexible?: boolean;
815
+ }): Promise<string>;
816
+ answerShippingQuery(params: {
817
+ shipping_query_id: string;
818
+ ok: boolean;
819
+ shipping_options?: T.ShippingOption[];
820
+ error_message?: string;
821
+ }): Promise<true>;
822
+ answerPreCheckoutQuery(params: {
823
+ pre_checkout_query_id: string;
824
+ ok: boolean;
825
+ error_message?: string;
826
+ }): Promise<true>;
827
+ getStickerSet(params: {
828
+ name: string;
829
+ }): Promise<T.StickerSet>;
830
+ getCustomEmojiStickers(params: {
831
+ custom_emoji_ids: string[];
832
+ }): Promise<T.Sticker[]>;
833
+ uploadStickerFile(params: {
834
+ user_id: T.Integer;
835
+ sticker: T.InputFile;
836
+ sticker_format: "static" | "animated" | "video";
837
+ }): Promise<T.File>;
838
+ createNewStickerSet(params: {
839
+ user_id: T.Integer;
840
+ name: string;
841
+ title: string;
842
+ stickers: T.InputSticker[];
843
+ sticker_type?: "regular" | "mask" | "custom_emoji";
844
+ needs_repainting?: boolean;
845
+ }): Promise<true>;
846
+ addStickerToSet(params: {
847
+ user_id: T.Integer;
848
+ name: string;
849
+ sticker: T.InputSticker;
850
+ }): Promise<true>;
851
+ setStickerPositionInSet(params: {
852
+ sticker: T.FileId;
853
+ position: T.Integer;
854
+ }): Promise<true>;
855
+ deleteStickerFromSet(params: {
856
+ sticker: T.FileId;
857
+ }): Promise<true>;
858
+ setStickerEmojiList(params: {
859
+ sticker: T.FileId;
860
+ emoji_list: string[];
861
+ }): Promise<true>;
862
+ setStickerKeywords(params: {
863
+ sticker: T.FileId;
864
+ keywords?: string[];
865
+ }): Promise<true>;
866
+ setStickerMaskPosition(params: {
867
+ sticker: T.FileId;
868
+ mask_position?: T.MaskPosition;
869
+ }): Promise<true>;
870
+ setStickerSetTitle(params: {
871
+ name: string;
872
+ title: string;
873
+ }): Promise<true>;
874
+ setStickerSetThumbnail(params: {
875
+ name: string;
876
+ user_id: T.Integer;
877
+ thumbnail?: T.InputFile;
878
+ format: string;
879
+ }): Promise<true>;
880
+ setCustomEmojiStickerSetThumbnail(params: {
881
+ name: string;
882
+ custom_emoji_id?: string;
883
+ }): Promise<true>;
884
+ deleteStickerSet(params: {
885
+ name: string;
886
+ }): Promise<true>;
887
+ sendGame(params: {
888
+ chat_id: T.Integer;
889
+ game_short_name: string;
890
+ } & CommonSendOptions): Promise<T.Message>;
891
+ setGameScore(params: {
892
+ user_id: T.Integer;
893
+ score: T.Integer;
894
+ force?: boolean;
895
+ chat_id?: T.Integer;
896
+ message_id?: T.Integer;
897
+ inline_message_id?: string;
898
+ }): Promise<true | T.Message>;
899
+ getGameHighScores(params: {
900
+ user_id: T.Integer;
901
+ chat_id?: T.Integer;
902
+ message_id?: T.Integer;
903
+ inline_message_id?: string;
904
+ }): Promise<T.GameHighScore[]>;
905
+ sendChecklist(params: {
906
+ business_connection_id: string;
907
+ chat_id: T.ChatId;
908
+ checklist: T.InputChecklist;
909
+ disable_notification?: boolean;
910
+ protect_content?: boolean;
911
+ message_effect_id?: string;
912
+ reply_parameters?: T.ReplyParameters;
913
+ reply_markup?: T.InlineKeyboardMarkup;
914
+ }): Promise<T.Message>;
915
+ editMessageChecklist(params: {
916
+ business_connection_id: string;
917
+ chat_id: T.ChatId;
918
+ message_id: T.Integer;
919
+ checklist: T.InputChecklist;
920
+ reply_markup?: T.InlineKeyboardMarkup;
921
+ }): Promise<T.Message>;
922
+ getBusinessConnection(params: {
923
+ business_connection_id: string;
924
+ }): Promise<T.BusinessConnection>;
925
+ readBusinessMessage(params: {
926
+ business_connection_id: string;
927
+ chat_id: T.Integer;
928
+ message_id: T.Integer;
929
+ }): Promise<true>;
930
+ deleteBusinessMessages(params: {
931
+ business_connection_id: string;
932
+ message_ids: T.Integer[];
933
+ }): Promise<true>;
934
+ setBusinessAccountName(params: {
935
+ business_connection_id: string;
936
+ first_name: string;
937
+ last_name?: string;
938
+ }): Promise<true>;
939
+ setBusinessAccountUsername(params: {
940
+ business_connection_id: string;
941
+ username?: string;
942
+ }): Promise<true>;
943
+ setBusinessAccountBio(params: {
944
+ business_connection_id: string;
945
+ bio?: string;
946
+ }): Promise<true>;
947
+ setBusinessAccountProfilePhoto(params: {
948
+ business_connection_id: string;
949
+ photo: T.InputProfilePhoto;
950
+ is_public?: boolean;
951
+ }): Promise<true>;
952
+ removeBusinessAccountProfilePhoto(params: {
953
+ business_connection_id: string;
954
+ is_public?: boolean;
955
+ }): Promise<true>;
956
+ setBusinessAccountGiftSettings(params: {
957
+ business_connection_id: string;
958
+ show_gift_button: boolean;
959
+ accepted_gift_types: T.AcceptedGiftTypes;
960
+ }): Promise<true>;
961
+ getBusinessAccountStarBalance(params: {
962
+ business_connection_id: string;
963
+ }): Promise<{
964
+ amount: T.Integer;
965
+ nanostar_amount?: T.Integer;
966
+ }>;
967
+ transferBusinessAccountStars(params: {
968
+ business_connection_id: string;
969
+ star_count: T.Integer;
970
+ }): Promise<true>;
971
+ getBusinessAccountGifts(params: {
972
+ business_connection_id: string;
973
+ exclude_unsaved?: boolean;
974
+ exclude_saved?: boolean;
975
+ exclude_unlimited?: boolean;
976
+ exclude_limited_upgradable?: boolean;
977
+ exclude_limited_non_upgradable?: boolean;
978
+ exclude_unique?: boolean;
979
+ exclude_from_blockchain?: boolean;
980
+ sort_by_price?: boolean;
981
+ offset?: string;
982
+ limit?: T.Integer;
983
+ }): Promise<{
984
+ gifts: T.OwnedGift[];
985
+ next_offset?: string;
986
+ }>;
987
+ /** Bot API 9.3+ */
988
+ getUserGifts(params: {
989
+ user_id: T.Integer;
990
+ offset?: string;
991
+ limit?: T.Integer;
992
+ }): Promise<{
993
+ gifts: T.OwnedGift[];
994
+ next_offset?: string;
995
+ }>;
996
+ getChatGifts(params: {
997
+ chat_id: T.ChatId;
998
+ offset?: string;
999
+ limit?: T.Integer;
1000
+ }): Promise<{
1001
+ gifts: T.OwnedGift[];
1002
+ next_offset?: string;
1003
+ }>;
1004
+ convertGiftToStars(params: {
1005
+ business_connection_id: string;
1006
+ owned_gift_id: string;
1007
+ }): Promise<true>;
1008
+ upgradeGift(params: {
1009
+ business_connection_id: string;
1010
+ owned_gift_id: string;
1011
+ keep_original_details?: boolean;
1012
+ star_count?: T.Integer;
1013
+ }): Promise<true>;
1014
+ transferGift(params: {
1015
+ business_connection_id: string;
1016
+ owned_gift_id: string;
1017
+ new_owner_chat_id: T.Integer;
1018
+ star_count?: T.Integer;
1019
+ }): Promise<true>;
1020
+ postStory(params: {
1021
+ business_connection_id: string;
1022
+ content: T.InputStoryContent;
1023
+ active_period: T.Integer;
1024
+ caption?: string;
1025
+ parse_mode?: T.ParseMode;
1026
+ caption_entities?: T.MessageEntity[];
1027
+ areas?: T.StoryArea[];
1028
+ post_to_chat_page?: boolean;
1029
+ protect_content?: boolean;
1030
+ }): Promise<T.Story>;
1031
+ editStory(params: {
1032
+ business_connection_id: string;
1033
+ story_id: T.Integer;
1034
+ content: T.InputStoryContent;
1035
+ caption?: string;
1036
+ parse_mode?: T.ParseMode;
1037
+ caption_entities?: T.MessageEntity[];
1038
+ areas?: T.StoryArea[];
1039
+ }): Promise<T.Story>;
1040
+ deleteStory(params: {
1041
+ business_connection_id: string;
1042
+ story_id: T.Integer;
1043
+ }): Promise<true>;
1044
+ /** Bot API 9.x+: repost a story across different business accounts the bot manages. */
1045
+ repostStory(params: {
1046
+ business_connection_id: string;
1047
+ story_id: T.Integer;
1048
+ active_period?: T.Integer;
1049
+ }): Promise<T.Story>;
1050
+ verifyUser(params: {
1051
+ user_id: T.Integer;
1052
+ custom_description?: string;
1053
+ }): Promise<true>;
1054
+ verifyChat(params: {
1055
+ chat_id: T.ChatId;
1056
+ custom_description?: string;
1057
+ }): Promise<true>;
1058
+ removeUserVerification(params: {
1059
+ user_id: T.Integer;
1060
+ }): Promise<true>;
1061
+ removeChatVerification(params: {
1062
+ chat_id: T.ChatId;
1063
+ }): Promise<true>;
1064
+ getAvailableGifts(): Promise<T.Gifts>;
1065
+ /** Send a gift to a user or channel chat (exactly one of user_id/chat_id). Can't be converted to Stars by the receiver. */
1066
+ sendGift(params: {
1067
+ gift_id: string;
1068
+ user_id?: T.Integer;
1069
+ chat_id?: T.ChatId;
1070
+ pay_for_upgrade?: boolean;
1071
+ text?: string;
1072
+ text_parse_mode?: T.ParseMode;
1073
+ text_entities?: T.MessageEntity[];
1074
+ }): Promise<true>;
1075
+ giftPremiumSubscription(params: {
1076
+ user_id: T.Integer;
1077
+ month_count: T.Integer;
1078
+ star_count: T.Integer;
1079
+ text?: string;
1080
+ text_parse_mode?: T.ParseMode;
1081
+ text_entities?: T.MessageEntity[];
1082
+ }): Promise<true>;
1083
+ getStarTransactions(params?: {
1084
+ offset?: T.Integer;
1085
+ limit?: T.Integer;
1086
+ }): Promise<T.StarTransactions>;
1087
+ /** Bot API 9.3+: the bot's own Stars balance. */
1088
+ getMyStarBalance(): Promise<T.StarAmount>;
1089
+ refundStarPayment(params: {
1090
+ user_id: T.Integer;
1091
+ telegram_payment_charge_id: string;
1092
+ }): Promise<true>;
1093
+ editUserStarSubscription(params: {
1094
+ user_id: T.Integer;
1095
+ telegram_payment_charge_id: string;
1096
+ is_canceled: boolean;
1097
+ }): Promise<true>;
1098
+ approveSuggestedPost(params: {
1099
+ chat_id: T.ChatId;
1100
+ message_id: T.Integer;
1101
+ send_date?: T.Integer;
1102
+ }): Promise<true>;
1103
+ declineSuggestedPost(params: {
1104
+ chat_id: T.ChatId;
1105
+ message_id: T.Integer;
1106
+ comment?: string;
1107
+ }): Promise<true>;
1108
+ /** Respond to a guest_message update, matching the shape of answerWebAppQuery. */
1109
+ answerGuestQuery(params: {
1110
+ guest_query_id: string;
1111
+ result: T.InlineQueryResult;
1112
+ }): Promise<T.SentWebAppMessage>;
1113
+ /** Retrieve the token of a bot your bot manages, after it's created via the newbot deep link flow. */
1114
+ getManagedBotToken(params: {
1115
+ bot_id: T.Integer;
1116
+ }): Promise<{
1117
+ token: string;
1118
+ }>;
1119
+ replaceManagedBotToken(params: {
1120
+ bot_id: T.Integer;
1121
+ }): Promise<{
1122
+ token: string;
1123
+ }>;
1124
+ /** Bot API 10.0+ */
1125
+ getManagedBotAccessSettings(params: {
1126
+ bot_id: T.Integer;
1127
+ }): Promise<T.BotAccessSettings>;
1128
+ setManagedBotAccessSettings(params: {
1129
+ bot_id: T.Integer;
1130
+ access_settings: T.BotAccessSettings;
1131
+ }): Promise<true>;
1132
+ /** Bot API 10.0+: fetch messages from a user's personal chat (e.g. to display in a Mini App). */
1133
+ getUserPersonalChatMessages(params: {
1134
+ user_id: T.Integer;
1135
+ offset?: T.Integer;
1136
+ limit?: T.Integer;
1137
+ }): Promise<T.Message[]>;
1138
+ }
1139
+ export {};