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