@mtkruto/node 0.78.0 → 0.78.1

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 (129) hide show
  1. package/esm/0_errors.d.ts +1 -0
  2. package/esm/0_errors.d.ts.map +1 -1
  3. package/esm/0_errors.js +5 -0
  4. package/esm/3_types.d.ts +3 -0
  5. package/esm/3_types.d.ts.map +1 -1
  6. package/esm/3_types.js +3 -0
  7. package/esm/4_constants.d.ts +1 -0
  8. package/esm/4_constants.d.ts.map +1 -1
  9. package/esm/4_constants.js +2 -0
  10. package/esm/5_client.d.ts +6 -1
  11. package/esm/5_client.d.ts.map +1 -1
  12. package/esm/5_client.js +6 -1
  13. package/esm/_dnt.polyfills.d.ts +13 -13
  14. package/esm/_dnt.polyfills.d.ts.map +1 -1
  15. package/esm/_dnt.polyfills.js +11 -11
  16. package/esm/client/0_worker_request.d.ts +26 -0
  17. package/esm/client/0_worker_request.d.ts.map +1 -0
  18. package/esm/client/0_worker_request.js +20 -0
  19. package/esm/client/0_worker_response.d.ts +39 -0
  20. package/esm/client/0_worker_response.d.ts.map +1 -0
  21. package/esm/client/0_worker_response.js +20 -0
  22. package/esm/client/1_client_generic.d.ts +1602 -0
  23. package/esm/client/1_client_generic.d.ts.map +1 -0
  24. package/esm/client/1_client_generic.js +24 -0
  25. package/esm/client/2_account_manager.d.ts +6 -1
  26. package/esm/client/2_account_manager.d.ts.map +1 -1
  27. package/esm/client/2_account_manager.js +84 -0
  28. package/esm/client/2_context.d.ts +114 -0
  29. package/esm/client/2_context.d.ts.map +1 -0
  30. package/esm/client/2_context.js +453 -0
  31. package/esm/client/2_file_manager.d.ts.map +1 -1
  32. package/esm/client/2_file_manager.js +3 -4
  33. package/esm/client/2_sign_in.d.ts +25 -0
  34. package/esm/client/2_sign_in.d.ts.map +1 -0
  35. package/esm/client/2_sign_in.js +114 -0
  36. package/esm/client/{0_filters.d.ts → 3_filters.d.ts} +6 -3
  37. package/esm/client/3_filters.d.ts.map +1 -0
  38. package/esm/client/3_filters_test.d.ts.map +1 -0
  39. package/esm/client/{1_composer.d.ts → 4_composer.d.ts} +12 -11
  40. package/esm/client/4_composer.d.ts.map +1 -0
  41. package/esm/client/{1_composer.js → 4_composer.js} +17 -7
  42. package/esm/client/4_composer_test.d.ts.map +1 -0
  43. package/esm/client/5_client.d.ts +43 -179
  44. package/esm/client/5_client.d.ts.map +1 -1
  45. package/esm/client/5_client.js +141 -595
  46. package/esm/client/5_client_dispatcher.d.ts +1660 -0
  47. package/esm/client/5_client_dispatcher.d.ts.map +1 -0
  48. package/esm/client/5_client_dispatcher.js +2141 -0
  49. package/esm/client/6_client_worker.d.ts +27 -0
  50. package/esm/client/6_client_worker.d.ts.map +1 -0
  51. package/esm/client/6_client_worker.js +51 -0
  52. package/esm/types/0_bot_token_check_result.d.ts +29 -0
  53. package/esm/types/0_bot_token_check_result.d.ts.map +1 -0
  54. package/esm/types/0_bot_token_check_result.js +20 -0
  55. package/esm/types/0_code_check_result.d.ts +37 -0
  56. package/esm/types/0_code_check_result.d.ts.map +1 -0
  57. package/esm/types/0_code_check_result.js +20 -0
  58. package/esm/types/0_password_check_result.d.ts +33 -0
  59. package/esm/types/0_password_check_result.d.ts.map +1 -0
  60. package/esm/types/0_password_check_result.js +20 -0
  61. package/package.json +1 -1
  62. package/script/0_errors.d.ts +1 -0
  63. package/script/0_errors.d.ts.map +1 -1
  64. package/script/0_errors.js +5 -0
  65. package/script/3_types.d.ts +3 -0
  66. package/script/3_types.d.ts.map +1 -1
  67. package/script/3_types.js +3 -0
  68. package/script/4_constants.d.ts +1 -0
  69. package/script/4_constants.d.ts.map +1 -1
  70. package/script/4_constants.js +3 -1
  71. package/script/5_client.d.ts +6 -1
  72. package/script/5_client.d.ts.map +1 -1
  73. package/script/5_client.js +6 -1
  74. package/script/_dnt.polyfills.d.ts +13 -13
  75. package/script/_dnt.polyfills.d.ts.map +1 -1
  76. package/script/_dnt.polyfills.js +11 -11
  77. package/script/client/0_worker_request.d.ts +26 -0
  78. package/script/client/0_worker_request.d.ts.map +1 -0
  79. package/script/client/0_worker_request.js +21 -0
  80. package/script/client/0_worker_response.d.ts +39 -0
  81. package/script/client/0_worker_response.d.ts.map +1 -0
  82. package/script/client/0_worker_response.js +21 -0
  83. package/script/client/1_client_generic.d.ts +1602 -0
  84. package/script/client/1_client_generic.d.ts.map +1 -0
  85. package/script/client/1_client_generic.js +28 -0
  86. package/script/client/2_account_manager.d.ts +6 -1
  87. package/script/client/2_account_manager.d.ts.map +1 -1
  88. package/script/client/2_account_manager.js +84 -0
  89. package/script/client/2_context.d.ts +114 -0
  90. package/script/client/2_context.d.ts.map +1 -0
  91. package/script/client/2_context.js +457 -0
  92. package/script/client/2_file_manager.d.ts.map +1 -1
  93. package/script/client/2_file_manager.js +2 -3
  94. package/script/client/2_sign_in.d.ts +25 -0
  95. package/script/client/2_sign_in.d.ts.map +1 -0
  96. package/script/client/2_sign_in.js +118 -0
  97. package/script/client/{0_filters.d.ts → 3_filters.d.ts} +6 -3
  98. package/script/client/3_filters.d.ts.map +1 -0
  99. package/script/client/3_filters_test.d.ts.map +1 -0
  100. package/script/client/{1_composer.d.ts → 4_composer.d.ts} +12 -11
  101. package/script/client/4_composer.d.ts.map +1 -0
  102. package/script/client/{1_composer.js → 4_composer.js} +17 -7
  103. package/script/client/4_composer_test.d.ts.map +1 -0
  104. package/script/client/5_client.d.ts +43 -179
  105. package/script/client/5_client.d.ts.map +1 -1
  106. package/script/client/5_client.js +140 -594
  107. package/script/client/5_client_dispatcher.d.ts +1660 -0
  108. package/script/client/5_client_dispatcher.d.ts.map +1 -0
  109. package/script/client/5_client_dispatcher.js +2178 -0
  110. package/script/client/6_client_worker.d.ts +27 -0
  111. package/script/client/6_client_worker.d.ts.map +1 -0
  112. package/script/client/6_client_worker.js +55 -0
  113. package/script/types/0_bot_token_check_result.d.ts +29 -0
  114. package/script/types/0_bot_token_check_result.d.ts.map +1 -0
  115. package/script/types/0_bot_token_check_result.js +21 -0
  116. package/script/types/0_code_check_result.d.ts +37 -0
  117. package/script/types/0_code_check_result.d.ts.map +1 -0
  118. package/script/types/0_code_check_result.js +21 -0
  119. package/script/types/0_password_check_result.d.ts +33 -0
  120. package/script/types/0_password_check_result.d.ts.map +1 -0
  121. package/script/types/0_password_check_result.js +21 -0
  122. package/esm/client/0_filters.d.ts.map +0 -1
  123. package/esm/client/0_filters_test.d.ts.map +0 -1
  124. package/esm/client/1_composer.d.ts.map +0 -1
  125. package/script/client/0_filters.d.ts.map +0 -1
  126. package/script/client/0_filters_test.d.ts.map +0 -1
  127. package/script/client/1_composer.d.ts.map +0 -1
  128. /package/esm/client/{0_filters.js → 3_filters.js} +0 -0
  129. /package/script/client/{0_filters.js → 3_filters.js} +0 -0
