@mtkruto/node 0.113.0 → 0.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/3_types.d.ts +1 -1
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +1 -1
- package/esm/client/0_params.d.ts +10 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +63 -2
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/2_context.d.ts +384 -188
- package/esm/client/2_context.d.ts.map +1 -1
- package/esm/client/2_context.js +745 -402
- package/esm/client/3_message_manager.d.ts +2 -2
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +6 -2
- package/esm/client/4_checklist_manager.d.ts +38 -0
- package/esm/client/4_checklist_manager.d.ts.map +1 -0
- package/esm/client/4_checklist_manager.js +68 -0
- package/esm/client/4_gift_manager.d.ts +1 -0
- package/esm/client/4_gift_manager.d.ts.map +1 -1
- package/esm/client/4_gift_manager.js +6 -0
- package/esm/client/5_client.d.ts +63 -2
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +84 -2
- package/esm/client/5_client_dispatcher.d.ts +63 -2
- package/esm/client/5_client_dispatcher.d.ts.map +1 -1
- package/esm/client/5_client_dispatcher.js +80 -2
- package/esm/types/{0_working_hour_interval.d.ts → 0_working_hours_interval.d.ts} +2 -2
- package/esm/types/0_working_hours_interval.d.ts.map +1 -0
- package/esm/types/1_working_hours.d.ts +2 -2
- package/esm/types/1_working_hours.d.ts.map +1 -1
- package/esm/types/3_reply_quote.d.ts +1 -1
- package/esm/types/3_reply_quote.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +1 -1
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +1 -1
- package/script/client/0_params.d.ts +10 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +63 -2
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/2_context.d.ts +384 -188
- package/script/client/2_context.d.ts.map +1 -1
- package/script/client/2_context.js +745 -402
- package/script/client/3_message_manager.d.ts +2 -2
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +6 -2
- package/script/client/4_checklist_manager.d.ts +38 -0
- package/script/client/4_checklist_manager.d.ts.map +1 -0
- package/script/client/4_checklist_manager.js +72 -0
- package/script/client/4_gift_manager.d.ts +1 -0
- package/script/client/4_gift_manager.d.ts.map +1 -1
- package/script/client/4_gift_manager.js +6 -0
- package/script/client/5_client.d.ts +63 -2
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +84 -2
- package/script/client/5_client_dispatcher.d.ts +63 -2
- package/script/client/5_client_dispatcher.d.ts.map +1 -1
- package/script/client/5_client_dispatcher.js +80 -2
- package/script/types/{0_working_hour_interval.d.ts → 0_working_hours_interval.d.ts} +2 -2
- package/script/types/0_working_hours_interval.d.ts.map +1 -0
- package/script/types/1_working_hours.d.ts +2 -2
- package/script/types/1_working_hours.d.ts.map +1 -1
- package/script/types/3_reply_quote.d.ts +1 -1
- package/script/types/3_reply_quote.d.ts.map +1 -1
- package/esm/types/0_working_hour_interval.d.ts.map +0 -1
- package/script/types/0_working_hour_interval.d.ts.map +0 -1
- /package/esm/types/{0_working_hour_interval.js → 0_working_hours_interval.js} +0 -0
- /package/script/types/{0_working_hour_interval.js → 0_working_hours_interval.js} +0 -0
package/esm/client/2_context.js
CHANGED
|
@@ -146,283 +146,361 @@ export class Context {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
* Context-aware alias for {@link Client.
|
|
149
|
+
* Context-aware alias for {@link Client.addContact}.
|
|
150
150
|
*/
|
|
151
|
-
async
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
return await this.client.sendMessage(chatId, text, { ...params, ...replyTo, businessConnectionId });
|
|
151
|
+
async addAsContact(params) {
|
|
152
|
+
const chatId = this.#mustGetChatId();
|
|
153
|
+
return await this.client.addContact(chatId, params);
|
|
155
154
|
}
|
|
156
155
|
/**
|
|
157
|
-
* Context-aware alias for {@link Client.
|
|
156
|
+
* Context-aware alias for {@link Client.addChatMember}.
|
|
158
157
|
*/
|
|
159
|
-
async
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
return await this.client.sendMessageDraft(chatId, draftId, text, { ...params, ...replyTo });
|
|
158
|
+
async addMember(userId, params) {
|
|
159
|
+
const chatId = this.#mustGetChatId();
|
|
160
|
+
return await this.client.addChatMember(chatId, userId, params);
|
|
163
161
|
}
|
|
164
162
|
/**
|
|
165
|
-
* Context-aware alias for {@link Client.
|
|
163
|
+
* Context-aware alias for {@link Client.addChatMembers}.
|
|
166
164
|
*/
|
|
167
|
-
async
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
return await this.client.sendPoll(chatId, question, options, { ...params, ...replyTo, businessConnectionId });
|
|
165
|
+
async addMembers(userIds) {
|
|
166
|
+
const chatId = this.#mustGetChatId();
|
|
167
|
+
return await this.client.addChatMembers(chatId, userIds);
|
|
171
168
|
}
|
|
172
169
|
/**
|
|
173
|
-
* Context-aware alias for {@link Client.
|
|
170
|
+
* Context-aware alias for {@link Client.addReaction}.
|
|
174
171
|
*/
|
|
175
|
-
async
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
return await this.client.sendChecklist(chatId, title, items, { ...params, ...replyTo, businessConnectionId });
|
|
172
|
+
async addReaction(messageId, reaction, params) {
|
|
173
|
+
const chatId = this.#mustGetChatId();
|
|
174
|
+
return await this.client.addReaction(chatId, messageId, reaction, params);
|
|
179
175
|
}
|
|
180
176
|
/**
|
|
181
|
-
* Context-aware alias for {@link Client.
|
|
177
|
+
* Context-aware alias for {@link Client.addStoriesToHighlights}.
|
|
182
178
|
*/
|
|
183
|
-
async
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
return await this.client.sendPhoto(chatId, photo, { ...params, ...replyTo, businessConnectionId });
|
|
179
|
+
async addStoriesToHighlights(storyIds) {
|
|
180
|
+
const chatId = this.#mustGetChatId();
|
|
181
|
+
return await this.client.addStoriesToHighlights(chatId, storyIds);
|
|
187
182
|
}
|
|
188
183
|
/**
|
|
189
|
-
* Context-aware alias for {@link Client.
|
|
184
|
+
* Context-aware alias for {@link Client.addStoryToHighlights}.
|
|
190
185
|
*/
|
|
191
|
-
async
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
return await this.client.sendMediaGroup(chatId, media, { ...params, ...replyTo, businessConnectionId });
|
|
186
|
+
async addStoryToHighlights(storyId) {
|
|
187
|
+
const chatId = this.#mustGetChatId();
|
|
188
|
+
return await this.client.addStoryToHighlights(chatId, storyId);
|
|
195
189
|
}
|
|
196
190
|
/**
|
|
197
|
-
* Context-aware alias for {@link Client.
|
|
191
|
+
* Context-aware alias for {@link Client.addToChecklist}.
|
|
198
192
|
*/
|
|
199
|
-
async
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
return await this.client.sendInvoice(chatId, title, description, payload, currency, prices, { ...params, ...replyTo, businessConnectionId });
|
|
193
|
+
async addToChecklist(messageId, items) {
|
|
194
|
+
const chatId = this.#mustGetChatId();
|
|
195
|
+
return await this.client.addToChecklist(chatId, messageId, items);
|
|
203
196
|
}
|
|
204
197
|
/**
|
|
205
|
-
* Context-aware alias for {@link Client.
|
|
198
|
+
* Context-aware alias for {@link Client.answerCallbackQuery}.
|
|
206
199
|
*/
|
|
207
|
-
async
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
200
|
+
async answerCallbackQuery(params) {
|
|
201
|
+
if (!("callbackQuery" in this.update)) {
|
|
202
|
+
unreachable();
|
|
203
|
+
}
|
|
204
|
+
return await this.client.answerCallbackQuery(this.update.callbackQuery.id, params);
|
|
211
205
|
}
|
|
212
206
|
/**
|
|
213
|
-
* Context-aware alias for {@link Client.
|
|
207
|
+
* Context-aware alias for {@link Client.answerInlineQuery}.
|
|
214
208
|
*/
|
|
215
|
-
async
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
209
|
+
async answerInlineQuery(results, params) {
|
|
210
|
+
if (!("inlineQuery" in this.update)) {
|
|
211
|
+
unreachable();
|
|
212
|
+
}
|
|
213
|
+
return await this.client.answerInlineQuery(this.update.inlineQuery.id, results, params);
|
|
219
214
|
}
|
|
220
215
|
/**
|
|
221
|
-
* Context-aware alias for {@link Client.
|
|
216
|
+
* Context-aware alias for {@link Client.answerPreCheckoutQuery}.
|
|
222
217
|
*/
|
|
223
|
-
async
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
218
|
+
async answerPreCheckoutQuery(ok, params) {
|
|
219
|
+
if (!("preCheckoutQuery" in this.update)) {
|
|
220
|
+
unreachable();
|
|
221
|
+
}
|
|
222
|
+
return await this.client.answerPreCheckoutQuery(this.update.preCheckoutQuery.id, ok, params);
|
|
227
223
|
}
|
|
228
224
|
/**
|
|
229
|
-
* Context-aware alias for {@link Client.
|
|
225
|
+
* Context-aware alias for {@link Client.approveJoinRequest}.
|
|
230
226
|
*/
|
|
231
|
-
async
|
|
232
|
-
const { chatId,
|
|
233
|
-
|
|
234
|
-
|
|
227
|
+
async approveJoinRequest() {
|
|
228
|
+
const { chatId, userId } = this.#mustGetMsg();
|
|
229
|
+
if (!userId) {
|
|
230
|
+
unreachable();
|
|
231
|
+
}
|
|
232
|
+
return await this.client.approveJoinRequest(chatId, userId);
|
|
235
233
|
}
|
|
236
234
|
/**
|
|
237
|
-
* Context-aware alias for {@link Client.
|
|
235
|
+
* Context-aware alias for {@link Client.approveJoinRequests}.
|
|
238
236
|
*/
|
|
239
|
-
async
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
return await this.client.sendVenue(chatId, latitude, longitude, title, address, { ...params, ...replyTo, businessConnectionId });
|
|
237
|
+
async approveJoinRequests(params) {
|
|
238
|
+
const chatId = this.#mustGetChatId();
|
|
239
|
+
return await this.client.approveJoinRequests(chatId, params);
|
|
243
240
|
}
|
|
244
241
|
/**
|
|
245
|
-
* Context-aware alias for {@link Client.
|
|
242
|
+
* Context-aware alias for {@link Client.archiveChat}.
|
|
246
243
|
*/
|
|
247
|
-
async
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
return await this.client.sendContact(chatId, firstName, number, { ...params, ...replyTo, businessConnectionId });
|
|
244
|
+
async archive() {
|
|
245
|
+
const chatId = this.#mustGetChatId();
|
|
246
|
+
return await this.client.archiveChat(chatId);
|
|
251
247
|
}
|
|
252
248
|
/**
|
|
253
|
-
* Context-aware alias for {@link Client.
|
|
249
|
+
* Context-aware alias for {@link Client.banChatMember}.
|
|
254
250
|
*/
|
|
255
|
-
async
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
return await this.client.sendVideo(chatId, video, { ...params, ...replyTo, businessConnectionId });
|
|
251
|
+
async banChatMember(memberId, params) {
|
|
252
|
+
const chatId = this.#mustGetChatId();
|
|
253
|
+
return await this.client.banChatMember(chatId, memberId, params);
|
|
259
254
|
}
|
|
260
255
|
/**
|
|
261
|
-
* Context-aware alias for {@link Client.
|
|
256
|
+
* Context-aware alias for {@link Client.banChatMember}.
|
|
262
257
|
*/
|
|
263
|
-
async
|
|
264
|
-
const { chatId,
|
|
265
|
-
|
|
266
|
-
|
|
258
|
+
async banSender(params) {
|
|
259
|
+
const { chatId, senderId } = this.#mustGetMsg();
|
|
260
|
+
if (!senderId) {
|
|
261
|
+
unreachable();
|
|
262
|
+
}
|
|
263
|
+
return await this.client.banChatMember(chatId, senderId, params);
|
|
267
264
|
}
|
|
268
265
|
/**
|
|
269
|
-
* Context-aware alias for {@link Client.
|
|
266
|
+
* Context-aware alias for {@link Client.blockUser}.
|
|
270
267
|
*/
|
|
271
|
-
async
|
|
272
|
-
|
|
273
|
-
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
274
|
-
return await this.client.sendVoice(chatId, voice, { ...params, ...replyTo, businessConnectionId });
|
|
268
|
+
async blockUser() {
|
|
269
|
+
return await this.client.blockUser(this.#mustGetUserId());
|
|
275
270
|
}
|
|
276
271
|
/**
|
|
277
|
-
* Context-aware alias for {@link Client.
|
|
272
|
+
* Context-aware alias for {@link Client.checkChecklistItem}.
|
|
278
273
|
*/
|
|
279
|
-
async
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
return await this.client.sendAudio(chatId, audio, { ...params, ...replyTo, businessConnectionId });
|
|
274
|
+
async checkChecklistItem(messageId, item) {
|
|
275
|
+
const chatId = this.#mustGetChatId();
|
|
276
|
+
return await this.client.checkChecklistItem(chatId, messageId, item);
|
|
283
277
|
}
|
|
284
278
|
/**
|
|
285
|
-
* Context-aware alias for {@link Client.
|
|
279
|
+
* Context-aware alias for {@link Client.checkChecklistItems}.
|
|
286
280
|
*/
|
|
287
|
-
async
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
return await this.client.sendVideoNote(chatId, videoNote, { ...params, ...replyTo, businessConnectionId });
|
|
281
|
+
async checkChecklistItems(messageId, items) {
|
|
282
|
+
const chatId = this.#mustGetChatId();
|
|
283
|
+
return await this.client.checkChecklistItems(chatId, messageId, items);
|
|
291
284
|
}
|
|
292
285
|
/**
|
|
293
|
-
* Context-aware alias for {@link Client.
|
|
286
|
+
* Context-aware alias for {@link Client.closeChat}.
|
|
294
287
|
*/
|
|
295
|
-
async
|
|
296
|
-
const
|
|
297
|
-
return await this.client.
|
|
288
|
+
async close() {
|
|
289
|
+
const chatId = this.#mustGetChatId();
|
|
290
|
+
return await this.client.closeChat(chatId);
|
|
298
291
|
}
|
|
299
292
|
/**
|
|
300
|
-
* Context-aware alias for {@link Client.
|
|
293
|
+
* Context-aware alias for {@link Client.closeTopic}.
|
|
301
294
|
*/
|
|
302
|
-
async
|
|
303
|
-
const
|
|
304
|
-
return await this.client.
|
|
295
|
+
async closeTopic(topicId) {
|
|
296
|
+
const chatId = this.#mustGetChatId();
|
|
297
|
+
return await this.client.closeTopic(chatId, topicId);
|
|
305
298
|
}
|
|
306
299
|
/**
|
|
307
|
-
* Context-aware alias for {@link Client.
|
|
300
|
+
* Context-aware alias for {@link Client.createInviteLink}.
|
|
308
301
|
*/
|
|
309
|
-
async
|
|
310
|
-
const
|
|
311
|
-
return await this.client.
|
|
302
|
+
async createInviteLink(params) {
|
|
303
|
+
const chatId = this.#mustGetChatId();
|
|
304
|
+
return await this.client.createInviteLink(chatId, params);
|
|
312
305
|
}
|
|
313
306
|
/**
|
|
314
|
-
* Context-aware alias for {@link Client.
|
|
307
|
+
* Context-aware alias for {@link Client.createStory}.
|
|
315
308
|
*/
|
|
316
|
-
async
|
|
317
|
-
const
|
|
318
|
-
return await this.client.
|
|
309
|
+
async createStory(content, params) {
|
|
310
|
+
const chatId = this.#mustGetChatId();
|
|
311
|
+
return await this.client.createStory(chatId, content, params);
|
|
319
312
|
}
|
|
320
313
|
/**
|
|
321
|
-
* Context-aware alias for {@link Client.
|
|
314
|
+
* Context-aware alias for {@link Client.createTopic}.
|
|
322
315
|
*/
|
|
323
|
-
async
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
unreachable();
|
|
327
|
-
}
|
|
328
|
-
return await this.client.banChatMember(chatId, senderId, params);
|
|
316
|
+
async createTopic(title, params) {
|
|
317
|
+
const chatId = this.#mustGetChatId();
|
|
318
|
+
return await this.client.createTopic(chatId, title, params);
|
|
329
319
|
}
|
|
330
320
|
/**
|
|
331
|
-
* Context-aware alias for {@link Client.
|
|
321
|
+
* Context-aware alias for {@link Client.declineJoinRequest}.
|
|
332
322
|
*/
|
|
333
|
-
async
|
|
334
|
-
const { chatId,
|
|
335
|
-
if (!
|
|
323
|
+
async declineJoinRequest() {
|
|
324
|
+
const { chatId, userId } = this.#mustGetMsg();
|
|
325
|
+
if (!userId) {
|
|
336
326
|
unreachable();
|
|
337
327
|
}
|
|
338
|
-
return await this.client.
|
|
328
|
+
return await this.client.declineJoinRequest(chatId, userId);
|
|
339
329
|
}
|
|
340
330
|
/**
|
|
341
|
-
* Context-aware alias for {@link Client.
|
|
331
|
+
* Context-aware alias for {@link Client.declineJoinRequests}.
|
|
342
332
|
*/
|
|
343
|
-
async
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
unreachable();
|
|
347
|
-
}
|
|
348
|
-
return await this.client.setChatMemberRights(chatId, senderId, params);
|
|
333
|
+
async declineJoinRequests(params) {
|
|
334
|
+
const chatId = this.#mustGetChatId();
|
|
335
|
+
return await this.client.declineJoinRequests(chatId, params);
|
|
349
336
|
}
|
|
350
337
|
/**
|
|
351
|
-
* Context-aware alias for {@link Client.
|
|
338
|
+
* Context-aware alias for {@link Client.deleteChatPhoto}.
|
|
352
339
|
*/
|
|
353
|
-
async
|
|
340
|
+
async deletChatPhoto() {
|
|
354
341
|
const chatId = this.#mustGetChatId();
|
|
355
|
-
return await this.client.
|
|
342
|
+
return await this.client.deleteChatPhoto(chatId);
|
|
356
343
|
}
|
|
357
344
|
/**
|
|
358
|
-
* Context-aware alias for {@link Client.
|
|
345
|
+
* Context-aware alias for {@link Client.deleteMessage}.
|
|
359
346
|
*/
|
|
360
|
-
async
|
|
347
|
+
async delete() {
|
|
361
348
|
const { chatId, messageId } = this.#mustGetMsg();
|
|
362
|
-
return await this.client.
|
|
349
|
+
return await this.client.deleteMessage(chatId, messageId);
|
|
363
350
|
}
|
|
364
351
|
/**
|
|
365
|
-
* Context-aware alias for {@link Client.
|
|
352
|
+
* Context-aware alias for {@link Client.deleteChat}.
|
|
366
353
|
*/
|
|
367
|
-
async
|
|
354
|
+
async deleteChat() {
|
|
368
355
|
const chatId = this.#mustGetChatId();
|
|
369
|
-
return await this.client.
|
|
356
|
+
return await this.client.deleteChat(chatId);
|
|
370
357
|
}
|
|
371
358
|
/**
|
|
372
|
-
* Context-aware alias for {@link Client.
|
|
359
|
+
* Context-aware alias for {@link Client.deleteChatMemberMessages}.
|
|
373
360
|
*/
|
|
374
|
-
async
|
|
375
|
-
const
|
|
376
|
-
return await this.client.
|
|
361
|
+
async deleteChatMemberMessages(userId) {
|
|
362
|
+
const chatId = this.#mustGetChatId();
|
|
363
|
+
return await this.client.deleteChatMemberMessages(chatId, userId);
|
|
377
364
|
}
|
|
378
365
|
/**
|
|
379
|
-
* Context-aware alias for {@link Client.
|
|
366
|
+
* Context-aware alias for {@link Client.deleteChatStickerSet}.
|
|
380
367
|
*/
|
|
381
|
-
async
|
|
382
|
-
const
|
|
383
|
-
return await this.client.
|
|
368
|
+
async deleteChatStickerSet() {
|
|
369
|
+
const chatId = this.#mustGetChatId();
|
|
370
|
+
return await this.client.deleteChatStickerSet(chatId);
|
|
384
371
|
}
|
|
385
372
|
/**
|
|
386
|
-
* Context-aware alias for {@link Client.
|
|
373
|
+
* Context-aware alias for {@link Client.deleteMessage}.
|
|
387
374
|
*/
|
|
388
|
-
async
|
|
389
|
-
const
|
|
390
|
-
return await this.client.
|
|
375
|
+
async deleteMessage(messageId, params) {
|
|
376
|
+
const chatId = this.#mustGetChatId();
|
|
377
|
+
return await this.client.deleteMessage(chatId, messageId, params);
|
|
391
378
|
}
|
|
392
379
|
/**
|
|
393
|
-
* Context-aware alias for {@link Client.
|
|
380
|
+
* Context-aware alias for {@link Client.deleteMessages}.
|
|
394
381
|
*/
|
|
395
|
-
async
|
|
396
|
-
const
|
|
397
|
-
return await this.client.
|
|
382
|
+
async deleteMessages(messageIds, params) {
|
|
383
|
+
const chatId = this.#mustGetChatId();
|
|
384
|
+
return await this.client.deleteMessages(chatId, messageIds, params);
|
|
398
385
|
}
|
|
399
386
|
/**
|
|
400
|
-
* Context-aware alias for {@link Client.
|
|
387
|
+
* Context-aware alias for {@link Client.deleteScheduledMessage}.
|
|
401
388
|
*/
|
|
402
|
-
async
|
|
403
|
-
const
|
|
404
|
-
return await this.client.
|
|
389
|
+
async deleteScheduledMessage(messageId) {
|
|
390
|
+
const chatId = this.#mustGetChatId();
|
|
391
|
+
return await this.client.deleteScheduledMessage(chatId, messageId);
|
|
405
392
|
}
|
|
406
393
|
/**
|
|
407
|
-
* Context-aware alias for {@link Client.
|
|
394
|
+
* Context-aware alias for {@link Client.deleteScheduledMessages}.
|
|
408
395
|
*/
|
|
409
|
-
async
|
|
396
|
+
async deleteScheduledMessages(messageIds) {
|
|
410
397
|
const chatId = this.#mustGetChatId();
|
|
411
|
-
return await this.client.
|
|
398
|
+
return await this.client.deleteScheduledMessages(chatId, messageIds);
|
|
412
399
|
}
|
|
413
400
|
/**
|
|
414
|
-
* Context-aware alias for {@link Client.
|
|
401
|
+
* Context-aware alias for {@link Client.deleteStories}.
|
|
415
402
|
*/
|
|
416
|
-
async
|
|
403
|
+
async deleteStories(storyIds) {
|
|
417
404
|
const chatId = this.#mustGetChatId();
|
|
418
|
-
return await this.client.
|
|
405
|
+
return await this.client.deleteStories(chatId, storyIds);
|
|
419
406
|
}
|
|
420
407
|
/**
|
|
421
|
-
* Context-aware alias for {@link Client.
|
|
408
|
+
* Context-aware alias for {@link Client.deleteStory}.
|
|
422
409
|
*/
|
|
423
|
-
async
|
|
410
|
+
async deleteStory(storyId) {
|
|
424
411
|
const chatId = this.#mustGetChatId();
|
|
425
|
-
return await this.client.
|
|
412
|
+
return await this.client.deleteStory(chatId, storyId);
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Context-aware alias for {@link Client.disableAntispam}.
|
|
416
|
+
*/
|
|
417
|
+
async disableAntispam() {
|
|
418
|
+
const chatId = this.#mustGetChatId();
|
|
419
|
+
return await this.client.disableAntispam(chatId);
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Context-aware alias for {@link Client.disableBusinessBots}.
|
|
423
|
+
*/
|
|
424
|
+
async disableBusinessBots() {
|
|
425
|
+
const chatId = this.#mustGetChatId();
|
|
426
|
+
return await this.client.disableBusinessBots(chatId);
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Context-aware alias for {@link Client.disableJoinRequests}.
|
|
430
|
+
*/
|
|
431
|
+
async disableJoinRequests() {
|
|
432
|
+
const chatId = this.#mustGetChatId();
|
|
433
|
+
return await this.client.disableJoinRequests(chatId);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Context-aware alias for {@link Client.disableSharing}.
|
|
437
|
+
*/
|
|
438
|
+
async disableSharing() {
|
|
439
|
+
const chatId = this.#mustGetChatId();
|
|
440
|
+
return await this.client.disableSharing(chatId);
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Context-aware alias for {@link Client.disableSignatures}.
|
|
444
|
+
*/
|
|
445
|
+
async disableSignatures() {
|
|
446
|
+
const chatId = this.#mustGetChatId();
|
|
447
|
+
return await this.client.disableSignatures(chatId);
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Context-aware alias for {@link Client.disableSlowMode}.
|
|
451
|
+
*/
|
|
452
|
+
async disableSlowMode() {
|
|
453
|
+
const chatId = this.#mustGetChatId();
|
|
454
|
+
return await this.client.disableSlowMode(chatId);
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Context-aware alias for {@link Client.disableTopics}.
|
|
458
|
+
*/
|
|
459
|
+
async disableTopics() {
|
|
460
|
+
const chatId = this.#mustGetChatId();
|
|
461
|
+
return await this.client.disableTopics(chatId);
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Context-aware alias for {@link Client.editInlineMessageCaption}.
|
|
465
|
+
*/
|
|
466
|
+
async editInlineMessageCaption(params) {
|
|
467
|
+
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
468
|
+
return await this.client.editInlineMessageCaption(inlineMessageId, params);
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Context-aware alias for {@link Client.editInlineMessageLiveLocation}.
|
|
472
|
+
*/
|
|
473
|
+
async editInlineMessageLiveLocation(latitude, longitude, params) {
|
|
474
|
+
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
475
|
+
return await this.client.editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params);
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Context-aware alias for {@link Client.editInlineMessageMedia}.
|
|
479
|
+
*/
|
|
480
|
+
async editInlineMessageMedia(media, params) {
|
|
481
|
+
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
482
|
+
return await this.client.editInlineMessageMedia(inlineMessageId, media, params);
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Context-aware alias for {@link Client.editInlineMessageReplyMarkup}.
|
|
486
|
+
*/
|
|
487
|
+
async editInlineMessageReplyMarkup(params) {
|
|
488
|
+
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
489
|
+
return await this.client.editInlineMessageReplyMarkup(inlineMessageId, params);
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Context-aware alias for {@link Client.editInlineMessageText}.
|
|
493
|
+
*/
|
|
494
|
+
async editInlineMessageText(text, params) {
|
|
495
|
+
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
496
|
+
return await this.client.editInlineMessageText(inlineMessageId, text, params);
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Context-aware alias for {@link Client.editMessageCaption}.
|
|
500
|
+
*/
|
|
501
|
+
async editMessageCaption(messageId, params) {
|
|
502
|
+
const chatId = this.#mustGetChatId();
|
|
503
|
+
return await this.client.editMessageCaption(chatId, messageId, params);
|
|
426
504
|
}
|
|
427
505
|
/**
|
|
428
506
|
* Context-aware alias for {@link Client.editMessageLiveLocation}.
|
|
@@ -431,6 +509,13 @@ export class Context {
|
|
|
431
509
|
const chatId = this.#mustGetChatId();
|
|
432
510
|
return await this.client.editMessageLiveLocation(chatId, messageId, latitude, longitude, params);
|
|
433
511
|
}
|
|
512
|
+
/**
|
|
513
|
+
* Context-aware alias for {@link Client.editMessageMedia}.
|
|
514
|
+
*/
|
|
515
|
+
async editMessageMedia(messageId, media, params) {
|
|
516
|
+
const chatId = this.#mustGetChatId();
|
|
517
|
+
return await this.client.editMessageMedia(chatId, messageId, media, params);
|
|
518
|
+
}
|
|
434
519
|
/**
|
|
435
520
|
* Context-aware alias for {@link Client.editMessageReplyMarkup}.
|
|
436
521
|
*/
|
|
@@ -439,22 +524,161 @@ export class Context {
|
|
|
439
524
|
return await this.client.editMessageReplyMarkup(chatId, messageId, params);
|
|
440
525
|
}
|
|
441
526
|
/**
|
|
442
|
-
* Context-aware alias for {@link Client.
|
|
527
|
+
* Context-aware alias for {@link Client.editMessageText}.
|
|
443
528
|
*/
|
|
444
|
-
async
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
return await this.client.answerCallbackQuery(this.update.callbackQuery.id, params);
|
|
529
|
+
async editMessageText(messageId, text, params) {
|
|
530
|
+
const chatId = this.#mustGetChatId();
|
|
531
|
+
return await this.client.editMessageText(chatId, messageId, text, params);
|
|
449
532
|
}
|
|
450
533
|
/**
|
|
451
|
-
* Context-aware alias for {@link Client.
|
|
534
|
+
* Context-aware alias for {@link Client.editTopic}.
|
|
452
535
|
*/
|
|
453
|
-
async
|
|
454
|
-
|
|
536
|
+
async editTopic(topicId, title, params) {
|
|
537
|
+
const chatId = this.#mustGetChatId();
|
|
538
|
+
return await this.client.editTopic(chatId, topicId, title, params);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Context-aware alias for {@link Client.enableAntispam}.
|
|
542
|
+
*/
|
|
543
|
+
async enableAntispam() {
|
|
544
|
+
const chatId = this.#mustGetChatId();
|
|
545
|
+
return await this.client.enableAntispam(chatId);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Context-aware alias for {@link Client.enableBusinessBots}.
|
|
549
|
+
*/
|
|
550
|
+
async enableBusinessBots() {
|
|
551
|
+
const chatId = this.#mustGetChatId();
|
|
552
|
+
return await this.client.enableBusinessBots(chatId);
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Context-aware alias for {@link Client.enableJoinRequests}.
|
|
556
|
+
*/
|
|
557
|
+
async enableJoinRequests() {
|
|
558
|
+
const chatId = this.#mustGetChatId();
|
|
559
|
+
return await this.client.enableJoinRequests(chatId);
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Context-aware alias for {@link Client.enableSharing}.
|
|
563
|
+
*/
|
|
564
|
+
async enableSharing() {
|
|
565
|
+
const chatId = this.#mustGetChatId();
|
|
566
|
+
return await this.client.enableSharing(chatId);
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Context-aware alias for {@link Client.enableSignatures}.
|
|
570
|
+
*/
|
|
571
|
+
async enableSignatures(params) {
|
|
572
|
+
const chatId = this.#mustGetChatId();
|
|
573
|
+
return await this.client.enableSignatures(chatId, params);
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Context-aware alias for {@link Client.enableTopics}.
|
|
577
|
+
*/
|
|
578
|
+
async enableTopics(isShownAsTabs) {
|
|
579
|
+
const chatId = this.#mustGetChatId();
|
|
580
|
+
return await this.client.enableTopics(chatId, isShownAsTabs);
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Context-aware alias for {@link Client.forwardMessage}.
|
|
584
|
+
*/
|
|
585
|
+
async forward(to, params) {
|
|
586
|
+
const { chatId, messageId } = this.#mustGetMsg();
|
|
587
|
+
return await this.client.forwardMessage(chatId, to, messageId, params);
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Context-aware alias for {@link Client.forwardMessage}.
|
|
591
|
+
*/
|
|
592
|
+
async forwardMessage(to, messageId, params) {
|
|
593
|
+
const chatId = this.#mustGetChatId();
|
|
594
|
+
return await this.client.forwardMessage(chatId, to, messageId, params);
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Context-aware alias for {@link Client.forwardMessages}.
|
|
598
|
+
*/
|
|
599
|
+
async forwardMessages(to, messageIds, params) {
|
|
600
|
+
const chatId = this.#mustGetChatId();
|
|
601
|
+
return await this.client.forwardMessages(chatId, to, messageIds, params);
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Context-aware alias for {@link Client.getBusinessConnection}.
|
|
605
|
+
*/
|
|
606
|
+
async getBusinessConnection() {
|
|
607
|
+
const { businessConnectionId } = this.#mustGetMsg();
|
|
608
|
+
if (!businessConnectionId) {
|
|
455
609
|
unreachable();
|
|
456
610
|
}
|
|
457
|
-
return await this.client.
|
|
611
|
+
return await this.client.getBusinessConnection(businessConnectionId);
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Context-aware alias for {@link Client.getChat}.
|
|
615
|
+
*/
|
|
616
|
+
async getChat() {
|
|
617
|
+
const chatId = this.#mustGetChatId();
|
|
618
|
+
return await this.client.getChat(chatId);
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Context-aware alias for {@link Client.getChatAdministrators}.
|
|
622
|
+
*/
|
|
623
|
+
async getChatAdministrators() {
|
|
624
|
+
const chatId = this.#mustGetChatId();
|
|
625
|
+
return await this.client.getChatAdministrators(chatId);
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Context-aware alias for {@link Client.getChatMember}.
|
|
629
|
+
*/
|
|
630
|
+
async getChatMember(userId) {
|
|
631
|
+
const chatId = this.#mustGetChatId();
|
|
632
|
+
return await this.client.getChatMember(chatId, userId);
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Context-aware alias for {@link Client.getChatMembers}.
|
|
636
|
+
*/
|
|
637
|
+
async getChatMembers(params) {
|
|
638
|
+
const chatId = this.#mustGetChatId();
|
|
639
|
+
return await this.client.getChatMembers(chatId, params);
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Context-aware alias for {@link Client.getChatSettings}.
|
|
643
|
+
*/
|
|
644
|
+
async getChatSettings() {
|
|
645
|
+
const chatId = this.#mustGetChatId();
|
|
646
|
+
return await this.client.getChatSettings(chatId);
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Context-aware alias for {@link Client.getClaimedGifts}.
|
|
650
|
+
*/
|
|
651
|
+
async getClaimedGifts(params) {
|
|
652
|
+
const chatId = this.#mustGetChatId();
|
|
653
|
+
return await this.client.getClaimedGifts(chatId, params);
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Context-aware alias for {@link Client.getChatSettings}.
|
|
657
|
+
*/
|
|
658
|
+
async getCommonChats() {
|
|
659
|
+
const chatId = this.#mustGetChatId();
|
|
660
|
+
return await this.client.getCommonChats(chatId);
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Context-aware alias for {@link Client.getCreatedInviteLinks}.
|
|
664
|
+
*/
|
|
665
|
+
async getCreatedInviteLinks(params) {
|
|
666
|
+
const chatId = this.#mustGetChatId();
|
|
667
|
+
return await this.client.getCreatedInviteLinks(chatId, params);
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Context-aware alias for {@link Client.getHistory}.
|
|
671
|
+
*/
|
|
672
|
+
async getHistory(params) {
|
|
673
|
+
const chatId = this.#mustGetChatId();
|
|
674
|
+
return await this.client.getHistory(chatId, params);
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Context-aware alias for {@link Client.getJoinRequests}.
|
|
678
|
+
*/
|
|
679
|
+
async getJoinRequests(params) {
|
|
680
|
+
const chatId = this.#mustGetChatId();
|
|
681
|
+
return await this.client.getJoinRequests(chatId, params);
|
|
458
682
|
}
|
|
459
683
|
/**
|
|
460
684
|
* Context-aware alias for {@link Client.getMessage}.
|
|
@@ -463,6 +687,13 @@ export class Context {
|
|
|
463
687
|
const chatId = this.#mustGetChatId();
|
|
464
688
|
return await this.client.getMessage(chatId, messageId);
|
|
465
689
|
}
|
|
690
|
+
/**
|
|
691
|
+
* Context-aware alias for {@link Client.getMessageReactions}.
|
|
692
|
+
*/
|
|
693
|
+
async getMessageReactions(messageId) {
|
|
694
|
+
const chatId = this.#mustGetChatId();
|
|
695
|
+
return await this.client.getMessageReactions(chatId, messageId);
|
|
696
|
+
}
|
|
466
697
|
/**
|
|
467
698
|
* Context-aware alias for {@link Client.getMessages}.
|
|
468
699
|
*/
|
|
@@ -471,80 +702,132 @@ export class Context {
|
|
|
471
702
|
return await this.client.getMessages(chatId, messageIds);
|
|
472
703
|
}
|
|
473
704
|
/**
|
|
474
|
-
* Context-aware alias for {@link Client.
|
|
705
|
+
* Context-aware alias for {@link Client.getSavedMessages}.
|
|
475
706
|
*/
|
|
476
|
-
async
|
|
707
|
+
async getSavedMessages(params) {
|
|
477
708
|
const chatId = this.#mustGetChatId();
|
|
478
|
-
return await this.client.
|
|
709
|
+
return await this.client.getSavedMessages(chatId, params);
|
|
479
710
|
}
|
|
480
711
|
/**
|
|
481
|
-
* Context-aware alias for {@link Client.
|
|
712
|
+
* Context-aware alias for {@link Client.getSimilarBots}.
|
|
482
713
|
*/
|
|
483
|
-
async
|
|
714
|
+
async getSimilarBots() {
|
|
484
715
|
const chatId = this.#mustGetChatId();
|
|
485
|
-
return await this.client.
|
|
716
|
+
return await this.client.getSimilarBots(chatId);
|
|
486
717
|
}
|
|
487
718
|
/**
|
|
488
|
-
* Context-aware alias for {@link Client.
|
|
719
|
+
* Context-aware alias for {@link Client.getSimilarChannels}.
|
|
489
720
|
*/
|
|
490
|
-
async
|
|
721
|
+
async getSimilarChannels() {
|
|
491
722
|
const chatId = this.#mustGetChatId();
|
|
492
|
-
return await this.client.
|
|
723
|
+
return await this.client.getSimilarChannels(chatId);
|
|
493
724
|
}
|
|
494
725
|
/**
|
|
495
|
-
* Context-aware alias for {@link Client.
|
|
726
|
+
* Context-aware alias for {@link Client.getStories}.
|
|
496
727
|
*/
|
|
497
|
-
async
|
|
728
|
+
async getStories(storyIds) {
|
|
498
729
|
const chatId = this.#mustGetChatId();
|
|
499
|
-
return await this.client.
|
|
730
|
+
return await this.client.getStories(chatId, storyIds);
|
|
500
731
|
}
|
|
501
732
|
/**
|
|
502
|
-
* Context-aware alias for {@link Client.
|
|
733
|
+
* Context-aware alias for {@link Client.getStory}.
|
|
503
734
|
*/
|
|
504
|
-
async
|
|
735
|
+
async getStory(storyId) {
|
|
505
736
|
const chatId = this.#mustGetChatId();
|
|
506
|
-
return await this.client.
|
|
737
|
+
return await this.client.getStory(chatId, storyId);
|
|
507
738
|
}
|
|
508
739
|
/**
|
|
509
|
-
* Context-aware alias for {@link Client.
|
|
740
|
+
* Context-aware alias for {@link Client.sendGift}.
|
|
510
741
|
*/
|
|
511
|
-
async
|
|
742
|
+
async gift(giftId, params) {
|
|
512
743
|
const chatId = this.#mustGetChatId();
|
|
513
|
-
return await this.client.
|
|
744
|
+
return await this.client.sendGift(chatId, giftId, params);
|
|
514
745
|
}
|
|
515
746
|
/**
|
|
516
|
-
* Context-aware alias for {@link Client.
|
|
747
|
+
* Context-aware alias for {@link Client.hideGeneralTopic}.
|
|
517
748
|
*/
|
|
518
|
-
async
|
|
749
|
+
async hideGeneralTopic() {
|
|
519
750
|
const chatId = this.#mustGetChatId();
|
|
520
|
-
return await this.client.
|
|
751
|
+
return await this.client.hideGeneralTopic(chatId);
|
|
521
752
|
}
|
|
522
753
|
/**
|
|
523
|
-
* Context-aware alias for {@link Client.
|
|
754
|
+
* Context-aware alias for {@link Client.hideMemberList}.
|
|
524
755
|
*/
|
|
525
|
-
async
|
|
756
|
+
async hideMemberList() {
|
|
526
757
|
const chatId = this.#mustGetChatId();
|
|
527
|
-
return await this.client.
|
|
758
|
+
return await this.client.hideMemberList(chatId);
|
|
528
759
|
}
|
|
529
760
|
/**
|
|
530
|
-
* Context-aware alias for {@link Client.
|
|
761
|
+
* Context-aware alias for {@link Client.kickChatMember}.
|
|
531
762
|
*/
|
|
532
|
-
async
|
|
763
|
+
async kickChatMember(memberId) {
|
|
533
764
|
const chatId = this.#mustGetChatId();
|
|
534
|
-
return await this.client.
|
|
765
|
+
return await this.client.kickChatMember(chatId, memberId);
|
|
535
766
|
}
|
|
536
767
|
/**
|
|
537
|
-
* Context-aware alias for {@link Client.
|
|
768
|
+
* Context-aware alias for {@link Client.kickChatMember}.
|
|
538
769
|
*/
|
|
539
|
-
async
|
|
770
|
+
async kickSender() {
|
|
771
|
+
const { chatId, senderId } = this.#mustGetMsg();
|
|
772
|
+
if (!senderId) {
|
|
773
|
+
unreachable();
|
|
774
|
+
}
|
|
775
|
+
return await this.client.kickChatMember(chatId, senderId);
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Context-aware alias for {@link Client.leaveChat}.
|
|
779
|
+
*/
|
|
780
|
+
async leaveChat() {
|
|
540
781
|
const chatId = this.#mustGetChatId();
|
|
541
|
-
return await this.client.
|
|
782
|
+
return await this.client.leaveChat(chatId);
|
|
542
783
|
}
|
|
543
784
|
/**
|
|
544
|
-
* Context-aware alias for {@link Client.
|
|
785
|
+
* Context-aware alias for {@link Client.openChat}.
|
|
545
786
|
*/
|
|
546
|
-
async
|
|
787
|
+
async open() {
|
|
788
|
+
const chatId = this.#mustGetChatId();
|
|
789
|
+
return await this.client.openChat(chatId);
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Context-aware alias for {@link Client.pauseBusinessBotConnection}.
|
|
793
|
+
*/
|
|
794
|
+
async pauseBusinessBotConnection() {
|
|
795
|
+
const chatId = this.#mustGetChatId();
|
|
796
|
+
return await this.client.pauseBusinessBotConnection(chatId);
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Context-aware alias for {@link Client.pinMessage}.
|
|
800
|
+
*/
|
|
801
|
+
async pin(params) {
|
|
802
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
803
|
+
return await this.client.pinMessage(chatId, messageId, { ...params, businessConnectionId });
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Context-aware alias for {@link Client.pinMessage}.
|
|
807
|
+
*/
|
|
808
|
+
async pinMessage(messageId, params) {
|
|
809
|
+
const chatId = this.#mustGetChatId();
|
|
810
|
+
return await this.client.pinMessage(chatId, messageId, params);
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Context-aware alias for {@link Client.pinTopic}.
|
|
814
|
+
*/
|
|
815
|
+
async pinTopic(topicId) {
|
|
547
816
|
const chatId = this.#mustGetChatId();
|
|
817
|
+
return await this.client.pinTopic(chatId, topicId);
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Context-aware alias for {@link Client.promoteChatMember}.
|
|
821
|
+
*/
|
|
822
|
+
async promoteChatMember(userId, params) {
|
|
823
|
+
const chatId = this.#mustGetChatId();
|
|
824
|
+
return await this.client.promoteChatMember(chatId, userId, params);
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Context-aware alias for {@link Client.setReactions}.
|
|
828
|
+
*/
|
|
829
|
+
async react(reactions, params) {
|
|
830
|
+
const { chatId, messageId } = this.#mustGetMsg();
|
|
548
831
|
return await this.client.setReactions(chatId, messageId, reactions, params);
|
|
549
832
|
}
|
|
550
833
|
/**
|
|
@@ -555,60 +838,204 @@ export class Context {
|
|
|
555
838
|
return await this.client.readMessages(chatId, messageId);
|
|
556
839
|
}
|
|
557
840
|
/**
|
|
558
|
-
* Context-aware alias for {@link Client.
|
|
841
|
+
* Context-aware alias for {@link Client.refundStarPayment}.
|
|
559
842
|
*/
|
|
560
|
-
async
|
|
843
|
+
async refundStarPayment(telegramPaymentChargeId) {
|
|
561
844
|
const chatId = this.#mustGetChatId();
|
|
562
|
-
return await this.client.
|
|
845
|
+
return await this.client.refundStarPayment(chatId, telegramPaymentChargeId);
|
|
563
846
|
}
|
|
564
847
|
/**
|
|
565
|
-
* Context-aware alias for {@link Client.
|
|
848
|
+
* Context-aware alias for {@link Client.deleteContact}.
|
|
566
849
|
*/
|
|
567
|
-
async
|
|
850
|
+
async removeAsContact() {
|
|
568
851
|
const chatId = this.#mustGetChatId();
|
|
569
|
-
return await this.client.
|
|
852
|
+
return await this.client.deleteContact(chatId);
|
|
570
853
|
}
|
|
571
854
|
/**
|
|
572
|
-
* Context-aware alias for {@link Client.
|
|
855
|
+
* Context-aware alias for {@link Client.removeReaction}.
|
|
573
856
|
*/
|
|
574
|
-
async
|
|
857
|
+
async removeReaction(messageId, reaction) {
|
|
575
858
|
const chatId = this.#mustGetChatId();
|
|
576
|
-
return await this.client.
|
|
859
|
+
return await this.client.removeReaction(chatId, messageId, reaction);
|
|
577
860
|
}
|
|
578
861
|
/**
|
|
579
|
-
* Context-aware alias for {@link Client.
|
|
862
|
+
* Context-aware alias for {@link Client.removeStoriesFromHighlights}.
|
|
580
863
|
*/
|
|
581
|
-
async
|
|
864
|
+
async removeStoriesFromHighlights(storyIds) {
|
|
582
865
|
const chatId = this.#mustGetChatId();
|
|
583
|
-
return await this.client.
|
|
866
|
+
return await this.client.removeStoriesFromHighlights(chatId, storyIds);
|
|
584
867
|
}
|
|
585
868
|
/**
|
|
586
|
-
* Context-aware alias for {@link Client.
|
|
869
|
+
* Context-aware alias for {@link Client.removeStoryFromHighlights}.
|
|
587
870
|
*/
|
|
588
|
-
async
|
|
871
|
+
async removeStoryFromHighlights(storyId) {
|
|
589
872
|
const chatId = this.#mustGetChatId();
|
|
590
|
-
return await this.client.
|
|
873
|
+
return await this.client.removeStoryFromHighlights(chatId, storyId);
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Context-aware alias for {@link Client.reopenTopic}.
|
|
877
|
+
*/
|
|
878
|
+
async reopenTopic(topicId) {
|
|
879
|
+
const chatId = this.#mustGetChatId();
|
|
880
|
+
return await this.client.reopenTopic(chatId, topicId);
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Context-aware alias for {@link Client.sendMessage}.
|
|
884
|
+
*/
|
|
885
|
+
async reply(text, params) {
|
|
886
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
887
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
888
|
+
return await this.client.sendMessage(chatId, text, { ...params, ...replyTo, businessConnectionId });
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Context-aware alias for {@link Client.sendAnimation}.
|
|
892
|
+
*/
|
|
893
|
+
async replyAnimation(animation, params) {
|
|
894
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
895
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
896
|
+
return await this.client.sendAnimation(chatId, animation, { ...params, ...replyTo, businessConnectionId });
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* Context-aware alias for {@link Client.sendAudio}.
|
|
900
|
+
*/
|
|
901
|
+
async replyAudio(audio, params) {
|
|
902
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
903
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
904
|
+
return await this.client.sendAudio(chatId, audio, { ...params, ...replyTo, businessConnectionId });
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Context-aware alias for {@link Client.sendChecklist}.
|
|
908
|
+
*/
|
|
909
|
+
async replyChecklist(title, items, params) {
|
|
910
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
911
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
912
|
+
return await this.client.sendChecklist(chatId, title, items, { ...params, ...replyTo, businessConnectionId });
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Context-aware alias for {@link Client.sendContact}.
|
|
916
|
+
*/
|
|
917
|
+
async replyContact(firstName, number, params) {
|
|
918
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
919
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
920
|
+
return await this.client.sendContact(chatId, firstName, number, { ...params, ...replyTo, businessConnectionId });
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Context-aware alias for {@link Client.sendDice}.
|
|
924
|
+
*/
|
|
925
|
+
async replyDice(params) {
|
|
926
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
927
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
928
|
+
return await this.client.sendDice(chatId, { ...params, ...replyTo, businessConnectionId });
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* Context-aware alias for {@link Client.sendDocument}.
|
|
932
|
+
*/
|
|
933
|
+
async replyDocument(document, params) {
|
|
934
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
935
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
936
|
+
return await this.client.sendDocument(chatId, document, { ...params, ...replyTo, businessConnectionId });
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Context-aware alias for {@link Client.sendMessageDraft}.
|
|
940
|
+
*/
|
|
941
|
+
async replyDraft(draftId, text, params) {
|
|
942
|
+
const { chatId, messageId } = this.#mustGetMsg();
|
|
943
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
944
|
+
return await this.client.sendMessageDraft(chatId, draftId, text, { ...params, ...replyTo });
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Context-aware alias for {@link Client.sendInvoice}.
|
|
948
|
+
*/
|
|
949
|
+
async replyInvoice(title, description, payload, currency, prices, params) {
|
|
950
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
951
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
952
|
+
return await this.client.sendInvoice(chatId, title, description, payload, currency, prices, { ...params, ...replyTo, businessConnectionId });
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* Context-aware alias for {@link Client.sendLocation}.
|
|
956
|
+
*/
|
|
957
|
+
async replyLocation(latitude, longitude, params) {
|
|
958
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
959
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
960
|
+
return await this.client.sendLocation(chatId, latitude, longitude, { ...params, ...replyTo, businessConnectionId });
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Context-aware alias for {@link Client.sendMediaGroup}.
|
|
964
|
+
*/
|
|
965
|
+
async replyMediaGroup(media, params) {
|
|
966
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
967
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
968
|
+
return await this.client.sendMediaGroup(chatId, media, { ...params, ...replyTo, businessConnectionId });
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* Context-aware alias for {@link Client.sendPhoto}.
|
|
972
|
+
*/
|
|
973
|
+
async replyPhoto(photo, params) {
|
|
974
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
975
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
976
|
+
return await this.client.sendPhoto(chatId, photo, { ...params, ...replyTo, businessConnectionId });
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Context-aware alias for {@link Client.sendPoll}.
|
|
980
|
+
*/
|
|
981
|
+
async replyPoll(question, options, params) {
|
|
982
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
983
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
984
|
+
return await this.client.sendPoll(chatId, question, options, { ...params, ...replyTo, businessConnectionId });
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Context-aware alias for {@link Client.sendSticker}.
|
|
988
|
+
*/
|
|
989
|
+
async replySticker(sticker, params) {
|
|
990
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
991
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
992
|
+
return await this.client.sendSticker(chatId, sticker, { ...params, ...replyTo, businessConnectionId });
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Context-aware alias for {@link Client.sendVenue}.
|
|
996
|
+
*/
|
|
997
|
+
async replyVenue(latitude, longitude, title, address, params) {
|
|
998
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
999
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1000
|
+
return await this.client.sendVenue(chatId, latitude, longitude, title, address, { ...params, ...replyTo, businessConnectionId });
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Context-aware alias for {@link Client.sendVideo}.
|
|
1004
|
+
*/
|
|
1005
|
+
async replyVideo(video, params) {
|
|
1006
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1007
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1008
|
+
return await this.client.sendVideo(chatId, video, { ...params, ...replyTo, businessConnectionId });
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Context-aware alias for {@link Client.sendVideoNote}.
|
|
1012
|
+
*/
|
|
1013
|
+
async replyVideoNote(videoNote, params) {
|
|
1014
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1015
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1016
|
+
return await this.client.sendVideoNote(chatId, videoNote, { ...params, ...replyTo, businessConnectionId });
|
|
591
1017
|
}
|
|
592
1018
|
/**
|
|
593
|
-
* Context-aware alias for {@link Client.
|
|
1019
|
+
* Context-aware alias for {@link Client.sendVoice}.
|
|
594
1020
|
*/
|
|
595
|
-
async
|
|
596
|
-
const chatId = this.#
|
|
597
|
-
|
|
1021
|
+
async replyVoice(voice, params) {
|
|
1022
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1023
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1024
|
+
return await this.client.sendVoice(chatId, voice, { ...params, ...replyTo, businessConnectionId });
|
|
598
1025
|
}
|
|
599
1026
|
/**
|
|
600
|
-
* Context-aware alias for {@link Client.
|
|
1027
|
+
* Context-aware alias for {@link Client.resumeBusinessBotConnection}.
|
|
601
1028
|
*/
|
|
602
|
-
async
|
|
1029
|
+
async resumeBusinessBotConnection() {
|
|
603
1030
|
const chatId = this.#mustGetChatId();
|
|
604
|
-
return await this.client.
|
|
1031
|
+
return await this.client.resumeBusinessBotConnection(chatId);
|
|
605
1032
|
}
|
|
606
1033
|
/**
|
|
607
|
-
* Context-aware alias for {@link Client.
|
|
1034
|
+
* Context-aware alias for {@link Client.scheduleVideoChat}.
|
|
608
1035
|
*/
|
|
609
|
-
async
|
|
1036
|
+
async scheduleVideoChat(startAt, params) {
|
|
610
1037
|
const chatId = this.#mustGetChatId();
|
|
611
|
-
return await this.client.
|
|
1038
|
+
return await this.client.scheduleVideoChat(chatId, startAt, params);
|
|
612
1039
|
}
|
|
613
1040
|
/**
|
|
614
1041
|
* Context-aware alias for {@link Client.searchMessages}.
|
|
@@ -620,58 +1047,53 @@ export class Context {
|
|
|
620
1047
|
return await this.client.searchMessages(params);
|
|
621
1048
|
}
|
|
622
1049
|
/**
|
|
623
|
-
* Context-aware alias for {@link Client.
|
|
1050
|
+
* Context-aware alias for {@link Client.sendChatAction}.
|
|
624
1051
|
*/
|
|
625
|
-
async
|
|
1052
|
+
async sendChatAction(action, params) {
|
|
626
1053
|
const chatId = this.#mustGetChatId();
|
|
627
|
-
return await this.client.
|
|
1054
|
+
return await this.client.sendChatAction(chatId, action, params);
|
|
628
1055
|
}
|
|
629
1056
|
/**
|
|
630
|
-
* Context-aware alias for {@link Client.
|
|
1057
|
+
* Context-aware alias for {@link Client.sendScheduledMessage}.
|
|
631
1058
|
*/
|
|
632
|
-
async
|
|
1059
|
+
async sendScheduledMessage(messageId) {
|
|
633
1060
|
const chatId = this.#mustGetChatId();
|
|
634
|
-
return await this.client.
|
|
1061
|
+
return await this.client.sendScheduledMessage(chatId, messageId);
|
|
635
1062
|
}
|
|
636
1063
|
/**
|
|
637
|
-
* Context-aware alias for {@link Client.
|
|
1064
|
+
* Context-aware alias for {@link Client.setAvailableReactions}.
|
|
638
1065
|
*/
|
|
639
|
-
async
|
|
1066
|
+
async setAvailableReactions(availableReactions) {
|
|
640
1067
|
const chatId = this.#mustGetChatId();
|
|
641
|
-
return await this.client.
|
|
1068
|
+
return await this.client.setAvailableReactions(chatId, availableReactions);
|
|
642
1069
|
}
|
|
643
1070
|
/**
|
|
644
|
-
* Context-aware alias for {@link Client.
|
|
1071
|
+
* Context-aware alias for {@link Client.setBoostsRequiredToCircumventRestrictions}.
|
|
645
1072
|
*/
|
|
646
|
-
async
|
|
1073
|
+
async setBoostsRequiredToCircumventRestrictions(boosts) {
|
|
647
1074
|
const chatId = this.#mustGetChatId();
|
|
648
|
-
return await this.client.
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Context-aware alias for {@link Client.blockUser}.
|
|
652
|
-
*/
|
|
653
|
-
async blockUser() {
|
|
654
|
-
return await this.client.blockUser(this.#mustGetUserId());
|
|
1075
|
+
return await this.client.setBoostsRequiredToCircumventRestrictions(chatId, boosts);
|
|
655
1076
|
}
|
|
656
1077
|
/**
|
|
657
|
-
* Context-aware alias for {@link Client.
|
|
1078
|
+
* Context-aware alias for {@link Client.setChatDescription}.
|
|
658
1079
|
*/
|
|
659
|
-
async
|
|
660
|
-
|
|
1080
|
+
async setChatDescription(description) {
|
|
1081
|
+
const chatId = this.#mustGetChatId();
|
|
1082
|
+
return await this.client.setChatDescription(chatId, description);
|
|
661
1083
|
}
|
|
662
1084
|
/**
|
|
663
|
-
* Context-aware alias for {@link Client.
|
|
1085
|
+
* Context-aware alias for {@link Client.setChatMemberRights}.
|
|
664
1086
|
*/
|
|
665
|
-
async
|
|
1087
|
+
async setChatMemberRights(memberId, params) {
|
|
666
1088
|
const chatId = this.#mustGetChatId();
|
|
667
|
-
return await this.client.
|
|
1089
|
+
return await this.client.setChatMemberRights(chatId, memberId, params);
|
|
668
1090
|
}
|
|
669
1091
|
/**
|
|
670
|
-
* Context-aware alias for {@link Client.
|
|
1092
|
+
* Context-aware alias for {@link Client.setChatPhoto}.
|
|
671
1093
|
*/
|
|
672
|
-
async
|
|
1094
|
+
async setChatPhoto(photo, params) {
|
|
673
1095
|
const chatId = this.#mustGetChatId();
|
|
674
|
-
return await this.client.
|
|
1096
|
+
return await this.client.setChatPhoto(chatId, photo, params);
|
|
675
1097
|
}
|
|
676
1098
|
/**
|
|
677
1099
|
* Context-aware alias for {@link Client.setChatStickerSet}.
|
|
@@ -681,50 +1103,18 @@ export class Context {
|
|
|
681
1103
|
return await this.client.setChatStickerSet(chatId, setName);
|
|
682
1104
|
}
|
|
683
1105
|
/**
|
|
684
|
-
* Context-aware alias for {@link Client.
|
|
1106
|
+
* Context-aware alias for {@link Client.setChatTitle}.
|
|
685
1107
|
*/
|
|
686
|
-
async
|
|
1108
|
+
async setChatTitle(title) {
|
|
687
1109
|
const chatId = this.#mustGetChatId();
|
|
688
|
-
return await this.client.
|
|
689
|
-
}
|
|
690
|
-
/**
|
|
691
|
-
* Context-aware alias for {@link Client.getBusinessConnection}.
|
|
692
|
-
*/
|
|
693
|
-
async getBusinessConnection() {
|
|
694
|
-
const { businessConnectionId } = this.#mustGetMsg();
|
|
695
|
-
if (!businessConnectionId) {
|
|
696
|
-
unreachable();
|
|
697
|
-
}
|
|
698
|
-
return await this.client.getBusinessConnection(businessConnectionId);
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
* Context-aware alias for {@link Client.answerPreCheckoutQuery}.
|
|
702
|
-
*/
|
|
703
|
-
async answerPreCheckoutQuery(ok, params) {
|
|
704
|
-
if (!("preCheckoutQuery" in this.update)) {
|
|
705
|
-
unreachable();
|
|
706
|
-
}
|
|
707
|
-
return await this.client.answerPreCheckoutQuery(this.update.preCheckoutQuery.id, ok, params);
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Context-aware alias for {@link Client.approveJoinRequest}.
|
|
711
|
-
*/
|
|
712
|
-
async approveJoinRequest() {
|
|
713
|
-
const { chatId, userId } = this.#mustGetMsg();
|
|
714
|
-
if (!userId) {
|
|
715
|
-
unreachable();
|
|
716
|
-
}
|
|
717
|
-
return await this.client.approveJoinRequest(chatId, userId);
|
|
1110
|
+
return await this.client.setChatTitle(chatId, title);
|
|
718
1111
|
}
|
|
719
1112
|
/**
|
|
720
|
-
* Context-aware alias for {@link Client.
|
|
1113
|
+
* Context-aware alias for {@link Client.setDiscussionChat}.
|
|
721
1114
|
*/
|
|
722
|
-
async
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
unreachable();
|
|
726
|
-
}
|
|
727
|
-
return await this.client.declineJoinRequest(chatId, userId);
|
|
1115
|
+
async setDiscussionChat(discussionChatId) {
|
|
1116
|
+
const chatId = this.#mustGetChatId();
|
|
1117
|
+
return await this.client.setDiscussionChat(chatId, discussionChatId);
|
|
728
1118
|
}
|
|
729
1119
|
/**
|
|
730
1120
|
* Context-aware alias for {@link Client.setChatMemberTag}.
|
|
@@ -737,39 +1127,28 @@ export class Context {
|
|
|
737
1127
|
return await this.client.setChatMemberTag(chatId, userId, params);
|
|
738
1128
|
}
|
|
739
1129
|
/**
|
|
740
|
-
* Context-aware alias for {@link Client.
|
|
741
|
-
*/
|
|
742
|
-
async enableSharing() {
|
|
743
|
-
const chatId = this.#mustGetChatId();
|
|
744
|
-
return await this.client.enableSharing(chatId);
|
|
745
|
-
}
|
|
746
|
-
/**
|
|
747
|
-
* Context-aware alias for {@link Client.disableSharing}.
|
|
748
|
-
*/
|
|
749
|
-
async disableSharing() {
|
|
750
|
-
const chatId = this.#mustGetChatId();
|
|
751
|
-
return await this.client.disableSharing(chatId);
|
|
752
|
-
}
|
|
753
|
-
/**
|
|
754
|
-
* Context-aware alias for {@link Client.pauseBusinessBotConnection}.
|
|
1130
|
+
* Context-aware alias for {@link Client.setMessageTtl}.
|
|
755
1131
|
*/
|
|
756
|
-
async
|
|
1132
|
+
async setMessageTtl(messageTtl) {
|
|
757
1133
|
const chatId = this.#mustGetChatId();
|
|
758
|
-
return await this.client.
|
|
1134
|
+
return await this.client.setMessageTtl(chatId, messageTtl);
|
|
759
1135
|
}
|
|
760
1136
|
/**
|
|
761
|
-
* Context-aware alias for {@link Client.
|
|
1137
|
+
* Context-aware alias for {@link Client.setReactions}.
|
|
762
1138
|
*/
|
|
763
|
-
async
|
|
1139
|
+
async setReactions(messageId, reactions, params) {
|
|
764
1140
|
const chatId = this.#mustGetChatId();
|
|
765
|
-
return await this.client.
|
|
1141
|
+
return await this.client.setReactions(chatId, messageId, reactions, params);
|
|
766
1142
|
}
|
|
767
1143
|
/**
|
|
768
|
-
* Context-aware alias for {@link Client.
|
|
1144
|
+
* Context-aware alias for {@link Client.setChatMemberRights}.
|
|
769
1145
|
*/
|
|
770
|
-
async
|
|
771
|
-
const chatId = this.#
|
|
772
|
-
|
|
1146
|
+
async setSenderRights(params) {
|
|
1147
|
+
const { chatId, senderId } = this.#mustGetMsg();
|
|
1148
|
+
if (!senderId) {
|
|
1149
|
+
unreachable();
|
|
1150
|
+
}
|
|
1151
|
+
return await this.client.setChatMemberRights(chatId, senderId, params);
|
|
773
1152
|
}
|
|
774
1153
|
/**
|
|
775
1154
|
* Context-aware alias for {@link Client.setSlowMode}.
|
|
@@ -779,25 +1158,11 @@ export class Context {
|
|
|
779
1158
|
return await this.client.setSlowMode(chatId, duration);
|
|
780
1159
|
}
|
|
781
1160
|
/**
|
|
782
|
-
* Context-aware alias for {@link Client.
|
|
783
|
-
*/
|
|
784
|
-
async setChatTitle(title) {
|
|
785
|
-
const chatId = this.#mustGetChatId();
|
|
786
|
-
return await this.client.setChatTitle(chatId, title);
|
|
787
|
-
}
|
|
788
|
-
/**
|
|
789
|
-
* Context-aware alias for {@link Client.setChatDescription}.
|
|
790
|
-
*/
|
|
791
|
-
async setChatDescription(description) {
|
|
792
|
-
const chatId = this.#mustGetChatId();
|
|
793
|
-
return await this.client.setChatDescription(chatId, description);
|
|
794
|
-
}
|
|
795
|
-
/**
|
|
796
|
-
* Context-aware alias for {@link Client.hideMemberList}.
|
|
1161
|
+
* Context-aware alias for {@link Client.showGeneralTopic}.
|
|
797
1162
|
*/
|
|
798
|
-
async
|
|
1163
|
+
async showGeneralTopic() {
|
|
799
1164
|
const chatId = this.#mustGetChatId();
|
|
800
|
-
return await this.client.
|
|
1165
|
+
return await this.client.showGeneralTopic(chatId);
|
|
801
1166
|
}
|
|
802
1167
|
/**
|
|
803
1168
|
* Context-aware alias for {@link Client.showMemberList}.
|
|
@@ -807,122 +1172,100 @@ export class Context {
|
|
|
807
1172
|
return await this.client.showMemberList(chatId);
|
|
808
1173
|
}
|
|
809
1174
|
/**
|
|
810
|
-
* Context-aware alias for {@link Client.
|
|
811
|
-
*/
|
|
812
|
-
async enableTopics(isShownAsTabs) {
|
|
813
|
-
const chatId = this.#mustGetChatId();
|
|
814
|
-
return await this.client.enableTopics(chatId, isShownAsTabs);
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* Context-aware alias for {@link Client.disableTopics}.
|
|
818
|
-
*/
|
|
819
|
-
async disableTopics() {
|
|
820
|
-
const chatId = this.#mustGetChatId();
|
|
821
|
-
return await this.client.disableTopics(chatId);
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* Context-aware alias for {@link Client.enableAntispam}.
|
|
1175
|
+
* Context-aware alias for {@link Client.startVideoChat}.
|
|
825
1176
|
*/
|
|
826
|
-
async
|
|
827
|
-
const chatId = this.#mustGetChatId();
|
|
828
|
-
return await this.client.enableAntispam(chatId);
|
|
829
|
-
}
|
|
830
|
-
/**
|
|
831
|
-
* Context-aware alias for {@link Client.disableAntispam}.
|
|
832
|
-
*/
|
|
833
|
-
async disableAntispam() {
|
|
1177
|
+
async startVideoChat(params) {
|
|
834
1178
|
const chatId = this.#mustGetChatId();
|
|
835
|
-
return await this.client.
|
|
1179
|
+
return await this.client.startVideoChat(chatId, params);
|
|
836
1180
|
}
|
|
837
1181
|
/**
|
|
838
|
-
* Context-aware alias for {@link Client.
|
|
1182
|
+
* Context-aware alias for {@link Client.stopPoll}.
|
|
839
1183
|
*/
|
|
840
|
-
async
|
|
1184
|
+
async stopPoll(messageId, params) {
|
|
841
1185
|
const chatId = this.#mustGetChatId();
|
|
842
|
-
return await this.client.
|
|
1186
|
+
return await this.client.stopPoll(chatId, messageId, params);
|
|
843
1187
|
}
|
|
844
1188
|
/**
|
|
845
|
-
* Context-aware alias for {@link Client.
|
|
1189
|
+
* Context-aware alias for {@link Client.transcribeVoice}.
|
|
846
1190
|
*/
|
|
847
|
-
async
|
|
1191
|
+
async transcribeVoice(messageId) {
|
|
848
1192
|
const chatId = this.#mustGetChatId();
|
|
849
|
-
return await this.client.
|
|
1193
|
+
return await this.client.transcribeVoice(chatId, messageId);
|
|
850
1194
|
}
|
|
851
1195
|
/**
|
|
852
|
-
* Context-aware alias for {@link Client.
|
|
1196
|
+
* Context-aware alias for {@link Client.transferChatOwnership}.
|
|
853
1197
|
*/
|
|
854
|
-
async
|
|
1198
|
+
async transferOwnership(userId, password) {
|
|
855
1199
|
const chatId = this.#mustGetChatId();
|
|
856
|
-
return await this.client.
|
|
1200
|
+
return await this.client.transferChatOwnership(chatId, userId, password);
|
|
857
1201
|
}
|
|
858
1202
|
/**
|
|
859
|
-
* Context-aware alias for {@link Client.
|
|
1203
|
+
* Context-aware alias for {@link Client.unarchiveChat}.
|
|
860
1204
|
*/
|
|
861
|
-
async
|
|
1205
|
+
async unarchive() {
|
|
862
1206
|
const chatId = this.#mustGetChatId();
|
|
863
|
-
return await this.client.
|
|
1207
|
+
return await this.client.unarchiveChat(chatId);
|
|
864
1208
|
}
|
|
865
1209
|
/**
|
|
866
|
-
* Context-aware alias for {@link Client.
|
|
1210
|
+
* Context-aware alias for {@link Client.unbanChatMember}.
|
|
867
1211
|
*/
|
|
868
|
-
async
|
|
1212
|
+
async unbanChatMember(memberId) {
|
|
869
1213
|
const chatId = this.#mustGetChatId();
|
|
870
|
-
return await this.client.
|
|
1214
|
+
return await this.client.unbanChatMember(chatId, memberId);
|
|
871
1215
|
}
|
|
872
1216
|
/**
|
|
873
|
-
* Context-aware alias for {@link Client.
|
|
1217
|
+
* Context-aware alias for {@link Client.unblockUser}.
|
|
874
1218
|
*/
|
|
875
|
-
async
|
|
876
|
-
|
|
877
|
-
return await this.client.createTopic(chatId, title, params);
|
|
1219
|
+
async unblockUser() {
|
|
1220
|
+
return await this.client.unblockUser(this.#mustGetUserId());
|
|
878
1221
|
}
|
|
879
1222
|
/**
|
|
880
|
-
* Context-aware alias for {@link Client.
|
|
1223
|
+
* Context-aware alias for {@link Client.uncheckChecklistItem}.
|
|
881
1224
|
*/
|
|
882
|
-
async
|
|
1225
|
+
async uncheckChecklistItem(messageId, item) {
|
|
883
1226
|
const chatId = this.#mustGetChatId();
|
|
884
|
-
return await this.client.
|
|
1227
|
+
return await this.client.uncheckChecklistItem(chatId, messageId, item);
|
|
885
1228
|
}
|
|
886
1229
|
/**
|
|
887
|
-
* Context-aware alias for {@link Client.
|
|
1230
|
+
* Context-aware alias for {@link Client.uncheckChecklistItems}.
|
|
888
1231
|
*/
|
|
889
|
-
async
|
|
1232
|
+
async uncheckChecklistItems(messageId, items) {
|
|
890
1233
|
const chatId = this.#mustGetChatId();
|
|
891
|
-
return await this.client.
|
|
1234
|
+
return await this.client.uncheckChecklistItems(chatId, messageId, items);
|
|
892
1235
|
}
|
|
893
1236
|
/**
|
|
894
|
-
* Context-aware alias for {@link Client.
|
|
1237
|
+
* Context-aware alias for {@link Client.unpinMessage}.
|
|
895
1238
|
*/
|
|
896
|
-
async
|
|
897
|
-
const chatId = this.#
|
|
898
|
-
return await this.client.
|
|
1239
|
+
async unpin() {
|
|
1240
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1241
|
+
return await this.client.unpinMessage(chatId, messageId, { businessConnectionId });
|
|
899
1242
|
}
|
|
900
1243
|
/**
|
|
901
|
-
* Context-aware alias for {@link Client.
|
|
1244
|
+
* Context-aware alias for {@link Client.unpinMessage}.
|
|
902
1245
|
*/
|
|
903
|
-
async
|
|
1246
|
+
async unpinMessage(messageId) {
|
|
904
1247
|
const chatId = this.#mustGetChatId();
|
|
905
|
-
return await this.client.
|
|
1248
|
+
return await this.client.unpinMessage(chatId, messageId);
|
|
906
1249
|
}
|
|
907
1250
|
/**
|
|
908
|
-
* Context-aware alias for {@link Client.
|
|
1251
|
+
* Context-aware alias for {@link Client.unpinMessages}.
|
|
909
1252
|
*/
|
|
910
|
-
async
|
|
1253
|
+
async unpinMessages() {
|
|
911
1254
|
const chatId = this.#mustGetChatId();
|
|
912
|
-
return await this.client.
|
|
1255
|
+
return await this.client.unpinMessages(chatId);
|
|
913
1256
|
}
|
|
914
1257
|
/**
|
|
915
|
-
* Context-aware alias for {@link Client.
|
|
1258
|
+
* Context-aware alias for {@link Client.unpinTopic}.
|
|
916
1259
|
*/
|
|
917
|
-
async
|
|
1260
|
+
async unpinTopic(topicId) {
|
|
918
1261
|
const chatId = this.#mustGetChatId();
|
|
919
|
-
return await this.client.
|
|
1262
|
+
return await this.client.unpinTopic(chatId, topicId);
|
|
920
1263
|
}
|
|
921
1264
|
/**
|
|
922
|
-
* Context-aware alias for {@link Client.
|
|
1265
|
+
* Context-aware alias for {@link Client.updateChecklist}.
|
|
923
1266
|
*/
|
|
924
|
-
async
|
|
1267
|
+
async updateChecklist(messageId, params) {
|
|
925
1268
|
const chatId = this.#mustGetChatId();
|
|
926
|
-
return await this.client.
|
|
1269
|
+
return await this.client.updateChecklist(chatId, messageId, params);
|
|
927
1270
|
}
|
|
928
1271
|
}
|