@mtkruto/node 0.190.0 → 0.192.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 +6 -2
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +6 -2
- 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 +1168 -1075
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/3_account_manager.d.ts +4 -0
- package/esm/client/3_account_manager.d.ts.map +1 -1
- package/esm/client/3_account_manager.js +20 -1
- package/esm/client/3_message_manager.d.ts +2 -1
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +7 -0
- package/esm/client/3_secret_chat_manager.d.ts +4 -1
- package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
- package/esm/client/3_secret_chat_manager.js +31 -0
- package/esm/client/4_context.d.ts +12 -2
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +25 -0
- package/esm/client/4_forum_manager.d.ts +4 -1
- package/esm/client/4_forum_manager.d.ts.map +1 -1
- package/esm/client/4_forum_manager.js +33 -1
- package/esm/client/6_client.d.ts +1166 -1075
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +1528 -1413
- package/esm/client/6_client_dispatcher.d.ts +1168 -1075
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +1502 -1391
- package/esm/types/0_report_reason.d.ts +1 -0
- package/esm/types/0_report_reason.d.ts.map +1 -1
- package/esm/types/0_secret_chat_action_type.d.ts +69 -0
- package/esm/types/0_secret_chat_action_type.d.ts.map +1 -0
- package/esm/types/0_secret_chat_action_type.js +46 -0
- package/esm/types/0_story_report_option.d.ts +3 -0
- package/esm/types/0_story_report_option.d.ts.map +1 -1
- package/esm/types/1_chat_p.d.ts +1 -5
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_story_report_result.d.ts +17 -3
- package/esm/types/1_story_report_result.d.ts.map +1 -1
- package/esm/types/2_secret_message.d.ts +1 -0
- package/esm/types/2_secret_message.d.ts.map +1 -1
- package/esm/types/3_bot_access_settings.d.ts +3 -0
- package/esm/types/3_bot_access_settings.d.ts.map +1 -1
- package/esm/types/3_connected_website.d.ts +45 -0
- package/esm/types/3_connected_website.d.ts.map +1 -0
- package/esm/types/3_connected_website.js +39 -0
- package/esm/types/3_poll_voter_list.d.ts +2 -1
- package/esm/types/3_poll_voter_list.d.ts.map +1 -1
- package/esm/types/3_text_to_translate.d.ts +3 -0
- package/esm/types/3_text_to_translate.d.ts.map +1 -1
- package/esm/types/3_translated_text.d.ts +3 -0
- package/esm/types/3_translated_text.d.ts.map +1 -1
- package/esm/types/9_message.d.ts +8 -1
- package/esm/types/9_message.d.ts.map +1 -1
- package/esm/types/9_message.js +3 -0
- package/esm/types/A_topic.d.ts +20 -3
- package/esm/types/A_topic.d.ts.map +1 -1
- package/esm/types/A_topic.js +37 -0
- package/esm/types/B_topic_list_item.d.ts +7 -0
- package/esm/types/B_topic_list_item.d.ts.map +1 -0
- package/esm/types/B_topic_list_item.js +1 -0
- package/esm/types/B_update.d.ts +16 -1
- package/esm/types/B_update.d.ts.map +1 -1
- package/esm/types/C_topic_list.d.ts +14 -0
- package/esm/types/C_topic_list.d.ts.map +1 -0
- package/esm/types/C_topic_list.js +9 -0
- package/package.json +1 -1
- package/script/3_types.d.ts +6 -2
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +6 -2
- 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 +1168 -1075
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/3_account_manager.d.ts +4 -0
- package/script/client/3_account_manager.d.ts.map +1 -1
- package/script/client/3_account_manager.js +19 -0
- package/script/client/3_message_manager.d.ts +2 -1
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +7 -0
- package/script/client/3_secret_chat_manager.d.ts +4 -1
- package/script/client/3_secret_chat_manager.d.ts.map +1 -1
- package/script/client/3_secret_chat_manager.js +31 -0
- package/script/client/4_context.d.ts +12 -2
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +25 -0
- package/script/client/4_forum_manager.d.ts +4 -1
- package/script/client/4_forum_manager.d.ts.map +1 -1
- package/script/client/4_forum_manager.js +32 -0
- package/script/client/6_client.d.ts +1166 -1075
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +1528 -1413
- package/script/client/6_client_dispatcher.d.ts +1168 -1075
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +1502 -1391
- package/script/types/0_report_reason.d.ts +1 -0
- package/script/types/0_report_reason.d.ts.map +1 -1
- package/script/types/0_secret_chat_action_type.d.ts +69 -0
- package/script/types/0_secret_chat_action_type.d.ts.map +1 -0
- package/script/types/0_secret_chat_action_type.js +49 -0
- package/script/types/0_story_report_option.d.ts +3 -0
- package/script/types/0_story_report_option.d.ts.map +1 -1
- package/script/types/1_chat_p.d.ts +1 -5
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_story_report_result.d.ts +17 -3
- package/script/types/1_story_report_result.d.ts.map +1 -1
- package/script/types/2_secret_message.d.ts +1 -0
- package/script/types/2_secret_message.d.ts.map +1 -1
- package/script/types/3_bot_access_settings.d.ts +3 -0
- package/script/types/3_bot_access_settings.d.ts.map +1 -1
- package/script/types/3_connected_website.d.ts +45 -0
- package/script/types/3_connected_website.d.ts.map +1 -0
- package/script/types/3_connected_website.js +42 -0
- package/script/types/3_poll_voter_list.d.ts +2 -1
- package/script/types/3_poll_voter_list.d.ts.map +1 -1
- package/script/types/3_text_to_translate.d.ts +3 -0
- package/script/types/3_text_to_translate.d.ts.map +1 -1
- package/script/types/3_translated_text.d.ts +3 -0
- package/script/types/3_translated_text.d.ts.map +1 -1
- package/script/types/9_message.d.ts +8 -1
- package/script/types/9_message.d.ts.map +1 -1
- package/script/types/9_message.js +3 -0
- package/script/types/A_topic.d.ts +20 -3
- package/script/types/A_topic.d.ts.map +1 -1
- package/script/types/A_topic.js +38 -0
- package/script/types/B_topic_list_item.d.ts +7 -0
- package/script/types/B_topic_list_item.d.ts.map +1 -0
- package/script/types/B_topic_list_item.js +2 -0
- package/script/types/B_update.d.ts +16 -1
- package/script/types/B_update.d.ts.map +1 -1
- package/script/types/C_topic_list.d.ts +14 -0
- package/script/types/C_topic_list.d.ts.map +1 -0
- package/script/types/C_topic_list.js +12 -0
package/esm/client/6_client.js
CHANGED
|
@@ -1227,42 +1227,22 @@ export class Client extends Composer {
|
|
|
1227
1227
|
// ========================= ACCOUNT ========================= //
|
|
1228
1228
|
//
|
|
1229
1229
|
/**
|
|
1230
|
-
*
|
|
1231
|
-
*
|
|
1232
|
-
* @method ac
|
|
1233
|
-
* @returns Information on the currently authorized user.
|
|
1234
|
-
*/
|
|
1235
|
-
async getMe() {
|
|
1236
|
-
if (this.#lastGetMe === null) {
|
|
1237
|
-
const me = await this.#checkAuthorization();
|
|
1238
|
-
if (!me) {
|
|
1239
|
-
throw new InputError("Not signed in.");
|
|
1240
|
-
}
|
|
1241
|
-
else {
|
|
1242
|
-
return me;
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
return await this.#getMeInner();
|
|
1246
|
-
}
|
|
1247
|
-
/**
|
|
1248
|
-
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1230
|
+
* Add a bot to the attachments menu. User-only.
|
|
1249
1231
|
*
|
|
1250
1232
|
* @method ac
|
|
1251
|
-
* @param
|
|
1252
|
-
* @param username The username to show.
|
|
1233
|
+
* @param botId The identifier of the bot to add to the attachments menu.
|
|
1253
1234
|
*/
|
|
1254
|
-
async
|
|
1255
|
-
await this.#accountManager.
|
|
1235
|
+
async addBotToAttachmentsMenu(botId, params) {
|
|
1236
|
+
return await this.#accountManager.addBotToAttachmentsMenu(botId, params);
|
|
1256
1237
|
}
|
|
1257
1238
|
/**
|
|
1258
|
-
*
|
|
1239
|
+
* Block a user. User-only.
|
|
1259
1240
|
*
|
|
1260
1241
|
* @method ac
|
|
1261
|
-
* @param
|
|
1262
|
-
* @param username The username to hide.
|
|
1242
|
+
* @param userId The identifier of the user to block.
|
|
1263
1243
|
*/
|
|
1264
|
-
async
|
|
1265
|
-
await this.#
|
|
1244
|
+
async blockUser(userId) {
|
|
1245
|
+
await this.#messageManager.blockUser(userId);
|
|
1266
1246
|
}
|
|
1267
1247
|
/**
|
|
1268
1248
|
* Check the availability of a username. User-only.
|
|
@@ -1275,696 +1255,640 @@ export class Client extends Composer {
|
|
|
1275
1255
|
return await this.#accountManager.checkUsername(username, params);
|
|
1276
1256
|
}
|
|
1277
1257
|
/**
|
|
1278
|
-
*
|
|
1258
|
+
* Delete the current account. User-only.
|
|
1279
1259
|
*
|
|
1280
1260
|
* @method ac
|
|
1281
|
-
* @param
|
|
1261
|
+
* @param reason The reason of the deletion.
|
|
1282
1262
|
*/
|
|
1283
|
-
async
|
|
1284
|
-
await this.#accountManager.
|
|
1263
|
+
async deleteAccount(reason, params) {
|
|
1264
|
+
return await this.#accountManager.deleteAccount(reason, params);
|
|
1285
1265
|
}
|
|
1286
1266
|
/**
|
|
1287
|
-
*
|
|
1267
|
+
* Disable sponsored messages on the current user. User-only.
|
|
1288
1268
|
*
|
|
1289
1269
|
* @method ac
|
|
1290
1270
|
*/
|
|
1291
|
-
async
|
|
1292
|
-
await this.#accountManager.
|
|
1271
|
+
async disableSponsoredMessages() {
|
|
1272
|
+
await this.#accountManager.disableSponsoredMessages();
|
|
1293
1273
|
}
|
|
1294
1274
|
/**
|
|
1295
|
-
*
|
|
1275
|
+
* Disconnect a connected website. User-only.
|
|
1296
1276
|
*
|
|
1297
1277
|
* @method ac
|
|
1298
|
-
* @param id
|
|
1299
|
-
* @param order The new order to use.
|
|
1300
|
-
* @returns Whether the order was changed.
|
|
1278
|
+
* @param id The identifier of a connected website.
|
|
1301
1279
|
*/
|
|
1302
|
-
async
|
|
1303
|
-
return await this.#accountManager.
|
|
1280
|
+
async disconnectConnectedWebsite(id) {
|
|
1281
|
+
return await this.#accountManager.disconnectConnectedWebsite(id);
|
|
1304
1282
|
}
|
|
1305
1283
|
/**
|
|
1306
|
-
*
|
|
1284
|
+
* Disconnect all connected websites. User-only.
|
|
1307
1285
|
*
|
|
1308
1286
|
* @method ac
|
|
1309
|
-
* @param id A supergroup ID or a channel ID.
|
|
1310
|
-
* @returns Whether any username was hidden.
|
|
1311
1287
|
*/
|
|
1312
|
-
async
|
|
1313
|
-
return await this.#accountManager.
|
|
1288
|
+
async disconnectConnectedWebsites() {
|
|
1289
|
+
return await this.#accountManager.disconnectConnectedWebsites();
|
|
1314
1290
|
}
|
|
1315
1291
|
/**
|
|
1316
|
-
*
|
|
1292
|
+
* Enable sponsored messages on the current user. User-only.
|
|
1317
1293
|
*
|
|
1318
1294
|
* @method ac
|
|
1319
|
-
* @param id The identifier of the business connection.
|
|
1320
|
-
* @cache
|
|
1321
1295
|
*/
|
|
1322
|
-
async
|
|
1323
|
-
|
|
1296
|
+
async enableSponsoredMessages() {
|
|
1297
|
+
await this.#accountManager.enableSponsoredMessages();
|
|
1324
1298
|
}
|
|
1325
1299
|
/**
|
|
1326
|
-
*
|
|
1300
|
+
* Get the current account's TTL. User-only.
|
|
1327
1301
|
*
|
|
1328
1302
|
* @method ac
|
|
1329
|
-
* @
|
|
1303
|
+
* @returns The current account's TTL in days.
|
|
1330
1304
|
*/
|
|
1331
|
-
async
|
|
1332
|
-
await this.#accountManager.
|
|
1305
|
+
async getAccountTtl() {
|
|
1306
|
+
return await this.#accountManager.getAccountTtl();
|
|
1333
1307
|
}
|
|
1334
1308
|
/**
|
|
1335
|
-
*
|
|
1309
|
+
* Get app support. User-only.
|
|
1336
1310
|
*
|
|
1337
1311
|
* @method ac
|
|
1338
|
-
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
1339
1312
|
*/
|
|
1340
|
-
async
|
|
1341
|
-
await this.#accountManager.
|
|
1313
|
+
async getAppSupport() {
|
|
1314
|
+
return await this.#accountManager.getAppSupport();
|
|
1342
1315
|
}
|
|
1343
1316
|
/**
|
|
1344
|
-
*
|
|
1317
|
+
* Get app support name. User-only.
|
|
1345
1318
|
*
|
|
1346
1319
|
* @method ac
|
|
1347
1320
|
*/
|
|
1348
|
-
async
|
|
1349
|
-
await this.#accountManager.
|
|
1321
|
+
async getAppSupportName() {
|
|
1322
|
+
return await this.#accountManager.getAppSupportName();
|
|
1350
1323
|
}
|
|
1351
1324
|
/**
|
|
1352
|
-
*
|
|
1325
|
+
* Get the authorization sessions. User-only.
|
|
1353
1326
|
*
|
|
1354
1327
|
* @method ac
|
|
1355
|
-
* @param chatId The identifier of a channel.
|
|
1356
|
-
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
1357
1328
|
*/
|
|
1358
|
-
async
|
|
1359
|
-
await this.#accountManager.
|
|
1329
|
+
async getAuthorizationSessions() {
|
|
1330
|
+
return await this.#accountManager.getAuthorizationSessions();
|
|
1360
1331
|
}
|
|
1361
1332
|
/**
|
|
1362
|
-
*
|
|
1333
|
+
* Get blocked users. User-only.
|
|
1363
1334
|
*
|
|
1364
1335
|
* @method ac
|
|
1365
|
-
* @param chatId The identifier of a channel.
|
|
1366
1336
|
*/
|
|
1367
|
-
async
|
|
1368
|
-
await this.#
|
|
1337
|
+
async getBlockedUsers(params) {
|
|
1338
|
+
return await this.#messageManager.getBlockedUsers(params);
|
|
1369
1339
|
}
|
|
1370
1340
|
/**
|
|
1371
|
-
*
|
|
1341
|
+
* Get a business connection. Bot-only.
|
|
1372
1342
|
*
|
|
1373
1343
|
* @method ac
|
|
1374
|
-
* @param
|
|
1375
|
-
* @
|
|
1344
|
+
* @param id The identifier of the business connection.
|
|
1345
|
+
* @cache
|
|
1376
1346
|
*/
|
|
1377
|
-
async
|
|
1378
|
-
await this.#
|
|
1347
|
+
async getBusinessConnection(id) {
|
|
1348
|
+
return await this.#businessConnectionManager.getBusinessConnection(id);
|
|
1379
1349
|
}
|
|
1380
1350
|
/**
|
|
1381
|
-
*
|
|
1351
|
+
* Get connected websites. User-only.
|
|
1382
1352
|
*
|
|
1383
1353
|
* @method ac
|
|
1384
|
-
* @param userId The identifier of a user of the bot.
|
|
1385
1354
|
*/
|
|
1386
|
-
async
|
|
1387
|
-
await this.#accountManager.
|
|
1355
|
+
async getConnectedWebsites() {
|
|
1356
|
+
return await this.#accountManager.getConnectedWebsites();
|
|
1388
1357
|
}
|
|
1389
1358
|
/**
|
|
1390
|
-
*
|
|
1359
|
+
* Get countries. User-only.
|
|
1391
1360
|
*
|
|
1392
1361
|
* @method ac
|
|
1393
1362
|
*/
|
|
1394
|
-
async
|
|
1395
|
-
await this.#accountManager.
|
|
1363
|
+
async getCountries(languageCode) {
|
|
1364
|
+
return await this.#accountManager.getCountries(languageCode);
|
|
1396
1365
|
}
|
|
1397
1366
|
/**
|
|
1398
|
-
*
|
|
1367
|
+
* Get the country code for the current user based on its IP address. User-only.
|
|
1399
1368
|
*
|
|
1400
1369
|
* @method ac
|
|
1401
|
-
* @param photo The photo to set as profile photo.
|
|
1402
1370
|
*/
|
|
1403
|
-
async
|
|
1404
|
-
await this.#accountManager.
|
|
1371
|
+
async getCountryCode() {
|
|
1372
|
+
return await this.#accountManager.getCountryCode();
|
|
1405
1373
|
}
|
|
1406
1374
|
/**
|
|
1407
|
-
*
|
|
1375
|
+
* Get information on the currently authorized user.
|
|
1408
1376
|
*
|
|
1409
1377
|
* @method ac
|
|
1410
|
-
* @
|
|
1378
|
+
* @returns Information on the currently authorized user.
|
|
1411
1379
|
*/
|
|
1412
|
-
async
|
|
1413
|
-
|
|
1380
|
+
async getMe() {
|
|
1381
|
+
if (this.#lastGetMe === null) {
|
|
1382
|
+
const me = await this.#checkAuthorization();
|
|
1383
|
+
if (!me) {
|
|
1384
|
+
throw new InputError("Not signed in.");
|
|
1385
|
+
}
|
|
1386
|
+
else {
|
|
1387
|
+
return me;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
return await this.#getMeInner();
|
|
1414
1391
|
}
|
|
1415
1392
|
/**
|
|
1416
|
-
*
|
|
1393
|
+
* Get owned bots. User-only.
|
|
1417
1394
|
*
|
|
1418
1395
|
* @method ac
|
|
1419
1396
|
*/
|
|
1420
|
-
async
|
|
1421
|
-
return await this.#accountManager.
|
|
1397
|
+
async getOwnedBots() {
|
|
1398
|
+
return await this.#accountManager.getOwnedBots();
|
|
1422
1399
|
}
|
|
1423
1400
|
/**
|
|
1424
|
-
*
|
|
1401
|
+
* Get the profile photos of a user.
|
|
1425
1402
|
*
|
|
1426
1403
|
* @method ac
|
|
1404
|
+
* @param userId The identifier of a user.
|
|
1427
1405
|
*/
|
|
1428
|
-
async
|
|
1429
|
-
await this.#accountManager.
|
|
1406
|
+
async getProfilePhotos(userId, params) {
|
|
1407
|
+
return await this.#accountManager.getProfilePhotos(userId, params);
|
|
1430
1408
|
}
|
|
1431
1409
|
/**
|
|
1432
|
-
*
|
|
1410
|
+
* Get timezones. User-only.
|
|
1433
1411
|
*
|
|
1434
1412
|
* @method ac
|
|
1435
1413
|
*/
|
|
1436
|
-
async
|
|
1437
|
-
await this.#accountManager.
|
|
1414
|
+
async getTimezones() {
|
|
1415
|
+
return await this.#accountManager.getTimezones();
|
|
1438
1416
|
}
|
|
1439
1417
|
/**
|
|
1440
|
-
*
|
|
1418
|
+
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1441
1419
|
*
|
|
1442
1420
|
* @method ac
|
|
1443
|
-
* @param
|
|
1421
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1422
|
+
* @param username The username to hide.
|
|
1444
1423
|
*/
|
|
1445
|
-
async
|
|
1446
|
-
await this.#accountManager.
|
|
1424
|
+
async hideUsername(id, username) {
|
|
1425
|
+
await this.#accountManager.hideUsername(id, username);
|
|
1447
1426
|
}
|
|
1448
1427
|
/**
|
|
1449
|
-
*
|
|
1428
|
+
* Hide all usernames from a supergroup or a channel's profile. User-only.
|
|
1450
1429
|
*
|
|
1451
1430
|
* @method ac
|
|
1452
|
-
* @param
|
|
1431
|
+
* @param id A supergroup ID or a channel ID.
|
|
1432
|
+
* @returns Whether any username was hidden.
|
|
1453
1433
|
*/
|
|
1454
|
-
async
|
|
1455
|
-
await this.#accountManager.
|
|
1434
|
+
async hideUsernames(id) {
|
|
1435
|
+
return await this.#accountManager.hideUsernames(id);
|
|
1456
1436
|
}
|
|
1457
1437
|
/**
|
|
1458
|
-
*
|
|
1438
|
+
* Pause the business bot in a chat. User-only.
|
|
1459
1439
|
*
|
|
1460
1440
|
* @method ac
|
|
1441
|
+
* @param chatId The identifier of a chat.
|
|
1461
1442
|
*/
|
|
1462
|
-
async
|
|
1463
|
-
await this.#accountManager.
|
|
1443
|
+
async pauseBusinessBotConnection(chatId) {
|
|
1444
|
+
await this.#accountManager.pauseBusinessBotConnection(chatId);
|
|
1464
1445
|
}
|
|
1465
1446
|
/**
|
|
1466
|
-
*
|
|
1447
|
+
* Remove an authorization session. User-only.
|
|
1467
1448
|
*
|
|
1468
1449
|
* @method ac
|
|
1450
|
+
* @param id The identifier of the authorization session to remove.
|
|
1469
1451
|
*/
|
|
1470
|
-
async
|
|
1471
|
-
await this.#accountManager.
|
|
1452
|
+
async removeAuthorizationSession(id) {
|
|
1453
|
+
return await this.#accountManager.removeAuthorizationSession(id);
|
|
1472
1454
|
}
|
|
1473
1455
|
/**
|
|
1474
|
-
*
|
|
1456
|
+
* Remove all authorization sessions except for the current one. User-only.
|
|
1475
1457
|
*
|
|
1476
1458
|
* @method ac
|
|
1477
1459
|
*/
|
|
1478
|
-
async
|
|
1479
|
-
await this.#accountManager.
|
|
1460
|
+
async removeAuthorizationSessions() {
|
|
1461
|
+
return await this.#accountManager.removeAuthorizationSessions();
|
|
1480
1462
|
}
|
|
1481
1463
|
/**
|
|
1482
|
-
*
|
|
1464
|
+
* Remove a bot from the attachments menu. User-only.
|
|
1483
1465
|
*
|
|
1484
1466
|
* @method ac
|
|
1467
|
+
* @param botId The identifier of the bot to remove from the attachments menu.
|
|
1485
1468
|
*/
|
|
1486
|
-
async
|
|
1487
|
-
await this.#accountManager.
|
|
1469
|
+
async removeBotFromAttachmentsMenu(botId) {
|
|
1470
|
+
return await this.#accountManager.removeBotFromAttachmentsMenu(botId);
|
|
1488
1471
|
}
|
|
1489
1472
|
/**
|
|
1490
|
-
*
|
|
1473
|
+
* Remove the emoji status of a channel. User-only.
|
|
1491
1474
|
*
|
|
1492
1475
|
* @method ac
|
|
1493
|
-
* @param chatId The identifier of a
|
|
1476
|
+
* @param chatId The identifier of a channel.
|
|
1494
1477
|
*/
|
|
1495
|
-
async
|
|
1496
|
-
await this.#accountManager.
|
|
1478
|
+
async removeChannelEmojiStatus(chatId) {
|
|
1479
|
+
await this.#accountManager.removeChannelEmojiStatus(chatId);
|
|
1497
1480
|
}
|
|
1498
1481
|
/**
|
|
1499
|
-
*
|
|
1482
|
+
* Remove the current account's emoji status. User-only.
|
|
1500
1483
|
*
|
|
1501
1484
|
* @method ac
|
|
1502
|
-
* @param chatId The identifier of a chat.
|
|
1503
1485
|
*/
|
|
1504
|
-
async
|
|
1505
|
-
await this.#accountManager.
|
|
1486
|
+
async removeEmojiStatus() {
|
|
1487
|
+
await this.#accountManager.removeEmojiStatus();
|
|
1506
1488
|
}
|
|
1507
1489
|
/**
|
|
1508
|
-
*
|
|
1490
|
+
* Remove the profile video of the current user or a bot managed by the current user.
|
|
1509
1491
|
*
|
|
1510
1492
|
* @method ac
|
|
1511
|
-
* @param username The username to resolve.
|
|
1512
1493
|
*/
|
|
1513
|
-
async
|
|
1514
|
-
return await this.#accountManager.
|
|
1494
|
+
async removeProfilePhoto(params) {
|
|
1495
|
+
return await this.#accountManager.removeProfilePhoto(params);
|
|
1515
1496
|
}
|
|
1516
1497
|
/**
|
|
1517
|
-
*
|
|
1498
|
+
* Remove the emoji status of a bot's user. Bot-only.
|
|
1518
1499
|
*
|
|
1519
1500
|
* @method ac
|
|
1520
|
-
* @param
|
|
1501
|
+
* @param userId The identifier of a user of the bot.
|
|
1521
1502
|
*/
|
|
1522
|
-
async
|
|
1523
|
-
|
|
1503
|
+
async removeUserEmojiStatus(userId) {
|
|
1504
|
+
await this.#accountManager.removeUserEmojiStatus(userId);
|
|
1524
1505
|
}
|
|
1525
1506
|
/**
|
|
1526
|
-
*
|
|
1507
|
+
* Remove the current account's username. User-only.
|
|
1527
1508
|
*
|
|
1528
1509
|
* @method ac
|
|
1529
|
-
* @param userIds The identifiers of users to set as close friends.
|
|
1530
1510
|
*/
|
|
1531
|
-
async
|
|
1532
|
-
await this.#accountManager.
|
|
1511
|
+
async removeUsername() {
|
|
1512
|
+
await this.#accountManager.removeUsername();
|
|
1533
1513
|
}
|
|
1534
1514
|
/**
|
|
1535
|
-
*
|
|
1515
|
+
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1536
1516
|
*
|
|
1537
1517
|
* @method ac
|
|
1538
|
-
* @param
|
|
1539
|
-
* @param
|
|
1518
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1519
|
+
* @param order The new order to use.
|
|
1520
|
+
* @returns Whether the order was changed.
|
|
1540
1521
|
*/
|
|
1541
|
-
async
|
|
1542
|
-
await this.#accountManager.
|
|
1522
|
+
async reorderUsernames(id, order) {
|
|
1523
|
+
return await this.#accountManager.reorderUsernames(id, order);
|
|
1543
1524
|
}
|
|
1544
1525
|
/**
|
|
1545
|
-
*
|
|
1526
|
+
* Resolve a phone number. User-only.
|
|
1546
1527
|
*
|
|
1547
1528
|
* @method ac
|
|
1548
|
-
* @param
|
|
1529
|
+
* @param phoneNumber The phone number to resolve.
|
|
1549
1530
|
*/
|
|
1550
|
-
async
|
|
1551
|
-
await this.#
|
|
1531
|
+
async resolvePhoneNumber(phoneNumber) {
|
|
1532
|
+
return await this.#accountManager.resolvePhoneNumber(phoneNumber);
|
|
1552
1533
|
}
|
|
1553
1534
|
/**
|
|
1554
|
-
*
|
|
1535
|
+
* Resolve a username.
|
|
1555
1536
|
*
|
|
1556
1537
|
* @method ac
|
|
1557
|
-
* @param
|
|
1538
|
+
* @param username The username to resolve.
|
|
1558
1539
|
*/
|
|
1559
|
-
async
|
|
1560
|
-
await this.#
|
|
1540
|
+
async resolveUsername(username, params) {
|
|
1541
|
+
return await this.#accountManager.resolveUsername(username, params);
|
|
1561
1542
|
}
|
|
1562
1543
|
/**
|
|
1563
|
-
*
|
|
1544
|
+
* Resume the business bot in a chat. User-only.
|
|
1564
1545
|
*
|
|
1565
1546
|
* @method ac
|
|
1547
|
+
* @param chatId The identifier of a chat.
|
|
1566
1548
|
*/
|
|
1567
|
-
async
|
|
1568
|
-
|
|
1549
|
+
async resumeBusinessBotConnection(chatId) {
|
|
1550
|
+
await this.#accountManager.resumeBusinessBotConnection(chatId);
|
|
1569
1551
|
}
|
|
1570
1552
|
/**
|
|
1571
|
-
*
|
|
1553
|
+
* Set the current account's TTL. User-only.
|
|
1572
1554
|
*
|
|
1573
1555
|
* @method ac
|
|
1574
|
-
* @param
|
|
1556
|
+
* @param dayCount The current account's TTL in days.
|
|
1575
1557
|
*/
|
|
1576
|
-
async
|
|
1577
|
-
return await this.#accountManager.
|
|
1558
|
+
async setAccountTtl(dayCount) {
|
|
1559
|
+
return await this.#accountManager.setAccountTtl(dayCount);
|
|
1578
1560
|
}
|
|
1579
1561
|
/**
|
|
1580
|
-
*
|
|
1562
|
+
* Set the birthday of the current user. User-only.
|
|
1581
1563
|
*
|
|
1582
1564
|
* @method ac
|
|
1583
|
-
* @param botId The identifier of the bot to remove from the attachments menu.
|
|
1584
1565
|
*/
|
|
1585
|
-
async
|
|
1586
|
-
|
|
1566
|
+
async setBirthday(params) {
|
|
1567
|
+
await this.#accountManager.setBirthday(params);
|
|
1587
1568
|
}
|
|
1588
1569
|
/**
|
|
1589
|
-
*
|
|
1570
|
+
* Set the emoji status of a channel. User-only.
|
|
1590
1571
|
*
|
|
1591
1572
|
* @method ac
|
|
1573
|
+
* @param chatId The identifier of a channel.
|
|
1574
|
+
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
1592
1575
|
*/
|
|
1593
|
-
async
|
|
1594
|
-
|
|
1576
|
+
async setChannelEmojiStatus(chatId, emojiStatus, params) {
|
|
1577
|
+
await this.#accountManager.setChannelEmojiStatus(chatId, emojiStatus, params);
|
|
1595
1578
|
}
|
|
1596
1579
|
/**
|
|
1597
|
-
*
|
|
1580
|
+
* Set the list of close friends. User-only.
|
|
1598
1581
|
*
|
|
1599
1582
|
* @method ac
|
|
1583
|
+
* @param userIds The identifiers of users to set as close friends.
|
|
1600
1584
|
*/
|
|
1601
|
-
async
|
|
1602
|
-
|
|
1585
|
+
async setCloseFriends(userIds) {
|
|
1586
|
+
await this.#accountManager.setCloseFriends(userIds);
|
|
1603
1587
|
}
|
|
1604
1588
|
/**
|
|
1605
|
-
*
|
|
1589
|
+
* Set the current account's emoji status. User-only.
|
|
1606
1590
|
*
|
|
1607
1591
|
* @method ac
|
|
1592
|
+
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
1608
1593
|
*/
|
|
1609
|
-
async
|
|
1610
|
-
|
|
1594
|
+
async setEmojiStatus(emojiStatus, params) {
|
|
1595
|
+
await this.#accountManager.setEmojiStatus(emojiStatus, params);
|
|
1611
1596
|
}
|
|
1612
1597
|
/**
|
|
1613
|
-
*
|
|
1598
|
+
* Set the current account's online status. User-only.
|
|
1614
1599
|
*
|
|
1615
1600
|
* @method ac
|
|
1601
|
+
* @param isOnline The new online status.
|
|
1616
1602
|
*/
|
|
1617
|
-
async
|
|
1618
|
-
|
|
1603
|
+
async setIsOnline(isOnline) {
|
|
1604
|
+
await this.#accountManager.setIsOnline(isOnline);
|
|
1619
1605
|
}
|
|
1620
1606
|
/**
|
|
1621
|
-
*
|
|
1607
|
+
* Set the location of the current user. User-only.
|
|
1622
1608
|
*
|
|
1623
1609
|
* @method ac
|
|
1624
1610
|
*/
|
|
1625
|
-
async
|
|
1626
|
-
|
|
1611
|
+
async setLocation(params) {
|
|
1612
|
+
await this.#accountManager.setLocation(params);
|
|
1627
1613
|
}
|
|
1628
1614
|
/**
|
|
1629
|
-
*
|
|
1615
|
+
* Set the name color of the current user. User-only.
|
|
1630
1616
|
*
|
|
1631
1617
|
* @method ac
|
|
1632
|
-
* @param
|
|
1618
|
+
* @param color The identifier of the color to set.
|
|
1633
1619
|
*/
|
|
1634
|
-
async
|
|
1635
|
-
|
|
1620
|
+
async setNameColor(color, params) {
|
|
1621
|
+
await this.#accountManager.setNameColor(color, params);
|
|
1636
1622
|
}
|
|
1637
1623
|
/**
|
|
1638
|
-
*
|
|
1624
|
+
* Set the personal channel of the current user. User-only.
|
|
1639
1625
|
*
|
|
1640
1626
|
* @method ac
|
|
1641
|
-
* @param reason The reason of the deletion.
|
|
1642
1627
|
*/
|
|
1643
|
-
async
|
|
1644
|
-
|
|
1628
|
+
async setPersonalChannel(params) {
|
|
1629
|
+
await this.#accountManager.setPersonalChannel(params);
|
|
1645
1630
|
}
|
|
1646
1631
|
/**
|
|
1647
|
-
*
|
|
1632
|
+
* Set the profile color of the current user. User-only.
|
|
1648
1633
|
*
|
|
1649
1634
|
* @method ac
|
|
1635
|
+
* @param color The identifier of the color to set.
|
|
1650
1636
|
*/
|
|
1651
|
-
async
|
|
1652
|
-
|
|
1637
|
+
async setProfileColor(color, params) {
|
|
1638
|
+
await this.#accountManager.setProfileColor(color, params);
|
|
1653
1639
|
}
|
|
1654
1640
|
/**
|
|
1655
|
-
*
|
|
1641
|
+
* Set the emoji status of a bot's user. Bot-only.
|
|
1656
1642
|
*
|
|
1657
1643
|
* @method ac
|
|
1658
|
-
* @param
|
|
1644
|
+
* @param userId The identifier of a user of the bot.
|
|
1645
|
+
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
1659
1646
|
*/
|
|
1660
|
-
async
|
|
1661
|
-
|
|
1647
|
+
async setUserEmojiStatus(userId, emojiStatus, params) {
|
|
1648
|
+
await this.#accountManager.setUserEmojiStatus(userId, emojiStatus, params);
|
|
1662
1649
|
}
|
|
1663
1650
|
/**
|
|
1664
|
-
*
|
|
1651
|
+
* Set the username of the current account. User-only.
|
|
1665
1652
|
*
|
|
1666
1653
|
* @method ac
|
|
1654
|
+
* @param username The username to set.
|
|
1667
1655
|
*/
|
|
1668
|
-
async
|
|
1669
|
-
|
|
1656
|
+
async setUsername(username) {
|
|
1657
|
+
await this.#accountManager.setUsername(username);
|
|
1670
1658
|
}
|
|
1671
1659
|
/**
|
|
1672
|
-
*
|
|
1660
|
+
* Set the working hours of the current user. User-only.
|
|
1673
1661
|
*
|
|
1674
1662
|
* @method ac
|
|
1675
|
-
* @returns The current account's TTL in days.
|
|
1676
1663
|
*/
|
|
1677
|
-
async
|
|
1678
|
-
|
|
1664
|
+
async setWorkingHours(params) {
|
|
1665
|
+
await this.#accountManager.setWorkingHours(params);
|
|
1679
1666
|
}
|
|
1680
1667
|
/**
|
|
1681
|
-
*
|
|
1668
|
+
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
1682
1669
|
*
|
|
1683
1670
|
* @method ac
|
|
1684
|
-
* @param
|
|
1671
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
1672
|
+
* @param username The username to show.
|
|
1685
1673
|
*/
|
|
1686
|
-
async
|
|
1687
|
-
|
|
1674
|
+
async showUsername(id, username) {
|
|
1675
|
+
await this.#accountManager.showUsername(id, username);
|
|
1688
1676
|
}
|
|
1689
|
-
//
|
|
1690
|
-
// ========================= MESSAGES ========================= //
|
|
1691
|
-
//
|
|
1692
1677
|
/**
|
|
1693
|
-
*
|
|
1678
|
+
* Suggest a birthday. User-only.
|
|
1694
1679
|
*
|
|
1695
|
-
* @method
|
|
1696
|
-
* @param
|
|
1697
|
-
* @param
|
|
1698
|
-
* @returns The sent text message.
|
|
1680
|
+
* @method ac
|
|
1681
|
+
* @param userId The identifier of the user to suggest a birthday for.
|
|
1682
|
+
* @param birthday The birthday to suggest.
|
|
1699
1683
|
*/
|
|
1700
|
-
async
|
|
1701
|
-
|
|
1684
|
+
async suggestBirthday(userId, birthday) {
|
|
1685
|
+
await this.#accountManager.suggestBirthday(userId, birthday);
|
|
1702
1686
|
}
|
|
1703
1687
|
/**
|
|
1704
|
-
*
|
|
1688
|
+
* Unblock a user. User-only.
|
|
1705
1689
|
*
|
|
1706
|
-
* @method
|
|
1707
|
-
* @param
|
|
1708
|
-
* @param richText The message's rich text.
|
|
1709
|
-
* @returns The sent rich text message.
|
|
1690
|
+
* @method ac
|
|
1691
|
+
* @param userId The identifier of the user to unblock.
|
|
1710
1692
|
*/
|
|
1711
|
-
async
|
|
1712
|
-
|
|
1693
|
+
async unblockUser(userId) {
|
|
1694
|
+
await this.#messageManager.unblockUser(userId);
|
|
1713
1695
|
}
|
|
1714
1696
|
/**
|
|
1715
|
-
*
|
|
1697
|
+
* Update the profile of the current user. At least one parameter must be specified. User-only.
|
|
1716
1698
|
*
|
|
1717
|
-
* @method
|
|
1718
|
-
* @param chatId The identifier of a chat to send the message to.
|
|
1719
|
-
* @param draftId The identifier of the draft.
|
|
1720
|
-
* @param text The message's text.
|
|
1699
|
+
* @method ac
|
|
1721
1700
|
*/
|
|
1722
|
-
async
|
|
1723
|
-
await this.#
|
|
1701
|
+
async updateProfile(params) {
|
|
1702
|
+
await this.#accountManager.updateProfile(params);
|
|
1724
1703
|
}
|
|
1725
1704
|
/**
|
|
1726
|
-
*
|
|
1705
|
+
* Update the profile photo of the current user or a bot managed by the current user.
|
|
1727
1706
|
*
|
|
1728
|
-
* @method
|
|
1729
|
-
* @param
|
|
1730
|
-
* @param draftId The identifier of the draft.
|
|
1731
|
-
* @param richText The message's rich text.
|
|
1707
|
+
* @method ac
|
|
1708
|
+
* @param photo The photo to set as profile photo.
|
|
1732
1709
|
*/
|
|
1733
|
-
async
|
|
1734
|
-
|
|
1710
|
+
async updateProfilePhoto(photo, params) {
|
|
1711
|
+
await this.#accountManager.updateProfilePhoto(photo, params);
|
|
1735
1712
|
}
|
|
1736
1713
|
/**
|
|
1737
|
-
*
|
|
1714
|
+
* Update the profile video of the current user or a bot managed by the current user.
|
|
1738
1715
|
*
|
|
1739
|
-
* @method
|
|
1740
|
-
* @param
|
|
1741
|
-
* @param photo The photo to send.
|
|
1742
|
-
* @returns The sent photo.
|
|
1716
|
+
* @method ac
|
|
1717
|
+
* @param video The video to set as profile video.
|
|
1743
1718
|
*/
|
|
1744
|
-
async
|
|
1745
|
-
return await this.#
|
|
1719
|
+
async updateProfileVideo(video, params) {
|
|
1720
|
+
return await this.#accountManager.updateProfileVideo(video, params);
|
|
1746
1721
|
}
|
|
1722
|
+
//
|
|
1723
|
+
// ========================= MESSAGES ========================= //
|
|
1724
|
+
//
|
|
1747
1725
|
/**
|
|
1748
|
-
*
|
|
1726
|
+
* Add a sticker to favorites. User-only.
|
|
1749
1727
|
*
|
|
1750
1728
|
* @method ms
|
|
1751
|
-
* @param
|
|
1752
|
-
* @param photo The photo to send.
|
|
1753
|
-
* @param video The video version of the photo.
|
|
1754
|
-
* @returns The sent live photo.
|
|
1729
|
+
* @param fileId The file identifier of the sticker.
|
|
1755
1730
|
*/
|
|
1756
|
-
async
|
|
1757
|
-
return await this.#messageManager.
|
|
1731
|
+
async addStickerToFavorites(fileId) {
|
|
1732
|
+
return await this.#messageManager.addStickerToFavorites(fileId);
|
|
1758
1733
|
}
|
|
1759
1734
|
/**
|
|
1760
|
-
*
|
|
1735
|
+
* Add a sticker to recents. User-only.
|
|
1761
1736
|
*
|
|
1762
1737
|
* @method ms
|
|
1763
|
-
* @param
|
|
1764
|
-
* @param document The document to send.
|
|
1765
|
-
* @returns The sent document.
|
|
1738
|
+
* @param fileId The file identifier of the sticker.
|
|
1766
1739
|
*/
|
|
1767
|
-
async
|
|
1768
|
-
return await this.#messageManager.
|
|
1740
|
+
async addStickerToRecents(fileId) {
|
|
1741
|
+
return await this.#messageManager.addStickerToRecents(fileId);
|
|
1769
1742
|
}
|
|
1770
1743
|
/**
|
|
1771
|
-
*
|
|
1744
|
+
* Clear all message drafts. User-only.
|
|
1772
1745
|
*
|
|
1773
1746
|
* @method ms
|
|
1774
|
-
* @param chatId The identifier of a chat to send the sticker to.
|
|
1775
|
-
* @param sticker The sticker to send.
|
|
1776
|
-
* @returns The sent sticker.
|
|
1777
1747
|
*/
|
|
1778
|
-
async
|
|
1779
|
-
|
|
1748
|
+
async clearDrafts() {
|
|
1749
|
+
await this.#messageManager.clearDrafts();
|
|
1780
1750
|
}
|
|
1781
1751
|
/**
|
|
1782
|
-
*
|
|
1752
|
+
* Clear recent stickers. User-only.
|
|
1783
1753
|
*
|
|
1784
1754
|
* @method ms
|
|
1785
|
-
* @param chatId The identifier of a chat to send the video to.
|
|
1786
|
-
* @param video The video to send.
|
|
1787
|
-
* @returns The sent video.
|
|
1788
1755
|
*/
|
|
1789
|
-
async
|
|
1790
|
-
return await this.#messageManager.
|
|
1756
|
+
async clearRecentStickers() {
|
|
1757
|
+
return await this.#messageManager.clearRecentStickers();
|
|
1791
1758
|
}
|
|
1792
1759
|
/**
|
|
1793
|
-
*
|
|
1760
|
+
* Delete all messages sent by a specific member of a chat. User-only.
|
|
1794
1761
|
*
|
|
1795
1762
|
* @method ms
|
|
1796
|
-
* @param chatId The identifier of a chat
|
|
1797
|
-
* @param
|
|
1798
|
-
* @returns The sent animation.
|
|
1763
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
1764
|
+
* @param memberId The identifier of the member.
|
|
1799
1765
|
*/
|
|
1800
|
-
async
|
|
1801
|
-
|
|
1766
|
+
async deleteChatMemberMessages(chatId, memberId) {
|
|
1767
|
+
await this.#messageManager.deleteChatMemberMessages(chatId, memberId);
|
|
1802
1768
|
}
|
|
1803
1769
|
/**
|
|
1804
|
-
*
|
|
1770
|
+
* Delete a single message.
|
|
1805
1771
|
*
|
|
1806
1772
|
* @method ms
|
|
1807
|
-
* @param chatId The identifier of
|
|
1808
|
-
* @param
|
|
1809
|
-
* @returns The sent voice message.
|
|
1773
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1774
|
+
* @param messageId The identifier of the message to delete.
|
|
1810
1775
|
*/
|
|
1811
|
-
async
|
|
1812
|
-
|
|
1776
|
+
async deleteMessage(chatId, messageId, params) {
|
|
1777
|
+
await this.#messageManager.deleteMessages(chatId, [messageId], params);
|
|
1813
1778
|
}
|
|
1814
1779
|
/**
|
|
1815
|
-
*
|
|
1816
|
-
*
|
|
1817
|
-
* @method ms
|
|
1818
|
-
* @param chatId The identifier of a chat to send the audio file to.
|
|
1819
|
-
* @param audio The audio to send.
|
|
1820
|
-
* @returns The sent audio file.
|
|
1821
|
-
*/
|
|
1822
|
-
async sendAudio(chatId, audio, params) {
|
|
1823
|
-
return await this.#messageManager.sendAudio(chatId, audio, params);
|
|
1824
|
-
}
|
|
1825
|
-
/**
|
|
1826
|
-
* Send a media group.
|
|
1827
|
-
*
|
|
1828
|
-
* @method ms
|
|
1829
|
-
* @param chatId The identifier of a chat to send the media group to.
|
|
1830
|
-
* @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.
|
|
1831
|
-
* @returns The sent messages.
|
|
1832
|
-
*/
|
|
1833
|
-
async sendMediaGroup(chatId, media, params) {
|
|
1834
|
-
return await this.#messageManager.sendMediaGroup(chatId, media, params);
|
|
1835
|
-
}
|
|
1836
|
-
/**
|
|
1837
|
-
* Send a video note.
|
|
1780
|
+
* Delete multiple messages.
|
|
1838
1781
|
*
|
|
1839
1782
|
* @method ms
|
|
1840
|
-
* @param chatId The identifier of
|
|
1841
|
-
* @param
|
|
1842
|
-
* @returns The sent video note.
|
|
1783
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1784
|
+
* @param messageIds The identifiers of the messages to delete.
|
|
1843
1785
|
*/
|
|
1844
|
-
async
|
|
1845
|
-
|
|
1786
|
+
async deleteMessages(chatId, messageIds, params) {
|
|
1787
|
+
await this.#messageManager.deleteMessages(chatId, messageIds, params);
|
|
1846
1788
|
}
|
|
1847
1789
|
/**
|
|
1848
|
-
*
|
|
1790
|
+
* Delete a scheduled message.
|
|
1849
1791
|
*
|
|
1850
1792
|
* @method ms
|
|
1851
|
-
* @param chatId The identifier of a chat
|
|
1852
|
-
* @param
|
|
1853
|
-
* @param longitude The location's longitude.
|
|
1854
|
-
* @returns The sent location.
|
|
1793
|
+
* @param chatId The identifier of a chat.
|
|
1794
|
+
* @param messageId The identifier of the scheduled message to delete.
|
|
1855
1795
|
*/
|
|
1856
|
-
async
|
|
1857
|
-
|
|
1796
|
+
async deleteScheduledMessage(chatId, messageId) {
|
|
1797
|
+
await this.#messageManager.deleteScheduledMessage(chatId, messageId);
|
|
1858
1798
|
}
|
|
1859
1799
|
/**
|
|
1860
|
-
*
|
|
1800
|
+
* Delete multiple scheduled messages.
|
|
1861
1801
|
*
|
|
1862
1802
|
* @method ms
|
|
1863
|
-
* @param chatId The identifier of a chat
|
|
1864
|
-
* @param
|
|
1865
|
-
* @param phoneNumber The contact's phone number.
|
|
1866
|
-
* @returns The sent contact.
|
|
1803
|
+
* @param chatId The identifier of a chat.
|
|
1804
|
+
* @param messageIds The identifiers of the scheduled messages to delete.
|
|
1867
1805
|
*/
|
|
1868
|
-
async
|
|
1869
|
-
|
|
1806
|
+
async deleteScheduledMessages(chatId, messageIds) {
|
|
1807
|
+
await this.#messageManager.deleteScheduledMessages(chatId, messageIds);
|
|
1870
1808
|
}
|
|
1871
1809
|
/**
|
|
1872
|
-
*
|
|
1810
|
+
* Edit an inline message's caption. Bot-only.
|
|
1873
1811
|
*
|
|
1874
1812
|
* @method ms
|
|
1875
|
-
* @param
|
|
1876
|
-
* @returns The sent dice.
|
|
1813
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1877
1814
|
*/
|
|
1878
|
-
async
|
|
1879
|
-
|
|
1815
|
+
async editInlineMessageCaption(inlineMessageId, params) {
|
|
1816
|
+
await this.#messageManager.editInlineMessageCaption(inlineMessageId, params);
|
|
1880
1817
|
}
|
|
1881
1818
|
/**
|
|
1882
|
-
*
|
|
1819
|
+
* Edit an inline message's live location. Bot-only.
|
|
1883
1820
|
*
|
|
1884
1821
|
* @method ms
|
|
1885
|
-
* @param
|
|
1886
|
-
* @param latitude The latitude
|
|
1887
|
-
* @param longitude The longitude
|
|
1888
|
-
* @
|
|
1889
|
-
* @param address The written address of the venue.
|
|
1890
|
-
* @returns The sent venue.
|
|
1822
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1823
|
+
* @param latitude The new latitude.
|
|
1824
|
+
* @param longitude The new longitude.
|
|
1825
|
+
* @returns The edited location message.
|
|
1891
1826
|
*/
|
|
1892
|
-
async
|
|
1893
|
-
|
|
1827
|
+
async editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params) {
|
|
1828
|
+
await this.#messageManager.editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params);
|
|
1894
1829
|
}
|
|
1895
1830
|
/**
|
|
1896
|
-
*
|
|
1831
|
+
* Edit an inline message's media.
|
|
1897
1832
|
*
|
|
1898
1833
|
* @method ms
|
|
1899
|
-
* @param
|
|
1900
|
-
* @param
|
|
1901
|
-
* @param options The poll's options.
|
|
1902
|
-
* @returns The sent poll.
|
|
1834
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1835
|
+
* @param media The new media of the message.
|
|
1903
1836
|
*/
|
|
1904
|
-
async
|
|
1905
|
-
|
|
1837
|
+
async editInlineMessageMedia(inlineMessageId, media, params) {
|
|
1838
|
+
await this.#messageManager.editInlineMessageMedia(inlineMessageId, media, params);
|
|
1906
1839
|
}
|
|
1907
1840
|
/**
|
|
1908
|
-
*
|
|
1841
|
+
* Edit an inline message's reply markup. Bot-only.
|
|
1909
1842
|
*
|
|
1910
1843
|
* @method ms
|
|
1911
|
-
* @param
|
|
1912
|
-
* @param title The checklist's title.
|
|
1913
|
-
* @param items The checklist's items.
|
|
1914
|
-
* @returns The sent checklist.
|
|
1844
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1915
1845
|
*/
|
|
1916
|
-
async
|
|
1917
|
-
|
|
1846
|
+
async editInlineMessageReplyMarkup(inlineMessageId, params) {
|
|
1847
|
+
await this.#messageManager.editInlineMessageReplyMarkup(inlineMessageId, params);
|
|
1918
1848
|
}
|
|
1919
1849
|
/**
|
|
1920
|
-
*
|
|
1850
|
+
* Edit an inline message's rich text. Bot-only.
|
|
1921
1851
|
*
|
|
1922
1852
|
* @method ms
|
|
1923
|
-
* @param
|
|
1924
|
-
* @param
|
|
1925
|
-
* @param description The invoice's description.
|
|
1926
|
-
* @param payload The invoice's payload.
|
|
1927
|
-
* @param currency The invoice's currency.
|
|
1928
|
-
* @param prices The invoice's price tags.
|
|
1929
|
-
* @returns The sent invoice.
|
|
1853
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1854
|
+
* @param richText The new rich text of the message.
|
|
1930
1855
|
*/
|
|
1931
|
-
async
|
|
1932
|
-
return await this.#messageManager.
|
|
1856
|
+
async editInlineMessageRichText(inlineMessageId, richText, params) {
|
|
1857
|
+
return await this.#messageManager.editInlineMessageRichText(inlineMessageId, richText, params);
|
|
1933
1858
|
}
|
|
1934
1859
|
/**
|
|
1935
|
-
* Edit
|
|
1860
|
+
* Edit an inline message's text. Bot-only.
|
|
1936
1861
|
*
|
|
1937
1862
|
* @method ms
|
|
1938
|
-
* @param
|
|
1939
|
-
* @param messageId The identifier of the message.
|
|
1863
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
1940
1864
|
* @param text The new text of the message.
|
|
1941
|
-
* @returns The edited text message.
|
|
1942
1865
|
*/
|
|
1943
|
-
async
|
|
1944
|
-
|
|
1866
|
+
async editInlineMessageText(inlineMessageId, text, params) {
|
|
1867
|
+
await this.#messageManager.editInlineMessageText(inlineMessageId, text, params);
|
|
1945
1868
|
}
|
|
1946
1869
|
/**
|
|
1947
|
-
* Edit a message's
|
|
1870
|
+
* Edit a message's caption.
|
|
1948
1871
|
*
|
|
1949
1872
|
* @method ms
|
|
1950
1873
|
* @param chatId The identifier of the chat which the message belongs to.
|
|
1951
1874
|
* @param messageId The identifier of the message.
|
|
1952
|
-
* @
|
|
1953
|
-
* @returns The edited rich text message.
|
|
1875
|
+
* @returns The edited message.
|
|
1954
1876
|
*/
|
|
1955
|
-
async
|
|
1956
|
-
return await this.#messageManager.
|
|
1877
|
+
async editMessageCaption(chatId, messageId, params) {
|
|
1878
|
+
return await this.#messageManager.editMessageCaption(chatId, messageId, params);
|
|
1957
1879
|
}
|
|
1958
1880
|
/**
|
|
1959
|
-
* Edit a message's
|
|
1881
|
+
* Edit a message's live location.
|
|
1960
1882
|
*
|
|
1961
1883
|
* @method ms
|
|
1962
1884
|
* @param chatId The identifier of the chat which the message belongs to.
|
|
1963
1885
|
* @param messageId The identifier of the message.
|
|
1964
|
-
* @
|
|
1886
|
+
* @param latitude The new latitude.
|
|
1887
|
+
* @param longitude The new longitude.
|
|
1888
|
+
* @returns The edited location message.
|
|
1965
1889
|
*/
|
|
1966
|
-
async
|
|
1967
|
-
return await this.#messageManager.
|
|
1890
|
+
async editMessageLiveLocation(chatId, messageId, latitude, longitude, params) {
|
|
1891
|
+
return await this.#messageManager.editMessageLiveLocation(chatId, messageId, latitude, longitude, params);
|
|
1968
1892
|
}
|
|
1969
1893
|
/**
|
|
1970
1894
|
* Edit a message's media.
|
|
@@ -1979,103 +1903,80 @@ export class Client extends Composer {
|
|
|
1979
1903
|
return await this.#messageManager.editMessageMedia(chatId, messageId, media, params);
|
|
1980
1904
|
}
|
|
1981
1905
|
/**
|
|
1982
|
-
* Edit
|
|
1906
|
+
* Edit a message's reply markup.
|
|
1983
1907
|
*
|
|
1984
1908
|
* @method ms
|
|
1985
|
-
* @param
|
|
1986
|
-
* @param
|
|
1909
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1910
|
+
* @param messageId The identifier of the message.
|
|
1911
|
+
* @returns The edited message.
|
|
1987
1912
|
*/
|
|
1988
|
-
async
|
|
1989
|
-
await this.#messageManager.
|
|
1913
|
+
async editMessageReplyMarkup(chatId, messageId, params) {
|
|
1914
|
+
return await this.#messageManager.editMessageReplyMarkup(chatId, messageId, params);
|
|
1990
1915
|
}
|
|
1991
1916
|
/**
|
|
1992
|
-
* Edit
|
|
1917
|
+
* Edit a message's rich text.
|
|
1993
1918
|
*
|
|
1994
1919
|
* @method ms
|
|
1995
|
-
* @param
|
|
1920
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1921
|
+
* @param messageId The identifier of the message.
|
|
1996
1922
|
* @param richText The new rich text of the message.
|
|
1923
|
+
* @returns The edited rich text message.
|
|
1997
1924
|
*/
|
|
1998
|
-
async
|
|
1999
|
-
return await this.#messageManager.
|
|
2000
|
-
}
|
|
2001
|
-
/**
|
|
2002
|
-
* Edit an inline message's text. Bot-only.
|
|
2003
|
-
*
|
|
2004
|
-
* @method ms
|
|
2005
|
-
* @param inlineMessageId The identifier of the inline message.
|
|
2006
|
-
* @param text The new text of the message.
|
|
2007
|
-
*/
|
|
2008
|
-
async editInlineMessageText(inlineMessageId, text, params) {
|
|
2009
|
-
await this.#messageManager.editInlineMessageText(inlineMessageId, text, params);
|
|
2010
|
-
}
|
|
2011
|
-
/**
|
|
2012
|
-
* Edit an inline message's caption. Bot-only.
|
|
2013
|
-
*
|
|
2014
|
-
* @method ms
|
|
2015
|
-
* @param inlineMessageId The identifier of the inline message.
|
|
2016
|
-
*/
|
|
2017
|
-
async editInlineMessageCaption(inlineMessageId, params) {
|
|
2018
|
-
await this.#messageManager.editInlineMessageCaption(inlineMessageId, params);
|
|
1925
|
+
async editMessageRichText(chatId, messageId, richText, params) {
|
|
1926
|
+
return await this.#messageManager.editMessageRichText(chatId, messageId, richText, params);
|
|
2019
1927
|
}
|
|
2020
1928
|
/**
|
|
2021
|
-
* Edit a message's
|
|
1929
|
+
* Edit a message's text.
|
|
2022
1930
|
*
|
|
2023
1931
|
* @method ms
|
|
2024
1932
|
* @param chatId The identifier of the chat which the message belongs to.
|
|
2025
1933
|
* @param messageId The identifier of the message.
|
|
2026
|
-
* @
|
|
1934
|
+
* @param text The new text of the message.
|
|
1935
|
+
* @returns The edited text message.
|
|
2027
1936
|
*/
|
|
2028
|
-
async
|
|
2029
|
-
return await this.#messageManager.
|
|
1937
|
+
async editMessageText(chatId, messageId, text, params) {
|
|
1938
|
+
return await this.#messageManager.editMessageText(chatId, messageId, text, params);
|
|
2030
1939
|
}
|
|
2031
1940
|
/**
|
|
2032
|
-
*
|
|
1941
|
+
* Forward a single message.
|
|
2033
1942
|
*
|
|
2034
1943
|
* @method ms
|
|
2035
|
-
* @param
|
|
1944
|
+
* @param from The identifier of a chat to forward the message from.
|
|
1945
|
+
* @param to The identifier of a chat to forward the message to.
|
|
1946
|
+
* @param messageId The identifier of the message to forward.
|
|
1947
|
+
* @returns The forwarded message.
|
|
2036
1948
|
*/
|
|
2037
|
-
async
|
|
2038
|
-
await this
|
|
1949
|
+
async forwardMessage(from, to, messageId, params) {
|
|
1950
|
+
return (await this.forwardMessages(from, to, [messageId], params))[0];
|
|
2039
1951
|
}
|
|
2040
1952
|
/**
|
|
2041
|
-
*
|
|
1953
|
+
* Forward multiple messages.
|
|
2042
1954
|
*
|
|
2043
1955
|
* @method ms
|
|
2044
|
-
* @param
|
|
2045
|
-
* @param
|
|
2046
|
-
* @param
|
|
2047
|
-
* @
|
|
2048
|
-
* @returns The edited location message.
|
|
1956
|
+
* @param from The identifier of a chat to forward the messages from.
|
|
1957
|
+
* @param to The identifier of a chat to forward the messages to.
|
|
1958
|
+
* @param messageIds The identifiers of the messages to forward.
|
|
1959
|
+
* @returns The forwarded messages.
|
|
2049
1960
|
*/
|
|
2050
|
-
async
|
|
2051
|
-
return await this.#messageManager.
|
|
1961
|
+
async forwardMessages(from, to, messageIds, params) {
|
|
1962
|
+
return await this.#messageManager.forwardMessages(from, to, messageIds, params);
|
|
2052
1963
|
}
|
|
2053
1964
|
/**
|
|
2054
|
-
*
|
|
1965
|
+
* Get favorite stickers. User-only.
|
|
2055
1966
|
*
|
|
2056
1967
|
* @method ms
|
|
2057
|
-
* @param inlineMessageId The identifier of the inline message.
|
|
2058
|
-
* @param latitude The new latitude.
|
|
2059
|
-
* @param longitude The new longitude.
|
|
2060
|
-
* @returns The edited location message.
|
|
2061
1968
|
*/
|
|
2062
|
-
async
|
|
2063
|
-
await this.#messageManager.
|
|
1969
|
+
async getFavoriteStickers() {
|
|
1970
|
+
return await this.#messageManager.getFavoriteStickers();
|
|
2064
1971
|
}
|
|
2065
1972
|
/**
|
|
2066
|
-
*
|
|
1973
|
+
* Get the link preview for a message that is about to be sent. User-only.
|
|
2067
1974
|
*
|
|
2068
1975
|
* @method ms
|
|
2069
|
-
* @param
|
|
2070
|
-
* @param messageIds The identifiers of the messages to retrieve.
|
|
2071
|
-
* @example ```ts
|
|
2072
|
-
* const message = await client.getMessages("@MTKruto", [210, 212]);
|
|
2073
|
-
* ```
|
|
2074
|
-
* @returns The retrieved messages.
|
|
2075
|
-
* @cache
|
|
1976
|
+
* @param text The message's text.
|
|
2076
1977
|
*/
|
|
2077
|
-
async
|
|
2078
|
-
return await this.#
|
|
1978
|
+
async getLinkPreview(text, params) {
|
|
1979
|
+
return await this.#linkPreviewManager.getLinkPreview(text, params);
|
|
2079
1980
|
}
|
|
2080
1981
|
/**
|
|
2081
1982
|
* Retrieve a single message.
|
|
@@ -2093,87 +1994,142 @@ export class Client extends Composer {
|
|
|
2093
1994
|
return await this.#messageManager.getMessage(chatId, messageId);
|
|
2094
1995
|
}
|
|
2095
1996
|
/**
|
|
2096
|
-
*
|
|
1997
|
+
* Get the counters of a single message. User-only.
|
|
2097
1998
|
*
|
|
2098
1999
|
* @method ms
|
|
2099
|
-
* @param
|
|
2100
|
-
* @
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
*/
|
|
2105
|
-
async resolveMessageLink(link) {
|
|
2106
|
-
return await this.#messageManager.resolveMessageLink(link);
|
|
2000
|
+
* @param chatId The identifier of the chat including the message.
|
|
2001
|
+
* @param messageId The identifier of the message.
|
|
2002
|
+
*/
|
|
2003
|
+
async getMessageCounters(chatId, messageId) {
|
|
2004
|
+
return await this.#messageManager.getMessageCounters(chatId, messageId);
|
|
2107
2005
|
}
|
|
2108
2006
|
/**
|
|
2109
|
-
*
|
|
2007
|
+
* Get a list of reactions made to a message. User-only.
|
|
2110
2008
|
*
|
|
2009
|
+
* @param chatId The identifier of a chat.
|
|
2010
|
+
* @param messageId The identifier of the message.
|
|
2111
2011
|
* @method ms
|
|
2112
|
-
* @param chatId The identifier of the chat which the message belongs to.
|
|
2113
|
-
* @param messageIds The identifiers of the messages to delete.
|
|
2114
2012
|
*/
|
|
2115
|
-
async
|
|
2116
|
-
await this.#messageManager.
|
|
2013
|
+
async getMessageReactions(chatId, messageId, params) {
|
|
2014
|
+
return await this.#messageManager.getMessageReactions(chatId, messageId, params);
|
|
2117
2015
|
}
|
|
2118
2016
|
/**
|
|
2119
|
-
*
|
|
2017
|
+
* Get a message's read date. User-only.
|
|
2120
2018
|
*
|
|
2121
2019
|
* @method ms
|
|
2122
|
-
* @param chatId The identifier of
|
|
2123
|
-
* @param messageId The identifier of the message
|
|
2020
|
+
* @param chatId The identifier of a chat.
|
|
2021
|
+
* @param messageId The identifier of the message.
|
|
2124
2022
|
*/
|
|
2125
|
-
async
|
|
2126
|
-
await this.#messageManager.
|
|
2023
|
+
async getMessageReadDate(chatId, messageId) {
|
|
2024
|
+
return await this.#messageManager.getMessageReadDate(chatId, messageId);
|
|
2127
2025
|
}
|
|
2128
2026
|
/**
|
|
2129
|
-
*
|
|
2027
|
+
* Retrieve multiple messages.
|
|
2130
2028
|
*
|
|
2131
2029
|
* @method ms
|
|
2132
|
-
* @param chatId The identifier of a chat
|
|
2133
|
-
* @param
|
|
2030
|
+
* @param chatId The identifier of a chat to retrieve the messages from.
|
|
2031
|
+
* @param messageIds The identifiers of the messages to retrieve.
|
|
2032
|
+
* @example ```ts
|
|
2033
|
+
* const message = await client.getMessages("@MTKruto", [210, 212]);
|
|
2034
|
+
* ```
|
|
2035
|
+
* @returns The retrieved messages.
|
|
2036
|
+
* @cache
|
|
2134
2037
|
*/
|
|
2135
|
-
async
|
|
2136
|
-
await this.#messageManager.
|
|
2038
|
+
async getMessages(chatId, messageIds) {
|
|
2039
|
+
return await this.#messageManager.getMessages(chatId, messageIds);
|
|
2137
2040
|
}
|
|
2138
2041
|
/**
|
|
2139
|
-
*
|
|
2042
|
+
* Get the counters of multiple messages. User-only.
|
|
2140
2043
|
*
|
|
2141
2044
|
* @method ms
|
|
2142
|
-
* @param chatId The identifier of
|
|
2143
|
-
* @param messageIds The identifiers of the
|
|
2045
|
+
* @param chatId The identifier of the chat including the messages.
|
|
2046
|
+
* @param messageIds The identifiers of the messages.
|
|
2144
2047
|
*/
|
|
2145
|
-
async
|
|
2146
|
-
await this.#messageManager.
|
|
2048
|
+
async getMessagesCounters(chatId, messageIds) {
|
|
2049
|
+
return await this.#messageManager.getMessagesCounters(chatId, messageIds);
|
|
2147
2050
|
}
|
|
2148
2051
|
/**
|
|
2149
|
-
*
|
|
2052
|
+
* Get a message's viewers. User-only.
|
|
2150
2053
|
*
|
|
2151
2054
|
* @method ms
|
|
2152
2055
|
* @param chatId The identifier of a chat.
|
|
2153
|
-
* @param messageId The identifier of the
|
|
2056
|
+
* @param messageId The identifier of the message.
|
|
2057
|
+
* @returns The message's viewers.
|
|
2154
2058
|
*/
|
|
2155
|
-
async
|
|
2156
|
-
await this.#messageManager.
|
|
2059
|
+
async getMessageViewers(chatId, messageId) {
|
|
2060
|
+
return await this.#messageManager.getMessageViewers(chatId, messageId);
|
|
2157
2061
|
}
|
|
2158
2062
|
/**
|
|
2159
|
-
*
|
|
2063
|
+
* Get a progress ID that can be passed to relevant send* methods to receive upload progress updates for them.
|
|
2160
2064
|
*
|
|
2161
2065
|
* @method ms
|
|
2162
|
-
* @
|
|
2163
|
-
* @param messageIds The identifiers of the scheduled messages to send.
|
|
2066
|
+
* @cache
|
|
2164
2067
|
*/
|
|
2165
|
-
async
|
|
2166
|
-
return await this.#
|
|
2068
|
+
async getProgressId() {
|
|
2069
|
+
return await this.#fileManager.getProgressId();
|
|
2167
2070
|
}
|
|
2168
2071
|
/**
|
|
2169
|
-
*
|
|
2072
|
+
* Get recent stickers. User-only.
|
|
2073
|
+
*
|
|
2074
|
+
* @method ms
|
|
2075
|
+
*/
|
|
2076
|
+
async getRecentStickers() {
|
|
2077
|
+
return await this.#messageManager.getRecentStickers();
|
|
2078
|
+
}
|
|
2079
|
+
/**
|
|
2080
|
+
* Get a message's full rich text. User-only.
|
|
2081
|
+
*
|
|
2082
|
+
* @method ms
|
|
2083
|
+
* @param chatId The identifier of the chat including the message.
|
|
2084
|
+
* @param messageId The identifier of the message.
|
|
2085
|
+
*/
|
|
2086
|
+
async getRichText(chatId, messageId) {
|
|
2087
|
+
return await this.#messageManager.getRichText(chatId, messageId);
|
|
2088
|
+
}
|
|
2089
|
+
/**
|
|
2090
|
+
* Get saved animations. User-only.
|
|
2091
|
+
*
|
|
2092
|
+
* @method ms
|
|
2093
|
+
*/
|
|
2094
|
+
async getSavedAnimations() {
|
|
2095
|
+
return await this.#messageManager.getSavedAnimations();
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* Get a list of saved chats.
|
|
2099
|
+
*
|
|
2100
|
+
* @method ms
|
|
2101
|
+
*/
|
|
2102
|
+
async getSavedChats(params) {
|
|
2103
|
+
return await this.#messageManager.getSavedChats(params);
|
|
2104
|
+
}
|
|
2105
|
+
/**
|
|
2106
|
+
* Get messages saved from a specific chat.
|
|
2170
2107
|
*
|
|
2171
2108
|
* @method ms
|
|
2172
2109
|
* @param chatId The identifier of a chat.
|
|
2173
|
-
* @param messageId The identifier of the scheduled message to send.
|
|
2174
2110
|
*/
|
|
2175
|
-
async
|
|
2176
|
-
return await this.#messageManager.
|
|
2111
|
+
async getSavedMessages(chatId, params) {
|
|
2112
|
+
return await this.#messageManager.getSavedMessages(chatId, params);
|
|
2113
|
+
}
|
|
2114
|
+
/**
|
|
2115
|
+
* Get the scheduled messages of a chat. User-only.
|
|
2116
|
+
*
|
|
2117
|
+
* @method ms
|
|
2118
|
+
* @param chatId The identifier of the chat including the scheduled messages.
|
|
2119
|
+
*/
|
|
2120
|
+
async getScheduledMessages(chatId) {
|
|
2121
|
+
return await this.#messageManager.getScheduledMessages(chatId);
|
|
2122
|
+
}
|
|
2123
|
+
/**
|
|
2124
|
+
* Open a mini app. User-only.
|
|
2125
|
+
*
|
|
2126
|
+
* @method ms
|
|
2127
|
+
* @param botId The identifier of a bot with the mini app.
|
|
2128
|
+
* @param chatId The identifier of the chat from which the mini app is opened.
|
|
2129
|
+
* @cache
|
|
2130
|
+
*/
|
|
2131
|
+
async openMiniApp(botId, chatId, params) {
|
|
2132
|
+
return await this.#messageManager.openMiniApp(botId, chatId, params);
|
|
2177
2133
|
}
|
|
2178
2134
|
/**
|
|
2179
2135
|
* Pin a message in a chat.
|
|
@@ -2186,58 +2142,84 @@ export class Client extends Composer {
|
|
|
2186
2142
|
await this.#messageManager.pinMessage(chatId, messageId, params);
|
|
2187
2143
|
}
|
|
2188
2144
|
/**
|
|
2189
|
-
*
|
|
2145
|
+
* Mark messages as read. User-only.
|
|
2190
2146
|
*
|
|
2191
2147
|
* @method ms
|
|
2192
|
-
* @param chatId The identifier of
|
|
2193
|
-
* @param
|
|
2148
|
+
* @param chatId The identifier of the chat which the messages belong to.
|
|
2149
|
+
* @param untilMessageId The identifier of the message that will be marked as read, along with any other unread messages before it.
|
|
2194
2150
|
*/
|
|
2195
|
-
async
|
|
2196
|
-
await this.#messageManager.
|
|
2151
|
+
async readMessages(chatId, untilMessageId) {
|
|
2152
|
+
await this.#messageManager.readMessages(chatId, untilMessageId);
|
|
2197
2153
|
}
|
|
2198
2154
|
/**
|
|
2199
|
-
*
|
|
2155
|
+
* Remove a sticker from favorites. User-only.
|
|
2200
2156
|
*
|
|
2201
2157
|
* @method ms
|
|
2202
|
-
* @param
|
|
2158
|
+
* @param fileId The file identifier of the sticker.
|
|
2203
2159
|
*/
|
|
2204
|
-
async
|
|
2205
|
-
await this.#messageManager.
|
|
2160
|
+
async removeStickerFromFavorites(fileId) {
|
|
2161
|
+
return await this.#messageManager.removeStickerFromFavorites(fileId);
|
|
2206
2162
|
}
|
|
2207
2163
|
/**
|
|
2208
|
-
*
|
|
2164
|
+
* Remove a sticker from recents. User-only.
|
|
2209
2165
|
*
|
|
2210
2166
|
* @method ms
|
|
2211
|
-
* @param
|
|
2212
|
-
* @param to The identifier of a chat to forward the messages to.
|
|
2213
|
-
* @param messageIds The identifiers of the messages to forward.
|
|
2214
|
-
* @returns The forwarded messages.
|
|
2167
|
+
* @param fileId The file identifier of the sticker.
|
|
2215
2168
|
*/
|
|
2216
|
-
async
|
|
2217
|
-
return await this.#messageManager.
|
|
2169
|
+
async removeStickerFromRecents(fileId) {
|
|
2170
|
+
return await this.#messageManager.removeStickerFromRecents(fileId);
|
|
2218
2171
|
}
|
|
2219
2172
|
/**
|
|
2220
|
-
*
|
|
2173
|
+
* Retrieve a message using its link.
|
|
2221
2174
|
*
|
|
2222
2175
|
* @method ms
|
|
2223
|
-
* @param
|
|
2224
|
-
* @
|
|
2225
|
-
*
|
|
2226
|
-
*
|
|
2176
|
+
* @param link A message link.
|
|
2177
|
+
* @example ```ts
|
|
2178
|
+
* const message = await client.resolveMessageLink("https://t.me/MTKruto/212");
|
|
2179
|
+
* ```
|
|
2180
|
+
* @returns The message that was linked to.
|
|
2227
2181
|
*/
|
|
2228
|
-
async
|
|
2229
|
-
return
|
|
2182
|
+
async resolveMessageLink(link) {
|
|
2183
|
+
return await this.#messageManager.resolveMessageLink(link);
|
|
2230
2184
|
}
|
|
2231
2185
|
/**
|
|
2232
|
-
*
|
|
2186
|
+
* Save an animation. User-only.
|
|
2233
2187
|
*
|
|
2234
2188
|
* @method ms
|
|
2235
|
-
* @param
|
|
2236
|
-
* @param messageId The identifier of the poll's message.
|
|
2237
|
-
* @returns The new state of the poll.
|
|
2189
|
+
* @param fileId The file identifier of the animation.
|
|
2238
2190
|
*/
|
|
2239
|
-
async
|
|
2240
|
-
return await this.#messageManager.
|
|
2191
|
+
async saveAnimation(fileId) {
|
|
2192
|
+
return await this.#messageManager.saveAnimation(fileId);
|
|
2193
|
+
}
|
|
2194
|
+
/**
|
|
2195
|
+
* Search for messages. User-only.
|
|
2196
|
+
*
|
|
2197
|
+
* @method ms
|
|
2198
|
+
*/
|
|
2199
|
+
async searchMessages(params) {
|
|
2200
|
+
return await this.#messageManager.searchMessages(params);
|
|
2201
|
+
}
|
|
2202
|
+
/**
|
|
2203
|
+
* Send an animation.
|
|
2204
|
+
*
|
|
2205
|
+
* @method ms
|
|
2206
|
+
* @param chatId The identifier of a chat to send the animation to.
|
|
2207
|
+
* @param animation The animation to send.
|
|
2208
|
+
* @returns The sent animation.
|
|
2209
|
+
*/
|
|
2210
|
+
async sendAnimation(chatId, animation, params) {
|
|
2211
|
+
return await this.#messageManager.sendAnimation(chatId, animation, params);
|
|
2212
|
+
}
|
|
2213
|
+
/**
|
|
2214
|
+
* Send an audio file.
|
|
2215
|
+
*
|
|
2216
|
+
* @method ms
|
|
2217
|
+
* @param chatId The identifier of a chat to send the audio file to.
|
|
2218
|
+
* @param audio The audio to send.
|
|
2219
|
+
* @returns The sent audio file.
|
|
2220
|
+
*/
|
|
2221
|
+
async sendAudio(chatId, audio, params) {
|
|
2222
|
+
return await this.#messageManager.sendAudio(chatId, audio, params);
|
|
2241
2223
|
}
|
|
2242
2224
|
/**
|
|
2243
2225
|
* Send a chat action.
|
|
@@ -2250,304 +2232,366 @@ export class Client extends Composer {
|
|
|
2250
2232
|
await this.#messageManager.sendChatAction(chatId, action, params);
|
|
2251
2233
|
}
|
|
2252
2234
|
/**
|
|
2253
|
-
*
|
|
2235
|
+
* Send a checklist.
|
|
2254
2236
|
*
|
|
2255
2237
|
* @method ms
|
|
2238
|
+
* @param chatId The identifier of a chat to send the checklist to.
|
|
2239
|
+
* @param title The checklist's title.
|
|
2240
|
+
* @param items The checklist's items.
|
|
2241
|
+
* @returns The sent checklist.
|
|
2256
2242
|
*/
|
|
2257
|
-
async
|
|
2258
|
-
return await this.#messageManager.
|
|
2243
|
+
async sendChecklist(chatId, title, items, params) {
|
|
2244
|
+
return await this.#messageManager.sendChecklist(chatId, title, items, params);
|
|
2259
2245
|
}
|
|
2260
2246
|
/**
|
|
2261
|
-
*
|
|
2247
|
+
* Send a contact.
|
|
2262
2248
|
*
|
|
2263
2249
|
* @method ms
|
|
2264
|
-
* @param chatId The identifier of
|
|
2265
|
-
* @param
|
|
2250
|
+
* @param chatId The identifier of a chat to send the contact to.
|
|
2251
|
+
* @param firstName The contact's first name.
|
|
2252
|
+
* @param phoneNumber The contact's phone number.
|
|
2253
|
+
* @returns The sent contact.
|
|
2266
2254
|
*/
|
|
2267
|
-
async
|
|
2268
|
-
await this.#messageManager.
|
|
2255
|
+
async sendContact(chatId, firstName, phoneNumber, params) {
|
|
2256
|
+
return await this.#messageManager.sendContact(chatId, firstName, phoneNumber, params);
|
|
2269
2257
|
}
|
|
2270
2258
|
/**
|
|
2271
|
-
*
|
|
2259
|
+
* Send a dice.
|
|
2272
2260
|
*
|
|
2273
2261
|
* @method ms
|
|
2274
|
-
* @param
|
|
2275
|
-
* @returns The
|
|
2262
|
+
* @param chatId The identifier of a chat to send the dice to.
|
|
2263
|
+
* @returns The sent dice.
|
|
2276
2264
|
*/
|
|
2277
|
-
async
|
|
2278
|
-
return await this.#messageManager.
|
|
2265
|
+
async sendDice(chatId, params) {
|
|
2266
|
+
return await this.#messageManager.sendDice(chatId, params);
|
|
2279
2267
|
}
|
|
2280
2268
|
/**
|
|
2281
|
-
*
|
|
2269
|
+
* Send a document.
|
|
2282
2270
|
*
|
|
2283
2271
|
* @method ms
|
|
2284
|
-
* @param chatId The identifier of
|
|
2285
|
-
* @param
|
|
2286
|
-
* @
|
|
2272
|
+
* @param chatId The identifier of a chat to send the document to.
|
|
2273
|
+
* @param document The document to send.
|
|
2274
|
+
* @returns The sent document.
|
|
2287
2275
|
*/
|
|
2288
|
-
async
|
|
2289
|
-
return await this.#messageManager.
|
|
2276
|
+
async sendDocument(chatId, document, params) {
|
|
2277
|
+
return await this.#messageManager.sendDocument(chatId, document, params);
|
|
2290
2278
|
}
|
|
2291
|
-
|
|
2292
|
-
*
|
|
2279
|
+
/**
|
|
2280
|
+
* Send an invoice. Bot-only.
|
|
2293
2281
|
*
|
|
2294
2282
|
* @method ms
|
|
2295
|
-
* @param
|
|
2283
|
+
* @param chatId The identifier of a chat to send the invoice to.
|
|
2284
|
+
* @param title The invoice's title.
|
|
2285
|
+
* @param description The invoice's description.
|
|
2286
|
+
* @param payload The invoice's payload.
|
|
2287
|
+
* @param currency The invoice's currency.
|
|
2288
|
+
* @param prices The invoice's price tags.
|
|
2289
|
+
* @returns The sent invoice.
|
|
2296
2290
|
*/
|
|
2297
|
-
async
|
|
2298
|
-
return await this.#
|
|
2291
|
+
async sendInvoice(chatId, title, description, payload, currency, prices, params) {
|
|
2292
|
+
return await this.#messageManager.sendInvoice(chatId, title, description, payload, currency, prices, params);
|
|
2299
2293
|
}
|
|
2300
2294
|
/**
|
|
2301
|
-
*
|
|
2295
|
+
* Send a live photo.
|
|
2302
2296
|
*
|
|
2303
2297
|
* @method ms
|
|
2304
|
-
* @param
|
|
2305
|
-
* @param
|
|
2306
|
-
* @
|
|
2298
|
+
* @param chatId The identifier of a chat to send the photo to.
|
|
2299
|
+
* @param photo The photo to send.
|
|
2300
|
+
* @param video The video version of the photo.
|
|
2301
|
+
* @returns The sent live photo.
|
|
2307
2302
|
*/
|
|
2308
|
-
async
|
|
2309
|
-
return await this.#messageManager.
|
|
2303
|
+
async sendLivePhoto(chatId, photo, video, params) {
|
|
2304
|
+
return await this.#messageManager.sendLivePhoto(chatId, photo, video, params);
|
|
2310
2305
|
}
|
|
2311
2306
|
/**
|
|
2312
|
-
*
|
|
2307
|
+
* Send a location.
|
|
2313
2308
|
*
|
|
2314
2309
|
* @method ms
|
|
2315
|
-
* @
|
|
2310
|
+
* @param chatId The identifier of a chat to send the location to.
|
|
2311
|
+
* @param latitude The location's latitude.
|
|
2312
|
+
* @param longitude The location's longitude.
|
|
2313
|
+
* @returns The sent location.
|
|
2316
2314
|
*/
|
|
2317
|
-
async
|
|
2318
|
-
return await this.#
|
|
2315
|
+
async sendLocation(chatId, latitude, longitude, params) {
|
|
2316
|
+
return await this.#messageManager.sendLocation(chatId, latitude, longitude, params);
|
|
2319
2317
|
}
|
|
2320
2318
|
/**
|
|
2321
|
-
*
|
|
2319
|
+
* Send a media group.
|
|
2322
2320
|
*
|
|
2323
2321
|
* @method ms
|
|
2324
|
-
* @param chatId The identifier of a chat.
|
|
2322
|
+
* @param chatId The identifier of a chat to send the media group to.
|
|
2323
|
+
* @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.
|
|
2324
|
+
* @returns The sent messages.
|
|
2325
2325
|
*/
|
|
2326
|
-
async
|
|
2327
|
-
return await this.#messageManager.
|
|
2326
|
+
async sendMediaGroup(chatId, media, params) {
|
|
2327
|
+
return await this.#messageManager.sendMediaGroup(chatId, media, params);
|
|
2328
2328
|
}
|
|
2329
2329
|
/**
|
|
2330
|
-
*
|
|
2330
|
+
* Send a text message.
|
|
2331
2331
|
*
|
|
2332
2332
|
* @method ms
|
|
2333
|
+
* @param chatId The identifier of a chat to send the message to.
|
|
2334
|
+
* @param text The message's text.
|
|
2335
|
+
* @returns The sent text message.
|
|
2333
2336
|
*/
|
|
2334
|
-
async
|
|
2335
|
-
return await this.#messageManager.
|
|
2337
|
+
async sendMessage(chatId, text, params) {
|
|
2338
|
+
return await this.#messageManager.sendMessage(chatId, text, params);
|
|
2336
2339
|
}
|
|
2337
2340
|
/**
|
|
2338
|
-
*
|
|
2341
|
+
* Stream a drafted text message. Bot-only.
|
|
2339
2342
|
*
|
|
2340
|
-
* @param chatId The identifier of a chat.
|
|
2341
|
-
* @param messageId The identifier of the message.
|
|
2342
2343
|
* @method ms
|
|
2344
|
+
* @param chatId The identifier of a chat to send the message to.
|
|
2345
|
+
* @param draftId The identifier of the draft.
|
|
2346
|
+
* @param text The message's text.
|
|
2343
2347
|
*/
|
|
2344
|
-
async
|
|
2345
|
-
|
|
2348
|
+
async sendMessageDraft(chatId, draftId, text, params) {
|
|
2349
|
+
await this.#messageManager.sendMessageDraft(chatId, draftId, text, params);
|
|
2350
|
+
}
|
|
2351
|
+
/**
|
|
2352
|
+
* Send a photo.
|
|
2353
|
+
*
|
|
2354
|
+
* @method ms
|
|
2355
|
+
* @param chatId The identifier of a chat to send the photo to.
|
|
2356
|
+
* @param photo The photo to send.
|
|
2357
|
+
* @returns The sent photo.
|
|
2358
|
+
*/
|
|
2359
|
+
async sendPhoto(chatId, photo, params) {
|
|
2360
|
+
return await this.#messageManager.sendPhoto(chatId, photo, params);
|
|
2346
2361
|
}
|
|
2347
2362
|
/**
|
|
2348
|
-
*
|
|
2363
|
+
* Send a poll.
|
|
2349
2364
|
*
|
|
2350
2365
|
* @method ms
|
|
2351
|
-
* @param
|
|
2366
|
+
* @param chatId The identifier of a chat to send the poll to.
|
|
2367
|
+
* @param question The poll's question.
|
|
2368
|
+
* @param options The poll's options.
|
|
2369
|
+
* @returns The sent poll.
|
|
2352
2370
|
*/
|
|
2353
|
-
async
|
|
2354
|
-
await this.#messageManager.
|
|
2371
|
+
async sendPoll(chatId, question, options, params) {
|
|
2372
|
+
return await this.#messageManager.sendPoll(chatId, question, options, params);
|
|
2355
2373
|
}
|
|
2356
2374
|
/**
|
|
2357
|
-
*
|
|
2375
|
+
* Send a rich text message.
|
|
2358
2376
|
*
|
|
2359
2377
|
* @method ms
|
|
2378
|
+
* @param chatId The identifier of a chat to send the message to.
|
|
2379
|
+
* @param richText The message's rich text.
|
|
2380
|
+
* @returns The sent rich text message.
|
|
2360
2381
|
*/
|
|
2361
|
-
async
|
|
2362
|
-
await this.#messageManager.
|
|
2382
|
+
async sendRichText(chatId, richText, params) {
|
|
2383
|
+
return await this.#messageManager.sendRichText(chatId, richText, params);
|
|
2363
2384
|
}
|
|
2364
2385
|
/**
|
|
2365
|
-
*
|
|
2386
|
+
* Stream a drafted rich text message. Bot-only.
|
|
2366
2387
|
*
|
|
2367
2388
|
* @method ms
|
|
2368
|
-
* @param chatId The identifier of a chat.
|
|
2369
|
-
* @param
|
|
2389
|
+
* @param chatId The identifier of a chat to send the message to.
|
|
2390
|
+
* @param draftId The identifier of the draft.
|
|
2391
|
+
* @param richText The message's rich text.
|
|
2370
2392
|
*/
|
|
2371
|
-
async
|
|
2372
|
-
return await this.#messageManager.
|
|
2393
|
+
async sendRichTextDraft(chatId, draftId, richText, params) {
|
|
2394
|
+
return await this.#messageManager.sendRichTextDraft(chatId, draftId, richText, params);
|
|
2373
2395
|
}
|
|
2374
2396
|
/**
|
|
2375
|
-
*
|
|
2397
|
+
* Send a scheduled message before its schedule.
|
|
2376
2398
|
*
|
|
2377
2399
|
* @method ms
|
|
2378
|
-
* @param chatId The identifier of
|
|
2379
|
-
* @param
|
|
2400
|
+
* @param chatId The identifier of a chat.
|
|
2401
|
+
* @param messageId The identifier of the scheduled message to send.
|
|
2380
2402
|
*/
|
|
2381
|
-
async
|
|
2382
|
-
return await this.#messageManager.
|
|
2403
|
+
async sendScheduledMessage(chatId, messageId) {
|
|
2404
|
+
return await this.#messageManager.sendScheduledMessage(chatId, messageId);
|
|
2383
2405
|
}
|
|
2384
2406
|
/**
|
|
2385
|
-
*
|
|
2407
|
+
* Send multiple scheduled messages before their schedule.
|
|
2386
2408
|
*
|
|
2387
2409
|
* @method ms
|
|
2388
|
-
* @param chatId The identifier of
|
|
2389
|
-
* @param
|
|
2410
|
+
* @param chatId The identifier of a chat.
|
|
2411
|
+
* @param messageIds The identifiers of the scheduled messages to send.
|
|
2390
2412
|
*/
|
|
2391
|
-
async
|
|
2392
|
-
return await this.#messageManager.
|
|
2413
|
+
async sendScheduledMessages(chatId, messageIds) {
|
|
2414
|
+
return await this.#messageManager.sendScheduledMessages(chatId, messageIds);
|
|
2393
2415
|
}
|
|
2394
2416
|
/**
|
|
2395
|
-
*
|
|
2417
|
+
* Send a screenshot notification. User-only.
|
|
2396
2418
|
*
|
|
2397
2419
|
* @method ms
|
|
2398
|
-
* @param
|
|
2399
|
-
* @param
|
|
2420
|
+
* @param chatId The identifier of a chat.
|
|
2421
|
+
* @param replyToMessageId The identifier of the message.
|
|
2400
2422
|
*/
|
|
2401
|
-
async
|
|
2402
|
-
return await this.#messageManager.
|
|
2423
|
+
async sendScreenshotNotification(chatId, replyToMessageId) {
|
|
2424
|
+
return await this.#messageManager.sendScreenshotNotification(chatId, replyToMessageId);
|
|
2403
2425
|
}
|
|
2404
2426
|
/**
|
|
2405
|
-
*
|
|
2427
|
+
* Send a sticker.
|
|
2406
2428
|
*
|
|
2407
2429
|
* @method ms
|
|
2408
|
-
* @param
|
|
2409
|
-
* @param
|
|
2430
|
+
* @param chatId The identifier of a chat to send the sticker to.
|
|
2431
|
+
* @param sticker The sticker to send.
|
|
2432
|
+
* @returns The sent sticker.
|
|
2410
2433
|
*/
|
|
2411
|
-
async
|
|
2412
|
-
return await this.#messageManager.
|
|
2434
|
+
async sendSticker(chatId, sticker, params) {
|
|
2435
|
+
return await this.#messageManager.sendSticker(chatId, sticker, params);
|
|
2413
2436
|
}
|
|
2414
2437
|
/**
|
|
2415
|
-
*
|
|
2438
|
+
* Send a venue.
|
|
2416
2439
|
*
|
|
2417
2440
|
* @method ms
|
|
2418
|
-
* @param
|
|
2419
|
-
* @param
|
|
2420
|
-
* @param
|
|
2441
|
+
* @param chatId The identifier of a chat to send the venue to.
|
|
2442
|
+
* @param latitude The latitude of the venue.
|
|
2443
|
+
* @param longitude The longitude of the venue.
|
|
2444
|
+
* @param title The title of the venue.
|
|
2445
|
+
* @param address The written address of the venue.
|
|
2446
|
+
* @returns The sent venue.
|
|
2421
2447
|
*/
|
|
2422
|
-
async
|
|
2423
|
-
return await this.#messageManager.
|
|
2448
|
+
async sendVenue(chatId, latitude, longitude, title, address, params) {
|
|
2449
|
+
return await this.#messageManager.sendVenue(chatId, latitude, longitude, title, address, params);
|
|
2424
2450
|
}
|
|
2425
2451
|
/**
|
|
2426
|
-
*
|
|
2452
|
+
* Send a video.
|
|
2427
2453
|
*
|
|
2428
2454
|
* @method ms
|
|
2429
|
-
* @param
|
|
2430
|
-
* @param
|
|
2431
|
-
* @
|
|
2455
|
+
* @param chatId The identifier of a chat to send the video to.
|
|
2456
|
+
* @param video The video to send.
|
|
2457
|
+
* @returns The sent video.
|
|
2432
2458
|
*/
|
|
2433
|
-
async
|
|
2434
|
-
return await this.#messageManager.
|
|
2459
|
+
async sendVideo(chatId, video, params) {
|
|
2460
|
+
return await this.#messageManager.sendVideo(chatId, video, params);
|
|
2435
2461
|
}
|
|
2436
2462
|
/**
|
|
2437
|
-
*
|
|
2463
|
+
* Send a video note.
|
|
2438
2464
|
*
|
|
2439
2465
|
* @method ms
|
|
2440
|
-
* @param chatId The identifier of
|
|
2441
|
-
* @param
|
|
2466
|
+
* @param chatId The identifier of a chat to send the video note to.
|
|
2467
|
+
* @param videoNote The video note to send.
|
|
2468
|
+
* @returns The sent video note.
|
|
2442
2469
|
*/
|
|
2443
|
-
async
|
|
2444
|
-
return await this.#messageManager.
|
|
2470
|
+
async sendVideoNote(chatId, videoNote, params) {
|
|
2471
|
+
return await this.#messageManager.sendVideoNote(chatId, videoNote, params);
|
|
2445
2472
|
}
|
|
2446
2473
|
/**
|
|
2447
|
-
*
|
|
2474
|
+
* Send a voice message.
|
|
2448
2475
|
*
|
|
2449
2476
|
* @method ms
|
|
2450
|
-
* @param chatId The identifier of
|
|
2451
|
-
* @param
|
|
2477
|
+
* @param chatId The identifier of a chat to send the voice message to.
|
|
2478
|
+
* @param voice The voice to send.
|
|
2479
|
+
* @returns The sent voice message.
|
|
2452
2480
|
*/
|
|
2453
|
-
async
|
|
2454
|
-
return await this.#messageManager.
|
|
2481
|
+
async sendVoice(chatId, voice, params) {
|
|
2482
|
+
return await this.#messageManager.sendVoice(chatId, voice, params);
|
|
2455
2483
|
}
|
|
2456
2484
|
/**
|
|
2457
|
-
*
|
|
2485
|
+
* Set a reaction as default. User-only.
|
|
2458
2486
|
*
|
|
2459
2487
|
* @method ms
|
|
2460
|
-
* @param
|
|
2461
|
-
* @param messageId The identifier of the message.
|
|
2488
|
+
* @param reaction The reaction to set as default.
|
|
2462
2489
|
*/
|
|
2463
|
-
async
|
|
2464
|
-
|
|
2490
|
+
async setDefaultReaction(reaction) {
|
|
2491
|
+
await this.#messageManager.setDefaultReaction(reaction);
|
|
2465
2492
|
}
|
|
2466
2493
|
/**
|
|
2467
|
-
*
|
|
2494
|
+
* Start a bot. User-only.
|
|
2468
2495
|
*
|
|
2469
2496
|
* @method ms
|
|
2470
|
-
* @param
|
|
2497
|
+
* @param botId The identifier of the bot to start.
|
|
2498
|
+
* @returns The start message.
|
|
2471
2499
|
*/
|
|
2472
|
-
async
|
|
2473
|
-
return await this.#messageManager.
|
|
2500
|
+
async startBot(botId, params) {
|
|
2501
|
+
return await this.#messageManager.startBot(botId, params);
|
|
2474
2502
|
}
|
|
2475
2503
|
/**
|
|
2476
|
-
*
|
|
2504
|
+
* Stop a poll.
|
|
2477
2505
|
*
|
|
2478
2506
|
* @method ms
|
|
2507
|
+
* @param chatId The chat that includes the poll.
|
|
2508
|
+
* @param messageId The identifier of the poll's message.
|
|
2509
|
+
* @returns The new state of the poll.
|
|
2479
2510
|
*/
|
|
2480
|
-
async
|
|
2481
|
-
return await this.#messageManager.
|
|
2511
|
+
async stopPoll(chatId, messageId, params) {
|
|
2512
|
+
return await this.#messageManager.stopPoll(chatId, messageId, params);
|
|
2482
2513
|
}
|
|
2483
2514
|
/**
|
|
2484
|
-
*
|
|
2515
|
+
* Summarize a message's text. User-only.
|
|
2485
2516
|
*
|
|
2486
2517
|
* @method ms
|
|
2487
|
-
* @param
|
|
2518
|
+
* @param chatId The identifier of a chat.
|
|
2519
|
+
* @param messageId The identifier of a message.
|
|
2488
2520
|
*/
|
|
2489
|
-
async
|
|
2490
|
-
return await this.#messageManager.
|
|
2521
|
+
async summarizeText(chatId, messageId, params) {
|
|
2522
|
+
return await this.#messageManager.summarizeText(chatId, messageId, params);
|
|
2491
2523
|
}
|
|
2492
2524
|
/**
|
|
2493
|
-
*
|
|
2525
|
+
* Transcribe a voice message. User-only.
|
|
2494
2526
|
*
|
|
2495
2527
|
* @method ms
|
|
2496
|
-
* @param
|
|
2528
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
2529
|
+
* @param messageId The identifier of the message.
|
|
2530
|
+
* @cache
|
|
2497
2531
|
*/
|
|
2498
|
-
async
|
|
2499
|
-
return await this.#messageManager.
|
|
2532
|
+
async transcribeVoice(chatId, messageId) {
|
|
2533
|
+
return await this.#messageManager.transcribeVoice(chatId, messageId);
|
|
2500
2534
|
}
|
|
2501
2535
|
/**
|
|
2502
|
-
*
|
|
2536
|
+
* Translate a single text. User-only.
|
|
2503
2537
|
*
|
|
2504
2538
|
* @method ms
|
|
2505
|
-
* @param
|
|
2539
|
+
* @param toLanguage The code of the language to translate into.
|
|
2540
|
+
* @param chatId The identifier of the chat including the message.
|
|
2541
|
+
* @param messageId The identifier of the message to translate.
|
|
2506
2542
|
*/
|
|
2507
|
-
async
|
|
2508
|
-
return await this.#messageManager.
|
|
2543
|
+
async translateMessage(toLanguage, chatId, messageId, params) {
|
|
2544
|
+
return await this.#messageManager.translateMessage(toLanguage, chatId, messageId, params);
|
|
2509
2545
|
}
|
|
2510
2546
|
/**
|
|
2511
|
-
*
|
|
2547
|
+
* Translate multiple texts. User-only.
|
|
2512
2548
|
*
|
|
2513
2549
|
* @method ms
|
|
2514
|
-
* @param
|
|
2550
|
+
* @param toLanguage The code of the language to translate into.
|
|
2551
|
+
* @param chatId The identifier of the chat including the messages.
|
|
2552
|
+
* @param messageIds The identifiers of the messages to translate.
|
|
2515
2553
|
*/
|
|
2516
|
-
async
|
|
2517
|
-
return await this.#messageManager.
|
|
2554
|
+
async translateMessages(toLanguage, chatId, messageIds, params) {
|
|
2555
|
+
return await this.#messageManager.translateMessages(toLanguage, chatId, messageIds, params);
|
|
2518
2556
|
}
|
|
2519
2557
|
/**
|
|
2520
|
-
*
|
|
2558
|
+
* Translate a single text. User-only.
|
|
2521
2559
|
*
|
|
2522
2560
|
* @method ms
|
|
2561
|
+
* @param toLanguage The code of the language to translate into.
|
|
2562
|
+
* @param text The text to translate.
|
|
2523
2563
|
*/
|
|
2524
|
-
async
|
|
2525
|
-
return await this.#messageManager.
|
|
2564
|
+
async translateText(toLanguage, text, params) {
|
|
2565
|
+
return await this.#messageManager.translateText(toLanguage, text, params);
|
|
2526
2566
|
}
|
|
2527
2567
|
/**
|
|
2528
|
-
*
|
|
2568
|
+
* Translate multiple texts. User-only.
|
|
2529
2569
|
*
|
|
2530
2570
|
* @method ms
|
|
2571
|
+
* @param toLanguage The code of the language to translate into.
|
|
2572
|
+
* @param texts The texts to translate.
|
|
2531
2573
|
*/
|
|
2532
|
-
async
|
|
2533
|
-
return await this.#messageManager.
|
|
2574
|
+
async translateTexts(toLanguage, texts, params) {
|
|
2575
|
+
return await this.#messageManager.translateTexts(toLanguage, texts, params);
|
|
2534
2576
|
}
|
|
2535
2577
|
/**
|
|
2536
|
-
*
|
|
2578
|
+
* Unpin a pinned message.
|
|
2537
2579
|
*
|
|
2538
2580
|
* @method ms
|
|
2581
|
+
* @param chatId The identifier of a chat.
|
|
2582
|
+
* @param messageId The identifier of the message.
|
|
2539
2583
|
*/
|
|
2540
|
-
async
|
|
2541
|
-
|
|
2584
|
+
async unpinMessage(chatId, messageId, params) {
|
|
2585
|
+
await this.#messageManager.unpinMessage(chatId, messageId, params);
|
|
2542
2586
|
}
|
|
2543
2587
|
/**
|
|
2544
|
-
*
|
|
2588
|
+
* Unpin all pinned messages.
|
|
2545
2589
|
*
|
|
2546
2590
|
* @method ms
|
|
2547
|
-
* @param
|
|
2591
|
+
* @param chatId The identifier of a chat.
|
|
2548
2592
|
*/
|
|
2549
|
-
async
|
|
2550
|
-
|
|
2593
|
+
async unpinMessages(chatId, params) {
|
|
2594
|
+
await this.#messageManager.unpinMessages(chatId, params);
|
|
2551
2595
|
}
|
|
2552
2596
|
/**
|
|
2553
2597
|
* Unsave an animation. User-only.
|
|
@@ -2559,60 +2603,48 @@ export class Client extends Composer {
|
|
|
2559
2603
|
return await this.#messageManager.unsaveAnimation(fileId);
|
|
2560
2604
|
}
|
|
2561
2605
|
/**
|
|
2562
|
-
*
|
|
2606
|
+
* View a single message. User-only.
|
|
2563
2607
|
*
|
|
2564
2608
|
* @method ms
|
|
2565
|
-
* @param chatId The identifier of
|
|
2609
|
+
* @param chatId The identifier of the chat including the message.
|
|
2566
2610
|
* @param messageId The identifier of the message.
|
|
2567
2611
|
*/
|
|
2568
|
-
async
|
|
2569
|
-
return await this.#messageManager.
|
|
2612
|
+
async viewMessage(chatId, messageId) {
|
|
2613
|
+
return await this.#messageManager.viewMessage(chatId, messageId);
|
|
2570
2614
|
}
|
|
2571
2615
|
/**
|
|
2572
|
-
*
|
|
2616
|
+
* View multiple messages. User-only.
|
|
2573
2617
|
*
|
|
2574
2618
|
* @method ms
|
|
2575
|
-
* @param chatId The identifier of
|
|
2576
|
-
* @param
|
|
2577
|
-
* @returns The message's viewers.
|
|
2619
|
+
* @param chatId The identifier of the chat including the messages.
|
|
2620
|
+
* @param messageIds The identifiers of the messages.
|
|
2578
2621
|
*/
|
|
2579
|
-
async
|
|
2580
|
-
return await this.#messageManager.
|
|
2622
|
+
async viewMessages(chatId, messageIds) {
|
|
2623
|
+
return await this.#messageManager.viewMessages(chatId, messageIds);
|
|
2581
2624
|
}
|
|
2582
2625
|
//
|
|
2583
2626
|
// ========================= POLLS ========================= //
|
|
2584
2627
|
//
|
|
2585
2628
|
/**
|
|
2586
|
-
*
|
|
2587
|
-
*
|
|
2588
|
-
* @method pl
|
|
2589
|
-
* @param chatId The identifier of the chat that includes the poll.
|
|
2590
|
-
* @param messageId The identifier of the message that includes the poll.
|
|
2591
|
-
* @param optionIndexes The indexes of the options to cast for.
|
|
2592
|
-
*/
|
|
2593
|
-
async vote(chatId, messageId, optionIndexes) {
|
|
2594
|
-
await this.#pollManager.vote(chatId, messageId, optionIndexes);
|
|
2595
|
-
}
|
|
2596
|
-
/**
|
|
2597
|
-
* Retract a vote. User-only.
|
|
2629
|
+
* Add an option to a poll. User-only.
|
|
2598
2630
|
*
|
|
2599
2631
|
* @method pl
|
|
2600
2632
|
* @param chatId The identifier of the chat that includes the poll.
|
|
2601
2633
|
* @param messageId The identifier of the message that includes the poll.
|
|
2634
|
+
* @param option The option to add.
|
|
2602
2635
|
*/
|
|
2603
|
-
async
|
|
2604
|
-
await this.#pollManager.
|
|
2636
|
+
async addPollOption(chatId, messageId, option) {
|
|
2637
|
+
await this.#pollManager.addPollOption(chatId, messageId, option);
|
|
2605
2638
|
}
|
|
2606
2639
|
/**
|
|
2607
|
-
*
|
|
2640
|
+
* Get poll voters. User-only.
|
|
2608
2641
|
*
|
|
2609
2642
|
* @method pl
|
|
2610
2643
|
* @param chatId The identifier of the chat that includes the poll.
|
|
2611
2644
|
* @param messageId The identifier of the message that includes the poll.
|
|
2612
|
-
* @param option The option to add.
|
|
2613
2645
|
*/
|
|
2614
|
-
async
|
|
2615
|
-
await this.#pollManager.
|
|
2646
|
+
async getPollVoters(chatId, messageId, params) {
|
|
2647
|
+
return await this.#pollManager.getPollVoters(chatId, messageId, params);
|
|
2616
2648
|
}
|
|
2617
2649
|
/**
|
|
2618
2650
|
* Remove an option from a poll. User-only.
|
|
@@ -2626,14 +2658,25 @@ export class Client extends Composer {
|
|
|
2626
2658
|
await this.#pollManager.removePollOption(chatId, messageId, optionIndex);
|
|
2627
2659
|
}
|
|
2628
2660
|
/**
|
|
2629
|
-
*
|
|
2661
|
+
* Retract a vote. User-only.
|
|
2630
2662
|
*
|
|
2631
2663
|
* @method pl
|
|
2632
2664
|
* @param chatId The identifier of the chat that includes the poll.
|
|
2633
2665
|
* @param messageId The identifier of the message that includes the poll.
|
|
2634
2666
|
*/
|
|
2635
|
-
async
|
|
2636
|
-
|
|
2667
|
+
async retractVote(chatId, messageId) {
|
|
2668
|
+
await this.#pollManager.retractVote(chatId, messageId);
|
|
2669
|
+
}
|
|
2670
|
+
/**
|
|
2671
|
+
* Cast a vote. User-only.
|
|
2672
|
+
*
|
|
2673
|
+
* @method pl
|
|
2674
|
+
* @param chatId The identifier of the chat that includes the poll.
|
|
2675
|
+
* @param messageId The identifier of the message that includes the poll.
|
|
2676
|
+
* @param optionIndexes The indexes of the options to cast for.
|
|
2677
|
+
*/
|
|
2678
|
+
async vote(chatId, messageId, optionIndexes) {
|
|
2679
|
+
await this.#pollManager.vote(chatId, messageId, optionIndexes);
|
|
2637
2680
|
}
|
|
2638
2681
|
//
|
|
2639
2682
|
// ========================= CHECKLISTS ========================= //
|
|
@@ -2650,14 +2693,15 @@ export class Client extends Composer {
|
|
|
2650
2693
|
await this.#checklistManager.addToChecklist(chatId, messageId, items);
|
|
2651
2694
|
}
|
|
2652
2695
|
/**
|
|
2653
|
-
*
|
|
2696
|
+
* Check a single item of a checklist. User-only.
|
|
2654
2697
|
*
|
|
2655
2698
|
* @param chatId The identifier of a chat.
|
|
2656
2699
|
* @param messageId The identifier of the checklist message.
|
|
2700
|
+
* @param item The identifier of the item to check.
|
|
2657
2701
|
* @method cl
|
|
2658
2702
|
*/
|
|
2659
|
-
async
|
|
2660
|
-
await this.#checklistManager.
|
|
2703
|
+
async checkChecklistItem(chatId, messageId, item) {
|
|
2704
|
+
await this.#checklistManager.checkChecklistItem(chatId, messageId, item);
|
|
2661
2705
|
}
|
|
2662
2706
|
/**
|
|
2663
2707
|
* Check multiple items of a checklist. User-only.
|
|
@@ -2671,41 +2715,58 @@ export class Client extends Composer {
|
|
|
2671
2715
|
await this.#checklistManager.checkChecklistItems(chatId, messageId, items);
|
|
2672
2716
|
}
|
|
2673
2717
|
/**
|
|
2674
|
-
* Uncheck
|
|
2718
|
+
* Uncheck a single item of a checklist. User-only.
|
|
2675
2719
|
*
|
|
2676
2720
|
* @param chatId The identifier of a chat.
|
|
2677
2721
|
* @param messageId The identifier of the checklist message.
|
|
2678
|
-
* @param
|
|
2722
|
+
* @param item The identifier of the item to uncheck.
|
|
2679
2723
|
* @method cl
|
|
2680
2724
|
*/
|
|
2681
|
-
async
|
|
2682
|
-
await this.#checklistManager.
|
|
2725
|
+
async uncheckChecklistItem(chatId, messageId, item) {
|
|
2726
|
+
await this.#checklistManager.uncheckChecklistItem(chatId, messageId, item);
|
|
2683
2727
|
}
|
|
2684
2728
|
/**
|
|
2685
|
-
*
|
|
2729
|
+
* Uncheck multiple items of a checklist. User-only.
|
|
2686
2730
|
*
|
|
2687
2731
|
* @param chatId The identifier of a chat.
|
|
2688
2732
|
* @param messageId The identifier of the checklist message.
|
|
2689
|
-
* @param
|
|
2733
|
+
* @param items The identifiers of the items to uncheck.
|
|
2690
2734
|
* @method cl
|
|
2691
2735
|
*/
|
|
2692
|
-
async
|
|
2693
|
-
await this.#checklistManager.
|
|
2736
|
+
async uncheckChecklistItems(chatId, messageId, items) {
|
|
2737
|
+
await this.#checklistManager.uncheckChecklistItems(chatId, messageId, items);
|
|
2694
2738
|
}
|
|
2695
2739
|
/**
|
|
2696
|
-
*
|
|
2740
|
+
* Update a checklist. User-only.
|
|
2697
2741
|
*
|
|
2698
2742
|
* @param chatId The identifier of a chat.
|
|
2699
2743
|
* @param messageId The identifier of the checklist message.
|
|
2700
|
-
* @param item The identifier of the item to uncheck.
|
|
2701
2744
|
* @method cl
|
|
2702
2745
|
*/
|
|
2703
|
-
async
|
|
2704
|
-
await this.#checklistManager.
|
|
2746
|
+
async updateChecklist(chatId, messageId, params) {
|
|
2747
|
+
await this.#checklistManager.updateChecklist(chatId, messageId, params);
|
|
2705
2748
|
}
|
|
2706
2749
|
//
|
|
2707
2750
|
// ========================= FILES ========================= //
|
|
2708
2751
|
//
|
|
2752
|
+
/**
|
|
2753
|
+
* Download a file.
|
|
2754
|
+
*
|
|
2755
|
+
* @method fs
|
|
2756
|
+
* @param fileId The identifier of the file to download.
|
|
2757
|
+
* @example ```ts
|
|
2758
|
+
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
2759
|
+
* await outFile.write(chunk);
|
|
2760
|
+
* }
|
|
2761
|
+
* ```
|
|
2762
|
+
* @returns A generator yielding the contents of the file.
|
|
2763
|
+
* @cache file
|
|
2764
|
+
*/
|
|
2765
|
+
async *download(fileId, params) {
|
|
2766
|
+
for await (const chunk of this.#fileManager.download(fileId, params)) {
|
|
2767
|
+
yield chunk;
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2709
2770
|
/**
|
|
2710
2771
|
* Download a chunk of a file.
|
|
2711
2772
|
*
|
|
@@ -2725,24 +2786,6 @@ export class Client extends Composer {
|
|
|
2725
2786
|
}
|
|
2726
2787
|
unreachable();
|
|
2727
2788
|
}
|
|
2728
|
-
/**
|
|
2729
|
-
* Download a file.
|
|
2730
|
-
*
|
|
2731
|
-
* @method fs
|
|
2732
|
-
* @param fileId The identifier of the file to download.
|
|
2733
|
-
* @example ```ts
|
|
2734
|
-
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
2735
|
-
* await outFile.write(chunk);
|
|
2736
|
-
* }
|
|
2737
|
-
* ```
|
|
2738
|
-
* @returns A generator yielding the contents of the file.
|
|
2739
|
-
* @cache file
|
|
2740
|
-
*/
|
|
2741
|
-
async *download(fileId, params) {
|
|
2742
|
-
for await (const chunk of this.#fileManager.download(fileId, params)) {
|
|
2743
|
-
yield chunk;
|
|
2744
|
-
}
|
|
2745
|
-
}
|
|
2746
2789
|
/**
|
|
2747
2790
|
* Get custom emoji documents for download.
|
|
2748
2791
|
*
|
|
@@ -2758,395 +2801,407 @@ export class Client extends Composer {
|
|
|
2758
2801
|
// ========================= CHATS ========================= //
|
|
2759
2802
|
//
|
|
2760
2803
|
/**
|
|
2761
|
-
*
|
|
2804
|
+
* Add a single user to a chat.
|
|
2762
2805
|
*
|
|
2763
2806
|
* @method ch
|
|
2807
|
+
* @param chatId The identifier of a chat to add the user to.
|
|
2808
|
+
* @param userId The identifier of the user to add to the chat.
|
|
2809
|
+
* @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
|
|
2764
2810
|
*/
|
|
2765
|
-
async
|
|
2766
|
-
return await this.#
|
|
2811
|
+
async addChatMember(chatId, userId, params) {
|
|
2812
|
+
return await this.#chatManager.addChatMember(chatId, userId, params);
|
|
2767
2813
|
}
|
|
2768
2814
|
/**
|
|
2769
|
-
*
|
|
2815
|
+
* Add multiple users at once to a channel or a supergroup.
|
|
2770
2816
|
*
|
|
2771
2817
|
* @method ch
|
|
2772
|
-
* @param
|
|
2818
|
+
* @param chatId The identifier of the channel or supergroup to add the users to.
|
|
2819
|
+
* @param userIds The identifiers of the users to add to the channel or supergroup.
|
|
2820
|
+
* @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.
|
|
2773
2821
|
*/
|
|
2774
|
-
async
|
|
2775
|
-
return await this.#
|
|
2822
|
+
async addChatMembers(chatId, userIds) {
|
|
2823
|
+
return await this.#chatManager.addChatMembers(chatId, userIds);
|
|
2776
2824
|
}
|
|
2777
2825
|
/**
|
|
2778
|
-
*
|
|
2826
|
+
* Approve a join request.
|
|
2779
2827
|
*
|
|
2780
2828
|
* @method ch
|
|
2781
|
-
* @
|
|
2829
|
+
* @param chatId The identifier of a chat with the join request.
|
|
2830
|
+
* @param userId The user who made the join request.
|
|
2782
2831
|
*/
|
|
2783
|
-
async
|
|
2784
|
-
|
|
2832
|
+
async approveJoinRequest(chatId, userId) {
|
|
2833
|
+
await this.#chatManager.approveJoinRequest(chatId, userId);
|
|
2785
2834
|
}
|
|
2786
2835
|
/**
|
|
2787
|
-
*
|
|
2836
|
+
* Approve all join requests. User-only.
|
|
2788
2837
|
*
|
|
2789
2838
|
* @method ch
|
|
2790
|
-
* @param chatId The identifier of a chat.
|
|
2839
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
2791
2840
|
*/
|
|
2792
|
-
async
|
|
2793
|
-
|
|
2841
|
+
async approveJoinRequests(chatId, params) {
|
|
2842
|
+
await this.#chatManager.approveJoinRequests(chatId, params);
|
|
2794
2843
|
}
|
|
2795
2844
|
/**
|
|
2796
|
-
*
|
|
2845
|
+
* Archive a single chat. User-only.
|
|
2797
2846
|
*
|
|
2798
2847
|
* @method ch
|
|
2799
2848
|
* @param chatId The identifier of a chat.
|
|
2800
|
-
* @param availableReactions The new available reactions.
|
|
2801
2849
|
*/
|
|
2802
|
-
async
|
|
2803
|
-
await this.#
|
|
2850
|
+
async archiveChat(chatId) {
|
|
2851
|
+
await this.#chatListManager.archiveChat(chatId);
|
|
2804
2852
|
}
|
|
2805
2853
|
/**
|
|
2806
|
-
*
|
|
2854
|
+
* Archive multiple chats. User-only.
|
|
2807
2855
|
*
|
|
2808
2856
|
* @method ch
|
|
2809
|
-
* @param
|
|
2810
|
-
* @param photo A photo to set as the chat's photo.
|
|
2857
|
+
* @param chatIds The identifiers of the chats to archive.
|
|
2811
2858
|
*/
|
|
2812
|
-
async
|
|
2813
|
-
await this.#
|
|
2859
|
+
async archiveChats(chatIds) {
|
|
2860
|
+
await this.#chatListManager.archiveChats(chatIds);
|
|
2814
2861
|
}
|
|
2815
2862
|
/**
|
|
2816
|
-
*
|
|
2863
|
+
* Ban a member from a chat.
|
|
2817
2864
|
*
|
|
2818
2865
|
* @method ch
|
|
2819
2866
|
* @param chatId The identifier of a chat.
|
|
2867
|
+
* @param memberId The identifier of the member.
|
|
2820
2868
|
*/
|
|
2821
|
-
async
|
|
2822
|
-
await this.#chatManager.
|
|
2869
|
+
async banChatMember(chatId, memberId, params) {
|
|
2870
|
+
await this.#chatManager.banChatMember(chatId, memberId, params);
|
|
2823
2871
|
}
|
|
2824
2872
|
/**
|
|
2825
|
-
*
|
|
2873
|
+
* Close a chat previously opened by openChat.
|
|
2874
|
+
*
|
|
2875
|
+
* @method ch
|
|
2876
|
+
* @param chatId The identifier of a chat to close.
|
|
2877
|
+
*/
|
|
2878
|
+
async closeChat(chatId) {
|
|
2879
|
+
await this.#updateManager.closeChat(chatId);
|
|
2880
|
+
}
|
|
2881
|
+
/**
|
|
2882
|
+
* Close a forum topic.
|
|
2826
2883
|
*
|
|
2827
2884
|
* @method ch
|
|
2828
2885
|
* @param chatId The identifier of a chat.
|
|
2829
|
-
* @param
|
|
2886
|
+
* @param topicId The identifier of the topic.
|
|
2830
2887
|
*/
|
|
2831
|
-
async
|
|
2832
|
-
await this.#
|
|
2888
|
+
async closeTopic(chatId, topicId) {
|
|
2889
|
+
await this.#forumManager.closeTopic(chatId, topicId);
|
|
2833
2890
|
}
|
|
2834
2891
|
/**
|
|
2835
|
-
*
|
|
2892
|
+
* Create a channel. User-only.
|
|
2836
2893
|
*
|
|
2837
2894
|
* @method ch
|
|
2838
|
-
* @param
|
|
2839
|
-
* @
|
|
2895
|
+
* @param title The title of the channel.
|
|
2896
|
+
* @returns The created channel.
|
|
2840
2897
|
*/
|
|
2841
|
-
async
|
|
2842
|
-
await this.#
|
|
2898
|
+
async createChannel(title, params) {
|
|
2899
|
+
return await this.#chatListManager.createChannel(title, params);
|
|
2843
2900
|
}
|
|
2844
2901
|
/**
|
|
2845
|
-
*
|
|
2902
|
+
* Create a group. User-only.
|
|
2846
2903
|
*
|
|
2847
2904
|
* @method ch
|
|
2848
|
-
* @param
|
|
2849
|
-
* @
|
|
2905
|
+
* @param title The title of the group.
|
|
2906
|
+
* @returns The created group.
|
|
2850
2907
|
*/
|
|
2851
|
-
async
|
|
2852
|
-
await this.#
|
|
2853
|
-
await this.#chatManager.unbanChatMember(chatId, memberId);
|
|
2908
|
+
async createGroup(title, params) {
|
|
2909
|
+
return await this.#chatListManager.createGroup(title, params);
|
|
2854
2910
|
}
|
|
2855
2911
|
/**
|
|
2856
|
-
*
|
|
2912
|
+
* Create an invite link.
|
|
2857
2913
|
*
|
|
2858
2914
|
* @method ch
|
|
2859
|
-
* @param chatId The identifier of a chat
|
|
2860
|
-
* @
|
|
2915
|
+
* @param chatId The identifier of a chat to create the invite link for.
|
|
2916
|
+
* @returns The newly created invite link.
|
|
2861
2917
|
*/
|
|
2862
|
-
async
|
|
2863
|
-
await this.#chatManager.
|
|
2918
|
+
async createInviteLink(chatId, params) {
|
|
2919
|
+
return await this.#chatManager.createInviteLink(chatId, params);
|
|
2864
2920
|
}
|
|
2865
2921
|
/**
|
|
2866
|
-
*
|
|
2922
|
+
* Create a supergroup. User-only.
|
|
2867
2923
|
*
|
|
2868
2924
|
* @method ch
|
|
2869
|
-
* @param
|
|
2870
|
-
* @returns The
|
|
2925
|
+
* @param title The title of the supergroup.
|
|
2926
|
+
* @returns The created supergroup.
|
|
2871
2927
|
*/
|
|
2872
|
-
async
|
|
2873
|
-
return await this.#chatListManager.
|
|
2928
|
+
async createSupergroup(title, params) {
|
|
2929
|
+
return await this.#chatListManager.createSupergroup(title, params);
|
|
2874
2930
|
}
|
|
2875
2931
|
/**
|
|
2876
|
-
*
|
|
2932
|
+
* Create a forum topic.
|
|
2877
2933
|
*
|
|
2878
2934
|
* @method ch
|
|
2879
|
-
* @param chatId The identifier of a chat.
|
|
2935
|
+
* @param chatId The identifier of a chat.
|
|
2936
|
+
* @param title The title of the topic.
|
|
2937
|
+
* @returns The created topic.
|
|
2880
2938
|
*/
|
|
2881
|
-
async
|
|
2882
|
-
await this.#
|
|
2939
|
+
async createTopic(chatId, title, params) {
|
|
2940
|
+
return await this.#forumManager.createTopic(chatId, title, params);
|
|
2883
2941
|
}
|
|
2884
2942
|
/**
|
|
2885
|
-
*
|
|
2943
|
+
* Decline a join request.
|
|
2886
2944
|
*
|
|
2887
2945
|
* @method ch
|
|
2888
|
-
* @param chatId The identifier of a chat
|
|
2946
|
+
* @param chatId The identifier of a chat with the join request.
|
|
2947
|
+
* @param userId The user who made the join request.
|
|
2889
2948
|
*/
|
|
2890
|
-
async
|
|
2891
|
-
await this.#chatManager.
|
|
2949
|
+
async declineJoinRequest(chatId, userId) {
|
|
2950
|
+
await this.#chatManager.declineJoinRequest(chatId, userId);
|
|
2892
2951
|
}
|
|
2893
2952
|
/**
|
|
2894
|
-
*
|
|
2953
|
+
* Decline all join requests. User-only.
|
|
2895
2954
|
*
|
|
2896
2955
|
* @method ch
|
|
2897
|
-
* @
|
|
2956
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
2898
2957
|
*/
|
|
2899
|
-
async
|
|
2900
|
-
|
|
2958
|
+
async declineJoinRequests(chatId, params) {
|
|
2959
|
+
await this.#chatManager.declineJoinRequests(chatId, params);
|
|
2901
2960
|
}
|
|
2902
2961
|
/**
|
|
2903
|
-
*
|
|
2962
|
+
* Delete a chat. User-only.
|
|
2904
2963
|
*
|
|
2905
2964
|
* @method ch
|
|
2906
2965
|
* @param chatId The identifier of a chat.
|
|
2907
|
-
* @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.
|
|
2908
2966
|
*/
|
|
2909
|
-
async
|
|
2910
|
-
|
|
2967
|
+
async deleteChat(chatId) {
|
|
2968
|
+
await this.#chatManager.deleteChat(chatId);
|
|
2911
2969
|
}
|
|
2912
2970
|
/**
|
|
2913
|
-
*
|
|
2971
|
+
* Delete a chat's photo.
|
|
2914
2972
|
*
|
|
2915
2973
|
* @method ch
|
|
2916
2974
|
* @param chatId The identifier of a chat.
|
|
2917
2975
|
*/
|
|
2918
|
-
async
|
|
2919
|
-
await this.#chatManager.
|
|
2976
|
+
async deleteChatPhoto(chatId) {
|
|
2977
|
+
await this.#chatManager.deleteChatPhoto(chatId);
|
|
2920
2978
|
}
|
|
2921
2979
|
/**
|
|
2922
|
-
*
|
|
2980
|
+
* Delete a chat's sticker set.
|
|
2923
2981
|
*
|
|
2924
2982
|
* @method ch
|
|
2925
|
-
* @param chatId The identifier of a chat.
|
|
2983
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
2926
2984
|
*/
|
|
2927
|
-
async
|
|
2928
|
-
await this.#
|
|
2985
|
+
async deleteChatStickerSet(chatId) {
|
|
2986
|
+
await this.#messageManager.deleteChatStickerSet(chatId);
|
|
2929
2987
|
}
|
|
2930
2988
|
/**
|
|
2931
|
-
*
|
|
2989
|
+
* Disable automatic anti-spam in a group. User-only.
|
|
2932
2990
|
*
|
|
2933
2991
|
* @method ch
|
|
2934
|
-
* @param chatId The identifier of
|
|
2935
|
-
* @param userId The identifier of the user.
|
|
2992
|
+
* @param chatId The identifier of the group.
|
|
2936
2993
|
*/
|
|
2937
|
-
async
|
|
2938
|
-
|
|
2994
|
+
async disableAntispam(chatId) {
|
|
2995
|
+
await this.#chatManager.disableAntispam(chatId);
|
|
2939
2996
|
}
|
|
2940
2997
|
/**
|
|
2941
|
-
*
|
|
2998
|
+
* Disable business bots in a private chat. User-only.
|
|
2942
2999
|
*
|
|
2943
3000
|
* @method ch
|
|
2944
|
-
* @param chatId The identifier of
|
|
3001
|
+
* @param chatId The identifier of the private chat to disable business bots in.
|
|
2945
3002
|
*/
|
|
2946
|
-
async
|
|
2947
|
-
|
|
3003
|
+
async disableBusinessBots(chatId) {
|
|
3004
|
+
await this.#chatListManager.disableBusinessBots(chatId);
|
|
2948
3005
|
}
|
|
2949
3006
|
/**
|
|
2950
|
-
*
|
|
3007
|
+
* Disable chat history for new members. User-only.
|
|
2951
3008
|
*
|
|
2952
3009
|
* @method ch
|
|
2953
|
-
* @param chatId The identifier of a chat.
|
|
2954
|
-
* @param setName The name of the set.
|
|
3010
|
+
* @param chatId The identifier of a chat.
|
|
2955
3011
|
*/
|
|
2956
|
-
async
|
|
2957
|
-
await this.#
|
|
3012
|
+
async disableChatHistoryForNewMembers(chatId) {
|
|
3013
|
+
await this.#chatManager.disableChatHistoryForNewMembers(chatId);
|
|
2958
3014
|
}
|
|
2959
3015
|
/**
|
|
2960
|
-
*
|
|
3016
|
+
* Disable join requests in a chat. User-only.
|
|
2961
3017
|
*
|
|
2962
3018
|
* @method ch
|
|
2963
|
-
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
3019
|
+
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
|
|
2964
3020
|
*/
|
|
2965
|
-
async
|
|
2966
|
-
await this.#
|
|
3021
|
+
async disableJoinRequests(chatId) {
|
|
3022
|
+
await this.#chatManager.disableJoinRequests(chatId);
|
|
2967
3023
|
}
|
|
2968
3024
|
/**
|
|
2969
|
-
*
|
|
3025
|
+
* Disable sharing in a chat. User-only.
|
|
2970
3026
|
*
|
|
2971
3027
|
* @method ch
|
|
2972
3028
|
* @param chatId The identifier of a chat.
|
|
2973
|
-
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
2974
3029
|
*/
|
|
2975
|
-
async
|
|
2976
|
-
await this.#chatManager.
|
|
3030
|
+
async disableSharing(chatId) {
|
|
3031
|
+
await this.#chatManager.disableSharing(chatId);
|
|
2977
3032
|
}
|
|
2978
3033
|
/**
|
|
2979
|
-
*
|
|
3034
|
+
* Disable post signatures in a channel. User-only.
|
|
2980
3035
|
*
|
|
2981
3036
|
* @method ch
|
|
2982
|
-
* @param chatId The identifier of
|
|
2983
|
-
* @returns The newly created invite link.
|
|
3037
|
+
* @param chatId The identifier of the channel.
|
|
2984
3038
|
*/
|
|
2985
|
-
async
|
|
2986
|
-
|
|
3039
|
+
async disableSignatures(chatId) {
|
|
3040
|
+
await this.#chatManager.disableSignatures(chatId);
|
|
2987
3041
|
}
|
|
2988
3042
|
/**
|
|
2989
|
-
*
|
|
3043
|
+
* Disable slow mode in a group. User-only.
|
|
2990
3044
|
*
|
|
2991
3045
|
* @method ch
|
|
2992
|
-
* @param chatId The identifier of
|
|
2993
|
-
* @param userId The user who made the join request.
|
|
3046
|
+
* @param chatId The identifier of the group to disable slow mode in.
|
|
2994
3047
|
*/
|
|
2995
|
-
async
|
|
2996
|
-
await this.#chatManager.
|
|
3048
|
+
async disableSlowMode(chatId) {
|
|
3049
|
+
await this.#chatManager.disableSlowMode(chatId);
|
|
2997
3050
|
}
|
|
2998
3051
|
/**
|
|
2999
|
-
*
|
|
3052
|
+
* Disable topics in a group. User-only.
|
|
3000
3053
|
*
|
|
3001
3054
|
* @method ch
|
|
3002
|
-
* @param chatId The identifier of
|
|
3003
|
-
* @param userId The user who made the join request.
|
|
3055
|
+
* @param chatId The identifier of the group.
|
|
3004
3056
|
*/
|
|
3005
|
-
async
|
|
3006
|
-
await this.#chatManager.
|
|
3057
|
+
async disableTopics(chatId) {
|
|
3058
|
+
await this.#chatManager.disableTopics(chatId);
|
|
3007
3059
|
}
|
|
3008
3060
|
/**
|
|
3009
|
-
*
|
|
3061
|
+
* Edit a forum topic.
|
|
3010
3062
|
*
|
|
3011
3063
|
* @method ch
|
|
3012
|
-
* @param chatId The identifier of a chat
|
|
3064
|
+
* @param chatId The identifier of a chat.
|
|
3065
|
+
* @param topicId The identifier of the topic.
|
|
3066
|
+
* @param title The new title of the topic.
|
|
3067
|
+
* @returns The new topic.
|
|
3013
3068
|
*/
|
|
3014
|
-
async
|
|
3015
|
-
await this.#
|
|
3069
|
+
async editTopic(chatId, topicId, title, params) {
|
|
3070
|
+
return await this.#forumManager.editTopic(chatId, topicId, title, params);
|
|
3016
3071
|
}
|
|
3017
3072
|
/**
|
|
3018
|
-
*
|
|
3073
|
+
* Enable automatic anti-spam in a group. User-only.
|
|
3019
3074
|
*
|
|
3020
3075
|
* @method ch
|
|
3021
|
-
* @param chatId The identifier of
|
|
3076
|
+
* @param chatId The identifier of the group.
|
|
3022
3077
|
*/
|
|
3023
|
-
async
|
|
3024
|
-
await this.#chatManager.
|
|
3078
|
+
async enableAntispam(chatId) {
|
|
3079
|
+
await this.#chatManager.enableAntispam(chatId);
|
|
3025
3080
|
}
|
|
3026
3081
|
/**
|
|
3027
|
-
*
|
|
3082
|
+
* Enable business bots in a private chat. User-only.
|
|
3028
3083
|
*
|
|
3029
3084
|
* @method ch
|
|
3030
|
-
* @param chatId The identifier of
|
|
3085
|
+
* @param chatId The identifier of the private chat to enable business bots in.
|
|
3031
3086
|
*/
|
|
3032
|
-
async
|
|
3033
|
-
|
|
3087
|
+
async enableBusinessBots(chatId) {
|
|
3088
|
+
await this.#chatListManager.enableBusinessBots(chatId);
|
|
3034
3089
|
}
|
|
3035
3090
|
/**
|
|
3036
|
-
*
|
|
3091
|
+
* Enable chat history for new members. User-only.
|
|
3037
3092
|
*
|
|
3038
3093
|
* @method ch
|
|
3039
|
-
* @param chatId The identifier of a chat
|
|
3040
|
-
* @param userId The identifier of the user to add to the chat.
|
|
3041
|
-
* @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
|
|
3094
|
+
* @param chatId The identifier of a chat.
|
|
3042
3095
|
*/
|
|
3043
|
-
async
|
|
3044
|
-
|
|
3096
|
+
async enableChatHistoryForNewMembers(chatId) {
|
|
3097
|
+
await this.#chatManager.enableChatHistoryForNewMembers(chatId);
|
|
3045
3098
|
}
|
|
3046
3099
|
/**
|
|
3047
|
-
*
|
|
3100
|
+
* Enable join requests in a chat. User-only.
|
|
3048
3101
|
*
|
|
3049
3102
|
* @method ch
|
|
3050
|
-
* @param chatId The identifier of
|
|
3051
|
-
* @param userIds The identifiers of the users to add to the channel or supergroup.
|
|
3052
|
-
* @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.
|
|
3103
|
+
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
|
|
3053
3104
|
*/
|
|
3054
|
-
async
|
|
3055
|
-
|
|
3105
|
+
async enableJoinRequests(chatId) {
|
|
3106
|
+
await this.#chatManager.enableJoinRequests(chatId);
|
|
3056
3107
|
}
|
|
3057
3108
|
/**
|
|
3058
|
-
*
|
|
3109
|
+
* Enable sharing in a chat. User-only.
|
|
3059
3110
|
*
|
|
3060
3111
|
* @method ch
|
|
3061
|
-
* @param chatId The identifier of a chat
|
|
3112
|
+
* @param chatId The identifier of a chat.
|
|
3062
3113
|
*/
|
|
3063
|
-
async
|
|
3064
|
-
await this.#
|
|
3114
|
+
async enableSharing(chatId) {
|
|
3115
|
+
await this.#chatManager.enableSharing(chatId);
|
|
3065
3116
|
}
|
|
3066
3117
|
/**
|
|
3067
|
-
*
|
|
3118
|
+
* Enable post signatures in a channel. User-only.
|
|
3068
3119
|
*
|
|
3069
3120
|
* @method ch
|
|
3070
|
-
* @param chatId The identifier of
|
|
3121
|
+
* @param chatId The identifier of the channel.
|
|
3071
3122
|
*/
|
|
3072
|
-
async
|
|
3073
|
-
await this.#
|
|
3123
|
+
async enableSignatures(chatId, params) {
|
|
3124
|
+
await this.#chatManager.enableSignatures(chatId, params);
|
|
3074
3125
|
}
|
|
3075
3126
|
/**
|
|
3076
|
-
*
|
|
3127
|
+
* Enable topics in a group. User-only.
|
|
3077
3128
|
*
|
|
3078
3129
|
* @method ch
|
|
3079
|
-
* @param
|
|
3080
|
-
* @
|
|
3130
|
+
* @param chatId The identifier of the group.
|
|
3131
|
+
* @param isShownAsTabs Whether topics should be displayed as tabs.
|
|
3081
3132
|
*/
|
|
3082
|
-
async
|
|
3083
|
-
|
|
3133
|
+
async enableTopics(chatId, isShownAsTabs) {
|
|
3134
|
+
await this.#chatManager.enableTopics(chatId, isShownAsTabs);
|
|
3084
3135
|
}
|
|
3085
3136
|
/**
|
|
3086
|
-
*
|
|
3137
|
+
* Get a chat.
|
|
3087
3138
|
*
|
|
3088
3139
|
* @method ch
|
|
3089
|
-
* @
|
|
3090
|
-
* @returns The created supergroup.
|
|
3140
|
+
* @cache
|
|
3091
3141
|
*/
|
|
3092
|
-
async
|
|
3093
|
-
return await this.#chatListManager.
|
|
3142
|
+
async getChat(chatId) {
|
|
3143
|
+
return await this.#chatListManager.getChat(chatId);
|
|
3094
3144
|
}
|
|
3095
3145
|
/**
|
|
3096
|
-
*
|
|
3146
|
+
* Get the administrators of a chat.
|
|
3097
3147
|
*
|
|
3098
3148
|
* @method ch
|
|
3099
|
-
* @param
|
|
3100
|
-
* @returns The
|
|
3149
|
+
* @param chatId The identifier of a chat.
|
|
3150
|
+
* @returns The chat's administrators.
|
|
3101
3151
|
*/
|
|
3102
|
-
async
|
|
3103
|
-
return await this.#chatListManager.
|
|
3152
|
+
async getChatAdministrators(chatId) {
|
|
3153
|
+
return await this.#chatListManager.getChatAdministrators(chatId);
|
|
3104
3154
|
}
|
|
3105
3155
|
/**
|
|
3106
|
-
*
|
|
3156
|
+
* Get information on a user's chat membership.
|
|
3107
3157
|
*
|
|
3108
3158
|
* @method ch
|
|
3109
3159
|
* @param chatId The identifier of a chat.
|
|
3110
|
-
* @param
|
|
3160
|
+
* @param userId The identifier of the user.
|
|
3111
3161
|
*/
|
|
3112
|
-
async
|
|
3113
|
-
await this.#chatListManager.
|
|
3162
|
+
async getChatMember(chatId, userId) {
|
|
3163
|
+
return await this.#chatListManager.getChatMember(chatId, userId);
|
|
3114
3164
|
}
|
|
3115
3165
|
/**
|
|
3116
|
-
*
|
|
3166
|
+
* Get the members of a chat.
|
|
3117
3167
|
*
|
|
3118
3168
|
* @method ch
|
|
3119
|
-
* @param
|
|
3169
|
+
* @param chatId The identifier of a chat.
|
|
3120
3170
|
*/
|
|
3121
|
-
async
|
|
3122
|
-
await this.#chatListManager.
|
|
3171
|
+
async getChatMembers(chatId, params) {
|
|
3172
|
+
return await this.#chatListManager.getChatMembers(chatId, params);
|
|
3123
3173
|
}
|
|
3124
3174
|
/**
|
|
3125
|
-
*
|
|
3175
|
+
* Get a partial chat.
|
|
3126
3176
|
*
|
|
3127
3177
|
* @method ch
|
|
3128
|
-
* @
|
|
3178
|
+
* @cache
|
|
3129
3179
|
*/
|
|
3130
|
-
async
|
|
3131
|
-
await this
|
|
3180
|
+
async getChatP(chatId) {
|
|
3181
|
+
const inputPeer = await this.getInputPeer(chatId);
|
|
3182
|
+
const peer = await this.#inputPeerToPeer(inputPeer);
|
|
3183
|
+
const chatP = await this[getPeer](peer);
|
|
3184
|
+
if (chatP === null) {
|
|
3185
|
+
throw new InputError("Chat not found.");
|
|
3186
|
+
}
|
|
3187
|
+
return chatP[0];
|
|
3132
3188
|
}
|
|
3133
3189
|
/**
|
|
3134
|
-
*
|
|
3190
|
+
* Get chats from a chat list. User-only.
|
|
3135
3191
|
*
|
|
3136
3192
|
* @method ch
|
|
3137
|
-
* @param chatIds The identifiers of the chats to unarchive.
|
|
3138
3193
|
*/
|
|
3139
|
-
async
|
|
3140
|
-
await this.#chatListManager.
|
|
3194
|
+
async getChats(params) {
|
|
3195
|
+
return await this.#chatListManager.getChats(params?.from, params?.after, params?.limit);
|
|
3141
3196
|
}
|
|
3142
3197
|
/**
|
|
3143
|
-
*
|
|
3198
|
+
* Get the settings of a chat. User-only.
|
|
3144
3199
|
*
|
|
3145
3200
|
* @method ch
|
|
3146
3201
|
* @param chatId The identifier of a chat.
|
|
3147
3202
|
*/
|
|
3148
|
-
async
|
|
3149
|
-
await this.#chatListManager.
|
|
3203
|
+
async getChatSettings(chatId) {
|
|
3204
|
+
return await this.#chatListManager.getChatSettings(chatId);
|
|
3150
3205
|
}
|
|
3151
3206
|
/**
|
|
3152
3207
|
* Get common chats between a user and the current one. User-only.
|
|
@@ -3158,272 +3213,289 @@ export class Client extends Composer {
|
|
|
3158
3213
|
return await this.#chatListManager.getCommonChats(userId, params);
|
|
3159
3214
|
}
|
|
3160
3215
|
/**
|
|
3161
|
-
* Get the
|
|
3216
|
+
* Get the invite links created for a chat. User-only.
|
|
3162
3217
|
*
|
|
3163
3218
|
* @method ch
|
|
3164
3219
|
* @param chatId The identifier of a chat.
|
|
3220
|
+
* @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.
|
|
3165
3221
|
*/
|
|
3166
|
-
async
|
|
3167
|
-
return await this.#
|
|
3222
|
+
async getCreatedInviteLinks(chatId, params) {
|
|
3223
|
+
return await this.#chatManager.getCreatedInviteLinks(chatId, params);
|
|
3168
3224
|
}
|
|
3169
3225
|
/**
|
|
3170
|
-
*
|
|
3226
|
+
* Get discussion chat suggestions. User-only.
|
|
3171
3227
|
*
|
|
3172
3228
|
* @method ch
|
|
3173
|
-
* @param chatId The identifier of the private chat to disable business bots in.
|
|
3174
3229
|
*/
|
|
3175
|
-
async
|
|
3176
|
-
await this.#
|
|
3230
|
+
async getDiscussionChatSuggestions() {
|
|
3231
|
+
return await this.#chatManager.getDiscussionChatSuggestions();
|
|
3177
3232
|
}
|
|
3178
3233
|
/**
|
|
3179
|
-
*
|
|
3234
|
+
* Get chat history. User-only.
|
|
3180
3235
|
*
|
|
3181
3236
|
* @method ch
|
|
3182
|
-
* @param chatId The identifier of
|
|
3237
|
+
* @param chatId The identifier of a chat.
|
|
3183
3238
|
*/
|
|
3184
|
-
async
|
|
3185
|
-
await this.#
|
|
3239
|
+
async getHistory(chatId, params) {
|
|
3240
|
+
return await this.#messageManager.getHistory(chatId, params);
|
|
3186
3241
|
}
|
|
3187
3242
|
/**
|
|
3188
|
-
*
|
|
3243
|
+
* Get inactive chats. User-only.
|
|
3189
3244
|
*
|
|
3190
3245
|
* @method ch
|
|
3191
|
-
* @
|
|
3246
|
+
* @returns A list of inactive chats the current user is a member of.
|
|
3192
3247
|
*/
|
|
3193
|
-
async
|
|
3194
|
-
await this.#
|
|
3248
|
+
async getInactiveChats() {
|
|
3249
|
+
return await this.#accountManager.getInactiveChats();
|
|
3195
3250
|
}
|
|
3196
3251
|
/**
|
|
3197
|
-
*
|
|
3252
|
+
* Get pending join requests in a chat. User-only.
|
|
3198
3253
|
*
|
|
3199
3254
|
* @method ch
|
|
3200
|
-
* @param chatId The identifier of
|
|
3201
|
-
* @param duration New slow mode duration.
|
|
3255
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
3202
3256
|
*/
|
|
3203
|
-
async
|
|
3204
|
-
await this.#chatManager.
|
|
3257
|
+
async getJoinRequests(chatId, params) {
|
|
3258
|
+
return await this.#chatManager.getJoinRequests(chatId, params);
|
|
3205
3259
|
}
|
|
3206
3260
|
/**
|
|
3207
|
-
*
|
|
3261
|
+
* Get the count of online members in a chat. User-only.
|
|
3208
3262
|
*
|
|
3209
3263
|
* @method ch
|
|
3210
3264
|
* @param chatId The identifier of a chat.
|
|
3211
|
-
* @
|
|
3265
|
+
* @returns The count of online members in the chat.
|
|
3212
3266
|
*/
|
|
3213
|
-
async
|
|
3214
|
-
await this.#chatManager.
|
|
3267
|
+
async getOnlineCount(chatId) {
|
|
3268
|
+
return await this.#chatManager.getOnlineCount(chatId);
|
|
3269
|
+
}
|
|
3270
|
+
/**
|
|
3271
|
+
* Get pinned chats from a chat list. User-only.
|
|
3272
|
+
*
|
|
3273
|
+
* @method ch
|
|
3274
|
+
* @param from The chat list to get the pinned chats from. Defaults to main.
|
|
3275
|
+
*/
|
|
3276
|
+
async getPinnedChats(from) {
|
|
3277
|
+
return await this.#chatListManager.getPinnedChats(from);
|
|
3278
|
+
}
|
|
3279
|
+
/**
|
|
3280
|
+
* Get recommended channels. User-only.
|
|
3281
|
+
*
|
|
3282
|
+
* @method ch
|
|
3283
|
+
* @returns A list of recommended channels.
|
|
3284
|
+
*/
|
|
3285
|
+
async getRecommendedChannels() {
|
|
3286
|
+
return await this.#chatManager.getRecommendedChannels();
|
|
3215
3287
|
}
|
|
3216
3288
|
/**
|
|
3217
|
-
*
|
|
3289
|
+
* Get similar bots. User-only.
|
|
3218
3290
|
*
|
|
3219
3291
|
* @method ch
|
|
3220
|
-
* @param chatId The identifier of a
|
|
3221
|
-
* @
|
|
3292
|
+
* @param chatId The identifier of a bot to get similar bots for.
|
|
3293
|
+
* @returns A list of similar bots.
|
|
3222
3294
|
*/
|
|
3223
|
-
async
|
|
3224
|
-
await this.#chatManager.
|
|
3295
|
+
async getSimilarBots(chatId) {
|
|
3296
|
+
return await this.#chatManager.getSimilarBots(chatId);
|
|
3225
3297
|
}
|
|
3226
3298
|
/**
|
|
3227
|
-
*
|
|
3299
|
+
* Get similar channels. User-only.
|
|
3228
3300
|
*
|
|
3229
3301
|
* @method ch
|
|
3230
|
-
* @param chatId The identifier of
|
|
3302
|
+
* @param chatId The identifier of a channel to get similar channels for.
|
|
3303
|
+
* @returns A list of similar channels.
|
|
3231
3304
|
*/
|
|
3232
|
-
async
|
|
3233
|
-
await this.#chatManager.
|
|
3305
|
+
async getSimilarChannels(chatId) {
|
|
3306
|
+
return await this.#chatManager.getSimilarChannels(chatId);
|
|
3234
3307
|
}
|
|
3235
3308
|
/**
|
|
3236
|
-
*
|
|
3309
|
+
* Get a topic of a forum chat by its identifier. User-only.
|
|
3237
3310
|
*
|
|
3238
3311
|
* @method ch
|
|
3239
|
-
* @param chatId The identifier of the
|
|
3312
|
+
* @param chatId The identifier of the chat.
|
|
3313
|
+
* @param topicId The identifier of the topic.
|
|
3240
3314
|
*/
|
|
3241
|
-
async
|
|
3242
|
-
await this.#
|
|
3315
|
+
async getTopic(chatId, topicId) {
|
|
3316
|
+
return await this.#forumManager.getTopic(chatId, topicId);
|
|
3243
3317
|
}
|
|
3244
3318
|
/**
|
|
3245
|
-
*
|
|
3319
|
+
* Get the topics of a forum chat. User-only.
|
|
3246
3320
|
*
|
|
3247
3321
|
* @method ch
|
|
3248
|
-
* @param chatId The identifier of the
|
|
3249
|
-
* @param isShownAsTabs Whether topics should be displayed as tabs.
|
|
3322
|
+
* @param chatId The identifier of the chat.
|
|
3250
3323
|
*/
|
|
3251
|
-
async
|
|
3252
|
-
await this.#
|
|
3324
|
+
async getTopics(chatId, params) {
|
|
3325
|
+
return await this.#forumManager.getTopics(chatId, params);
|
|
3253
3326
|
}
|
|
3254
3327
|
/**
|
|
3255
|
-
*
|
|
3328
|
+
* Get topics of a forum chat by their identifiers. User-only.
|
|
3256
3329
|
*
|
|
3257
3330
|
* @method ch
|
|
3258
|
-
* @param chatId The identifier of the
|
|
3331
|
+
* @param chatId The identifier of the chat.
|
|
3332
|
+
* @param topicIds The identifiers of the topics.
|
|
3259
3333
|
*/
|
|
3260
|
-
async
|
|
3261
|
-
await this.#
|
|
3334
|
+
async getTopicsById(chatId, topicIds) {
|
|
3335
|
+
return await this.#forumManager.getTopicsById(chatId, topicIds);
|
|
3262
3336
|
}
|
|
3263
3337
|
/**
|
|
3264
|
-
*
|
|
3338
|
+
* Hide the general forum topic.
|
|
3265
3339
|
*
|
|
3266
3340
|
* @method ch
|
|
3267
|
-
* @param chatId The identifier of
|
|
3341
|
+
* @param chatId The identifier of a chat.
|
|
3268
3342
|
*/
|
|
3269
|
-
async
|
|
3270
|
-
await this.#
|
|
3343
|
+
async hideGeneralTopic(chatId) {
|
|
3344
|
+
await this.#forumManager.hideGeneralTopic(chatId);
|
|
3271
3345
|
}
|
|
3272
3346
|
/**
|
|
3273
|
-
*
|
|
3347
|
+
* Hide the member list of a group to non-admins. User-only.
|
|
3274
3348
|
*
|
|
3275
3349
|
* @method ch
|
|
3276
3350
|
* @param chatId The identifier of the group.
|
|
3277
3351
|
*/
|
|
3278
|
-
async
|
|
3279
|
-
await this.#chatManager.
|
|
3352
|
+
async hideMemberList(chatId) {
|
|
3353
|
+
await this.#chatManager.hideMemberList(chatId);
|
|
3280
3354
|
}
|
|
3281
3355
|
/**
|
|
3282
|
-
*
|
|
3356
|
+
* Join a chat. User-only.
|
|
3283
3357
|
*
|
|
3284
3358
|
* @method ch
|
|
3285
|
-
* @param chatId The identifier of
|
|
3359
|
+
* @param chatId The identifier of a chat.
|
|
3286
3360
|
*/
|
|
3287
|
-
async
|
|
3288
|
-
await this.#chatManager.
|
|
3361
|
+
async joinChat(chatId) {
|
|
3362
|
+
await this.#chatManager.joinChat(chatId);
|
|
3289
3363
|
}
|
|
3290
3364
|
/**
|
|
3291
|
-
*
|
|
3365
|
+
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
3292
3366
|
*
|
|
3293
3367
|
* @method ch
|
|
3294
|
-
* @param chatId The identifier of
|
|
3368
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
3369
|
+
* @param memberId The identifier of the member.
|
|
3295
3370
|
*/
|
|
3296
|
-
async
|
|
3297
|
-
await this.#chatManager.
|
|
3371
|
+
async kickChatMember(chatId, memberId) {
|
|
3372
|
+
await this.#chatManager.banChatMember(chatId, memberId);
|
|
3373
|
+
await this.#chatManager.unbanChatMember(chatId, memberId);
|
|
3298
3374
|
}
|
|
3299
3375
|
/**
|
|
3300
|
-
*
|
|
3376
|
+
* Leave a chat.
|
|
3301
3377
|
*
|
|
3302
3378
|
* @method ch
|
|
3303
3379
|
* @param chatId The identifier of a chat.
|
|
3304
3380
|
*/
|
|
3305
|
-
async
|
|
3306
|
-
await this.#chatManager.
|
|
3381
|
+
async leaveChat(chatId) {
|
|
3382
|
+
await this.#chatManager.leaveChat(chatId);
|
|
3307
3383
|
}
|
|
3308
3384
|
/**
|
|
3309
|
-
*
|
|
3385
|
+
* Mark all mentions in a chat as read. User-only.
|
|
3310
3386
|
*
|
|
3311
3387
|
* @method ch
|
|
3388
|
+
* @param chatId The identifier of the chat.
|
|
3312
3389
|
*/
|
|
3313
|
-
async
|
|
3314
|
-
return await this.#chatManager.
|
|
3390
|
+
async markAllMentionsAsRead(chatId, params) {
|
|
3391
|
+
return await this.#chatManager.markAllMentionsAsRead(chatId, params);
|
|
3315
3392
|
}
|
|
3316
3393
|
/**
|
|
3317
|
-
*
|
|
3394
|
+
* Mark a chat as read. User-only.
|
|
3318
3395
|
*
|
|
3319
3396
|
* @method ch
|
|
3320
|
-
* @param chatId The identifier of a
|
|
3321
|
-
* @param discussionChatId The identifier of a chat to use as discussion for the channel.
|
|
3397
|
+
* @param chatId The identifier of a chat.
|
|
3322
3398
|
*/
|
|
3323
|
-
async
|
|
3324
|
-
await this.#chatManager.
|
|
3399
|
+
async markChatAsRead(chatId) {
|
|
3400
|
+
return await this.#chatManager.markChatAsRead(chatId);
|
|
3325
3401
|
}
|
|
3326
3402
|
/**
|
|
3327
|
-
*
|
|
3403
|
+
* Mark a chat as unread. User-only.
|
|
3328
3404
|
*
|
|
3329
3405
|
* @method ch
|
|
3330
3406
|
* @param chatId The identifier of a chat.
|
|
3331
|
-
* @param userId The identifier of the new owner.
|
|
3332
|
-
* @param password The password of the current account.
|
|
3333
3407
|
*/
|
|
3334
|
-
async
|
|
3335
|
-
await this.#chatManager.
|
|
3408
|
+
async markChatAsUnread(chatId) {
|
|
3409
|
+
return await this.#chatManager.markChatAsUnread(chatId);
|
|
3336
3410
|
}
|
|
3337
3411
|
/**
|
|
3338
|
-
*
|
|
3412
|
+
* Open a chat.
|
|
3339
3413
|
*
|
|
3340
3414
|
* @method ch
|
|
3341
|
-
* @param chatId The identifier of a chat.
|
|
3342
|
-
* @param title The title of the topic.
|
|
3343
|
-
* @returns The created topic.
|
|
3415
|
+
* @param chatId The identifier of a chat to open.
|
|
3344
3416
|
*/
|
|
3345
|
-
async
|
|
3346
|
-
|
|
3417
|
+
async openChat(chatId, params) {
|
|
3418
|
+
await this.#updateManager.openChat(chatId, params);
|
|
3347
3419
|
}
|
|
3348
3420
|
/**
|
|
3349
|
-
*
|
|
3421
|
+
* Pin a forum topic.
|
|
3350
3422
|
*
|
|
3351
3423
|
* @method ch
|
|
3352
3424
|
* @param chatId The identifier of a chat.
|
|
3353
3425
|
* @param topicId The identifier of the topic.
|
|
3354
|
-
* @param title The new title of the topic.
|
|
3355
|
-
* @returns The new topic.
|
|
3356
3426
|
*/
|
|
3357
|
-
async
|
|
3358
|
-
|
|
3427
|
+
async pinTopic(chatId, topicId) {
|
|
3428
|
+
await this.#forumManager.pinTopic(chatId, topicId);
|
|
3359
3429
|
}
|
|
3360
3430
|
/**
|
|
3361
|
-
*
|
|
3431
|
+
* Promote a chat member.
|
|
3362
3432
|
*
|
|
3363
3433
|
* @method ch
|
|
3364
3434
|
* @param chatId The identifier of a chat.
|
|
3435
|
+
* @param userId The identifier of the user to promote.
|
|
3365
3436
|
*/
|
|
3366
|
-
async
|
|
3367
|
-
await this.#
|
|
3437
|
+
async promoteChatMember(chatId, userId, params) {
|
|
3438
|
+
await this.#chatManager.promoteChatMember(chatId, userId, params);
|
|
3368
3439
|
}
|
|
3369
3440
|
/**
|
|
3370
|
-
*
|
|
3441
|
+
* Reopen a forum topic.
|
|
3371
3442
|
*
|
|
3372
3443
|
* @method ch
|
|
3373
3444
|
* @param chatId The identifier of a chat.
|
|
3445
|
+
* @param topicId The identifier of the topic.
|
|
3374
3446
|
*/
|
|
3375
|
-
async
|
|
3376
|
-
await this.#forumManager.
|
|
3447
|
+
async reopenTopic(chatId, topicId) {
|
|
3448
|
+
await this.#forumManager.reopenTopic(chatId, topicId);
|
|
3377
3449
|
}
|
|
3378
3450
|
/**
|
|
3379
|
-
*
|
|
3451
|
+
* Report a chat. User-only.
|
|
3380
3452
|
*
|
|
3381
3453
|
* @method ch
|
|
3382
|
-
* @param chatId The identifier of a chat.
|
|
3383
|
-
* @param
|
|
3454
|
+
* @param chatId The identifier of a chat to report.
|
|
3455
|
+
* @param reason The reason of the report.
|
|
3384
3456
|
*/
|
|
3385
|
-
async
|
|
3386
|
-
await this.#
|
|
3457
|
+
async reportChat(chatId, reason, params) {
|
|
3458
|
+
return await this.#chatManager.reportChat(chatId, reason, params);
|
|
3387
3459
|
}
|
|
3388
3460
|
/**
|
|
3389
|
-
*
|
|
3461
|
+
* Set a chat's available reactions. User-only.
|
|
3390
3462
|
*
|
|
3391
3463
|
* @method ch
|
|
3392
3464
|
* @param chatId The identifier of a chat.
|
|
3393
|
-
* @param
|
|
3465
|
+
* @param availableReactions The new available reactions.
|
|
3394
3466
|
*/
|
|
3395
|
-
async
|
|
3396
|
-
await this.#
|
|
3467
|
+
async setAvailableReactions(chatId, availableReactions) {
|
|
3468
|
+
await this.#chatManager.setAvailableReactions(chatId, availableReactions);
|
|
3397
3469
|
}
|
|
3398
3470
|
/**
|
|
3399
|
-
*
|
|
3471
|
+
* Set the number of boosts required to circumvent a chat's default restrictions. User-only.
|
|
3400
3472
|
*
|
|
3401
3473
|
* @method ch
|
|
3402
3474
|
* @param chatId The identifier of a chat.
|
|
3403
|
-
* @param
|
|
3475
|
+
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
3404
3476
|
*/
|
|
3405
|
-
async
|
|
3406
|
-
await this.#
|
|
3477
|
+
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
3478
|
+
await this.#chatManager.setBoostsRequiredToCircumventRestrictions(chatId, boosts);
|
|
3407
3479
|
}
|
|
3408
3480
|
/**
|
|
3409
|
-
*
|
|
3481
|
+
* Change the description of a chat.
|
|
3410
3482
|
*
|
|
3411
3483
|
* @method ch
|
|
3412
3484
|
* @param chatId The identifier of a chat.
|
|
3413
|
-
* @param
|
|
3485
|
+
* @param description The new description.
|
|
3414
3486
|
*/
|
|
3415
|
-
async
|
|
3416
|
-
await this.#
|
|
3487
|
+
async setChatDescription(chatId, description) {
|
|
3488
|
+
await this.#chatManager.setChatDescription(chatId, description);
|
|
3417
3489
|
}
|
|
3418
3490
|
/**
|
|
3419
|
-
*
|
|
3491
|
+
* Set the rights of a chat member.
|
|
3420
3492
|
*
|
|
3421
3493
|
* @method ch
|
|
3422
|
-
* @param chatId The identifier of a chat.
|
|
3423
|
-
* @param
|
|
3494
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
3495
|
+
* @param memberId The identifier of the member.
|
|
3424
3496
|
*/
|
|
3425
|
-
async
|
|
3426
|
-
await this.#chatManager.
|
|
3497
|
+
async setChatMemberRights(chatId, memberId, params) {
|
|
3498
|
+
await this.#chatManager.setChatMemberRights(chatId, memberId, params);
|
|
3427
3499
|
}
|
|
3428
3500
|
/**
|
|
3429
3501
|
* Change the tag of a chat member.
|
|
@@ -3436,130 +3508,154 @@ export class Client extends Composer {
|
|
|
3436
3508
|
await this.#chatManager.setChatMemberTag(chatId, userId, params);
|
|
3437
3509
|
}
|
|
3438
3510
|
/**
|
|
3439
|
-
*
|
|
3511
|
+
* Set a chat's photo.
|
|
3440
3512
|
*
|
|
3441
3513
|
* @method ch
|
|
3442
3514
|
* @param chatId The identifier of a chat.
|
|
3515
|
+
* @param photo A photo to set as the chat's photo.
|
|
3443
3516
|
*/
|
|
3444
|
-
async
|
|
3445
|
-
await this.#chatManager.
|
|
3517
|
+
async setChatPhoto(chatId, photo, params) {
|
|
3518
|
+
await this.#chatManager.setChatPhoto(chatId, photo, params);
|
|
3446
3519
|
}
|
|
3447
3520
|
/**
|
|
3448
|
-
*
|
|
3521
|
+
* Set a chat's sticker set.
|
|
3449
3522
|
*
|
|
3450
3523
|
* @method ch
|
|
3451
|
-
* @param chatId The identifier of a chat.
|
|
3524
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
3525
|
+
* @param setName The name of the set.
|
|
3452
3526
|
*/
|
|
3453
|
-
async
|
|
3454
|
-
await this.#
|
|
3527
|
+
async setChatStickerSet(chatId, setName) {
|
|
3528
|
+
await this.#messageManager.setChatStickerSet(chatId, setName);
|
|
3455
3529
|
}
|
|
3456
3530
|
/**
|
|
3457
|
-
*
|
|
3531
|
+
* Change the title of a chat.
|
|
3458
3532
|
*
|
|
3459
3533
|
* @method ch
|
|
3460
|
-
* @
|
|
3534
|
+
* @param chatId The identifier of a chat.
|
|
3535
|
+
* @param title The new title.
|
|
3461
3536
|
*/
|
|
3462
|
-
async
|
|
3463
|
-
|
|
3537
|
+
async setChatTitle(chatId, title) {
|
|
3538
|
+
await this.#chatManager.setChatTitle(chatId, title);
|
|
3464
3539
|
}
|
|
3465
3540
|
/**
|
|
3466
|
-
*
|
|
3541
|
+
* Set the default send as chat of a chat. User-only.
|
|
3467
3542
|
*
|
|
3468
3543
|
* @method ch
|
|
3469
|
-
* @param chatId The identifier of a
|
|
3470
|
-
* @
|
|
3544
|
+
* @param chatId The identifier of a chat.
|
|
3545
|
+
* @param sendAs The new default send as chat.
|
|
3471
3546
|
*/
|
|
3472
|
-
async
|
|
3473
|
-
|
|
3547
|
+
async setDefaultSendAs(chatId, sendAs) {
|
|
3548
|
+
await this.#chatManager.setDefaultSendAs(chatId, sendAs);
|
|
3474
3549
|
}
|
|
3475
3550
|
/**
|
|
3476
|
-
*
|
|
3551
|
+
* Set a channel's discussion chat. User-only.
|
|
3477
3552
|
*
|
|
3478
3553
|
* @method ch
|
|
3479
|
-
* @param chatId The identifier of a
|
|
3480
|
-
* @
|
|
3554
|
+
* @param chatId The identifier of a channel.
|
|
3555
|
+
* @param discussionChatId The identifier of a chat to use as discussion for the channel.
|
|
3481
3556
|
*/
|
|
3482
|
-
async
|
|
3483
|
-
|
|
3557
|
+
async setDiscussionChat(chatId, discussionChatId) {
|
|
3558
|
+
await this.#chatManager.setDiscussionChat(chatId, discussionChatId);
|
|
3484
3559
|
}
|
|
3485
3560
|
/**
|
|
3486
|
-
*
|
|
3561
|
+
* Set the time to live of the messages of a chat. User-only.
|
|
3487
3562
|
*
|
|
3488
3563
|
* @method ch
|
|
3489
3564
|
* @param chatId The identifier of a chat.
|
|
3490
|
-
* @
|
|
3565
|
+
* @param messageTtl The time to live of the messages in seconds.
|
|
3491
3566
|
*/
|
|
3492
|
-
async
|
|
3493
|
-
|
|
3567
|
+
async setMessageTtl(chatId, messageTtl) {
|
|
3568
|
+
await this.#chatListManager.setMessageTtl(chatId, messageTtl);
|
|
3494
3569
|
}
|
|
3495
3570
|
/**
|
|
3496
|
-
*
|
|
3571
|
+
* Change slow mode in a group. User-only.
|
|
3497
3572
|
*
|
|
3498
3573
|
* @method ch
|
|
3499
|
-
* @param chatId The identifier of
|
|
3574
|
+
* @param chatId The identifier of the group to change slow mode in.
|
|
3575
|
+
* @param duration New slow mode duration.
|
|
3500
3576
|
*/
|
|
3501
|
-
async
|
|
3502
|
-
await this.#chatManager.
|
|
3577
|
+
async setSlowMode(chatId, duration) {
|
|
3578
|
+
await this.#chatManager.setSlowMode(chatId, duration);
|
|
3503
3579
|
}
|
|
3504
3580
|
/**
|
|
3505
|
-
*
|
|
3581
|
+
* Show the general forum topic.
|
|
3506
3582
|
*
|
|
3507
3583
|
* @method ch
|
|
3508
3584
|
* @param chatId The identifier of a chat.
|
|
3509
3585
|
*/
|
|
3510
|
-
async
|
|
3511
|
-
await this.#
|
|
3586
|
+
async showGeneralTopic(chatId) {
|
|
3587
|
+
await this.#forumManager.showGeneralTopic(chatId);
|
|
3512
3588
|
}
|
|
3513
3589
|
/**
|
|
3514
|
-
*
|
|
3590
|
+
* Show the member list of a group to non-admins. User-only.
|
|
3591
|
+
*
|
|
3592
|
+
* @method ch
|
|
3593
|
+
* @param chatId The identifier of the group.
|
|
3594
|
+
*/
|
|
3595
|
+
async showMemberList(chatId) {
|
|
3596
|
+
await this.#chatManager.showMemberList(chatId);
|
|
3597
|
+
}
|
|
3598
|
+
/**
|
|
3599
|
+
* Transfer the ownership of a chat. User-only.
|
|
3515
3600
|
*
|
|
3516
3601
|
* @method ch
|
|
3517
3602
|
* @param chatId The identifier of a chat.
|
|
3518
|
-
* @param
|
|
3603
|
+
* @param userId The identifier of the new owner.
|
|
3604
|
+
* @param password The password of the current account.
|
|
3519
3605
|
*/
|
|
3520
|
-
async
|
|
3521
|
-
await this.#chatManager.
|
|
3606
|
+
async transferChatOwnership(chatId, userId, password) {
|
|
3607
|
+
await this.#chatManager.transferChatOwnership(chatId, userId, password);
|
|
3522
3608
|
}
|
|
3523
3609
|
/**
|
|
3524
|
-
*
|
|
3610
|
+
* Unarchive a single chat. User-only.
|
|
3525
3611
|
*
|
|
3526
3612
|
* @method ch
|
|
3527
|
-
* @param chatId The identifier of a chat
|
|
3528
|
-
* @param reason The reason of the report.
|
|
3613
|
+
* @param chatId The identifier of a chat.
|
|
3529
3614
|
*/
|
|
3530
|
-
async
|
|
3531
|
-
|
|
3615
|
+
async unarchiveChat(chatId) {
|
|
3616
|
+
await this.#chatListManager.unarchiveChat(chatId);
|
|
3532
3617
|
}
|
|
3533
3618
|
/**
|
|
3534
|
-
*
|
|
3619
|
+
* Unarchive multiple chats. User-only.
|
|
3535
3620
|
*
|
|
3536
3621
|
* @method ch
|
|
3537
|
-
* @param
|
|
3622
|
+
* @param chatIds The identifiers of the chats to unarchive.
|
|
3538
3623
|
*/
|
|
3539
|
-
async
|
|
3540
|
-
|
|
3624
|
+
async unarchiveChats(chatIds) {
|
|
3625
|
+
await this.#chatListManager.unarchiveChats(chatIds);
|
|
3541
3626
|
}
|
|
3542
3627
|
/**
|
|
3543
|
-
*
|
|
3628
|
+
* Unban a member from a chat.
|
|
3544
3629
|
*
|
|
3545
3630
|
* @method ch
|
|
3546
|
-
* @param chatId The identifier of a chat.
|
|
3631
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
3632
|
+
* @param memberId The identifier of the member.
|
|
3547
3633
|
*/
|
|
3548
|
-
async
|
|
3549
|
-
|
|
3634
|
+
async unbanChatMember(chatId, memberId) {
|
|
3635
|
+
await this.#chatManager.unbanChatMember(chatId, memberId);
|
|
3550
3636
|
}
|
|
3551
3637
|
/**
|
|
3552
|
-
*
|
|
3638
|
+
* Unpin a forum topic.
|
|
3553
3639
|
*
|
|
3554
3640
|
* @method ch
|
|
3555
|
-
* @param chatId The identifier of
|
|
3641
|
+
* @param chatId The identifier of a chat.
|
|
3642
|
+
* @param topicId The identifier of the topic.
|
|
3556
3643
|
*/
|
|
3557
|
-
async
|
|
3558
|
-
|
|
3644
|
+
async unpinTopic(chatId, topicId) {
|
|
3645
|
+
await this.#forumManager.unpinTopic(chatId, topicId);
|
|
3559
3646
|
}
|
|
3560
3647
|
//
|
|
3561
3648
|
// ========================= CALLBACK QUERIES ========================= //
|
|
3562
3649
|
//
|
|
3650
|
+
/**
|
|
3651
|
+
* Answer a callback query. Bot-only.
|
|
3652
|
+
*
|
|
3653
|
+
* @method cq
|
|
3654
|
+
* @param id ID of the callback query to answer.
|
|
3655
|
+
*/
|
|
3656
|
+
async answerCallbackQuery(id, params) {
|
|
3657
|
+
await this.#callbackQueryManager.answerCallbackQuery(id, params);
|
|
3658
|
+
}
|
|
3563
3659
|
/**
|
|
3564
3660
|
* Send a callback query. User-only.
|
|
3565
3661
|
*
|
|
@@ -3573,18 +3669,19 @@ export class Client extends Composer {
|
|
|
3573
3669
|
async sendCallbackQuery(botId, messageId, question) {
|
|
3574
3670
|
return await this.#callbackQueryManager.sendCallbackQuery(botId, messageId, question);
|
|
3575
3671
|
}
|
|
3672
|
+
//
|
|
3673
|
+
// ========================= INLINE QUERIES ========================= //
|
|
3674
|
+
//
|
|
3576
3675
|
/**
|
|
3577
|
-
* Answer
|
|
3676
|
+
* Answer an inline query. Bot-only.
|
|
3578
3677
|
*
|
|
3579
|
-
* @method
|
|
3580
|
-
* @param id
|
|
3678
|
+
* @method iq
|
|
3679
|
+
* @param id The identifier of the inline query to answer.
|
|
3680
|
+
* @param results The results to answer with.
|
|
3581
3681
|
*/
|
|
3582
|
-
async
|
|
3583
|
-
await this.#
|
|
3682
|
+
async answerInlineQuery(id, results, params) {
|
|
3683
|
+
await this.#inlineQueryManager.answerInlineQuery(id, results, params);
|
|
3584
3684
|
}
|
|
3585
|
-
//
|
|
3586
|
-
// ========================= INLINE QUERIES ========================= //
|
|
3587
|
-
//
|
|
3588
3685
|
/**
|
|
3589
3686
|
* Send an inline query. User-only.
|
|
3590
3687
|
*
|
|
@@ -3597,42 +3694,17 @@ export class Client extends Composer {
|
|
|
3597
3694
|
async sendInlineQuery(botId, chatId, params) {
|
|
3598
3695
|
return await this.#inlineQueryManager.sendInlineQuery(botId, chatId, params);
|
|
3599
3696
|
}
|
|
3600
|
-
/**
|
|
3601
|
-
* Answer an inline query. Bot-only.
|
|
3602
|
-
*
|
|
3603
|
-
* @method iq
|
|
3604
|
-
* @param id The identifier of the inline query to answer.
|
|
3605
|
-
* @param results The results to answer with.
|
|
3606
|
-
*/
|
|
3607
|
-
async answerInlineQuery(id, results, params) {
|
|
3608
|
-
await this.#inlineQueryManager.answerInlineQuery(id, results, params);
|
|
3609
|
-
}
|
|
3610
3697
|
//
|
|
3611
3698
|
// ========================= BOTS ========================= //
|
|
3612
3699
|
//
|
|
3613
3700
|
/**
|
|
3614
|
-
*
|
|
3615
|
-
*
|
|
3616
|
-
* @method bo
|
|
3617
|
-
*/
|
|
3618
|
-
async setMyDescription(params) {
|
|
3619
|
-
await this.#botInfoManager.setMyDescription(params);
|
|
3620
|
-
}
|
|
3621
|
-
/**
|
|
3622
|
-
* Set the bot's name in the given language. Bot-only.
|
|
3623
|
-
*
|
|
3624
|
-
* @method bo
|
|
3625
|
-
*/
|
|
3626
|
-
async setMyName(params) {
|
|
3627
|
-
await this.#botInfoManager.setMyName(params);
|
|
3628
|
-
}
|
|
3629
|
-
/**
|
|
3630
|
-
* Set the bot's short description in the given language. Bot-only.
|
|
3701
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
3631
3702
|
*
|
|
3632
3703
|
* @method bo
|
|
3704
|
+
* @returns The current bot's commands in the specified language.
|
|
3633
3705
|
*/
|
|
3634
|
-
async
|
|
3635
|
-
await this.#botInfoManager.
|
|
3706
|
+
async getMyCommands(params) {
|
|
3707
|
+
return await this.#botInfoManager.getMyCommands(params);
|
|
3636
3708
|
}
|
|
3637
3709
|
/**
|
|
3638
3710
|
* Get the bot's description in the given language. Bot-only.
|
|
@@ -3671,28 +3743,32 @@ export class Client extends Composer {
|
|
|
3671
3743
|
await this.#botInfoManager.setMyCommands(commands, params);
|
|
3672
3744
|
}
|
|
3673
3745
|
/**
|
|
3674
|
-
*
|
|
3746
|
+
* Set the bot's description in the given language. Bot-only.
|
|
3675
3747
|
*
|
|
3676
3748
|
* @method bo
|
|
3677
|
-
* @returns The current bot's commands in the specified language.
|
|
3678
3749
|
*/
|
|
3679
|
-
async
|
|
3680
|
-
|
|
3750
|
+
async setMyDescription(params) {
|
|
3751
|
+
await this.#botInfoManager.setMyDescription(params);
|
|
3681
3752
|
}
|
|
3682
|
-
//
|
|
3683
|
-
// ========================= REACTIONS ========================= //
|
|
3684
|
-
//
|
|
3685
3753
|
/**
|
|
3686
|
-
*
|
|
3754
|
+
* Set the bot's name in the given language. Bot-only.
|
|
3687
3755
|
*
|
|
3688
|
-
* @method
|
|
3689
|
-
* @param chatId The identifier of the chat which the message belongs to.
|
|
3690
|
-
* @param messageId The identifier of the message to add the reaction to.
|
|
3691
|
-
* @param reactions The new reactions.
|
|
3756
|
+
* @method bo
|
|
3692
3757
|
*/
|
|
3693
|
-
async
|
|
3694
|
-
await this.#
|
|
3758
|
+
async setMyName(params) {
|
|
3759
|
+
await this.#botInfoManager.setMyName(params);
|
|
3760
|
+
}
|
|
3761
|
+
/**
|
|
3762
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
3763
|
+
*
|
|
3764
|
+
* @method bo
|
|
3765
|
+
*/
|
|
3766
|
+
async setMyShortDescription(params) {
|
|
3767
|
+
await this.#botInfoManager.setMyShortDescription(params);
|
|
3695
3768
|
}
|
|
3769
|
+
//
|
|
3770
|
+
// ========================= REACTIONS ========================= //
|
|
3771
|
+
//
|
|
3696
3772
|
/**
|
|
3697
3773
|
* Make a reaction to a message.
|
|
3698
3774
|
*
|
|
@@ -3704,6 +3780,14 @@ export class Client extends Composer {
|
|
|
3704
3780
|
async addReaction(chatId, messageId, reaction, params) {
|
|
3705
3781
|
await this.#messageManager.addReaction(chatId, messageId, reaction, params);
|
|
3706
3782
|
}
|
|
3783
|
+
/**
|
|
3784
|
+
* Clear recent reactions. User-only.
|
|
3785
|
+
*
|
|
3786
|
+
* @method re
|
|
3787
|
+
*/
|
|
3788
|
+
async clearRecentReactions() {
|
|
3789
|
+
return await this.#messageManager.clearRecentReactions();
|
|
3790
|
+
}
|
|
3707
3791
|
/**
|
|
3708
3792
|
* Undo a reaction made to a message.
|
|
3709
3793
|
*
|
|
@@ -3737,50 +3821,48 @@ export class Client extends Composer {
|
|
|
3737
3821
|
return await this.#messageManager.removeUserReactions(chatId, userId);
|
|
3738
3822
|
}
|
|
3739
3823
|
/**
|
|
3740
|
-
*
|
|
3824
|
+
* Change reactions made to a message.
|
|
3741
3825
|
*
|
|
3742
3826
|
* @method re
|
|
3827
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
3828
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
3829
|
+
* @param reactions The new reactions.
|
|
3743
3830
|
*/
|
|
3744
|
-
async
|
|
3745
|
-
|
|
3831
|
+
async setReactions(chatId, messageId, reactions, params) {
|
|
3832
|
+
await this.#messageManager.setReactions(chatId, messageId, reactions, params);
|
|
3746
3833
|
}
|
|
3747
3834
|
//
|
|
3748
3835
|
// ========================= STORIES ========================= //
|
|
3749
3836
|
//
|
|
3750
3837
|
/**
|
|
3751
|
-
*
|
|
3838
|
+
* Add multiple stories to highlights. User-only.
|
|
3752
3839
|
*
|
|
3753
3840
|
* @method st
|
|
3754
|
-
* @param
|
|
3755
|
-
* @
|
|
3841
|
+
* @param chatId The identifier of a chat.
|
|
3842
|
+
* @param storyIds The identifiers of the stories to add to highlights.
|
|
3756
3843
|
*/
|
|
3757
|
-
async
|
|
3758
|
-
|
|
3844
|
+
async addStoriesToHighlights(chatId, storyIds) {
|
|
3845
|
+
await this.#storyManager.addStoriesToHighlights(chatId, storyIds);
|
|
3759
3846
|
}
|
|
3760
3847
|
/**
|
|
3761
|
-
*
|
|
3848
|
+
* Add a single story to highlights. User-only.
|
|
3762
3849
|
*
|
|
3763
3850
|
* @method st
|
|
3764
3851
|
* @param chatId The identifier of a chat.
|
|
3765
|
-
* @param
|
|
3766
|
-
* @returns The retrieved stories.
|
|
3852
|
+
* @param storyId The identifier of the story to add to highlights.
|
|
3767
3853
|
*/
|
|
3768
|
-
async
|
|
3769
|
-
|
|
3770
|
-
return [];
|
|
3771
|
-
}
|
|
3772
|
-
return await this.#storyManager.getStories(chatId, storyIds);
|
|
3854
|
+
async addStoryToHighlights(chatId, storyId) {
|
|
3855
|
+
await this.#storyManager.addStoryToHighlights(chatId, storyId);
|
|
3773
3856
|
}
|
|
3774
3857
|
/**
|
|
3775
|
-
*
|
|
3858
|
+
* Create a story. User-only.
|
|
3776
3859
|
*
|
|
3777
3860
|
* @method st
|
|
3778
|
-
* @param
|
|
3779
|
-
* @
|
|
3780
|
-
* @returns The retrieved story.
|
|
3861
|
+
* @param content The content of the story.
|
|
3862
|
+
* @returns The created story.
|
|
3781
3863
|
*/
|
|
3782
|
-
async
|
|
3783
|
-
return await this.#storyManager.
|
|
3864
|
+
async createStory(chatId, content, params) {
|
|
3865
|
+
return await this.#storyManager.createStory(chatId, content, params);
|
|
3784
3866
|
}
|
|
3785
3867
|
/**
|
|
3786
3868
|
* Delete multiple stories. User-only.
|
|
@@ -3803,24 +3885,29 @@ export class Client extends Composer {
|
|
|
3803
3885
|
await this.#storyManager.deleteStory(chatId, storyId);
|
|
3804
3886
|
}
|
|
3805
3887
|
/**
|
|
3806
|
-
*
|
|
3888
|
+
* Retrieve multiple stories. User-only.
|
|
3807
3889
|
*
|
|
3808
3890
|
* @method st
|
|
3809
3891
|
* @param chatId The identifier of a chat.
|
|
3810
|
-
* @param storyIds The identifiers of the stories to
|
|
3892
|
+
* @param storyIds The identifiers of the stories to retrieve.
|
|
3893
|
+
* @returns The retrieved stories.
|
|
3811
3894
|
*/
|
|
3812
|
-
async
|
|
3813
|
-
|
|
3895
|
+
async getStories(chatId, storyIds) {
|
|
3896
|
+
if (!storyIds.length) {
|
|
3897
|
+
return [];
|
|
3898
|
+
}
|
|
3899
|
+
return await this.#storyManager.getStories(chatId, storyIds);
|
|
3814
3900
|
}
|
|
3815
3901
|
/**
|
|
3816
|
-
*
|
|
3902
|
+
* Retrieve a single story. User-only.
|
|
3817
3903
|
*
|
|
3818
3904
|
* @method st
|
|
3819
3905
|
* @param chatId The identifier of a chat.
|
|
3820
|
-
* @param storyId The identifier of the story to
|
|
3906
|
+
* @param storyId The identifier of the story to retrieve.
|
|
3907
|
+
* @returns The retrieved story.
|
|
3821
3908
|
*/
|
|
3822
|
-
async
|
|
3823
|
-
await this.#storyManager.
|
|
3909
|
+
async getStory(chatId, storyId) {
|
|
3910
|
+
return await this.#storyManager.getStory(chatId, storyId);
|
|
3824
3911
|
}
|
|
3825
3912
|
/**
|
|
3826
3913
|
* Remove multiple stories from highlights. User-only.
|
|
@@ -3842,6 +3929,16 @@ export class Client extends Composer {
|
|
|
3842
3929
|
async removeStoryFromHighlights(chatId, storyId) {
|
|
3843
3930
|
await this.#storyManager.removeStoryFromHighlights(chatId, storyId);
|
|
3844
3931
|
}
|
|
3932
|
+
/**
|
|
3933
|
+
* Report multiple stories. User-only.
|
|
3934
|
+
*
|
|
3935
|
+
* @method st
|
|
3936
|
+
* @param chatId The identifier of a chat that posted the stories.
|
|
3937
|
+
* @param storyIds The identifiers of the stories to report.
|
|
3938
|
+
*/
|
|
3939
|
+
async reportStories(chatId, storyIds, params) {
|
|
3940
|
+
return await this.#storyManager.reportStories(chatId, storyIds, params);
|
|
3941
|
+
}
|
|
3845
3942
|
/**
|
|
3846
3943
|
* Report a single story. User-only.
|
|
3847
3944
|
*
|
|
@@ -3852,19 +3949,31 @@ export class Client extends Composer {
|
|
|
3852
3949
|
async reportStory(chatId, storyId, params) {
|
|
3853
3950
|
return await this.#storyManager.reportStory(chatId, storyId, params);
|
|
3854
3951
|
}
|
|
3952
|
+
//
|
|
3953
|
+
// ========================= STORY ALBUMS ========================= //
|
|
3954
|
+
//
|
|
3855
3955
|
/**
|
|
3856
|
-
*
|
|
3956
|
+
* Add multiple stories to an album. User-only.
|
|
3857
3957
|
*
|
|
3858
|
-
* @method
|
|
3859
|
-
* @param chatId The identifier of
|
|
3860
|
-
* @param
|
|
3958
|
+
* @method sa
|
|
3959
|
+
* @param chatId The identifier of the chat including the album.
|
|
3960
|
+
* @param albumId The identifier of an album.
|
|
3961
|
+
* @param storyIds The identifiers of the stories to add.
|
|
3861
3962
|
*/
|
|
3862
|
-
async
|
|
3863
|
-
return await this.#
|
|
3963
|
+
async addStoriesToAlbum(chatId, albumId, storyIds) {
|
|
3964
|
+
return await this.#storyAlbumManager.addStoriesToAlbum(chatId, albumId, storyIds);
|
|
3965
|
+
}
|
|
3966
|
+
/**
|
|
3967
|
+
* Add a single story to an album. User-only.
|
|
3968
|
+
*
|
|
3969
|
+
* @method sa
|
|
3970
|
+
* @param chatId The identifier of the chat including the album.
|
|
3971
|
+
* @param albumId The identifier of an album.
|
|
3972
|
+
* @param storyId The identifier of the story to add.
|
|
3973
|
+
*/
|
|
3974
|
+
async addStoryToAlbum(chatId, albumId, storyId) {
|
|
3975
|
+
return await this.#storyAlbumManager.addStoryToAlbum(chatId, albumId, storyId);
|
|
3864
3976
|
}
|
|
3865
|
-
//
|
|
3866
|
-
// ========================= STORY ALBUMS ========================= //
|
|
3867
|
-
//
|
|
3868
3977
|
/**
|
|
3869
3978
|
* Create a story album. User-only.
|
|
3870
3979
|
*
|
|
@@ -3877,37 +3986,23 @@ export class Client extends Composer {
|
|
|
3877
3986
|
return await this.#storyAlbumManager.createStoryAlbum(chatId, name, storyIds);
|
|
3878
3987
|
}
|
|
3879
3988
|
/**
|
|
3880
|
-
*
|
|
3881
|
-
*
|
|
3882
|
-
* @method sa
|
|
3883
|
-
* @param chatId The identifier of the chat including the album.
|
|
3884
|
-
* @param albumId The identifier of the album to rename.
|
|
3885
|
-
* @param name The new name of the album.
|
|
3886
|
-
*/
|
|
3887
|
-
async setStoryAlbumName(chatId, albumId, name) {
|
|
3888
|
-
return await this.#storyAlbumManager.setStoryAlbumName(chatId, albumId, name);
|
|
3889
|
-
}
|
|
3890
|
-
/**
|
|
3891
|
-
* Add multiple stories to an album. User-only.
|
|
3989
|
+
* Get stories inside an album. User-only.
|
|
3892
3990
|
*
|
|
3893
3991
|
* @method sa
|
|
3894
|
-
* @param chatId The identifier of the chat including
|
|
3992
|
+
* @param chatId The identifier of the chat including albums.
|
|
3895
3993
|
* @param albumId The identifier of an album.
|
|
3896
|
-
* @param storyIds The identifiers of the stories to add.
|
|
3897
3994
|
*/
|
|
3898
|
-
async
|
|
3899
|
-
return await this.#storyAlbumManager.
|
|
3995
|
+
async getStoriesInAlbum(chatId, albumId) {
|
|
3996
|
+
return await this.#storyAlbumManager.getStoriesInAlbum(chatId, albumId);
|
|
3900
3997
|
}
|
|
3901
3998
|
/**
|
|
3902
|
-
*
|
|
3999
|
+
* Get story albums in a chat. User-only.
|
|
3903
4000
|
*
|
|
3904
4001
|
* @method sa
|
|
3905
|
-
* @param chatId The identifier of
|
|
3906
|
-
* @param albumId The identifier of an album.
|
|
3907
|
-
* @param storyId The identifier of the story to add.
|
|
4002
|
+
* @param chatId The identifier of a chat including albums.
|
|
3908
4003
|
*/
|
|
3909
|
-
async
|
|
3910
|
-
return await this.#storyAlbumManager.
|
|
4004
|
+
async getStoryAlbums(chatId) {
|
|
4005
|
+
return await this.#storyAlbumManager.getStoryAlbums(chatId);
|
|
3911
4006
|
}
|
|
3912
4007
|
/**
|
|
3913
4008
|
* Remove multiple stories from an album. User-only.
|
|
@@ -3943,23 +4038,15 @@ export class Client extends Composer {
|
|
|
3943
4038
|
return await this.#storyAlbumManager.reorderStoriesInAlbum(chatId, albumId, storyIds);
|
|
3944
4039
|
}
|
|
3945
4040
|
/**
|
|
3946
|
-
*
|
|
3947
|
-
*
|
|
3948
|
-
* @method sa
|
|
3949
|
-
* @param chatId The identifier of a chat including albums.
|
|
3950
|
-
*/
|
|
3951
|
-
async getStoryAlbums(chatId) {
|
|
3952
|
-
return await this.#storyAlbumManager.getStoryAlbums(chatId);
|
|
3953
|
-
}
|
|
3954
|
-
/**
|
|
3955
|
-
* Get stories inside an album. User-only.
|
|
4041
|
+
* Set the name of a story album. User-only.
|
|
3956
4042
|
*
|
|
3957
4043
|
* @method sa
|
|
3958
|
-
* @param chatId The identifier of the chat including
|
|
3959
|
-
* @param albumId The identifier of
|
|
4044
|
+
* @param chatId The identifier of the chat including the album.
|
|
4045
|
+
* @param albumId The identifier of the album to rename.
|
|
4046
|
+
* @param name The new name of the album.
|
|
3960
4047
|
*/
|
|
3961
|
-
async
|
|
3962
|
-
return await this.#storyAlbumManager.
|
|
4048
|
+
async setStoryAlbumName(chatId, albumId, name) {
|
|
4049
|
+
return await this.#storyAlbumManager.setStoryAlbumName(chatId, albumId, name);
|
|
3963
4050
|
}
|
|
3964
4051
|
//
|
|
3965
4052
|
// ========================= NETWORK STATISTICS ========================= //
|
|
@@ -3976,85 +4063,85 @@ export class Client extends Composer {
|
|
|
3976
4063
|
// ========================= VIDEO CHATS ========================= //
|
|
3977
4064
|
//
|
|
3978
4065
|
/**
|
|
3979
|
-
*
|
|
4066
|
+
* Download a live stream segment. User-only.
|
|
3980
4067
|
*
|
|
3981
4068
|
* @method vc
|
|
3982
|
-
* @param
|
|
3983
|
-
* @
|
|
4069
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
4070
|
+
* @param channelId Stream channel ID.
|
|
4071
|
+
* @param scale Stream channel scale.
|
|
4072
|
+
* @param timestamp Millisecond timestamp of the chunk to download.
|
|
3984
4073
|
*/
|
|
3985
|
-
async
|
|
3986
|
-
return await this.#videoChatManager.
|
|
4074
|
+
async downloadLiveStreamSegment(id, channelId, scale, timestamp, params) {
|
|
4075
|
+
return await this.#videoChatManager.downloadLiveStreamSegment(id, channelId, scale, timestamp, params);
|
|
3987
4076
|
}
|
|
3988
4077
|
/**
|
|
3989
|
-
*
|
|
4078
|
+
* Get live stream channels. User-only.
|
|
3990
4079
|
*
|
|
3991
4080
|
* @method vc
|
|
3992
|
-
* @param
|
|
3993
|
-
* @param startAt A point in time in the future when the video chat will be started.
|
|
3994
|
-
* @returns The scheduled video chat.
|
|
4081
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
3995
4082
|
*/
|
|
3996
|
-
async
|
|
3997
|
-
return await this.#videoChatManager.
|
|
4083
|
+
async getLiveStreamChannels(id) {
|
|
4084
|
+
return await this.#videoChatManager.getLiveStreamChannels(id);
|
|
3998
4085
|
}
|
|
3999
4086
|
/**
|
|
4000
|
-
*
|
|
4087
|
+
* Get a video chat. User-only.
|
|
4001
4088
|
*
|
|
4002
4089
|
* @method vc
|
|
4003
4090
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
4004
|
-
* @
|
|
4005
|
-
* @returns Parameters to be passed to the used WebRTC library.
|
|
4091
|
+
* @cache
|
|
4006
4092
|
*/
|
|
4007
|
-
async
|
|
4008
|
-
return await this.#videoChatManager.
|
|
4093
|
+
async getVideoChat(id) {
|
|
4094
|
+
return await this.#videoChatManager.getVideoChat(id);
|
|
4009
4095
|
}
|
|
4010
4096
|
/**
|
|
4011
|
-
*
|
|
4097
|
+
* Join a live stream. User-only.
|
|
4012
4098
|
*
|
|
4013
4099
|
* @method vc
|
|
4014
4100
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
4015
4101
|
*/
|
|
4016
|
-
async
|
|
4017
|
-
await this.#videoChatManager.
|
|
4102
|
+
async joinLiveStream(id) {
|
|
4103
|
+
await this.#videoChatManager.joinLiveStream(id);
|
|
4018
4104
|
}
|
|
4019
4105
|
/**
|
|
4020
|
-
* Join a
|
|
4106
|
+
* Join a video chat. User-only.
|
|
4021
4107
|
*
|
|
4022
4108
|
* @method vc
|
|
4023
4109
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
4110
|
+
* @param params_ WebRTC connection parameters.
|
|
4111
|
+
* @returns Parameters to be passed to the used WebRTC library.
|
|
4024
4112
|
*/
|
|
4025
|
-
async
|
|
4026
|
-
await this.#videoChatManager.
|
|
4113
|
+
async joinVideoChat(id, params_, params) {
|
|
4114
|
+
return await this.#videoChatManager.joinVideoChat(id, params_, params);
|
|
4027
4115
|
}
|
|
4028
4116
|
/**
|
|
4029
|
-
*
|
|
4117
|
+
* Leave a video chat. User-only.
|
|
4030
4118
|
*
|
|
4031
4119
|
* @method vc
|
|
4032
4120
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
4033
|
-
* @cache
|
|
4034
4121
|
*/
|
|
4035
|
-
async
|
|
4036
|
-
|
|
4122
|
+
async leaveVideoChat(id) {
|
|
4123
|
+
await this.#videoChatManager.leaveVideoChat(id);
|
|
4037
4124
|
}
|
|
4038
4125
|
/**
|
|
4039
|
-
*
|
|
4126
|
+
* Schedule a video chat. User-only.
|
|
4040
4127
|
*
|
|
4041
4128
|
* @method vc
|
|
4042
|
-
* @param
|
|
4129
|
+
* @param chatId The identifier of a chat to schedule the video chat in.
|
|
4130
|
+
* @param startAt A point in time in the future when the video chat will be started.
|
|
4131
|
+
* @returns The scheduled video chat.
|
|
4043
4132
|
*/
|
|
4044
|
-
async
|
|
4045
|
-
return await this.#videoChatManager.
|
|
4133
|
+
async scheduleVideoChat(chatId, startAt, params) {
|
|
4134
|
+
return await this.#videoChatManager.scheduleVideoChat(chatId, startAt, params);
|
|
4046
4135
|
}
|
|
4047
4136
|
/**
|
|
4048
|
-
*
|
|
4137
|
+
* Start a video chat. User-only.
|
|
4049
4138
|
*
|
|
4050
4139
|
* @method vc
|
|
4051
|
-
* @param
|
|
4052
|
-
* @
|
|
4053
|
-
* @param scale Stream channel scale.
|
|
4054
|
-
* @param timestamp Millisecond timestamp of the chunk to download.
|
|
4140
|
+
* @param chatId The identifier of a chat to start the video chat in.
|
|
4141
|
+
* @returns The started video chat.
|
|
4055
4142
|
*/
|
|
4056
|
-
async
|
|
4057
|
-
return await this.#videoChatManager.
|
|
4143
|
+
async startVideoChat(chatId, params) {
|
|
4144
|
+
return await this.#videoChatManager.startVideoChat(chatId, params);
|
|
4058
4145
|
}
|
|
4059
4146
|
//
|
|
4060
4147
|
// ========================= PAYMENTS ========================= //
|
|
@@ -4070,23 +4157,22 @@ export class Client extends Composer {
|
|
|
4070
4157
|
await this.#paymentManager.answerPreCheckoutQuery(preCheckoutQueryId, ok, params);
|
|
4071
4158
|
}
|
|
4072
4159
|
/**
|
|
4073
|
-
*
|
|
4160
|
+
* Get the star balance of a chat.
|
|
4074
4161
|
*
|
|
4075
4162
|
* @method pa
|
|
4076
|
-
* @param
|
|
4077
|
-
* @param telegramPaymentChargeId The identifier of the charge.
|
|
4163
|
+
* @param chatId The identifier of the chat to get the star balance for.
|
|
4078
4164
|
*/
|
|
4079
|
-
async
|
|
4080
|
-
await this.#paymentManager.
|
|
4165
|
+
async getStarBalance(chatId) {
|
|
4166
|
+
return await this.#paymentManager.getStarBalance(chatId);
|
|
4081
4167
|
}
|
|
4082
4168
|
/**
|
|
4083
|
-
* Get
|
|
4169
|
+
* Get star transactions.
|
|
4084
4170
|
*
|
|
4085
4171
|
* @method pa
|
|
4086
|
-
* @param chatId The identifier of the chat to get
|
|
4172
|
+
* @param chatId The identifier of the chat to get star transactions for.
|
|
4087
4173
|
*/
|
|
4088
|
-
async
|
|
4089
|
-
return await this.#paymentManager.
|
|
4174
|
+
async getStarTransactions(chatId, params) {
|
|
4175
|
+
return await this.#paymentManager.getStarTransactions(chatId, params);
|
|
4090
4176
|
}
|
|
4091
4177
|
/**
|
|
4092
4178
|
* Get the TON balance of a chat.
|
|
@@ -4098,52 +4184,53 @@ export class Client extends Composer {
|
|
|
4098
4184
|
return await this.#paymentManager.getTonBalance(chatId);
|
|
4099
4185
|
}
|
|
4100
4186
|
/**
|
|
4101
|
-
*
|
|
4187
|
+
* Refund a star payment. Bot-only.
|
|
4102
4188
|
*
|
|
4103
4189
|
* @method pa
|
|
4104
|
-
* @param
|
|
4190
|
+
* @param userId The identifier of the user that was charged.
|
|
4191
|
+
* @param telegramPaymentChargeId The identifier of the charge.
|
|
4105
4192
|
*/
|
|
4106
|
-
async
|
|
4107
|
-
|
|
4193
|
+
async refundStarPayment(userId, telegramPaymentChargeId) {
|
|
4194
|
+
await this.#paymentManager.refundStarPayment(userId, telegramPaymentChargeId);
|
|
4108
4195
|
}
|
|
4109
4196
|
//
|
|
4110
4197
|
// ========================= CONTACTS ========================= //
|
|
4111
4198
|
//
|
|
4112
4199
|
/**
|
|
4113
|
-
*
|
|
4200
|
+
* Add a contact. User-only.
|
|
4114
4201
|
*
|
|
4115
4202
|
* @method co
|
|
4203
|
+
* @param userId The identifier of the user to add as contact.
|
|
4204
|
+
* @param firstName The contact's first name.
|
|
4116
4205
|
*/
|
|
4117
|
-
async
|
|
4118
|
-
|
|
4206
|
+
async addContact(userId, firstName, params) {
|
|
4207
|
+
await this.#contactManager.addContact(userId, firstName, params);
|
|
4119
4208
|
}
|
|
4120
4209
|
/**
|
|
4121
|
-
* Delete
|
|
4210
|
+
* Delete a single contact. User-only.
|
|
4122
4211
|
*
|
|
4123
4212
|
* @method co
|
|
4124
|
-
* @param
|
|
4213
|
+
* @param userId The identifier of the contact to delete.
|
|
4125
4214
|
*/
|
|
4126
|
-
async
|
|
4127
|
-
await this.#contactManager.
|
|
4215
|
+
async deleteContact(userId) {
|
|
4216
|
+
await this.#contactManager.deleteContact(userId);
|
|
4128
4217
|
}
|
|
4129
4218
|
/**
|
|
4130
|
-
* Delete
|
|
4219
|
+
* Delete multiple contacts. User-only.
|
|
4131
4220
|
*
|
|
4132
4221
|
* @method co
|
|
4133
|
-
* @param
|
|
4222
|
+
* @param userIds The identifiers of contacts to delete.
|
|
4134
4223
|
*/
|
|
4135
|
-
async
|
|
4136
|
-
await this.#contactManager.
|
|
4224
|
+
async deleteContacts(userIds) {
|
|
4225
|
+
await this.#contactManager.deleteContacts(userIds);
|
|
4137
4226
|
}
|
|
4138
4227
|
/**
|
|
4139
|
-
*
|
|
4228
|
+
* Get contacts. User-only.
|
|
4140
4229
|
*
|
|
4141
4230
|
* @method co
|
|
4142
|
-
* @param userId The identifier of the user to add as contact.
|
|
4143
|
-
* @param firstName The contact's first name.
|
|
4144
4231
|
*/
|
|
4145
|
-
async
|
|
4146
|
-
await this.#contactManager.
|
|
4232
|
+
async getContacts() {
|
|
4233
|
+
return await this.#contactManager.getContacts();
|
|
4147
4234
|
}
|
|
4148
4235
|
/**
|
|
4149
4236
|
* Set a contact note.
|
|
@@ -4170,12 +4257,13 @@ export class Client extends Composer {
|
|
|
4170
4257
|
// ========================= GIFTS ========================= //
|
|
4171
4258
|
//
|
|
4172
4259
|
/**
|
|
4173
|
-
*
|
|
4260
|
+
* Craft gifts.
|
|
4174
4261
|
*
|
|
4175
4262
|
* @method gf
|
|
4263
|
+
* @param gifts The gifts to craft.
|
|
4176
4264
|
*/
|
|
4177
|
-
async
|
|
4178
|
-
|
|
4265
|
+
async craftGifts(gifts) {
|
|
4266
|
+
await this.#giftManager.craftGifts(gifts);
|
|
4179
4267
|
}
|
|
4180
4268
|
/**
|
|
4181
4269
|
* Get gifts claimed by a user or a channel. User-only.
|
|
@@ -4187,73 +4275,74 @@ export class Client extends Composer {
|
|
|
4187
4275
|
return await this.#giftManager.getClaimedGifts(chatId, params);
|
|
4188
4276
|
}
|
|
4189
4277
|
/**
|
|
4190
|
-
*
|
|
4278
|
+
* Get a gift using its slug.
|
|
4191
4279
|
*
|
|
4192
4280
|
* @method gf
|
|
4193
|
-
* @param
|
|
4194
|
-
* @param giftId The identifier of the gift to send.
|
|
4281
|
+
* @param slug The slug of a gift.
|
|
4195
4282
|
*/
|
|
4196
|
-
async
|
|
4197
|
-
await this.#giftManager.
|
|
4283
|
+
async getGift(slug) {
|
|
4284
|
+
return await this.#giftManager.getGift(slug);
|
|
4198
4285
|
}
|
|
4199
4286
|
/**
|
|
4200
|
-
*
|
|
4287
|
+
* Get available gifts.
|
|
4201
4288
|
*
|
|
4202
4289
|
* @method gf
|
|
4203
|
-
* @param gift The gift to sell.
|
|
4204
4290
|
*/
|
|
4205
|
-
async
|
|
4206
|
-
await this.#giftManager.
|
|
4291
|
+
async getGifts() {
|
|
4292
|
+
return await this.#giftManager.getGifts();
|
|
4207
4293
|
}
|
|
4208
4294
|
/**
|
|
4209
|
-
*
|
|
4295
|
+
* Gift a Telegram Premium subscription. Bot-only.
|
|
4210
4296
|
*
|
|
4211
4297
|
* @method gf
|
|
4212
|
-
* @param
|
|
4298
|
+
* @param userId The identifier of a user to gift the Telegram Premium subscription to.
|
|
4299
|
+
* @param duration The duration of the subscription.
|
|
4213
4300
|
*/
|
|
4214
|
-
async
|
|
4215
|
-
await this.#giftManager.
|
|
4301
|
+
async giftPremiumSubscription(userId, duration, params) {
|
|
4302
|
+
return await this.#giftManager.giftPremiumSubscription(userId, duration, params);
|
|
4216
4303
|
}
|
|
4217
4304
|
/**
|
|
4218
|
-
*
|
|
4305
|
+
* Sell a gift.
|
|
4219
4306
|
*
|
|
4220
4307
|
* @method gf
|
|
4221
|
-
* @param
|
|
4308
|
+
* @param gift The gift to sell.
|
|
4222
4309
|
*/
|
|
4223
|
-
async
|
|
4224
|
-
|
|
4310
|
+
async sellGift(gift) {
|
|
4311
|
+
await this.#giftManager.sellGift(gift);
|
|
4225
4312
|
}
|
|
4226
4313
|
/**
|
|
4227
|
-
*
|
|
4314
|
+
* Send a gift.
|
|
4228
4315
|
*
|
|
4229
4316
|
* @method gf
|
|
4230
|
-
* @param chatId The identifier of a
|
|
4231
|
-
* @param
|
|
4317
|
+
* @param chatId The identifier of a user or a channel to send the gift to.
|
|
4318
|
+
* @param giftId The identifier of the gift to send.
|
|
4232
4319
|
*/
|
|
4233
|
-
async
|
|
4234
|
-
|
|
4320
|
+
async sendGift(chatId, giftId, params) {
|
|
4321
|
+
await this.#giftManager.sendGift(chatId, giftId, params);
|
|
4235
4322
|
}
|
|
4236
4323
|
/**
|
|
4237
|
-
*
|
|
4324
|
+
* Transfer a gift. User-only.
|
|
4238
4325
|
*
|
|
4239
4326
|
* @method gf
|
|
4240
|
-
* @param
|
|
4241
|
-
* @param
|
|
4327
|
+
* @param chatId The identifier of a chat to transfer the gift to.
|
|
4328
|
+
* @param gift The gift to transfer.
|
|
4242
4329
|
*/
|
|
4243
|
-
async
|
|
4244
|
-
return await this.#giftManager.
|
|
4330
|
+
async transferGift(chatId, gift) {
|
|
4331
|
+
return await this.#giftManager.transferGift(chatId, gift);
|
|
4245
4332
|
}
|
|
4246
4333
|
//
|
|
4247
4334
|
// ========================= GIFT COLLECTIONS ========================= //
|
|
4248
4335
|
//
|
|
4249
4336
|
/**
|
|
4250
|
-
*
|
|
4337
|
+
* Add gifts to a gift collection. User-only.
|
|
4251
4338
|
*
|
|
4252
4339
|
* @method gc
|
|
4253
|
-
* @param chatId The identifier of
|
|
4340
|
+
* @param chatId The identifier of the chat that includes the gift collection.
|
|
4341
|
+
* @param collectionId The identifier of a gift collection.
|
|
4342
|
+
* @param gifts The gifts to add to the collection.
|
|
4254
4343
|
*/
|
|
4255
|
-
async
|
|
4256
|
-
return await this.#giftCollectionManager.
|
|
4344
|
+
async addGiftsToCollection(chatId, collectionId, gifts) {
|
|
4345
|
+
return await this.#giftCollectionManager.addGiftsToCollection(chatId, collectionId, gifts);
|
|
4257
4346
|
}
|
|
4258
4347
|
/**
|
|
4259
4348
|
* Create a gift collection. User-only.
|
|
@@ -4267,26 +4356,23 @@ export class Client extends Composer {
|
|
|
4267
4356
|
return await this.#giftCollectionManager.createGiftCollection(chatId, name, gifts);
|
|
4268
4357
|
}
|
|
4269
4358
|
/**
|
|
4270
|
-
*
|
|
4359
|
+
* Delete a gift collection. User-only.
|
|
4271
4360
|
*
|
|
4272
4361
|
* @method gc
|
|
4273
4362
|
* @param chatId The identifier of the chat that includes the gift collection.
|
|
4274
4363
|
* @param collectionId The identifier of a gift collection.
|
|
4275
|
-
* @param name The gift collection's new name.
|
|
4276
4364
|
*/
|
|
4277
|
-
async
|
|
4278
|
-
return await this.#giftCollectionManager.
|
|
4365
|
+
async deleteGiftCollection(chatId, collectionId) {
|
|
4366
|
+
return await this.#giftCollectionManager.deleteGiftCollection(chatId, collectionId);
|
|
4279
4367
|
}
|
|
4280
4368
|
/**
|
|
4281
|
-
*
|
|
4369
|
+
* Get gift collections of a chat. User-only.
|
|
4282
4370
|
*
|
|
4283
4371
|
* @method gc
|
|
4284
|
-
* @param chatId The identifier of
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
async addGiftsToCollection(chatId, collectionId, gifts) {
|
|
4289
|
-
return await this.#giftCollectionManager.addGiftsToCollection(chatId, collectionId, gifts);
|
|
4372
|
+
* @param chatId The identifier of a chat to get gift collections for.
|
|
4373
|
+
*/
|
|
4374
|
+
async getGiftCollections(chatId) {
|
|
4375
|
+
return await this.#giftCollectionManager.getGiftCollections(chatId);
|
|
4290
4376
|
}
|
|
4291
4377
|
/**
|
|
4292
4378
|
* Remove gifts from a gift collection. User-only.
|
|
@@ -4311,27 +4397,19 @@ export class Client extends Composer {
|
|
|
4311
4397
|
return await this.#giftCollectionManager.reorderGiftsInCollection(chatId, collectionId, gifts);
|
|
4312
4398
|
}
|
|
4313
4399
|
/**
|
|
4314
|
-
*
|
|
4400
|
+
* Set the name of a gift collection. User-only.
|
|
4315
4401
|
*
|
|
4316
4402
|
* @method gc
|
|
4317
4403
|
* @param chatId The identifier of the chat that includes the gift collection.
|
|
4318
4404
|
* @param collectionId The identifier of a gift collection.
|
|
4405
|
+
* @param name The gift collection's new name.
|
|
4319
4406
|
*/
|
|
4320
|
-
async
|
|
4321
|
-
return await this.#giftCollectionManager.
|
|
4407
|
+
async setGiftCollectionName(chatId, collectionId, name) {
|
|
4408
|
+
return await this.#giftCollectionManager.setGiftCollectionName(chatId, collectionId, name);
|
|
4322
4409
|
}
|
|
4323
4410
|
//
|
|
4324
4411
|
// ========================= TAKEOUTS ========================= //
|
|
4325
4412
|
//
|
|
4326
|
-
/**
|
|
4327
|
-
* Start a takeout session. User-only.
|
|
4328
|
-
*
|
|
4329
|
-
* @method to
|
|
4330
|
-
* @returns The identifier of the takeout session.
|
|
4331
|
-
*/
|
|
4332
|
-
async startTakeoutSession(params) {
|
|
4333
|
-
return await this.#takeoutManager.startTakeoutSession(params);
|
|
4334
|
-
}
|
|
4335
4413
|
/**
|
|
4336
4414
|
* End a takeout session. User-only.
|
|
4337
4415
|
*
|
|
@@ -4350,26 +4428,37 @@ export class Client extends Composer {
|
|
|
4350
4428
|
async getLeftChannels(takeoutId, params) {
|
|
4351
4429
|
return await this.#takeoutManager.getLeftChannels(takeoutId, params);
|
|
4352
4430
|
}
|
|
4431
|
+
/**
|
|
4432
|
+
* Start a takeout session. User-only.
|
|
4433
|
+
*
|
|
4434
|
+
* @method to
|
|
4435
|
+
* @returns The identifier of the takeout session.
|
|
4436
|
+
*/
|
|
4437
|
+
async startTakeoutSession(params) {
|
|
4438
|
+
return await this.#takeoutManager.startTakeoutSession(params);
|
|
4439
|
+
}
|
|
4353
4440
|
//
|
|
4354
4441
|
// ========================= STICKER SETS ========================= //
|
|
4355
4442
|
//
|
|
4356
4443
|
/**
|
|
4357
|
-
*
|
|
4444
|
+
* Add a sticker to a sticker set.
|
|
4358
4445
|
*
|
|
4359
4446
|
* @method ss
|
|
4360
4447
|
* @param slug The slug of the sticker set or its link.
|
|
4448
|
+
* @param sticker The sticker to add.
|
|
4361
4449
|
*/
|
|
4362
|
-
async
|
|
4363
|
-
return await this.#stickerSetManager.
|
|
4450
|
+
async addStickerToStickerSet(slug, sticker, params) {
|
|
4451
|
+
return await this.#stickerSetManager.addStickerToStickerSet(slug, sticker, params);
|
|
4364
4452
|
}
|
|
4365
4453
|
/**
|
|
4366
|
-
*
|
|
4454
|
+
* Change the position of a sticker in its set.
|
|
4367
4455
|
*
|
|
4368
4456
|
* @method ss
|
|
4369
|
-
* @param
|
|
4457
|
+
* @param fileId The identifier of the sticker.
|
|
4458
|
+
* @param position The new position of the sticker.
|
|
4370
4459
|
*/
|
|
4371
|
-
async
|
|
4372
|
-
return await this.#stickerSetManager.
|
|
4460
|
+
async changeStickerPositionInStickerSet(fileId, position) {
|
|
4461
|
+
return await this.#stickerSetManager.changeStickerPositionInStickerSet(fileId, position);
|
|
4373
4462
|
}
|
|
4374
4463
|
/**
|
|
4375
4464
|
* Check the availability of a sticker set slug.
|
|
@@ -4381,16 +4470,6 @@ export class Client extends Composer {
|
|
|
4381
4470
|
async checkStickerSetSlug(slug) {
|
|
4382
4471
|
return await this.#stickerSetManager.checkStickerSetSlug(slug);
|
|
4383
4472
|
}
|
|
4384
|
-
/**
|
|
4385
|
-
* Suggest a sticker set slug from its title.
|
|
4386
|
-
*
|
|
4387
|
-
* @method ss
|
|
4388
|
-
* @param title A title of a sticker set.
|
|
4389
|
-
* @returns The suggested slug.
|
|
4390
|
-
*/
|
|
4391
|
-
async suggestStickerSetSlug(title) {
|
|
4392
|
-
return await this.#stickerSetManager.suggestStickerSetSlug(title);
|
|
4393
|
-
}
|
|
4394
4473
|
/**
|
|
4395
4474
|
* Create a sticker set.
|
|
4396
4475
|
*
|
|
@@ -4403,14 +4482,31 @@ export class Client extends Composer {
|
|
|
4403
4482
|
return await this.#stickerSetManager.createStickerSet(name, slug, stickers, params);
|
|
4404
4483
|
}
|
|
4405
4484
|
/**
|
|
4406
|
-
*
|
|
4485
|
+
* Delete a sticker set.
|
|
4407
4486
|
*
|
|
4408
4487
|
* @method ss
|
|
4409
4488
|
* @param slug The slug of the sticker set or its link.
|
|
4410
|
-
* @param sticker The sticker to add.
|
|
4411
4489
|
*/
|
|
4412
|
-
async
|
|
4413
|
-
return await this.#stickerSetManager.
|
|
4490
|
+
async deleteStickerSet(slug) {
|
|
4491
|
+
return await this.#stickerSetManager.deleteStickerSet(slug);
|
|
4492
|
+
}
|
|
4493
|
+
/**
|
|
4494
|
+
* Get a dice sticker set.
|
|
4495
|
+
*
|
|
4496
|
+
* @method ss
|
|
4497
|
+
* @param emoji The emoji of the dice.
|
|
4498
|
+
*/
|
|
4499
|
+
async getDiceStickerSet(emoji) {
|
|
4500
|
+
return await this.#stickerSetManager.getDiceStickerSet(emoji);
|
|
4501
|
+
}
|
|
4502
|
+
/**
|
|
4503
|
+
* Get a sticker set.
|
|
4504
|
+
*
|
|
4505
|
+
* @method ss
|
|
4506
|
+
* @param slug The slug of the sticker set or its link.
|
|
4507
|
+
*/
|
|
4508
|
+
async getStickerSet(slug) {
|
|
4509
|
+
return await this.#stickerSetManager.getStickerSet(slug);
|
|
4414
4510
|
}
|
|
4415
4511
|
/**
|
|
4416
4512
|
* Remove a sticker from its set.
|
|
@@ -4442,57 +4538,57 @@ export class Client extends Composer {
|
|
|
4442
4538
|
return await this.#stickerSetManager.replaceStickerInStickerSet(currentStickerFileId, newSticker, params);
|
|
4443
4539
|
}
|
|
4444
4540
|
/**
|
|
4445
|
-
*
|
|
4541
|
+
* Set a custom emoji as a sticker set's thumbnail.
|
|
4446
4542
|
*
|
|
4447
4543
|
* @method ss
|
|
4448
4544
|
* @param slug The slug of the sticker set or its link.
|
|
4545
|
+
* @param customEmojiId The identifier of the custom emoji to use as thumbnail.
|
|
4449
4546
|
*/
|
|
4450
|
-
async
|
|
4451
|
-
return await this.#stickerSetManager.
|
|
4547
|
+
async setCustomEmojiAsStickerSetThumbnail(slug, customEmojiId) {
|
|
4548
|
+
return await this.#stickerSetManager.setCustomEmojiAsStickerSetThumbnail(slug, customEmojiId);
|
|
4452
4549
|
}
|
|
4453
4550
|
/**
|
|
4454
|
-
* Set
|
|
4551
|
+
* Set a sticker set's thumbnail.
|
|
4455
4552
|
*
|
|
4456
4553
|
* @method ss
|
|
4457
4554
|
* @param slug The slug of the sticker set or its link.
|
|
4458
|
-
* @param
|
|
4459
|
-
*/
|
|
4460
|
-
async setStickerSetTitle(slug, title) {
|
|
4461
|
-
return await this.#stickerSetManager.setStickerSetTitle(slug, title);
|
|
4462
|
-
}
|
|
4463
|
-
/**
|
|
4464
|
-
* Change the position of a sticker in its set.
|
|
4465
|
-
*
|
|
4466
|
-
* @method ss
|
|
4467
|
-
* @param fileId The identifier of the sticker.
|
|
4468
|
-
* @param position The new position of the sticker.
|
|
4555
|
+
* @param thumbnail The new thumbnail of the sticker set.
|
|
4469
4556
|
*/
|
|
4470
|
-
async
|
|
4471
|
-
return await this.#stickerSetManager.
|
|
4557
|
+
async setStickerSetThumbnail(slug, thumbnail) {
|
|
4558
|
+
return await this.#stickerSetManager.setStickerSetThumbnail(slug, thumbnail);
|
|
4472
4559
|
}
|
|
4473
4560
|
/**
|
|
4474
|
-
* Set a sticker set
|
|
4561
|
+
* Set the title of a sticker set.
|
|
4475
4562
|
*
|
|
4476
4563
|
* @method ss
|
|
4477
4564
|
* @param slug The slug of the sticker set or its link.
|
|
4478
|
-
* @param
|
|
4565
|
+
* @param title The sticker set's new title.
|
|
4479
4566
|
*/
|
|
4480
|
-
async
|
|
4481
|
-
return await this.#stickerSetManager.
|
|
4567
|
+
async setStickerSetTitle(slug, title) {
|
|
4568
|
+
return await this.#stickerSetManager.setStickerSetTitle(slug, title);
|
|
4482
4569
|
}
|
|
4483
4570
|
/**
|
|
4484
|
-
*
|
|
4571
|
+
* Suggest a sticker set slug from its title.
|
|
4485
4572
|
*
|
|
4486
4573
|
* @method ss
|
|
4487
|
-
* @param
|
|
4488
|
-
* @
|
|
4574
|
+
* @param title A title of a sticker set.
|
|
4575
|
+
* @returns The suggested slug.
|
|
4489
4576
|
*/
|
|
4490
|
-
async
|
|
4491
|
-
return await this.#stickerSetManager.
|
|
4577
|
+
async suggestStickerSetSlug(title) {
|
|
4578
|
+
return await this.#stickerSetManager.suggestStickerSetSlug(title);
|
|
4492
4579
|
}
|
|
4493
4580
|
//
|
|
4494
4581
|
// ========================= MANAGED BOTS ========================= //
|
|
4495
4582
|
//
|
|
4583
|
+
/**
|
|
4584
|
+
* Set the access settings of a managed bot. Bot-only.
|
|
4585
|
+
*
|
|
4586
|
+
* @method mb
|
|
4587
|
+
* @param userId The identifier of the bot user.
|
|
4588
|
+
*/
|
|
4589
|
+
async getManagedBotAccessSettings(userId) {
|
|
4590
|
+
return await this.#managedBotManager.getManagedBotAccessSettings(userId);
|
|
4591
|
+
}
|
|
4496
4592
|
/**
|
|
4497
4593
|
* Get the token of a managed bot. Bot-only.
|
|
4498
4594
|
*
|
|
@@ -4523,15 +4619,6 @@ export class Client extends Composer {
|
|
|
4523
4619
|
async setManagedBotAccessSettings(userId, isAccessRestricted, params) {
|
|
4524
4620
|
return await this.#managedBotManager.setManagedBotAccessSettings(userId, isAccessRestricted, params);
|
|
4525
4621
|
}
|
|
4526
|
-
/**
|
|
4527
|
-
* Set the access settings of a managed bot. Bot-only.
|
|
4528
|
-
*
|
|
4529
|
-
* @method mb
|
|
4530
|
-
* @param userId The identifier of the bot user.
|
|
4531
|
-
*/
|
|
4532
|
-
async getManagedBotAccessSettings(userId) {
|
|
4533
|
-
return await this.#managedBotManager.getManagedBotAccessSettings(userId);
|
|
4534
|
-
}
|
|
4535
4622
|
//
|
|
4536
4623
|
// ========================= GUEST QUERIES ========================= //
|
|
4537
4624
|
//
|
|
@@ -4548,15 +4635,6 @@ export class Client extends Composer {
|
|
|
4548
4635
|
//
|
|
4549
4636
|
// ========================= SECRET CHATS ========================= //
|
|
4550
4637
|
//
|
|
4551
|
-
/**
|
|
4552
|
-
* Request a secret chat. User-only.
|
|
4553
|
-
*
|
|
4554
|
-
* @method sc
|
|
4555
|
-
* @param chatId The identifier of a chat.
|
|
4556
|
-
*/
|
|
4557
|
-
async requestSecretChat(chatId) {
|
|
4558
|
-
return await this.#secretChatManager.requestSecretChat(chatId);
|
|
4559
|
-
}
|
|
4560
4638
|
/**
|
|
4561
4639
|
* Accept a secret chat. User-only.
|
|
4562
4640
|
*
|
|
@@ -4576,38 +4654,42 @@ export class Client extends Composer {
|
|
|
4576
4654
|
return await this.#secretChatManager.endSecretChat(id, params);
|
|
4577
4655
|
}
|
|
4578
4656
|
/**
|
|
4579
|
-
*
|
|
4657
|
+
* Request a secret chat. User-only.
|
|
4658
|
+
*
|
|
4659
|
+
* @method sc
|
|
4660
|
+
* @param chatId The identifier of a chat.
|
|
4661
|
+
*/
|
|
4662
|
+
async requestSecretChat(chatId) {
|
|
4663
|
+
return await this.#secretChatManager.requestSecretChat(chatId);
|
|
4664
|
+
}
|
|
4665
|
+
/**
|
|
4666
|
+
* Send an animation to a secret chat. User-only.
|
|
4580
4667
|
*
|
|
4581
4668
|
* @method sc
|
|
4582
4669
|
* @param id The identifier of the secret chat.
|
|
4583
|
-
* @param
|
|
4670
|
+
* @param animation The animation to send.
|
|
4584
4671
|
*/
|
|
4585
|
-
async
|
|
4586
|
-
return await this.#secretChatManager.
|
|
4672
|
+
async sendSecretAnimation(id, animation, params) {
|
|
4673
|
+
return await this.#secretChatManager.sendSecretAnimation(id, animation, params);
|
|
4587
4674
|
}
|
|
4588
4675
|
/**
|
|
4589
|
-
* Send
|
|
4676
|
+
* Send an audio file to a secret chat. User-only.
|
|
4590
4677
|
*
|
|
4591
4678
|
* @method sc
|
|
4592
4679
|
* @param id The identifier of the secret chat.
|
|
4593
|
-
* @param
|
|
4594
|
-
* @param longitude The location's longitude.
|
|
4680
|
+
* @param audio The audio file to send.
|
|
4595
4681
|
*/
|
|
4596
|
-
async
|
|
4597
|
-
return await this.#secretChatManager.
|
|
4682
|
+
async sendSecretAudio(id, audio, params) {
|
|
4683
|
+
return await this.#secretChatManager.sendSecretAudio(id, audio, params);
|
|
4598
4684
|
}
|
|
4599
4685
|
/**
|
|
4600
|
-
* Send a
|
|
4686
|
+
* Send a cancel typing action to a secret chat. User-only.
|
|
4601
4687
|
*
|
|
4602
4688
|
* @method sc
|
|
4603
4689
|
* @param id The identifier of the secret chat.
|
|
4604
|
-
* @param latitude The latitude of the venue.
|
|
4605
|
-
* @param longitude The longitude of the venue.
|
|
4606
|
-
* @param title The title of the venue.
|
|
4607
|
-
* @param address The written address of the venue.
|
|
4608
4690
|
*/
|
|
4609
|
-
async
|
|
4610
|
-
return await this.#secretChatManager.
|
|
4691
|
+
async sendSecretCancelTypingAction(id) {
|
|
4692
|
+
return await this.#secretChatManager.sendSecretTypingAction(id);
|
|
4611
4693
|
}
|
|
4612
4694
|
/**
|
|
4613
4695
|
* Send a contact to a secret chat. User-only.
|
|
@@ -4630,6 +4712,27 @@ export class Client extends Composer {
|
|
|
4630
4712
|
async sendSecretDocument(id, document, params) {
|
|
4631
4713
|
return await this.#secretChatManager.sendSecretDocument(id, document, params);
|
|
4632
4714
|
}
|
|
4715
|
+
/**
|
|
4716
|
+
* Send a location to a secret chat. User-only.
|
|
4717
|
+
*
|
|
4718
|
+
* @method sc
|
|
4719
|
+
* @param id The identifier of the secret chat.
|
|
4720
|
+
* @param latitude The location's latitude.
|
|
4721
|
+
* @param longitude The location's longitude.
|
|
4722
|
+
*/
|
|
4723
|
+
async sendSecretLocation(id, latitude, longitude, params) {
|
|
4724
|
+
return await this.#secretChatManager.sendSecretLocation(id, latitude, longitude, params);
|
|
4725
|
+
}
|
|
4726
|
+
/**
|
|
4727
|
+
* Send a message to a secret chat. User-only.
|
|
4728
|
+
*
|
|
4729
|
+
* @method sc
|
|
4730
|
+
* @param id The identifier of the secret chat.
|
|
4731
|
+
* @param text The message's text.
|
|
4732
|
+
*/
|
|
4733
|
+
async sendSecretMessage(id, text, params) {
|
|
4734
|
+
return await this.#secretChatManager.sendSecretMessage(id, text, params);
|
|
4735
|
+
}
|
|
4633
4736
|
/**
|
|
4634
4737
|
* Send a photo to a secret chat. User-only.
|
|
4635
4738
|
*
|
|
@@ -4641,63 +4744,75 @@ export class Client extends Composer {
|
|
|
4641
4744
|
return await this.#secretChatManager.sendSecretPhoto(id, photo, params);
|
|
4642
4745
|
}
|
|
4643
4746
|
/**
|
|
4644
|
-
* Send a
|
|
4747
|
+
* Send a secret chat screenshot notification. User-only.
|
|
4645
4748
|
*
|
|
4646
4749
|
* @method sc
|
|
4647
4750
|
* @param id The identifier of the secret chat.
|
|
4648
|
-
* @param
|
|
4751
|
+
* @param messageIds Identifiers of messages.
|
|
4649
4752
|
*/
|
|
4650
|
-
async
|
|
4651
|
-
return await this.#secretChatManager.
|
|
4753
|
+
async sendSecretScreenshotNotification(id, messageIds) {
|
|
4754
|
+
return await this.#secretChatManager.sendSecretScreenshotNotification(id, messageIds);
|
|
4652
4755
|
}
|
|
4653
4756
|
/**
|
|
4654
|
-
* Send a
|
|
4757
|
+
* Send a sticker to a secret chat. User-only.
|
|
4655
4758
|
*
|
|
4656
4759
|
* @method sc
|
|
4657
4760
|
* @param id The identifier of the secret chat.
|
|
4658
|
-
* @param
|
|
4761
|
+
* @param sticker The sticker to send.
|
|
4659
4762
|
*/
|
|
4660
|
-
async
|
|
4661
|
-
return await this.#secretChatManager.
|
|
4763
|
+
async sendSecretSticker(id, sticker, params) {
|
|
4764
|
+
return await this.#secretChatManager.sendSecretSticker(id, sticker, params);
|
|
4662
4765
|
}
|
|
4663
4766
|
/**
|
|
4664
|
-
* Send
|
|
4767
|
+
* Send a typing action to a secret chat. User-only.
|
|
4665
4768
|
*
|
|
4666
4769
|
* @method sc
|
|
4667
4770
|
* @param id The identifier of the secret chat.
|
|
4668
|
-
* @param animation The animation to send.
|
|
4669
4771
|
*/
|
|
4670
|
-
async
|
|
4671
|
-
return await this.#secretChatManager.
|
|
4772
|
+
async sendSecretTypingAction(id) {
|
|
4773
|
+
return await this.#secretChatManager.sendSecretCancelTypingAction(id);
|
|
4672
4774
|
}
|
|
4673
4775
|
/**
|
|
4674
|
-
* Send
|
|
4776
|
+
* Send a venue to a secret chat. User-only.
|
|
4675
4777
|
*
|
|
4676
4778
|
* @method sc
|
|
4677
4779
|
* @param id The identifier of the secret chat.
|
|
4678
|
-
* @param
|
|
4780
|
+
* @param latitude The latitude of the venue.
|
|
4781
|
+
* @param longitude The longitude of the venue.
|
|
4782
|
+
* @param title The title of the venue.
|
|
4783
|
+
* @param address The written address of the venue.
|
|
4679
4784
|
*/
|
|
4680
|
-
async
|
|
4681
|
-
return await this.#secretChatManager.
|
|
4785
|
+
async sendSecretVenue(id, latitude, longitude, title, address, params) {
|
|
4786
|
+
return await this.#secretChatManager.sendSecretVenue(id, latitude, longitude, title, address, params);
|
|
4682
4787
|
}
|
|
4683
4788
|
/**
|
|
4684
|
-
* Send a
|
|
4789
|
+
* Send a video to a secret chat. User-only.
|
|
4685
4790
|
*
|
|
4686
4791
|
* @method sc
|
|
4687
4792
|
* @param id The identifier of the secret chat.
|
|
4688
|
-
* @param
|
|
4793
|
+
* @param video The video to send.
|
|
4689
4794
|
*/
|
|
4690
|
-
async
|
|
4691
|
-
return await this.#secretChatManager.
|
|
4795
|
+
async sendSecretVideo(id, video, params) {
|
|
4796
|
+
return await this.#secretChatManager.sendSecretVideo(id, video, params);
|
|
4692
4797
|
}
|
|
4693
4798
|
/**
|
|
4694
|
-
* Send a
|
|
4799
|
+
* Send a video note to a secret chat. User-only.
|
|
4695
4800
|
*
|
|
4696
4801
|
* @method sc
|
|
4697
4802
|
* @param id The identifier of the secret chat.
|
|
4698
|
-
* @param
|
|
4803
|
+
* @param videoNote The video note to send.
|
|
4699
4804
|
*/
|
|
4700
|
-
async
|
|
4701
|
-
return await this.#secretChatManager.
|
|
4805
|
+
async sendSecretVideoNote(id, videoNote, params) {
|
|
4806
|
+
return await this.#secretChatManager.sendSecretVideoNote(id, videoNote, params);
|
|
4807
|
+
}
|
|
4808
|
+
/**
|
|
4809
|
+
* Send a voice message to a secret chat. User-only.
|
|
4810
|
+
*
|
|
4811
|
+
* @method sc
|
|
4812
|
+
* @param id The identifier of the secret chat.
|
|
4813
|
+
* @param voice The voice message to send.
|
|
4814
|
+
*/
|
|
4815
|
+
async sendSecretVoice(id, voice, params) {
|
|
4816
|
+
return await this.#secretChatManager.sendSecretVoice(id, voice, params);
|
|
4702
4817
|
}
|
|
4703
4818
|
}
|