@@ -0,0 +1,1602 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import type { Api } from "../2_tl.js";
21
+ import type { BotCommand, BotTokenCheckResult, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatAction, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, FailedInvitation, FileSource, Gift, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputMedia, InputStoryContent, InviteLink, JoinRequest, LinkPreview, LiveStreamChannel, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageInvoice, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, MiniAppInfo, NetworkStatistics, PasswordCheckResult, Poll, PriceTag, Reaction, SavedChats, SlowModeDuration, Sticker, StickerSet, Story, Topic, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
22
+ import type { AddChatMemberParams, AddContactParams, AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, EditTopicParams, ForwardMessagesParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetSavedChatsParams, GetSavedMessagesParams, GetTranslationsParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatPhotoParams, SetEmojiStatusParams, SetLocationParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetSignaturesEnabledParams, SignInParams, StartBotParams, StartVideoChatParams, StopPollParams, UnpinMessageParams, UpdateProfileParams } from "./0_params.js";
23
+ /**
24
+ * A generic MTKruto client.
25
+ */
26
+ export declare abstract class ClientGeneric {
27
+ abstract connect(): Promise<void>;
28
+ abstract disconnect(): Promise<void>;
29
+ abstract start(params?: SignInParams): Promise<void>;
30
+ /**
31
+ * Send a user verification code.
32
+ *
33
+ * @param phoneNumber The phone number to send the code to.
34
+ * @method ac
35
+ */
36
+ abstract sendCode(phoneNumber: string): Promise<void>;
37
+ /**
38
+ * Check if a code entered by the user was the same as the verification code.
39
+ *
40
+ * @param code A code entered by the user.
41
+ * @method ac
42
+ */
43
+ abstract checkCode(code: string): Promise<CodeCheckResult>;
44
+ /**
45
+ * Get the user account password's hint.
46
+ *
47
+ * @method ac
48
+ */
49
+ abstract getPasswordHint(): Promise<string | null>;
50
+ /**
51
+ * Check whether a password entered by the user is the same as the account's one.
52
+ *
53
+ * @param password The password to check
54
+ * @returns The result of the check.
55
+ */
56
+ abstract checkPassword(password: string): Promise<PasswordCheckResult>;
57
+ /**
58
+ * Check whether a bot token is valid.
59
+ *
60
+ * @param password The password to check
61
+ * @returns The result of the check.
62
+ */
63
+ abstract checkBotToken(botToken: string): Promise<BotTokenCheckResult>;
64
+ /**
65
+ * Signs in using the provided parameters if not already signed in.
66
+ * If no parameters are provided, the credentials will be prompted in runtime.
67
+ *
68
+ * Notes:
69
+ * 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
70
+ * 3. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
71
+ */
72
+ abstract signIn(params?: SignInParams): Promise<void>;
73
+ abstract signOut(): Promise<void>;
74
+ abstract exportAuthString(): Promise<string>;
75
+ abstract importAuthString(authString: string): Promise<void>;
76
+ /**
77
+ * Get a chat's inputPeer. Useful when calling API functions directly.
78
+ *
79
+ * @param id The identifier of a chat.
80
+ */
81
+ abstract getInputPeer(id: ID): Promise<Api.InputPeer>;
82
+ /**
83
+ * Get a channel or a supergroup's inputChannel. Useful when calling API functions directly.
84
+ *
85
+ * @param id The identifier of the channel or the supergroup.
86
+ */
87
+ abstract getInputChannel(id: ID): Promise<Api.inputChannel | Api.inputChannelFromMessage>;
88
+ /**
89
+ * Get a user's inputUser. Useful when calling API functions directly.
90
+ *
91
+ * @param id The identifier of the user.
92
+ */
93
+ abstract getInputUser(id: ID): Promise<Api.inputUserSelf | Api.inputUser | Api.inputUserFromMessage>;
94
+ /**
95
+ * Get information on the currently authorized user.
96
+ *
97
+ * @method ac
98
+ * @returns Information on the currently authorized user.
99
+ */
100
+ abstract getMe(): Promise<User>;
101
+ /**
102
+ * Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
103
+ *
104
+ * @method ac
105
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
106
+ * @param username The username to show.
107
+ */
108
+ abstract showUsername(id: ID, username: string): Promise<void>;
109
+ /**
110
+ * Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
111
+ *
112
+ * @method ac
113
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
114
+ * @param username The username to hide.
115
+ */
116
+ abstract hideUsername(id: ID, username: string): Promise<void>;
117
+ /**
118
+ * Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
119
+ *
120
+ * @method ac
121
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
122
+ * @param order The new order to use.
123
+ * @returns Whether the order was changed.
124
+ */
125
+ abstract reorderUsernames(id: ID, order: string[]): Promise<boolean>;
126
+ /**
127
+ * Hide all usernames from a supergroup or a channel's profile. User-only.
128
+ *
129
+ * @method ac
130
+ * @param id A supergroup ID or a channel ID.
131
+ * @returns Whether any username was hidden.
132
+ */
133
+ abstract hideUsernames(id: ID): Promise<boolean>;
134
+ /**
135
+ * Get a business connection. Bot-only.
136
+ *
137
+ * @method ac
138
+ * @param id The identifier of the business connection.
139
+ * @cache
140
+ */
141
+ abstract getBusinessConnection(id: string): Promise<BusinessConnection>;
142
+ /**
143
+ * Set the current account's online status. User-only.
144
+ *
145
+ * @method ac
146
+ * @param online The new online status.
147
+ */
148
+ abstract setOnline(online: boolean): Promise<void>;
149
+ /**
150
+ * Set the current account's emoji status. User-only.
151
+ *
152
+ * @method ac
153
+ * @param id The identifier of the emoji to be used as the new status.
154
+ */
155
+ abstract setEmojiStatus(id: string, params?: SetEmojiStatusParams): Promise<void>;
156
+ /**
157
+ * Set the emoji status of a bot's user. Bot-only.
158
+ *
159
+ * @method ac
160
+ * @param userId The identifier of a user of the bot.
161
+ * @param id The identifier of the emoji to be used as the new status.
162
+ */
163
+ abstract setUserEmojiStatus(userId: ID, id: string, params?: SetEmojiStatusParams): Promise<void>;
164
+ /**
165
+ * Update the profile of the current user. At least one parameter must be specified. User-only.
166
+ *
167
+ * @method ac
168
+ */
169
+ abstract updateProfile(params?: UpdateProfileParams): Promise<void>;
170
+ /**
171
+ * Set the birthday of the current user. User-only.
172
+ *
173
+ * @method ac
174
+ */
175
+ abstract setBirthday(params?: SetBirthdayParams): Promise<void>;
176
+ /**
177
+ * Set the personal channel of the current user. User-only.
178
+ *
179
+ * @method ac
180
+ */
181
+ abstract setPersonalChannel(params?: SetPersonalChannelParams): Promise<void>;
182
+ /**
183
+ * Set the name color of the current user. User-only.
184
+ *
185
+ * @method ac
186
+ * @param color The identifier of the color to set.
187
+ */
188
+ abstract setNameColor(color: number, params?: SetNameColorParams): Promise<void>;
189
+ /**
190
+ * Set the profile color of the current user. User-only.
191
+ *
192
+ * @method ac
193
+ * @param color The identifier of the color to set.
194
+ */
195
+ abstract setProfileColor(color: number, params?: SetProfileColorParams): Promise<void>;
196
+ /**
197
+ * Set the location of the current user. User-only.
198
+ *
199
+ * @method ac
200
+ */
201
+ abstract setLocation(params?: SetLocationParams): Promise<void>;
202
+ /**
203
+ * Send a text message.
204
+ *
205
+ * @method ms
206
+ * @param chatId The identifier of a chat to send the message to.
207
+ * @param text The message's text.
208
+ * @returns The sent text message.
209
+ */
210
+ abstract sendMessage(chatId: ID, text: string, params?: SendMessageParams): Promise<MessageText>;
211
+ /**
212
+ * Send a photo.
213
+ *
214
+ * @method ms
215
+ * @param chatId The identifier of a chat to send the photo to.
216
+ * @param photo The photo to send.
217
+ * @returns The sent photo.
218
+ */
219
+ abstract sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
220
+ /**
221
+ * Send a document.
222
+ *
223
+ * @method ms
224
+ * @param chatId The identifier of a chat to send the document to.
225
+ * @param document The document to send.
226
+ * @returns The sent document.
227
+ */
228
+ abstract sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
229
+ /**
230
+ * Send a sticker.
231
+ *
232
+ * @method ms
233
+ * @param chatId The identifier of a chat to send the sticker to.
234
+ * @param document The sticker to send.
235
+ * @returns The sent sticker.
236
+ */
237
+ abstract sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
238
+ /**
239
+ * Send a video.
240
+ *
241
+ * @method ms
242
+ * @param chatId The identifier of a chat to send the video to.
243
+ * @param video The video to send.
244
+ * @returns The sent video.
245
+ */
246
+ abstract sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
247
+ /**
248
+ * Send an animation.
249
+ *
250
+ * @method ms
251
+ * @param chatId The identifier of a chat to send the animation to.
252
+ * @param animation The animation to send.
253
+ * @returns The sent animation.
254
+ */
255
+ abstract sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
256
+ /**
257
+ * Send a voice message.
258
+ *
259
+ * @method ms
260
+ * @param chatId The identifier of a chat to send the voice message to.
261
+ * @param voice The voice to send.
262
+ * @returns The sent voice message.
263
+ */
264
+ abstract sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
265
+ /**
266
+ * Send an audio file.
267
+ *
268
+ * @method ms
269
+ * @param chatId The identifier of a chat to send the audio file to.
270
+ * @param audio The audio to send.
271
+ * @returns The sent audio filr.
272
+ */
273
+ abstract sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
274
+ /**
275
+ * Send a media group.
276
+ *
277
+ * @method ms
278
+ * @param chatId The identifier of a chat to send the media group to.
279
+ * @param media The media to include in the media group. Animations are not allowed. All of them must be of the same media type, but an exception is that photos and videos can be mixed.
280
+ * @returns The sent messages.
281
+ */
282
+ abstract sendMediaGroup(chatId: ID, media: InputMedia[], params?: SendMediaGroupParams): Promise<Message[]>;
283
+ /**
284
+ * Send a video note.
285
+ *
286
+ * @method ms
287
+ * @param chatId The identifier of a chat to send the video note to.
288
+ * @param videoNote The video note to send.
289
+ * @returns The sent video note.
290
+ */
291
+ abstract sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
292
+ /**
293
+ * Send a location.
294
+ *
295
+ * @method ms
296
+ * @param chatId The identifier of a chat to send the location to.
297
+ * @param latitude The location's latitude.
298
+ * @param longitude The location's longitude.
299
+ * @returns The sent location.
300
+ */
301
+ abstract sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
302
+ /**
303
+ * Send a contact.
304
+ *
305
+ * @method ms
306
+ * @param chatId The identifier of a chat to send the contact to.
307
+ * @param firstName The contact's first name.
308
+ * @param number The contact's phone number.
309
+ * @returns The sent contact.
310
+ */
311
+ abstract sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
312
+ /**
313
+ * Send a dice.
314
+ *
315
+ * @method ms
316
+ * @param chatId The identifier of a chat to send the dice to.
317
+ * @returns The sent dice.
318
+ */
319
+ abstract sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
320
+ /**
321
+ * Send a venue.
322
+ *
323
+ * @method ms
324
+ * @param chatId The identifier of a chat to send the venue to.
325
+ * @param latitude The latitude of the venue.
326
+ * @param longitude The longitude of the venue.
327
+ * @param title The title of the venue.
328
+ * @param address The written address of the venue.
329
+ * @returns The sent venue.
330
+ */
331
+ abstract sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
332
+ /**
333
+ * Send a poll.
334
+ *
335
+ * @method ms
336
+ * @param chatId The identifier of a chat to send the poll to.
337
+ * @param question The poll's question.
338
+ * @param options The poll's options.
339
+ * @returns The sent poll.
340
+ */
341
+ abstract sendPoll(chatId: ID, question: string, options: string[], params?: SendPollParams): Promise<MessagePoll>;
342
+ /**
343
+ * Send an invoice. Bot-only.
344
+ *
345
+ * @method ms
346
+ * @param chatId The identifier of a chat to send the invoice to.
347
+ * @param title The invoice's title.
348
+ * @param description The invoice's description.
349
+ * @param payload The invoice's payload.
350
+ * @param currency The invoice's currency.
351
+ * @param prices The invoice's price tags.
352
+ * @returns The sent invoice.
353
+ */
354
+ abstract sendInvoice(chatId: ID, title: string, description: string, payload: string, currency: string, prices: PriceTag[], params?: SendInvoiceParams): Promise<MessageInvoice>;
355
+ /**
356
+ * Edit a message's text.
357
+ *
358
+ * @method ms
359
+ * @param chatId The identifier of the chat which the message belongs to.
360
+ * @param messageId The identifier of the message.
361
+ * @param text The new text of the message.
362
+ * @returns The edited text message.
363
+ */
364
+ abstract editMessageText(chatId: ID, messageId: number, text: string, params?: EditMessageTextParams): Promise<MessageText>;
365
+ /**
366
+ * Edit a message's caption.
367
+ *
368
+ * @method ms
369
+ * @param chatId The identifier of the chat which the message belongs to.
370
+ * @param messageId The identifier of the message.
371
+ * @param text The new caption of the message.
372
+ * @returns The edited message.
373
+ */
374
+ abstract editMessageCaption(chatId: ID, messageId: number, params?: EditMessageCaptionParams): Promise<Message>;
375
+ /**
376
+ * Edit a message's media.
377
+ *
378
+ * @method ms
379
+ * @param chatId The identifier of the chat which the message belongs to.
380
+ * @param messageId The identifier of the message.
381
+ * @param media The new media of the message.
382
+ * @returns The edited message.
383
+ */
384
+ abstract editMessageMedia(chatId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise<Message>;
385
+ /**
386
+ * Edit an inline message's media.
387
+ *
388
+ * @method ms
389
+ * @param inlineMessageId The identifier of the inline message.
390
+ * @param media The new media of the message.
391
+ */
392
+ abstract editInlineMessageMedia(inlineMessageId: string, media: InputMedia, params?: EditInlineMessageMediaParams): Promise<void>;
393
+ /**
394
+ * Edit an inline message's text. Bot-only.
395
+ *
396
+ * @method ms
397
+ * @param inlineMessageId The identifier of the inline message.
398
+ * @param text The new text of the message.
399
+ */
400
+ abstract editInlineMessageText(inlineMessageId: string, text: string, params?: EditInlineMessageTextParams): Promise<void>;
401
+ /**
402
+ * Edit an inline message's caption. Bot-only.
403
+ *
404
+ * @method ms
405
+ * @param inlineMessageId The identifier of the inline message.
406
+ */
407
+ abstract editInlineMessageCaption(inlineMessageId: string, params?: EditInlineMessageCaptionParams): Promise<void>;
408
+ /**
409
+ * Edit a message's reply markup.
410
+ *
411
+ * @method ms
412
+ * @param chatId The identifier of the chat which the message belongs to.
413
+ * @param messageId The identifier of the message.
414
+ * @returns The edited message.
415
+ */
416
+ abstract editMessageReplyMarkup(chatId: ID, messageId: number, params?: EditMessageReplyMarkupParams): Promise<Message>;
417
+ /**
418
+ * Edit an inline message's reply markup. Bot-only.
419
+ *
420
+ * @method ms
421
+ * @param inlineMessageId The identifier of the inline message.
422
+ */
423
+ abstract editInlineMessageReplyMarkup(inlineMessageId: string, params?: EditMessageReplyMarkupParams): Promise<void>;
424
+ /**
425
+ * Edit a message's live location.
426
+ *
427
+ * @method ms
428
+ * @param chatId The identifier of the chat which the message belongs to.
429
+ * @param messageId The identifier of the message.
430
+ * @param latitude The new latitude.
431
+ * @param longitude The new longitude.
432
+ * @returns The edited location message.
433
+ */
434
+ abstract editMessageLiveLocation(chatId: ID, messageId: number, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise<MessageLocation>;
435
+ /**
436
+ * Edit an inline message's live location. Bot-only.
437
+ *
438
+ * @method ms
439
+ * @param inlineMessageId The identifier of the inline message.
440
+ * @param latitude The new latitude.
441
+ * @param longitude The new longitude.
442
+ * @returns The edited location message.
443
+ */
444
+ abstract editInlineMessageLiveLocation(inlineMessageId: string, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise<void>;
445
+ /**
446
+ * Retrieve multiple messages.
447
+ *
448
+ * @method ms
449
+ * @param chatId The identifier of a chat to retrieve the messages from.
450
+ * @param messageIds The identifiers of the messages to retrieve.
451
+ * @example ```ts
452
+ * const message = await client.getMessages("@MTKruto", [210, 212]): Promise<void>;
453
+ * ```
454
+ * @returns The retrieved messages.
455
+ * @cache
456
+ */
457
+ abstract getMessages(chatId: ID, messageIds: number[]): Promise<Message[]>;
458
+ /**
459
+ * Retrieve a single message.
460
+ *
461
+ * @method ms
462
+ * @param chatId The identifier of a chat.
463
+ * @param messageId The identifier of the message to retrieve.
464
+ * @example ```ts
465
+ * const message = await client.getMessage("@MTKruto", 212): Promise<void>;
466
+ * ```
467
+ * @returns The retrieved message.
468
+ * @cache
469
+ */
470
+ abstract getMessage(chatId: ID, messageId: number): Promise<Message | null>;
471
+ /**
472
+ * Retrieve a message using its link.
473
+ *
474
+ * @method ms
475
+ * @param link A message link.
476
+ * @example ```ts
477
+ * const message = await client.resolveMessageLink("https://t.me/MTKruto/212"): Promise<void>;
478
+ * ```
479
+ * @returns The message that was linked to.
480
+ */
481
+ abstract resolveMessageLink(link: string): Promise<Message | null>;
482
+ /**
483
+ * Delete multiple messages.
484
+ *
485
+ * @method ms
486
+ * @param chatId The identifier of the chat which the message belongs to.
487
+ * @param messageIds The identifiers of the messages to delete.
488
+ */
489
+ abstract deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
490
+ /**
491
+ * Delete a single message.
492
+ *
493
+ * @method ms
494
+ * @param chatId The identifier of the chat which the message belongs to.
495
+ * @param messageId The identifier of the message to delete.
496
+ */
497
+ abstract deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise<void>;
498
+ /**
499
+ * Delete all messages sent by a specific member of a chat. User-only.
500
+ *
501
+ * @method ms
502
+ * @param chatId The identifier of a chat. Must be a supergroup.
503
+ * @param memberId The identifier of the member.
504
+ */
505
+ abstract deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
506
+ /**
507
+ * Delete multiple scheduled messages.
508
+ *
509
+ * @method ms
510
+ * @param chatId The identifier of a chat.
511
+ * @param messageIds The identifiers of the scheduled messages to delete.
512
+ */
513
+ abstract deleteScheduledMessages(chatId: ID, messageIds: number[]): Promise<void>;
514
+ /**
515
+ * Delete a scheduled message.
516
+ *
517
+ * @method ms
518
+ * @param chatId The identifier of a chat.
519
+ * @param messageId The identifier of the scheduled message to delete.
520
+ */
521
+ abstract deleteScheduledMessage(chatId: ID, messageId: number): Promise<void>;
522
+ /**
523
+ * Send multiple scheduled messages before their schedule.
524
+ *
525
+ * @method ms
526
+ * @param chatId The identifier of a chat.
527
+ * @param messageIds The identifiers of the scheduled messages to send.
528
+ */
529
+ abstract sendScheduledMessages(chatId: ID, messageIds: number[]): Promise<Message[]>;
530
+ /**
531
+ * Send a scheduled message before its schedule.
532
+ *
533
+ * @method ms
534
+ * @param chatId The identifier of a chat.
535
+ * @param messageId The identifier of the scheduled message to send.
536
+ */
537
+ abstract sendScheduledMessage(chatId: ID, messageId: number): Promise<Message>;
538
+ /**
539
+ * Pin a message in a chat.
540
+ *
541
+ * @method ms
542
+ * @param chatId The identifier of a chat.
543
+ * @param messageId The identifier of the message.
544
+ */
545
+ abstract pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
546
+ /**
547
+ * Unpin a pinned message.
548
+ *
549
+ * @method ms
550
+ * @param chatId The identifier of a chat.
551
+ * @param messageId The identifier of the message.
552
+ */
553
+ abstract unpinMessage(chatId: ID, messageId: number, params?: UnpinMessageParams): Promise<void>;
554
+ /**
555
+ * Unpin all pinned messages.
556
+ *
557
+ * @method ms
558
+ * @param chatId The identifier of a chat.
559
+ */
560
+ abstract unpinMessages(chatId: ID): Promise<void>;
561
+ /**
562
+ * Forward multiple messages.
563
+ *
564
+ * @method ms
565
+ * @param from The identifier of a chat to forward the messages from.
566
+ * @param to The identifier of a chat to forward the messages to.
567
+ * @param messageIds The identifiers of the messages to forward.
568
+ * @returns The forwarded messages.
569
+ */
570
+ abstract forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise<Message[]>;
571
+ /**
572
+ * Forward a single message.
573
+ *
574
+ * @method ms
575
+ * @param from The identifier of a chat to forward the message from.
576
+ * @param to The identifier of a chat to forward the message to.
577
+ * @param messageId The identifier of the message to forward.
578
+ * @returns The forwarded message.
579
+ */
580
+ abstract forwardMessage(from: ID, to: ID, messageId: number, params?: ForwardMessagesParams): Promise<Message>;
581
+ /**
582
+ * Stop a poll.
583
+ *
584
+ * @method ms
585
+ * @param chatId The chat that includes the poll.
586
+ * @param messageId The idenfifier of the poll's message.
587
+ * @returns The new state of the poll.
588
+ */
589
+ abstract stopPoll(chatId: ID, messageId: number, params?: StopPollParams): Promise<Poll>;
590
+ /**
591
+ * Send a chat action.
592
+ *
593
+ * @method ms
594
+ * @param chatId The identifier of a chat to send the chat action to.
595
+ * @param action The chat action.
596
+ * @param messageThreadId The thread to send the chat action to.
597
+ */
598
+ abstract sendChatAction(chatId: ID, action: ChatAction, params?: {
599
+ messageThreadId?: number;
600
+ }): Promise<void>;
601
+ /**
602
+ * Search for messages. User-only.
603
+ *
604
+ * @method ms
605
+ */
606
+ abstract searchMessages(params?: SearchMessagesParams): Promise<Message[]>;
607
+ /**
608
+ * Mark messages as read. User-only.
609
+ *
610
+ * @method ms
611
+ * @param chatId The identifier of the chat which the messages belong to.
612
+ * @param untilMessageId The identifier of the message that will be marked as read, along with any other unread messages before it.
613
+ */
614
+ abstract readMessages(chatId: ID, untilMessageId: number): Promise<void>;
615
+ /**
616
+ * Start a bot. User-only.
617
+ *
618
+ * @method ms
619
+ * @param botId The identifier of the bot to start.
620
+ * @returns The start message.
621
+ */
622
+ abstract startBot(botId: number, params?: StartBotParams): Promise<Message>;
623
+ /**
624
+ * Transcribe a voice message. User-only.
625
+ *
626
+ * @method ms
627
+ * @param chatId The identifier of the chat which the message belongs to.
628
+ * @param messageId The identifier of the message.
629
+ * @cache
630
+ */
631
+ abstract transcribeVoice(chatId: ID, messageId: number): Promise<VoiceTranscription>;
632
+ /**
633
+ * Get a sticker set.
634
+ *
635
+ * @method ms
636
+ * @param name The name of the sticker set or its link.
637
+ */
638
+ abstract getStickerSet(name: string): Promise<StickerSet>;
639
+ abstract getLinkPreview(text: string, params?: GetLinkPreviewParams): Promise<LinkPreview | null>;
640
+ /**
641
+ * Open a mini app. User-only.
642
+ *
643
+ * @method ms
644
+ * @param botId The identifier of a bot with the mini app.
645
+ * @param chatId The identifier of the chat from which the mini app is opened.
646
+ * @cache
647
+ */
648
+ abstract openMiniApp(botId: ID, chatId: ID, params?: OpenMiniAppParams): Promise<MiniAppInfo>;
649
+ /**
650
+ * Get a progress ID that can be passed to relevant send* methods to receive upload progress updates for them.
651
+ *
652
+ * @method ms
653
+ * @cache
654
+ */
655
+ abstract getProgressId(): Promise<string>;
656
+ /**
657
+ * Get messages saved from a specific chat.
658
+ *
659
+ * @method ms
660
+ * @param chatId The identifier of a chat.
661
+ */
662
+ abstract getSavedMessages(chatId: ID, params?: GetSavedMessagesParams): Promise<Message[]>;
663
+ /**
664
+ * Get a list of saved chats.
665
+ *
666
+ * @method ms
667
+ */
668
+ abstract getSavedChats(params?: GetSavedChatsParams): Promise<SavedChats>;
669
+ /**
670
+ * Get a list of reactions made to a message. User-only.
671
+ *
672
+ * @param chatId The identifier of a chat.
673
+ * @param messageId The identifier of the message.
674
+ * @method ms
675
+ */
676
+ abstract getMessageReactions(chatId: ID, messageId: number, params?: GetMessageReactionsParams): Promise<MessageReactionList>;
677
+ /**
678
+ * Cast a vote. User-only.
679
+ *
680
+ * @method pl
681
+ * @param chatId The identifier of the chat that includes the poll.
682
+ * @param messageId The identifier of the message that includes the poll.
683
+ * @param optionIndexes The indexes of the options to cast for.
684
+ */
685
+ abstract vote(chatId: ID, messageId: number, optionIndexes: number[]): Promise<void>;
686
+ /**
687
+ * Retract a vote. User-only.
688
+ *
689
+ * @method pl
690
+ * @param chatId The identifier of the chat that includes the poll.
691
+ * @param messageId The identifier of the message that includes the poll.
692
+ */
693
+ abstract retractVote(chatId: ID, messageId: number): Promise<void>;
694
+ /**
695
+ * Download a chunk of a file.
696
+ *
697
+ * @method fs
698
+ * @param fileId The identifier of a file.
699
+ * @example ```ts
700
+ * const chunk = await client.downloadChunk(fileId, { chunkSize: 256 * 1024 });
701
+ * ```
702
+ * @returns The downloaded chunk.
703
+ * @cache file
704
+ */
705
+ abstract downloadChunk(fileId: string, params?: DownloadParams): Promise<Uint8Array>;
706
+ /**
707
+ * Download a file.
708
+ *
709
+ * @method fs
710
+ * @param fileId The identifier of the file to download.
711
+ * @example ```ts
712
+ * for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
713
+ * await outFile.write(chunk): Promise<void>;
714
+ * }
715
+ * ```
716
+ * @returns A generator yielding the contents of the file.
717
+ * @cache file
718
+ */
719
+ abstract download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
720
+ /**
721
+ * Get custom emoji documents for download.
722
+ *
723
+ * @method fs
724
+ * @param id Identifier of one or more of custom emojis.
725
+ * @returns The custom emoji documents.
726
+ * @cache
727
+ */
728
+ abstract getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
729
+ /**
730
+ * Get chats from a chat list. User-only.
731
+ *
732
+ * @method ch
733
+ */
734
+ abstract getChats(params?: GetChatsParams): Promise<ChatListItem[]>;
735
+ /**
736
+ * Get a chat.
737
+ *
738
+ * @method ch
739
+ * @cache
740
+ */
741
+ abstract getChat(chatId: ID): Promise<Chat>;
742
+ /**
743
+ * Get chat history. User-only.
744
+ *
745
+ * @method ch
746
+ * @param chatId The identifier of a chat.
747
+ */
748
+ abstract getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
749
+ /**
750
+ * Set a chat's available reactions. User-only.
751
+ *
752
+ * @method ch
753
+ * @param chatId The identifier of a chat.
754
+ * @param availableReactions The new available reactions.
755
+ */
756
+ abstract setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
757
+ /**
758
+ * Set a chat's photo.
759
+ *
760
+ * @method ch
761
+ * @param chatId The identifier of a chat.
762
+ * @param photo A photo to set as the chat's photo.
763
+ */
764
+ abstract setChatPhoto(chatId: ID, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
765
+ /**
766
+ * Delete a chat's photo.
767
+ *
768
+ * @method ch
769
+ * @param chatId The identifier of a chat.
770
+ */
771
+ abstract deleteChatPhoto(chatId: ID): Promise<void>;
772
+ /**
773
+ * Ban a member from a chat.
774
+ *
775
+ * @method ch
776
+ * @param chatId The identifier of a chat.
777
+ * @param memberId The identifier of the member.
778
+ */
779
+ abstract banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
780
+ /**
781
+ * Unban a member from a chat.
782
+ *
783
+ * @method ch
784
+ * @param chatId The identifier of a chat. Must be a supergroup.
785
+ * @param memberId The identifier of the member.
786
+ */
787
+ abstract unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
788
+ /**
789
+ * Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
790
+ *
791
+ * @method ch
792
+ * @param chatId The identifier of a chat. Must be a supergroup.
793
+ * @param memberId The identifier of the member.
794
+ */
795
+ abstract kickChatMember(chatId: ID, memberId: ID): Promise<void>;
796
+ /**
797
+ * Set the rights of a chat member.
798
+ *
799
+ * @method ch
800
+ * @param chatId The identifier of a chat. Must be a supergroup.
801
+ * @param memberId The identifier of the member.
802
+ */
803
+ abstract setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
804
+ /**
805
+ * Get the administrators of a chat.
806
+ *
807
+ * @method ch
808
+ * @param chatId The identifier of a chat.
809
+ * @returns The chat's administrators.
810
+ */
811
+ abstract getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
812
+ /**
813
+ * Enable join requests in a chat. User-only.
814
+ *
815
+ * @method ch
816
+ * @param chatId The identifier of a chat. Must be a channel or a supergroup.
817
+ */
818
+ abstract enableJoinRequests(chatId: ID): Promise<void>;
819
+ /**
820
+ * Disable join requests in a chat. User-only.
821
+ *
822
+ * @method ch
823
+ * @param chatId The identifier of a chat. Must be a channel or a supergroup.
824
+ */
825
+ abstract disableJoinRequests(chatId: ID): Promise<void>;
826
+ /**
827
+ * Get inactive chats. User-only.
828
+ *
829
+ * @method ch
830
+ * @retuns A list of inactive chats the current user is member of.
831
+ */
832
+ abstract getInactiveChats(): Promise<InactiveChat[]>;
833
+ /**
834
+ * Get the invite links created for a chat. User-only.
835
+ *
836
+ * @method ch
837
+ * @param chatId The identifier of a chat.
838
+ * @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
839
+ */
840
+ abstract getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
841
+ /**
842
+ * Join a chat. User-only.
843
+ *
844
+ * @method ch
845
+ * @param chatId The identifier of a chat.
846
+ */
847
+ abstract joinChat(chatId: ID): Promise<void>;
848
+ /**
849
+ * Leave a chat.
850
+ *
851
+ * @method ch
852
+ * @param chatId The identifier of a chat.
853
+ */
854
+ abstract leaveChat(chatId: ID): Promise<void>;
855
+ /**
856
+ * Get information on a user's chat membership.
857
+ *
858
+ * @method ch
859
+ * @param chatId The identifier of a chat.
860
+ * @param userId The identifier of the user.
861
+ */
862
+ abstract getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
863
+ /**
864
+ * Get the members of a chat.
865
+ *
866
+ * @method ch
867
+ * @param chatId The identifier of a chat.
868
+ */
869
+ abstract getChatMembers(chatId: ID, params?: GetChatMembersParams): Promise<ChatMember[]>;
870
+ /**
871
+ * Set a chat's sticker set.
872
+ *
873
+ * @method ch
874
+ * @param chatId The identifier of a chat. Must be a supergroup.
875
+ * @param setName The name of the set.
876
+ */
877
+ abstract setChatStickerSet(chatId: ID, setName: string): Promise<void>;
878
+ /**
879
+ * Delete a chat's sticker set.
880
+ *
881
+ * @method ch
882
+ * @param chatId The identifier of a chat. Must be a supergroup.
883
+ */
884
+ abstract deleteChatStickerSet(chatId: ID): Promise<void>;
885
+ /**
886
+ * Set the number of boosts required to circument a chat's default restrictions. User-only.
887
+ *
888
+ * @method ch
889
+ * @param chatId The identifier of a chat.
890
+ * @param boosts The number of boosts required to circumvent its restrictions.
891
+ */
892
+ abstract setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
893
+ /**
894
+ * Create an invite link.
895
+ *
896
+ * @method ch
897
+ * @param chatId The identifier of a chat to create the invite link for.
898
+ * @returns The newly created invite link.
899
+ */
900
+ abstract createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
901
+ /**
902
+ * Approve a join request.
903
+ *
904
+ * @method ch
905
+ * @param chatId The identifier of a chat with the join request.
906
+ * @param userId The user who made the join request.
907
+ */
908
+ abstract approveJoinRequest(chatId: ID, userId: ID): Promise<void>;
909
+ /**
910
+ * Decline a join request.
911
+ *
912
+ * @method ch
913
+ * @param chatId The identifier of a chat with the join request.
914
+ * @param userId The user who made the join request.
915
+ */
916
+ abstract declineJoinRequest(chatId: ID, userId: ID): Promise<void>;
917
+ /**
918
+ * Approve all join requests. User-only.
919
+ *
920
+ * @method ch
921
+ * @param chatId The identifier of a chat with the join requests.
922
+ */
923
+ abstract approveJoinRequests(chatId: ID, params?: ApproveJoinRequestsParams): Promise<void>;
924
+ /**
925
+ * Decline all join requests. User-only.
926
+ *
927
+ * @method ch
928
+ * @param chatId The identifier of a chat with the join requests.
929
+ */
930
+ abstract declineJoinRequests(chatId: ID, params?: DeclineJoinRequestsParams): Promise<void>;
931
+ /**
932
+ * Get pending join requests in a chat. User-only.
933
+ *
934
+ * @method ch
935
+ * @param chatId The identifier of a chat with the join requests.
936
+ */
937
+ abstract getJoinRequests(chatId: ID, params?: GetJoinRequestsParams): Promise<JoinRequest[]>;
938
+ /**
939
+ * Add a single user to a chat.
940
+ *
941
+ * @method ch
942
+ * @param chatId The identifier of a chat to add the user to.
943
+ * @param userId The identifier of the user to add to the chat.
944
+ * @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
945
+ */
946
+ abstract addChatMember(chatId: ID, userId: ID, params?: AddChatMemberParams): Promise<FailedInvitation[]>;
947
+ /**
948
+ * Add multiple users at once to a channel or a supergroup.
949
+ *
950
+ * @method ch
951
+ * @param chatId The identifier of the channel or supergroup to add the users to.
952
+ * @param userId The identifiers of the users to add to the channel or supergroup.
953
+ * @returns An array of FailedInvitation that has at most a length that is the same as that of the parameter userIds. If empty, it means that all the provided users were added.
954
+ */
955
+ abstract addChatMembers(chatId: ID, userIds: ID[]): Promise<FailedInvitation[]>;
956
+ /**
957
+ * Open a chat.
958
+ *
959
+ * @method ch
960
+ * @param chatId The identifier of a chat to open.
961
+ */
962
+ abstract openChat(chatId: ID, params?: OpenChatParams): Promise<void>;
963
+ /**
964
+ * Close a chat previously opened by openChat.
965
+ *
966
+ * @method ch
967
+ * @param chatId The identifier of a chat to close.
968
+ */
969
+ abstract closeChat(chatId: ID): Promise<void>;
970
+ /**
971
+ * Create a group. User-only.
972
+ *
973
+ * @method ch
974
+ * @param title The title of the group.
975
+ * @returns The created group.
976
+ */
977
+ abstract createGroup(title: string, params?: CreateGroupParams): Promise<ChatPGroup>;
978
+ /**
979
+ * Create a supergroup. User-only.
980
+ *
981
+ * @method ch
982
+ * @param title The title of the supergroup.
983
+ * @returns The created supergroup.
984
+ */
985
+ abstract createSupergroup(title: string, params?: CreateSupergroupParams): Promise<ChatPSupergroup>;
986
+ /**
987
+ * Create a channel. User-only.
988
+ *
989
+ * @method ch
990
+ * @param title The title of the channel.
991
+ * @returns The created channel.
992
+ */
993
+ abstract createChannel(title: string, params?: CreateChannelParams): Promise<ChatPChannel>;
994
+ /**
995
+ * Set the time to live of the messages of a chat. User-only.
996
+ *
997
+ * @method ch
998
+ * @param chatId The identifier of a chat.
999
+ * @param messageTtl The time to live of the messages in seconds.
1000
+ */
1001
+ abstract setMessageTtl(chatId: ID, messageTtl: number): Promise<void>;
1002
+ /**
1003
+ * Archive multiple chats. User-only.
1004
+ *
1005
+ * @method ch
1006
+ * @param chatIds The identifiers of the chats to archive.
1007
+ */
1008
+ abstract archiveChats(chatIds: ID[]): Promise<void>;
1009
+ /**
1010
+ * Archive a single chat. User-only.
1011
+ *
1012
+ * @method ch
1013
+ * @param chatId The identifier of a chat.
1014
+ */
1015
+ abstract archiveChat(chatId: ID): Promise<void>;
1016
+ /**
1017
+ * Unarchive multiple chats. User-only.
1018
+ *
1019
+ * @method ch
1020
+ * @param chatIds The identifiers of the chats to unarchive.
1021
+ */
1022
+ abstract unarchiveChats(chatIds: ID[]): Promise<void>;
1023
+ /**
1024
+ * Unarchive a single chat. User-only.
1025
+ *
1026
+ * @method ch
1027
+ * @param chatId The identifier of a chat.
1028
+ */
1029
+ abstract unarchiveChat(chatId: ID): Promise<void>;
1030
+ /**
1031
+ * Get common chats between a user and the current one. User-only.
1032
+ *
1033
+ * @method ch
1034
+ * @param userId The identifier of the user to get the common chats with them.
1035
+ */
1036
+ abstract getCommonChats(userId: ID, params?: GetCommonChatsParams): Promise<ChatP[]>;
1037
+ /**
1038
+ * Get the settings of a chat. User-only.
1039
+ *
1040
+ * @method ch
1041
+ * @param chatId The identifier of a chat.
1042
+ */
1043
+ abstract getChatSettings(chatId: ID): Promise<ChatSettings>;
1044
+ /**
1045
+ * Disable business bots in a private chat. User-only.
1046
+ *
1047
+ * @method ch
1048
+ * @param chatId The identifier of the private chat to disable business bots in.
1049
+ */
1050
+ abstract disableBusinessBots(chatId: ID): Promise<void>;
1051
+ /**
1052
+ * Enable business bots in a private chat. User-only.
1053
+ *
1054
+ * @method ch
1055
+ * @param chatId The identifier of the private chat to enable business bots in.
1056
+ */
1057
+ abstract enableBusinessBots(chatId: ID): Promise<void>;
1058
+ /**
1059
+ * Disable slow mode in a group. User-only.
1060
+ *
1061
+ * @method ch
1062
+ * @param chatId The identifier of the group to disable slow mode in.
1063
+ */
1064
+ abstract disableSlowMode(chatId: ID): Promise<void>;
1065
+ /**
1066
+ * Change slow mode in a group. User-only.
1067
+ *
1068
+ * @method ch
1069
+ * @param chatId The identifier of the group to change slow mode in.
1070
+ * @param duration New slow mode duration.
1071
+ */
1072
+ abstract setSlowMode(chatId: ID, duration: SlowModeDuration): Promise<void>;
1073
+ /**
1074
+ * Change the title of a chat.
1075
+ *
1076
+ * @method ch
1077
+ * @param chatId The identifier of a chat.
1078
+ * @param title The new title.
1079
+ */
1080
+ abstract setChatTitle(chatId: ID, title: string): Promise<void>;
1081
+ /**
1082
+ * Change the description of a chat.
1083
+ *
1084
+ * @method ch
1085
+ * @param chatId The identifier of a chat.
1086
+ * @param description The new description.
1087
+ */
1088
+ abstract setChatDescription(chatId: ID, description: string): Promise<void>;
1089
+ /**
1090
+ * Hide or show the member list of a group to non-admins. User-only.
1091
+ *
1092
+ * @method ch
1093
+ * @param chatId The identifier of the group.
1094
+ * @param visible Whether the member list of the group should be visible.
1095
+ */
1096
+ abstract setMemberListVisibility(chatId: ID, visible: boolean): Promise<void>;
1097
+ /**
1098
+ * Enable or disable topics in a group. User-only.
1099
+ *
1100
+ * @method ch
1101
+ * @param chatId The identifier of the group.
1102
+ * @param enabled Whether topics should be enabled in the group.
1103
+ * @param tabs Whether topics should be displayed as tabs.
1104
+ */
1105
+ abstract setTopicsEnabled(chatId: ID, enabled: boolean, tabs: boolean): Promise<void>;
1106
+ /**
1107
+ * Enable or disable automatic anti-spam in a group. User-only.
1108
+ *
1109
+ * @method ch
1110
+ * @param chatId The identifier of the group.
1111
+ * @param enabled Whether automatic anti-spam should be enabled in the group.
1112
+ */
1113
+ abstract setAntispamEnabled(chatId: ID, enabled: boolean): Promise<void>;
1114
+ /**
1115
+ * Enable or disable post signatures in a channel. User-only.
1116
+ *
1117
+ * @method ch
1118
+ * @param chatId The identifier of the channel.
1119
+ * @param enabled Whether post signatures should be enabled in the channel.
1120
+ */
1121
+ abstract setSignaturesEnabled(chatId: ID, enabled: boolean, params?: SetSignaturesEnabledParams): Promise<void>;
1122
+ /**
1123
+ * Delete a chat. User-only.
1124
+ *
1125
+ * @method ch
1126
+ * @param chatId The identifier of a chat.
1127
+ */
1128
+ abstract deleteChat(chatId: ID): Promise<void>;
1129
+ /**
1130
+ * Get discussion chat suggestions. User-only.
1131
+ *
1132
+ * @method ch
1133
+ */
1134
+ abstract getDiscussionChatSuggestions(): Promise<ChatP[]>;
1135
+ /**
1136
+ * Set a channel's discussion chat. User-only.
1137
+ *
1138
+ * @method ch
1139
+ * @param chatId The identifier of a channel.
1140
+ * @param discussionChatId The identifier of a chat to use as discussion for the channel.
1141
+ */
1142
+ abstract setDiscussionChat(chatId: ID, discussionChatId: ID): Promise<void>;
1143
+ /**
1144
+ * Transfer the ownership of a chat. User-only.
1145
+ *
1146
+ * @method ch
1147
+ * @param chatId The identifier of a chat.
1148
+ * @param userId The identifier of the new owner.
1149
+ * @param password The password of the current account.
1150
+ */
1151
+ abstract transferChatOwnership(chatId: ID, userId: ID, password: string): Promise<void>;
1152
+ /**
1153
+ * Create a forum topic.
1154
+ *
1155
+ * @method ch
1156
+ * @param chatId The identifier of a chat.
1157
+ * @param title The title of the topic.
1158
+ * @returns The created topic.
1159
+ */
1160
+ abstract createTopic(chatId: ID, title: string, params?: CreateTopicParams): Promise<Topic>;
1161
+ /**
1162
+ * Edit a forum topic.
1163
+ *
1164
+ * @method ch
1165
+ * @param chatId The identifier of a chat.
1166
+ * @param topicId The identifier of the topic.
1167
+ * @param title The new title of the topic.
1168
+ * @returns The new topic.
1169
+ */
1170
+ abstract editTopic(chatId: ID, topicId: number, title: string, params?: EditTopicParams): Promise<Topic>;
1171
+ /**
1172
+ * Hide the general forum topic.
1173
+ *
1174
+ * @method ch
1175
+ * @param chatId The identifier of a chat.
1176
+ */
1177
+ abstract hideGeneralTopic(chatId: ID): Promise<void>;
1178
+ /**
1179
+ * Show the general forum topic.
1180
+ *
1181
+ * @method ch
1182
+ * @param chatId The identifier of a chat.
1183
+ */
1184
+ abstract showGeneralTopic(chatId: ID): Promise<void>;
1185
+ /**
1186
+ * Close a forum topic.
1187
+ *
1188
+ * @method ch
1189
+ * @param chatId The identifier of a chat.
1190
+ * @param topicId The identifier of the topic.
1191
+ */
1192
+ abstract closeTopic(chatId: ID, topicId: number): Promise<void>;
1193
+ /**
1194
+ * Reopen a forum topic.
1195
+ *
1196
+ * @method ch
1197
+ * @param chatId The identifier of a chat.
1198
+ * @param topicId The identifier of the topic.
1199
+ */
1200
+ abstract reopenTopic(chatId: ID, topicId: number): Promise<void>;
1201
+ /**
1202
+ * Pin a forum topic.
1203
+ *
1204
+ * @method ch
1205
+ * @param chatId The identifier of a chat.
1206
+ * @param topicId The identifier of the topic.
1207
+ */
1208
+ abstract pinTopic(chatId: ID, topicId: number): Promise<void>;
1209
+ /**
1210
+ * Unpin a forum topic.
1211
+ *
1212
+ * @method ch
1213
+ * @param chatId The identifier of a chat.
1214
+ * @param topicId The identifier of the topic.
1215
+ */
1216
+ abstract unpinTopic(chatId: ID, topicId: number): Promise<void>;
1217
+ /**
1218
+ * Promote a chat member.
1219
+ *
1220
+ * @method ch
1221
+ * @param chatId The identifier of a chat.
1222
+ * @param userId The identifier of the user to promote.
1223
+ */
1224
+ abstract promoteChatMember(chatId: ID, userId: ID, params?: PromoteChatMemberParams): Promise<void>;
1225
+ /**
1226
+ * Send a callback query. User-only.
1227
+ *
1228
+ * @method cq
1229
+ * @param botId The identifier of the bot to send the callback query to.
1230
+ * @param messageId The identifier of the message that includes at a button responsible for the callback query question.
1231
+ * @param question The callback query's question.
1232
+ * @returns The bot's answer to the callback query.
1233
+ * @cache
1234
+ */
1235
+ abstract sendCallbackQuery(botId: ID, messageId: number, question: CallbackQueryQuestion): Promise<CallbackQueryAnswer>;
1236
+ /**
1237
+ * Answer a callback query. Bot-only.
1238
+ *
1239
+ * @method cq
1240
+ * @param id ID of the callback query to answer.
1241
+ */
1242
+ abstract answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
1243
+ /**
1244
+ * Send an inline query. User-only.
1245
+ *
1246
+ * @method iq
1247
+ * @param botId The identifier of a bot to send the inline query to.
1248
+ * @param chatId The identifier of the chat from which the inline query is sent.
1249
+ * @returns The bot's answer to the inline query.
1250
+ * @cache
1251
+ */
1252
+ abstract sendInlineQuery(botId: ID, chatId: ID, params?: SendInlineQueryParams): Promise<InlineQueryAnswer>;
1253
+ /**
1254
+ * Answer an inline query. Bot-only.
1255
+ *
1256
+ * @method iq
1257
+ * @param id The identifier of the inline query to answer.
1258
+ * @param results The results to answer with.
1259
+ */
1260
+ abstract answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
1261
+ /**
1262
+ * Set the bot's description in the given language. Bot-only.
1263
+ *
1264
+ * @method bs
1265
+ */
1266
+ abstract setMyDescription(params?: {
1267
+ description?: string;
1268
+ languageCode?: string;
1269
+ }): Promise<void>;
1270
+ /**
1271
+ * Set the bot's name in the given language. Bot-only.
1272
+ *
1273
+ * @method bs
1274
+ */
1275
+ abstract setMyName(params?: {
1276
+ name?: string;
1277
+ languageCode?: string;
1278
+ }): Promise<void>;
1279
+ /**
1280
+ * Set the bot's short description in the given language. Bot-only.
1281
+ *
1282
+ * @method bs
1283
+ */
1284
+ abstract setMyShortDescription(params?: {
1285
+ shortDescription?: string;
1286
+ languageCode?: string;
1287
+ }): Promise<void>;
1288
+ /**
1289
+ * Get the bot's description in the given language. Bot-only.
1290
+ *
1291
+ * @method bs
1292
+ * @returns The current bot's description in the specified language.
1293
+ */
1294
+ abstract getMyDescription(params?: {
1295
+ languageCode?: string;
1296
+ }): Promise<string>;
1297
+ /**
1298
+ * Get the bot's name in the given language. Bot-only.
1299
+ *
1300
+ * @method bs
1301
+ * @returns The current bot's name in the specified language.
1302
+ */
1303
+ abstract getMyName(params?: {
1304
+ languageCode?: string;
1305
+ }): Promise<string>;
1306
+ /**
1307
+ * Get the bot's short description in the given language. Bot-only.
1308
+ *
1309
+ * @method bs
1310
+ * @returns The current bot's short description in the specified language.
1311
+ */
1312
+ abstract getMyShortDescription(params?: {
1313
+ languageCode?: string;
1314
+ }): Promise<string>;
1315
+ /**
1316
+ * Set the bot's commands in the given scope and/or language. Bot-only.
1317
+ *
1318
+ * @method bs
1319
+ * @param commands The commands to set.
1320
+ */
1321
+ abstract setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
1322
+ /**
1323
+ * Get the bot's commands in the given scope and/or language. Bot-only.
1324
+ *
1325
+ * @method bs
1326
+ * @returns The current bot's commands in the specified language.
1327
+ */
1328
+ abstract getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
1329
+ /**
1330
+ * Change reactions made to a message.
1331
+ *
1332
+ * @method re
1333
+ * @param chatId The identifier of the chat which the message belongs to.
1334
+ * @param messageId The identifier of the message to add the reaction to.
1335
+ * @param reactions The new reactions.
1336
+ */
1337
+ abstract setReactions(chatId: ID, messageId: number, reactions: Reaction[], params?: SetReactionsParams): Promise<void>;
1338
+ /**
1339
+ * Make a reaction to a message.
1340
+ *
1341
+ * @method re
1342
+ * @param chatId The identifier of the chat which the message belongs to.
1343
+ * @param messageId The identifier of the message to add the reaction to.
1344
+ * @param reaction The reaction to add.
1345
+ */
1346
+ abstract addReaction(chatId: ID, messageId: number, reaction: Reaction, params?: AddReactionParams): Promise<void>;
1347
+ /**
1348
+ * Undo a reaction made to a message.
1349
+ *
1350
+ * @method re
1351
+ * @param chatId The identifier of the chat which the message belongs to.
1352
+ * @param messageId The identifier of the message which the reaction was made to.
1353
+ * @param reaction The reaction to remove.
1354
+ */
1355
+ abstract removeReaction(chatId: ID, messageId: number, reaction: Reaction): Promise<void>;
1356
+ /**
1357
+ * Create a story. User-only.
1358
+ *
1359
+ * @method st
1360
+ * @param content The content of the story.
1361
+ * @returns The created story.
1362
+ */
1363
+ abstract createStory(chatId: ID, content: InputStoryContent, params?: CreateStoryParams): Promise<Story>;
1364
+ /**
1365
+ * Retrieve multiple stories. User-only.
1366
+ *
1367
+ * @method st
1368
+ * @param chatId The identifier of a chat.
1369
+ * @param storyIds The identifiers of the stories to retrieve.
1370
+ * @returns The retrieved stories.
1371
+ */
1372
+ abstract getStories(chatId: ID, storyIds: number[]): Promise<Story[]>;
1373
+ /**
1374
+ * Retrieve a single story. User-only.
1375
+ *
1376
+ * @method st
1377
+ * @param chatId The identifier of a chat.
1378
+ * @param storyId The identifier of the story to retrieve.
1379
+ * @returns The retrieved story.
1380
+ */
1381
+ abstract getStory(chatId: ID, storyId: number): Promise<Story | null>;
1382
+ /**
1383
+ * Delete multiple stories. User-only.
1384
+ *
1385
+ * @method st
1386
+ * @param chatId The identifier of a chat.
1387
+ * @param storyIds The identifiers of the stories to delete.
1388
+ */
1389
+ abstract deleteStories(chatId: ID, storyIds: number[]): Promise<void>;
1390
+ /**
1391
+ * Delete a single story. User-only.
1392
+ *
1393
+ * @method st
1394
+ * @param chatId The identifier of a chat.
1395
+ * @param storyId The identifier of the story to delete.
1396
+ */
1397
+ abstract deleteStory(chatId: ID, storyId: number): Promise<void>;
1398
+ /**
1399
+ * Add multiple stories to highlights. User-only.
1400
+ *
1401
+ * @method st
1402
+ * @param chatId The identifier of a chat.
1403
+ * @param storyIds The identifiers of the stories to add to highlights.
1404
+ */
1405
+ abstract addStoriesToHighlights(chatId: ID, storyIds: number[]): Promise<void>;
1406
+ /**
1407
+ * Add a single story to highlights. User-only.
1408
+ *
1409
+ * @method st
1410
+ * @param chatId The identifier of a chat.
1411
+ * @param storyId The identifier of the story to add to highlights.
1412
+ */
1413
+ abstract addStoryToHighlights(chatId: ID, storyId: number): Promise<void>;
1414
+ /**
1415
+ * Remove multiple stories from highlights. User-only.
1416
+ *
1417
+ * @method st
1418
+ * @param chatId The identifier of a chat.
1419
+ * @param storyIds The identifiers of the stories to remove from highlights.
1420
+ */
1421
+ abstract removeStoriesFromHighlights(chatId: ID, storyIds: number[]): Promise<void>;
1422
+ /**
1423
+ * Remove a single story from highlights. User-only.
1424
+ *
1425
+ * @method st
1426
+ * @param chatId The identifier of a chat.
1427
+ * @param storyId The identifier of the story to remove from highlights.
1428
+ */
1429
+ abstract removeStoryFromHighlights(chatId: ID, storyId: number): Promise<void>;
1430
+ /**
1431
+ * Get network statistics. This might not always be available.
1432
+ *
1433
+ * @method mc
1434
+ */
1435
+ abstract getNetworkStatistics(): Promise<NetworkStatistics>;
1436
+ /**
1437
+ * Block a user. User-only.
1438
+ *
1439
+ * @method mc
1440
+ * @param userId The identifier of the user to block.
1441
+ */
1442
+ abstract blockUser(userId: ID): Promise<void>;
1443
+ /**
1444
+ * Unblock a user. User-only.
1445
+ *
1446
+ * @method mc
1447
+ * @param userId The identifier of the user to unblock.
1448
+ */
1449
+ abstract unblockUser(userId: ID): Promise<void>;
1450
+ /**
1451
+ * Start a video chat. User-only.
1452
+ *
1453
+ * @method vc
1454
+ * @param chatId The identifier of a chat to start the video chat in.
1455
+ * @returns The started video chat.
1456
+ */
1457
+ abstract startVideoChat(chatId: ID, params?: StartVideoChatParams): Promise<VideoChatActive>;
1458
+ /**
1459
+ * Schedule a video chat. User-only.
1460
+ *
1461
+ * @method vc
1462
+ * @param chatId The identifier of a chat to schedule the video chat in.
1463
+ * @param startAt A point in time within the future in which the video chat will be started.
1464
+ * @returns The scheduled video chat.
1465
+ */
1466
+ abstract scheduleVideoChat(chatId: ID, startAt: number, params?: ScheduleVideoChatParams): Promise<VideoChatScheduled>;
1467
+ /**
1468
+ * Join a video chat. User-only.
1469
+ *
1470
+ * @method vc
1471
+ * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
1472
+ * @param params_ WebRTC connection parameters.
1473
+ * @returns Parameters to be passed to the used WebRTC library.
1474
+ */
1475
+ abstract joinVideoChat(id: string, params_: string, params?: JoinVideoChatParams): Promise<string>;
1476
+ /**
1477
+ * Leave a video chat. User-only.
1478
+ *
1479
+ * @method vc
1480
+ * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
1481
+ */
1482
+ abstract leaveVideoChat(id: string): Promise<void>;
1483
+ /**
1484
+ * Join a live stream. User-only.
1485
+ *
1486
+ * @method vc
1487
+ * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
1488
+ */
1489
+ abstract joinLiveStream(id: string): Promise<void>;
1490
+ /**
1491
+ * Get a video chat. User-only.
1492
+ *
1493
+ * @method vc
1494
+ * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
1495
+ * @cache
1496
+ */
1497
+ abstract getVideoChat(id: string): Promise<VideoChat>;
1498
+ /**
1499
+ * Get live stream channels. User-only.
1500
+ *
1501
+ * @method vc
1502
+ * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
1503
+ */
1504
+ abstract getLiveStreamChannels(id: string): Promise<LiveStreamChannel[]>;
1505
+ /**
1506
+ * Download a live stream segment. User-only.
1507
+ *
1508
+ * @method vc
1509
+ * @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
1510
+ * @param channelId Stream channel ID.
1511
+ * @param scale Stream channel scale.
1512
+ * @param timestamp Millisecond timestamp of the chunk to download.
1513
+ */
1514
+ abstract downloadLiveStreamSegment(id: string, channelId: number, scale: number, timestamp: number, params?: DownloadLiveStreamSegmentParams): Promise<Uint8Array>;
1515
+ /**
1516
+ * Answer a pre-checkout query. Bot-only.
1517
+ *
1518
+ * @method pa
1519
+ * @param preCheckoutQueryId The identifier of the pre-checkout query.
1520
+ * @param ok Whether the checkout is going to be processed.
1521
+ */
1522
+ abstract answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, params?: AnswerPreCheckoutQueryParams): Promise<void>;
1523
+ /**
1524
+ * Refund a star payment. Bot-only.
1525
+ *
1526
+ * @method pa
1527
+ * @param userId The identifier of the user that was charged.
1528
+ * @param telegramPaymentChargeId The identifier of the charge.
1529
+ */
1530
+ abstract refundStarPayment(userId: ID, telegramPaymentChargeId: string): Promise<void>;
1531
+ /**
1532
+ * Get contacts. User-only.
1533
+ *
1534
+ * @method co
1535
+ */
1536
+ abstract getContacts(): Promise<User[]>;
1537
+ /**
1538
+ * Delete multiple contacts. User-only.
1539
+ *
1540
+ * @method co
1541
+ * @param userIds The identifiers of contacts to delete.
1542
+ */
1543
+ abstract deleteContacts(userIds: ID[]): Promise<void>;
1544
+ /**
1545
+ * Delete a single contact. User-only.
1546
+ *
1547
+ * @method co
1548
+ * @param userId The identifier of the contact to delete.
1549
+ */
1550
+ abstract deleteContact(userId: ID): Promise<void>;
1551
+ /**
1552
+ * Add a contact. User-only.
1553
+ *
1554
+ * @method co
1555
+ * @param userId The identifier of the user to add as contact.
1556
+ */
1557
+ abstract addContact(userId: ID, params?: AddContactParams): Promise<void>;
1558
+ /**
1559
+ * Get translations. User-only.
1560
+ *
1561
+ * @method ta
1562
+ * @cache
1563
+ */
1564
+ abstract getTranslations(params?: GetTranslationsParams): Promise<Translation[]>;
1565
+ /**
1566
+ * Get available gifts.
1567
+ *
1568
+ * @method gf
1569
+ */
1570
+ abstract getGifts(): Promise<Gift[]>;
1571
+ /**
1572
+ * Get gifts claimed by a user or a channel. User-only.
1573
+ *
1574
+ * @method gf
1575
+ * @param chatId The identifier of a user or a channel to get gifts for.
1576
+ */
1577
+ abstract getClaimedGifts(chatId: ID, params?: GetClaimedGiftsParams): Promise<ClaimedGifts>;
1578
+ /**
1579
+ * Send a gift.
1580
+ *
1581
+ * @method gf
1582
+ * @param chatId The identifier of a user or a channel to send the gift to.
1583
+ * @param giftId The identifier of the gift to send.
1584
+ */
1585
+ abstract sendGift(chatId: ID, giftId: string, params?: SendGiftParams): Promise<void>;
1586
+ /**
1587
+ * Sell a gift.
1588
+ *
1589
+ * @method gf
1590
+ * @param userId The identifier of the user that sent the gift.
1591
+ * @param messageId The identifier of the service message announcing the receival of the gift.
1592
+ */
1593
+ abstract sellGift(userId: ID, messageId: number): Promise<void>;
1594
+ /**
1595
+ * Get a gift using its slug.
1596
+ *
1597
+ * @method gf
1598
+ * @param slug The slug of a gift.
1599
+ */
1600
+ abstract getGift(slug: string): Promise<Gift>;
1601
+ }
1602
+ //# sourceMappingURL=1_client_generic.d.ts.map