@mtkruto/node 0.190.0 → 0.191.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 +3 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +3 -0
- package/esm/client/1_client_generic.d.ts +1134 -1070
- 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 +3 -1
- package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
- package/esm/client/3_secret_chat_manager.js +75 -1
- package/esm/client/4_context.d.ts +7 -1
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +15 -0
- package/esm/client/6_client.d.ts +1135 -1073
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +1495 -1417
- package/esm/client/6_client_dispatcher.d.ts +1137 -1073
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +1459 -1385
- 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/1_chat_p.d.ts +1 -5
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_secret_chat_action.d.ts +30 -0
- package/esm/types/1_secret_chat_action.d.ts.map +1 -0
- package/esm/types/1_secret_chat_action.js +28 -0
- package/esm/types/3_connected_website.d.ts +35 -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 +1 -1
- package/esm/types/3_poll_voter_list.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/B_update.d.ts +16 -1
- package/esm/types/B_update.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +3 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +3 -0
- package/script/client/1_client_generic.d.ts +1134 -1070
- 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 +3 -1
- package/script/client/3_secret_chat_manager.d.ts.map +1 -1
- package/script/client/3_secret_chat_manager.js +74 -0
- package/script/client/4_context.d.ts +7 -1
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +15 -0
- package/script/client/6_client.d.ts +1135 -1073
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +1495 -1417
- package/script/client/6_client_dispatcher.d.ts +1137 -1073
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +1459 -1385
- 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/1_chat_p.d.ts +1 -5
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_secret_chat_action.d.ts +30 -0
- package/script/types/1_secret_chat_action.d.ts.map +1 -0
- package/script/types/1_secret_chat_action.js +31 -0
- package/script/types/3_connected_website.d.ts +35 -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 +1 -1
- package/script/types/3_poll_voter_list.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/B_update.d.ts +16 -1
- package/script/types/B_update.d.ts.map +1 -1
|
@@ -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
|
+
}
|
|
2333
|
+
/**
|
|
2334
|
+
* Send a text message.
|
|
2335
|
+
*
|
|
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.
|
|
2340
|
+
*/
|
|
2341
|
+
async sendMessage(chatId, text, params) {
|
|
2342
|
+
return await this.#messageManager.sendMessage(chatId, text, params);
|
|
2332
2343
|
}
|
|
2333
2344
|
/**
|
|
2334
|
-
*
|
|
2345
|
+
* Stream a drafted text message. Bot-only.
|
|
2335
2346
|
*
|
|
2336
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.
|
|
2337
2351
|
*/
|
|
2338
|
-
async
|
|
2339
|
-
|
|
2352
|
+
async sendMessageDraft(chatId, draftId, text, params) {
|
|
2353
|
+
await this.#messageManager.sendMessageDraft(chatId, draftId, text, params);
|
|
2340
2354
|
}
|
|
2341
2355
|
/**
|
|
2342
|
-
*
|
|
2356
|
+
* Send a photo.
|
|
2343
2357
|
*
|
|
2344
|
-
* @param chatId The identifier of a chat.
|
|
2345
|
-
* @param messageId The identifier of the message.
|
|
2346
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.
|
|
2347
2362
|
*/
|
|
2348
|
-
async
|
|
2349
|
-
return await this.#messageManager.
|
|
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,81 +2607,80 @@ 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
|
-
*
|
|
2633
|
+
* Add an option to a poll. User-only.
|
|
2591
2634
|
*
|
|
2592
2635
|
* @method pl
|
|
2593
2636
|
* @param chatId The identifier of the chat that includes the poll.
|
|
2594
2637
|
* @param messageId The identifier of the message that includes the poll.
|
|
2595
|
-
* @param
|
|
2638
|
+
* @param option The option to add.
|
|
2596
2639
|
*/
|
|
2597
|
-
async
|
|
2598
|
-
await this.#pollManager.
|
|
2640
|
+
async addPollOption(chatId, messageId, option) {
|
|
2641
|
+
await this.#pollManager.addPollOption(chatId, messageId, option);
|
|
2599
2642
|
}
|
|
2600
2643
|
/**
|
|
2601
|
-
*
|
|
2644
|
+
* Get poll voters. User-only.
|
|
2602
2645
|
*
|
|
2603
2646
|
* @method pl
|
|
2604
2647
|
* @param chatId The identifier of the chat that includes the poll.
|
|
2605
2648
|
* @param messageId The identifier of the message that includes the poll.
|
|
2606
2649
|
*/
|
|
2607
|
-
async
|
|
2608
|
-
await this.#pollManager.
|
|
2650
|
+
async getPollVoters(chatId, messageId, params) {
|
|
2651
|
+
return await this.#pollManager.getPollVoters(chatId, messageId, params);
|
|
2609
2652
|
}
|
|
2610
2653
|
/**
|
|
2611
|
-
*
|
|
2654
|
+
* Remove an option from a poll. User-only.
|
|
2612
2655
|
*
|
|
2613
2656
|
* @method pl
|
|
2614
2657
|
* @param chatId The identifier of the chat that includes the poll.
|
|
2615
2658
|
* @param messageId The identifier of the message that includes the poll.
|
|
2616
|
-
* @param
|
|
2659
|
+
* @param optionIndex The index of the option to remove.
|
|
2617
2660
|
*/
|
|
2618
|
-
async
|
|
2619
|
-
await this.#pollManager.
|
|
2661
|
+
async removePollOption(chatId, messageId, optionIndex) {
|
|
2662
|
+
await this.#pollManager.removePollOption(chatId, messageId, optionIndex);
|
|
2620
2663
|
}
|
|
2621
2664
|
/**
|
|
2622
|
-
*
|
|
2665
|
+
* Retract a vote. User-only.
|
|
2623
2666
|
*
|
|
2624
2667
|
* @method pl
|
|
2625
2668
|
* @param chatId The identifier of the chat that includes the poll.
|
|
2626
2669
|
* @param messageId The identifier of the message that includes the poll.
|
|
2627
|
-
* @param optionIndex The index of the option to remove.
|
|
2628
2670
|
*/
|
|
2629
|
-
async
|
|
2630
|
-
await this.#pollManager.
|
|
2671
|
+
async retractVote(chatId, messageId) {
|
|
2672
|
+
await this.#pollManager.retractVote(chatId, messageId);
|
|
2631
2673
|
}
|
|
2632
2674
|
/**
|
|
2633
|
-
*
|
|
2675
|
+
* Cast a vote. User-only.
|
|
2634
2676
|
*
|
|
2635
2677
|
* @method pl
|
|
2636
2678
|
* @param chatId The identifier of the chat that includes the poll.
|
|
2637
2679
|
* @param messageId The identifier of the message that includes the poll.
|
|
2680
|
+
* @param optionIndexes The indexes of the options to cast for.
|
|
2638
2681
|
*/
|
|
2639
|
-
async
|
|
2640
|
-
|
|
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,260 @@ 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.#
|
|
3172
|
-
}
|
|
3173
|
-
/**
|
|
3174
|
-
* Disable business bots in a private chat. User-only.
|
|
3175
|
-
*
|
|
3176
|
-
* @method ch
|
|
3177
|
-
* @param chatId The identifier of the private chat to disable business bots in.
|
|
3178
|
-
*/
|
|
3179
|
-
async disableBusinessBots(chatId) {
|
|
3180
|
-
await this.#chatListManager.disableBusinessBots(chatId);
|
|
3226
|
+
async getCreatedInviteLinks(chatId, params) {
|
|
3227
|
+
return await this.#chatManager.getCreatedInviteLinks(chatId, params);
|
|
3181
3228
|
}
|
|
3182
3229
|
/**
|
|
3183
|
-
*
|
|
3230
|
+
* Get discussion chat suggestions. User-only.
|
|
3184
3231
|
*
|
|
3185
3232
|
* @method ch
|
|
3186
|
-
* @param chatId The identifier of the private chat to enable business bots in.
|
|
3187
3233
|
*/
|
|
3188
|
-
async
|
|
3189
|
-
await this.#
|
|
3234
|
+
async getDiscussionChatSuggestions() {
|
|
3235
|
+
return await this.#chatManager.getDiscussionChatSuggestions();
|
|
3190
3236
|
}
|
|
3191
3237
|
/**
|
|
3192
|
-
*
|
|
3238
|
+
* Get chat history. User-only.
|
|
3193
3239
|
*
|
|
3194
3240
|
* @method ch
|
|
3195
|
-
* @param chatId The identifier of
|
|
3241
|
+
* @param chatId The identifier of a chat.
|
|
3196
3242
|
*/
|
|
3197
|
-
async
|
|
3198
|
-
await this.#
|
|
3243
|
+
async getHistory(chatId, params) {
|
|
3244
|
+
return await this.#messageManager.getHistory(chatId, params);
|
|
3199
3245
|
}
|
|
3200
3246
|
/**
|
|
3201
|
-
*
|
|
3247
|
+
* Get inactive chats. User-only.
|
|
3202
3248
|
*
|
|
3203
3249
|
* @method ch
|
|
3204
|
-
* @
|
|
3205
|
-
* @param duration New slow mode duration.
|
|
3250
|
+
* @returns A list of inactive chats the current user is a member of.
|
|
3206
3251
|
*/
|
|
3207
|
-
async
|
|
3208
|
-
await this.#
|
|
3252
|
+
async getInactiveChats() {
|
|
3253
|
+
return await this.#accountManager.getInactiveChats();
|
|
3209
3254
|
}
|
|
3210
3255
|
/**
|
|
3211
|
-
*
|
|
3256
|
+
* Get pending join requests in a chat. User-only.
|
|
3212
3257
|
*
|
|
3213
3258
|
* @method ch
|
|
3214
|
-
* @param chatId The identifier of a chat.
|
|
3215
|
-
* @param title The new title.
|
|
3259
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
3216
3260
|
*/
|
|
3217
|
-
async
|
|
3218
|
-
await this.#chatManager.
|
|
3261
|
+
async getJoinRequests(chatId, params) {
|
|
3262
|
+
return await this.#chatManager.getJoinRequests(chatId, params);
|
|
3219
3263
|
}
|
|
3220
3264
|
/**
|
|
3221
|
-
*
|
|
3265
|
+
* Get the count of online members in a chat. User-only.
|
|
3222
3266
|
*
|
|
3223
3267
|
* @method ch
|
|
3224
3268
|
* @param chatId The identifier of a chat.
|
|
3225
|
-
* @
|
|
3269
|
+
* @returns The count of online members in the chat.
|
|
3226
3270
|
*/
|
|
3227
|
-
async
|
|
3228
|
-
await this.#chatManager.
|
|
3271
|
+
async getOnlineCount(chatId) {
|
|
3272
|
+
return await this.#chatManager.getOnlineCount(chatId);
|
|
3229
3273
|
}
|
|
3230
3274
|
/**
|
|
3231
|
-
*
|
|
3275
|
+
* Get pinned chats from a chat list. User-only.
|
|
3232
3276
|
*
|
|
3233
3277
|
* @method ch
|
|
3234
|
-
* @param
|
|
3278
|
+
* @param from The chat list to get the pinned chats from. Defaults to main.
|
|
3235
3279
|
*/
|
|
3236
|
-
async
|
|
3237
|
-
await this.#
|
|
3280
|
+
async getPinnedChats(from) {
|
|
3281
|
+
return await this.#chatListManager.getPinnedChats(from);
|
|
3238
3282
|
}
|
|
3239
3283
|
/**
|
|
3240
|
-
*
|
|
3284
|
+
* Get recommended channels. User-only.
|
|
3241
3285
|
*
|
|
3242
3286
|
* @method ch
|
|
3243
|
-
* @
|
|
3287
|
+
* @returns A list of recommended channels.
|
|
3244
3288
|
*/
|
|
3245
|
-
async
|
|
3246
|
-
await this.#chatManager.
|
|
3289
|
+
async getRecommendedChannels() {
|
|
3290
|
+
return await this.#chatManager.getRecommendedChannels();
|
|
3247
3291
|
}
|
|
3248
3292
|
/**
|
|
3249
|
-
*
|
|
3293
|
+
* Get similar bots. User-only.
|
|
3250
3294
|
*
|
|
3251
3295
|
* @method ch
|
|
3252
|
-
* @param chatId The identifier of
|
|
3253
|
-
* @
|
|
3296
|
+
* @param chatId The identifier of a bot to get similar bots for.
|
|
3297
|
+
* @returns A list of similar bots.
|
|
3254
3298
|
*/
|
|
3255
|
-
async
|
|
3256
|
-
await this.#chatManager.
|
|
3299
|
+
async getSimilarBots(chatId) {
|
|
3300
|
+
return await this.#chatManager.getSimilarBots(chatId);
|
|
3257
3301
|
}
|
|
3258
3302
|
/**
|
|
3259
|
-
*
|
|
3303
|
+
* Get similar channels. User-only.
|
|
3260
3304
|
*
|
|
3261
3305
|
* @method ch
|
|
3262
|
-
* @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.
|
|
3263
3308
|
*/
|
|
3264
|
-
async
|
|
3265
|
-
await this.#chatManager.
|
|
3309
|
+
async getSimilarChannels(chatId) {
|
|
3310
|
+
return await this.#chatManager.getSimilarChannels(chatId);
|
|
3266
3311
|
}
|
|
3267
3312
|
/**
|
|
3268
|
-
*
|
|
3313
|
+
* Hide the general forum topic.
|
|
3269
3314
|
*
|
|
3270
3315
|
* @method ch
|
|
3271
|
-
* @param chatId The identifier of
|
|
3316
|
+
* @param chatId The identifier of a chat.
|
|
3272
3317
|
*/
|
|
3273
|
-
async
|
|
3274
|
-
await this.#
|
|
3318
|
+
async hideGeneralTopic(chatId) {
|
|
3319
|
+
await this.#forumManager.hideGeneralTopic(chatId);
|
|
3275
3320
|
}
|
|
3276
3321
|
/**
|
|
3277
|
-
*
|
|
3322
|
+
* Hide the member list of a group to non-admins. User-only.
|
|
3278
3323
|
*
|
|
3279
3324
|
* @method ch
|
|
3280
3325
|
* @param chatId The identifier of the group.
|
|
3281
3326
|
*/
|
|
3282
|
-
async
|
|
3283
|
-
await this.#chatManager.
|
|
3327
|
+
async hideMemberList(chatId) {
|
|
3328
|
+
await this.#chatManager.hideMemberList(chatId);
|
|
3284
3329
|
}
|
|
3285
3330
|
/**
|
|
3286
|
-
*
|
|
3331
|
+
* Join a chat. User-only.
|
|
3287
3332
|
*
|
|
3288
3333
|
* @method ch
|
|
3289
|
-
* @param chatId The identifier of
|
|
3334
|
+
* @param chatId The identifier of a chat.
|
|
3290
3335
|
*/
|
|
3291
|
-
async
|
|
3292
|
-
await this.#chatManager.
|
|
3336
|
+
async joinChat(chatId) {
|
|
3337
|
+
await this.#chatManager.joinChat(chatId);
|
|
3293
3338
|
}
|
|
3294
3339
|
/**
|
|
3295
|
-
*
|
|
3340
|
+
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
3296
3341
|
*
|
|
3297
3342
|
* @method ch
|
|
3298
|
-
* @param chatId The identifier of
|
|
3343
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
3344
|
+
* @param memberId The identifier of the member.
|
|
3299
3345
|
*/
|
|
3300
|
-
async
|
|
3301
|
-
await this.#chatManager.
|
|
3346
|
+
async kickChatMember(chatId, memberId) {
|
|
3347
|
+
await this.#chatManager.banChatMember(chatId, memberId);
|
|
3348
|
+
await this.#chatManager.unbanChatMember(chatId, memberId);
|
|
3302
3349
|
}
|
|
3303
3350
|
/**
|
|
3304
|
-
*
|
|
3351
|
+
* Leave a chat.
|
|
3305
3352
|
*
|
|
3306
3353
|
* @method ch
|
|
3307
3354
|
* @param chatId The identifier of a chat.
|
|
3308
3355
|
*/
|
|
3309
|
-
async
|
|
3310
|
-
await this.#chatManager.
|
|
3356
|
+
async leaveChat(chatId) {
|
|
3357
|
+
await this.#chatManager.leaveChat(chatId);
|
|
3311
3358
|
}
|
|
3312
3359
|
/**
|
|
3313
|
-
*
|
|
3360
|
+
* Mark all mentions in a chat as read. User-only.
|
|
3314
3361
|
*
|
|
3315
3362
|
* @method ch
|
|
3363
|
+
* @param chatId The identifier of the chat.
|
|
3316
3364
|
*/
|
|
3317
|
-
async
|
|
3318
|
-
return await this.#chatManager.
|
|
3365
|
+
async markAllMentionsAsRead(chatId, params) {
|
|
3366
|
+
return await this.#chatManager.markAllMentionsAsRead(chatId, params);
|
|
3319
3367
|
}
|
|
3320
3368
|
/**
|
|
3321
|
-
*
|
|
3369
|
+
* Mark a chat as read. User-only.
|
|
3322
3370
|
*
|
|
3323
3371
|
* @method ch
|
|
3324
|
-
* @param chatId The identifier of a
|
|
3325
|
-
* @param discussionChatId The identifier of a chat to use as discussion for the channel.
|
|
3372
|
+
* @param chatId The identifier of a chat.
|
|
3326
3373
|
*/
|
|
3327
|
-
async
|
|
3328
|
-
await this.#chatManager.
|
|
3374
|
+
async markChatAsRead(chatId) {
|
|
3375
|
+
return await this.#chatManager.markChatAsRead(chatId);
|
|
3329
3376
|
}
|
|
3330
3377
|
/**
|
|
3331
|
-
*
|
|
3378
|
+
* Mark a chat as unread. User-only.
|
|
3332
3379
|
*
|
|
3333
3380
|
* @method ch
|
|
3334
3381
|
* @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
3382
|
*/
|
|
3338
|
-
async
|
|
3339
|
-
await this.#chatManager.
|
|
3383
|
+
async markChatAsUnread(chatId) {
|
|
3384
|
+
return await this.#chatManager.markChatAsUnread(chatId);
|
|
3340
3385
|
}
|
|
3341
3386
|
/**
|
|
3342
|
-
*
|
|
3387
|
+
* Open a chat.
|
|
3343
3388
|
*
|
|
3344
3389
|
* @method ch
|
|
3345
|
-
* @param chatId The identifier of a chat.
|
|
3346
|
-
* @param title The title of the topic.
|
|
3347
|
-
* @returns The created topic.
|
|
3390
|
+
* @param chatId The identifier of a chat to open.
|
|
3348
3391
|
*/
|
|
3349
|
-
async
|
|
3350
|
-
|
|
3392
|
+
async openChat(chatId, params) {
|
|
3393
|
+
await this.#updateManager.openChat(chatId, params);
|
|
3351
3394
|
}
|
|
3352
3395
|
/**
|
|
3353
|
-
*
|
|
3396
|
+
* Pin a forum topic.
|
|
3354
3397
|
*
|
|
3355
3398
|
* @method ch
|
|
3356
3399
|
* @param chatId The identifier of a chat.
|
|
3357
3400
|
* @param topicId The identifier of the topic.
|
|
3358
|
-
* @param title The new title of the topic.
|
|
3359
|
-
* @returns The new topic.
|
|
3360
3401
|
*/
|
|
3361
|
-
async
|
|
3362
|
-
|
|
3402
|
+
async pinTopic(chatId, topicId) {
|
|
3403
|
+
await this.#forumManager.pinTopic(chatId, topicId);
|
|
3363
3404
|
}
|
|
3364
3405
|
/**
|
|
3365
|
-
*
|
|
3406
|
+
* Promote a chat member.
|
|
3366
3407
|
*
|
|
3367
3408
|
* @method ch
|
|
3368
3409
|
* @param chatId The identifier of a chat.
|
|
3410
|
+
* @param userId The identifier of the user to promote.
|
|
3369
3411
|
*/
|
|
3370
|
-
async
|
|
3371
|
-
await this.#
|
|
3412
|
+
async promoteChatMember(chatId, userId, params) {
|
|
3413
|
+
await this.#chatManager.promoteChatMember(chatId, userId, params);
|
|
3372
3414
|
}
|
|
3373
3415
|
/**
|
|
3374
|
-
*
|
|
3416
|
+
* Reopen a forum topic.
|
|
3375
3417
|
*
|
|
3376
3418
|
* @method ch
|
|
3377
3419
|
* @param chatId The identifier of a chat.
|
|
3420
|
+
* @param topicId The identifier of the topic.
|
|
3378
3421
|
*/
|
|
3379
|
-
async
|
|
3380
|
-
await this.#forumManager.
|
|
3422
|
+
async reopenTopic(chatId, topicId) {
|
|
3423
|
+
await this.#forumManager.reopenTopic(chatId, topicId);
|
|
3381
3424
|
}
|
|
3382
3425
|
/**
|
|
3383
|
-
*
|
|
3426
|
+
* Report a chat. User-only.
|
|
3384
3427
|
*
|
|
3385
3428
|
* @method ch
|
|
3386
|
-
* @param chatId The identifier of a chat.
|
|
3387
|
-
* @param
|
|
3429
|
+
* @param chatId The identifier of a chat to report.
|
|
3430
|
+
* @param reason The reason of the report.
|
|
3388
3431
|
*/
|
|
3389
|
-
async
|
|
3390
|
-
await this.#
|
|
3432
|
+
async reportChat(chatId, reason, params) {
|
|
3433
|
+
return await this.#chatManager.reportChat(chatId, reason, params);
|
|
3391
3434
|
}
|
|
3392
3435
|
/**
|
|
3393
|
-
*
|
|
3436
|
+
* Set a chat's available reactions. User-only.
|
|
3394
3437
|
*
|
|
3395
3438
|
* @method ch
|
|
3396
3439
|
* @param chatId The identifier of a chat.
|
|
3397
|
-
* @param
|
|
3440
|
+
* @param availableReactions The new available reactions.
|
|
3398
3441
|
*/
|
|
3399
|
-
async
|
|
3400
|
-
await this.#
|
|
3442
|
+
async setAvailableReactions(chatId, availableReactions) {
|
|
3443
|
+
await this.#chatManager.setAvailableReactions(chatId, availableReactions);
|
|
3401
3444
|
}
|
|
3402
3445
|
/**
|
|
3403
|
-
*
|
|
3446
|
+
* Set the number of boosts required to circumvent a chat's default restrictions. User-only.
|
|
3404
3447
|
*
|
|
3405
3448
|
* @method ch
|
|
3406
3449
|
* @param chatId The identifier of a chat.
|
|
3407
|
-
* @param
|
|
3450
|
+
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
3408
3451
|
*/
|
|
3409
|
-
async
|
|
3410
|
-
await this.#
|
|
3452
|
+
async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
|
|
3453
|
+
await this.#chatManager.setBoostsRequiredToCircumventRestrictions(chatId, boosts);
|
|
3411
3454
|
}
|
|
3412
3455
|
/**
|
|
3413
|
-
*
|
|
3456
|
+
* Change the description of a chat.
|
|
3414
3457
|
*
|
|
3415
3458
|
* @method ch
|
|
3416
3459
|
* @param chatId The identifier of a chat.
|
|
3417
|
-
* @param
|
|
3460
|
+
* @param description The new description.
|
|
3418
3461
|
*/
|
|
3419
|
-
async
|
|
3420
|
-
await this.#
|
|
3462
|
+
async setChatDescription(chatId, description) {
|
|
3463
|
+
await this.#chatManager.setChatDescription(chatId, description);
|
|
3421
3464
|
}
|
|
3422
3465
|
/**
|
|
3423
|
-
*
|
|
3466
|
+
* Set the rights of a chat member.
|
|
3424
3467
|
*
|
|
3425
3468
|
* @method ch
|
|
3426
|
-
* @param chatId The identifier of a chat.
|
|
3427
|
-
* @param
|
|
3469
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
3470
|
+
* @param memberId The identifier of the member.
|
|
3428
3471
|
*/
|
|
3429
|
-
async
|
|
3430
|
-
await this.#chatManager.
|
|
3472
|
+
async setChatMemberRights(chatId, memberId, params) {
|
|
3473
|
+
await this.#chatManager.setChatMemberRights(chatId, memberId, params);
|
|
3431
3474
|
}
|
|
3432
3475
|
/**
|
|
3433
3476
|
* Change the tag of a chat member.
|
|
@@ -3440,130 +3483,154 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3440
3483
|
await this.#chatManager.setChatMemberTag(chatId, userId, params);
|
|
3441
3484
|
}
|
|
3442
3485
|
/**
|
|
3443
|
-
*
|
|
3486
|
+
* Set a chat's photo.
|
|
3444
3487
|
*
|
|
3445
3488
|
* @method ch
|
|
3446
3489
|
* @param chatId The identifier of a chat.
|
|
3490
|
+
* @param photo A photo to set as the chat's photo.
|
|
3447
3491
|
*/
|
|
3448
|
-
async
|
|
3449
|
-
await this.#chatManager.
|
|
3492
|
+
async setChatPhoto(chatId, photo, params) {
|
|
3493
|
+
await this.#chatManager.setChatPhoto(chatId, photo, params);
|
|
3450
3494
|
}
|
|
3451
3495
|
/**
|
|
3452
|
-
*
|
|
3496
|
+
* Set a chat's sticker set.
|
|
3453
3497
|
*
|
|
3454
3498
|
* @method ch
|
|
3455
|
-
* @param chatId The identifier of a chat.
|
|
3499
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
3500
|
+
* @param setName The name of the set.
|
|
3456
3501
|
*/
|
|
3457
|
-
async
|
|
3458
|
-
await this.#
|
|
3502
|
+
async setChatStickerSet(chatId, setName) {
|
|
3503
|
+
await this.#messageManager.setChatStickerSet(chatId, setName);
|
|
3459
3504
|
}
|
|
3460
3505
|
/**
|
|
3461
|
-
*
|
|
3506
|
+
* Change the title of a chat.
|
|
3462
3507
|
*
|
|
3463
3508
|
* @method ch
|
|
3464
|
-
* @
|
|
3509
|
+
* @param chatId The identifier of a chat.
|
|
3510
|
+
* @param title The new title.
|
|
3465
3511
|
*/
|
|
3466
|
-
async
|
|
3467
|
-
|
|
3512
|
+
async setChatTitle(chatId, title) {
|
|
3513
|
+
await this.#chatManager.setChatTitle(chatId, title);
|
|
3468
3514
|
}
|
|
3469
3515
|
/**
|
|
3470
|
-
*
|
|
3516
|
+
* Set the default send as chat of a chat. User-only.
|
|
3471
3517
|
*
|
|
3472
3518
|
* @method ch
|
|
3473
|
-
* @param chatId The identifier of a
|
|
3474
|
-
* @
|
|
3519
|
+
* @param chatId The identifier of a chat.
|
|
3520
|
+
* @param sendAs The new default send as chat.
|
|
3475
3521
|
*/
|
|
3476
|
-
async
|
|
3477
|
-
|
|
3522
|
+
async setDefaultSendAs(chatId, sendAs) {
|
|
3523
|
+
await this.#chatManager.setDefaultSendAs(chatId, sendAs);
|
|
3478
3524
|
}
|
|
3479
3525
|
/**
|
|
3480
|
-
*
|
|
3526
|
+
* Set a channel's discussion chat. User-only.
|
|
3481
3527
|
*
|
|
3482
3528
|
* @method ch
|
|
3483
|
-
* @param chatId The identifier of a
|
|
3484
|
-
* @
|
|
3529
|
+
* @param chatId The identifier of a channel.
|
|
3530
|
+
* @param discussionChatId The identifier of a chat to use as discussion for the channel.
|
|
3485
3531
|
*/
|
|
3486
|
-
async
|
|
3487
|
-
|
|
3532
|
+
async setDiscussionChat(chatId, discussionChatId) {
|
|
3533
|
+
await this.#chatManager.setDiscussionChat(chatId, discussionChatId);
|
|
3488
3534
|
}
|
|
3489
3535
|
/**
|
|
3490
|
-
*
|
|
3536
|
+
* Set the time to live of the messages of a chat. User-only.
|
|
3491
3537
|
*
|
|
3492
3538
|
* @method ch
|
|
3493
3539
|
* @param chatId The identifier of a chat.
|
|
3494
|
-
* @
|
|
3540
|
+
* @param messageTtl The time to live of the messages in seconds.
|
|
3495
3541
|
*/
|
|
3496
|
-
async
|
|
3497
|
-
|
|
3542
|
+
async setMessageTtl(chatId, messageTtl) {
|
|
3543
|
+
await this.#chatListManager.setMessageTtl(chatId, messageTtl);
|
|
3498
3544
|
}
|
|
3499
3545
|
/**
|
|
3500
|
-
*
|
|
3546
|
+
* Change slow mode in a group. User-only.
|
|
3547
|
+
*
|
|
3548
|
+
* @method ch
|
|
3549
|
+
* @param chatId The identifier of the group to change slow mode in.
|
|
3550
|
+
* @param duration New slow mode duration.
|
|
3551
|
+
*/
|
|
3552
|
+
async setSlowMode(chatId, duration) {
|
|
3553
|
+
await this.#chatManager.setSlowMode(chatId, duration);
|
|
3554
|
+
}
|
|
3555
|
+
/**
|
|
3556
|
+
* Show the general forum topic.
|
|
3501
3557
|
*
|
|
3502
3558
|
* @method ch
|
|
3503
3559
|
* @param chatId The identifier of a chat.
|
|
3504
3560
|
*/
|
|
3505
|
-
async
|
|
3506
|
-
await this.#
|
|
3561
|
+
async showGeneralTopic(chatId) {
|
|
3562
|
+
await this.#forumManager.showGeneralTopic(chatId);
|
|
3563
|
+
}
|
|
3564
|
+
/**
|
|
3565
|
+
* Show the member list of a group to non-admins. User-only.
|
|
3566
|
+
*
|
|
3567
|
+
* @method ch
|
|
3568
|
+
* @param chatId The identifier of the group.
|
|
3569
|
+
*/
|
|
3570
|
+
async showMemberList(chatId) {
|
|
3571
|
+
await this.#chatManager.showMemberList(chatId);
|
|
3507
3572
|
}
|
|
3508
3573
|
/**
|
|
3509
|
-
*
|
|
3574
|
+
* Transfer the ownership of a chat. User-only.
|
|
3510
3575
|
*
|
|
3511
3576
|
* @method ch
|
|
3512
3577
|
* @param chatId The identifier of a chat.
|
|
3578
|
+
* @param userId The identifier of the new owner.
|
|
3579
|
+
* @param password The password of the current account.
|
|
3513
3580
|
*/
|
|
3514
|
-
async
|
|
3515
|
-
await this.#chatManager.
|
|
3581
|
+
async transferChatOwnership(chatId, userId, password) {
|
|
3582
|
+
await this.#chatManager.transferChatOwnership(chatId, userId, password);
|
|
3516
3583
|
}
|
|
3517
3584
|
/**
|
|
3518
|
-
*
|
|
3585
|
+
* Unarchive a single chat. User-only.
|
|
3519
3586
|
*
|
|
3520
3587
|
* @method ch
|
|
3521
3588
|
* @param chatId The identifier of a chat.
|
|
3522
|
-
* @param sendAs The new default send as chat.
|
|
3523
3589
|
*/
|
|
3524
|
-
async
|
|
3525
|
-
await this.#
|
|
3590
|
+
async unarchiveChat(chatId) {
|
|
3591
|
+
await this.#chatListManager.unarchiveChat(chatId);
|
|
3526
3592
|
}
|
|
3527
3593
|
/**
|
|
3528
|
-
*
|
|
3594
|
+
* Unarchive multiple chats. User-only.
|
|
3529
3595
|
*
|
|
3530
3596
|
* @method ch
|
|
3531
|
-
* @param
|
|
3532
|
-
* @param reason The reason of the report.
|
|
3597
|
+
* @param chatIds The identifiers of the chats to unarchive.
|
|
3533
3598
|
*/
|
|
3534
|
-
async
|
|
3535
|
-
|
|
3599
|
+
async unarchiveChats(chatIds) {
|
|
3600
|
+
await this.#chatListManager.unarchiveChats(chatIds);
|
|
3536
3601
|
}
|
|
3537
3602
|
/**
|
|
3538
|
-
*
|
|
3603
|
+
* Unban a member from a chat.
|
|
3539
3604
|
*
|
|
3540
3605
|
* @method ch
|
|
3541
|
-
* @param chatId The identifier of a chat.
|
|
3606
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
3607
|
+
* @param memberId The identifier of the member.
|
|
3542
3608
|
*/
|
|
3543
|
-
async
|
|
3544
|
-
|
|
3609
|
+
async unbanChatMember(chatId, memberId) {
|
|
3610
|
+
await this.#chatManager.unbanChatMember(chatId, memberId);
|
|
3545
3611
|
}
|
|
3546
3612
|
/**
|
|
3547
|
-
*
|
|
3613
|
+
* Unpin a forum topic.
|
|
3548
3614
|
*
|
|
3549
3615
|
* @method ch
|
|
3550
3616
|
* @param chatId The identifier of a chat.
|
|
3617
|
+
* @param topicId The identifier of the topic.
|
|
3551
3618
|
*/
|
|
3552
|
-
async
|
|
3553
|
-
|
|
3619
|
+
async unpinTopic(chatId, topicId) {
|
|
3620
|
+
await this.#forumManager.unpinTopic(chatId, topicId);
|
|
3554
3621
|
}
|
|
3622
|
+
//
|
|
3623
|
+
// ========================= CALLBACK QUERIES ========================= //
|
|
3624
|
+
//
|
|
3555
3625
|
/**
|
|
3556
|
-
*
|
|
3626
|
+
* Answer a callback query. Bot-only.
|
|
3557
3627
|
*
|
|
3558
|
-
* @method
|
|
3559
|
-
* @param
|
|
3628
|
+
* @method cq
|
|
3629
|
+
* @param id ID of the callback query to answer.
|
|
3560
3630
|
*/
|
|
3561
|
-
async
|
|
3562
|
-
|
|
3631
|
+
async answerCallbackQuery(id, params) {
|
|
3632
|
+
await this.#callbackQueryManager.answerCallbackQuery(id, params);
|
|
3563
3633
|
}
|
|
3564
|
-
//
|
|
3565
|
-
// ========================= CALLBACK QUERIES ========================= //
|
|
3566
|
-
//
|
|
3567
3634
|
/**
|
|
3568
3635
|
* Send a callback query. User-only.
|
|
3569
3636
|
*
|
|
@@ -3577,18 +3644,19 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3577
3644
|
async sendCallbackQuery(botId, messageId, question) {
|
|
3578
3645
|
return await this.#callbackQueryManager.sendCallbackQuery(botId, messageId, question);
|
|
3579
3646
|
}
|
|
3647
|
+
//
|
|
3648
|
+
// ========================= INLINE QUERIES ========================= //
|
|
3649
|
+
//
|
|
3580
3650
|
/**
|
|
3581
|
-
* Answer
|
|
3651
|
+
* Answer an inline query. Bot-only.
|
|
3582
3652
|
*
|
|
3583
|
-
* @method
|
|
3584
|
-
* @param id
|
|
3653
|
+
* @method iq
|
|
3654
|
+
* @param id The identifier of the inline query to answer.
|
|
3655
|
+
* @param results The results to answer with.
|
|
3585
3656
|
*/
|
|
3586
|
-
async
|
|
3587
|
-
await this.#
|
|
3657
|
+
async answerInlineQuery(id, results, params) {
|
|
3658
|
+
await this.#inlineQueryManager.answerInlineQuery(id, results, params);
|
|
3588
3659
|
}
|
|
3589
|
-
//
|
|
3590
|
-
// ========================= INLINE QUERIES ========================= //
|
|
3591
|
-
//
|
|
3592
3660
|
/**
|
|
3593
3661
|
* Send an inline query. User-only.
|
|
3594
3662
|
*
|
|
@@ -3601,42 +3669,17 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3601
3669
|
async sendInlineQuery(botId, chatId, params) {
|
|
3602
3670
|
return await this.#inlineQueryManager.sendInlineQuery(botId, chatId, params);
|
|
3603
3671
|
}
|
|
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
3672
|
//
|
|
3615
3673
|
// ========================= BOTS ========================= //
|
|
3616
3674
|
//
|
|
3617
3675
|
/**
|
|
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.
|
|
3676
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
3635
3677
|
*
|
|
3636
3678
|
* @method bo
|
|
3679
|
+
* @returns The current bot's commands in the specified language.
|
|
3637
3680
|
*/
|
|
3638
|
-
async
|
|
3639
|
-
await this.#botInfoManager.
|
|
3681
|
+
async getMyCommands(params) {
|
|
3682
|
+
return await this.#botInfoManager.getMyCommands(params);
|
|
3640
3683
|
}
|
|
3641
3684
|
/**
|
|
3642
3685
|
* Get the bot's description in the given language. Bot-only.
|
|
@@ -3675,28 +3718,32 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3675
3718
|
await this.#botInfoManager.setMyCommands(commands, params);
|
|
3676
3719
|
}
|
|
3677
3720
|
/**
|
|
3678
|
-
*
|
|
3721
|
+
* Set the bot's description in the given language. Bot-only.
|
|
3679
3722
|
*
|
|
3680
3723
|
* @method bo
|
|
3681
|
-
* @returns The current bot's commands in the specified language.
|
|
3682
3724
|
*/
|
|
3683
|
-
async
|
|
3684
|
-
|
|
3725
|
+
async setMyDescription(params) {
|
|
3726
|
+
await this.#botInfoManager.setMyDescription(params);
|
|
3685
3727
|
}
|
|
3686
|
-
//
|
|
3687
|
-
// ========================= REACTIONS ========================= //
|
|
3688
|
-
//
|
|
3689
3728
|
/**
|
|
3690
|
-
*
|
|
3729
|
+
* Set the bot's name in the given language. Bot-only.
|
|
3691
3730
|
*
|
|
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.
|
|
3731
|
+
* @method bo
|
|
3696
3732
|
*/
|
|
3697
|
-
async
|
|
3698
|
-
await this.#
|
|
3733
|
+
async setMyName(params) {
|
|
3734
|
+
await this.#botInfoManager.setMyName(params);
|
|
3699
3735
|
}
|
|
3736
|
+
/**
|
|
3737
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
3738
|
+
*
|
|
3739
|
+
* @method bo
|
|
3740
|
+
*/
|
|
3741
|
+
async setMyShortDescription(params) {
|
|
3742
|
+
await this.#botInfoManager.setMyShortDescription(params);
|
|
3743
|
+
}
|
|
3744
|
+
//
|
|
3745
|
+
// ========================= REACTIONS ========================= //
|
|
3746
|
+
//
|
|
3700
3747
|
/**
|
|
3701
3748
|
* Make a reaction to a message.
|
|
3702
3749
|
*
|
|
@@ -3708,6 +3755,14 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3708
3755
|
async addReaction(chatId, messageId, reaction, params) {
|
|
3709
3756
|
await this.#messageManager.addReaction(chatId, messageId, reaction, params);
|
|
3710
3757
|
}
|
|
3758
|
+
/**
|
|
3759
|
+
* Clear recent reactions. User-only.
|
|
3760
|
+
*
|
|
3761
|
+
* @method re
|
|
3762
|
+
*/
|
|
3763
|
+
async clearRecentReactions() {
|
|
3764
|
+
return await this.#messageManager.clearRecentReactions();
|
|
3765
|
+
}
|
|
3711
3766
|
/**
|
|
3712
3767
|
* Undo a reaction made to a message.
|
|
3713
3768
|
*
|
|
@@ -3741,50 +3796,48 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3741
3796
|
return await this.#messageManager.removeUserReactions(chatId, userId);
|
|
3742
3797
|
}
|
|
3743
3798
|
/**
|
|
3744
|
-
*
|
|
3799
|
+
* Change reactions made to a message.
|
|
3745
3800
|
*
|
|
3746
3801
|
* @method re
|
|
3802
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
3803
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
3804
|
+
* @param reactions The new reactions.
|
|
3747
3805
|
*/
|
|
3748
|
-
async
|
|
3749
|
-
|
|
3806
|
+
async setReactions(chatId, messageId, reactions, params) {
|
|
3807
|
+
await this.#messageManager.setReactions(chatId, messageId, reactions, params);
|
|
3750
3808
|
}
|
|
3751
3809
|
//
|
|
3752
3810
|
// ========================= STORIES ========================= //
|
|
3753
3811
|
//
|
|
3754
3812
|
/**
|
|
3755
|
-
*
|
|
3813
|
+
* Add multiple stories to highlights. User-only.
|
|
3756
3814
|
*
|
|
3757
3815
|
* @method st
|
|
3758
|
-
* @param
|
|
3759
|
-
* @
|
|
3816
|
+
* @param chatId The identifier of a chat.
|
|
3817
|
+
* @param storyIds The identifiers of the stories to add to highlights.
|
|
3760
3818
|
*/
|
|
3761
|
-
async
|
|
3762
|
-
|
|
3819
|
+
async addStoriesToHighlights(chatId, storyIds) {
|
|
3820
|
+
await this.#storyManager.addStoriesToHighlights(chatId, storyIds);
|
|
3763
3821
|
}
|
|
3764
3822
|
/**
|
|
3765
|
-
*
|
|
3823
|
+
* Add a single story to highlights. User-only.
|
|
3766
3824
|
*
|
|
3767
3825
|
* @method st
|
|
3768
3826
|
* @param chatId The identifier of a chat.
|
|
3769
|
-
* @param
|
|
3770
|
-
* @returns The retrieved stories.
|
|
3827
|
+
* @param storyId The identifier of the story to add to highlights.
|
|
3771
3828
|
*/
|
|
3772
|
-
async
|
|
3773
|
-
|
|
3774
|
-
return [];
|
|
3775
|
-
}
|
|
3776
|
-
return await this.#storyManager.getStories(chatId, storyIds);
|
|
3829
|
+
async addStoryToHighlights(chatId, storyId) {
|
|
3830
|
+
await this.#storyManager.addStoryToHighlights(chatId, storyId);
|
|
3777
3831
|
}
|
|
3778
3832
|
/**
|
|
3779
|
-
*
|
|
3833
|
+
* Create a story. User-only.
|
|
3780
3834
|
*
|
|
3781
3835
|
* @method st
|
|
3782
|
-
* @param
|
|
3783
|
-
* @
|
|
3784
|
-
* @returns The retrieved story.
|
|
3836
|
+
* @param content The content of the story.
|
|
3837
|
+
* @returns The created story.
|
|
3785
3838
|
*/
|
|
3786
|
-
async
|
|
3787
|
-
return await this.#storyManager.
|
|
3839
|
+
async createStory(chatId, content, params) {
|
|
3840
|
+
return await this.#storyManager.createStory(chatId, content, params);
|
|
3788
3841
|
}
|
|
3789
3842
|
/**
|
|
3790
3843
|
* Delete multiple stories. User-only.
|
|
@@ -3807,24 +3860,29 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3807
3860
|
await this.#storyManager.deleteStory(chatId, storyId);
|
|
3808
3861
|
}
|
|
3809
3862
|
/**
|
|
3810
|
-
*
|
|
3863
|
+
* Retrieve multiple stories. User-only.
|
|
3811
3864
|
*
|
|
3812
3865
|
* @method st
|
|
3813
3866
|
* @param chatId The identifier of a chat.
|
|
3814
|
-
* @param storyIds The identifiers of the stories to
|
|
3867
|
+
* @param storyIds The identifiers of the stories to retrieve.
|
|
3868
|
+
* @returns The retrieved stories.
|
|
3815
3869
|
*/
|
|
3816
|
-
async
|
|
3817
|
-
|
|
3870
|
+
async getStories(chatId, storyIds) {
|
|
3871
|
+
if (!storyIds.length) {
|
|
3872
|
+
return [];
|
|
3873
|
+
}
|
|
3874
|
+
return await this.#storyManager.getStories(chatId, storyIds);
|
|
3818
3875
|
}
|
|
3819
3876
|
/**
|
|
3820
|
-
*
|
|
3877
|
+
* Retrieve a single story. User-only.
|
|
3821
3878
|
*
|
|
3822
3879
|
* @method st
|
|
3823
3880
|
* @param chatId The identifier of a chat.
|
|
3824
|
-
* @param storyId The identifier of the story to
|
|
3881
|
+
* @param storyId The identifier of the story to retrieve.
|
|
3882
|
+
* @returns The retrieved story.
|
|
3825
3883
|
*/
|
|
3826
|
-
async
|
|
3827
|
-
await this.#storyManager.
|
|
3884
|
+
async getStory(chatId, storyId) {
|
|
3885
|
+
return await this.#storyManager.getStory(chatId, storyId);
|
|
3828
3886
|
}
|
|
3829
3887
|
/**
|
|
3830
3888
|
* Remove multiple stories from highlights. User-only.
|
|
@@ -3846,16 +3904,6 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3846
3904
|
async removeStoryFromHighlights(chatId, storyId) {
|
|
3847
3905
|
await this.#storyManager.removeStoryFromHighlights(chatId, storyId);
|
|
3848
3906
|
}
|
|
3849
|
-
/**
|
|
3850
|
-
* Report a single story. User-only.
|
|
3851
|
-
*
|
|
3852
|
-
* @method st
|
|
3853
|
-
* @param chatId The identifier of a chat that posted the story.
|
|
3854
|
-
* @param storyId The identifier of the story to report.
|
|
3855
|
-
*/
|
|
3856
|
-
async reportStory(chatId, storyId, params) {
|
|
3857
|
-
return await this.#storyManager.reportStory(chatId, storyId, params);
|
|
3858
|
-
}
|
|
3859
3907
|
/**
|
|
3860
3908
|
* Report multiple stories. User-only.
|
|
3861
3909
|
*
|
|
@@ -3866,52 +3914,70 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3866
3914
|
async reportStories(chatId, storyIds, params) {
|
|
3867
3915
|
return await this.#storyManager.reportStories(chatId, storyIds, params);
|
|
3868
3916
|
}
|
|
3917
|
+
/**
|
|
3918
|
+
* Report a single story. User-only.
|
|
3919
|
+
*
|
|
3920
|
+
* @method st
|
|
3921
|
+
* @param chatId The identifier of a chat that posted the story.
|
|
3922
|
+
* @param storyId The identifier of the story to report.
|
|
3923
|
+
*/
|
|
3924
|
+
async reportStory(chatId, storyId, params) {
|
|
3925
|
+
return await this.#storyManager.reportStory(chatId, storyId, params);
|
|
3926
|
+
}
|
|
3869
3927
|
//
|
|
3870
3928
|
// ========================= STORY ALBUMS ========================= //
|
|
3871
3929
|
//
|
|
3872
3930
|
/**
|
|
3873
|
-
*
|
|
3931
|
+
* Add multiple stories to an album. User-only.
|
|
3874
3932
|
*
|
|
3875
3933
|
* @method sa
|
|
3876
|
-
* @param chatId The identifier of the chat
|
|
3877
|
-
* @param
|
|
3878
|
-
* @param storyIds The
|
|
3934
|
+
* @param chatId The identifier of the chat including the album.
|
|
3935
|
+
* @param albumId The identifier of an album.
|
|
3936
|
+
* @param storyIds The identifiers of the stories to add.
|
|
3879
3937
|
*/
|
|
3880
|
-
async
|
|
3881
|
-
return await this.#storyAlbumManager.
|
|
3938
|
+
async addStoriesToAlbum(chatId, albumId, storyIds) {
|
|
3939
|
+
return await this.#storyAlbumManager.addStoriesToAlbum(chatId, albumId, storyIds);
|
|
3882
3940
|
}
|
|
3883
3941
|
/**
|
|
3884
|
-
*
|
|
3942
|
+
* Add a single story to an album. User-only.
|
|
3885
3943
|
*
|
|
3886
3944
|
* @method sa
|
|
3887
3945
|
* @param chatId The identifier of the chat including the album.
|
|
3888
|
-
* @param albumId The identifier of
|
|
3889
|
-
* @param
|
|
3946
|
+
* @param albumId The identifier of an album.
|
|
3947
|
+
* @param storyId The identifier of the story to add.
|
|
3948
|
+
*/
|
|
3949
|
+
async addStoryToAlbum(chatId, albumId, storyId) {
|
|
3950
|
+
return await this.#storyAlbumManager.addStoryToAlbum(chatId, albumId, storyId);
|
|
3951
|
+
}
|
|
3952
|
+
/**
|
|
3953
|
+
* Create a story album. User-only.
|
|
3954
|
+
*
|
|
3955
|
+
* @method sa
|
|
3956
|
+
* @param chatId The identifier of the chat to create the album in.
|
|
3957
|
+
* @param name The name of the album.
|
|
3958
|
+
* @param storyIds The initial stories inside the album.
|
|
3890
3959
|
*/
|
|
3891
|
-
async
|
|
3892
|
-
return await this.#storyAlbumManager.
|
|
3960
|
+
async createStoryAlbum(chatId, name, storyIds) {
|
|
3961
|
+
return await this.#storyAlbumManager.createStoryAlbum(chatId, name, storyIds);
|
|
3893
3962
|
}
|
|
3894
3963
|
/**
|
|
3895
|
-
*
|
|
3964
|
+
* Get stories inside an album. User-only.
|
|
3896
3965
|
*
|
|
3897
3966
|
* @method sa
|
|
3898
|
-
* @param chatId The identifier of the chat including
|
|
3967
|
+
* @param chatId The identifier of the chat including albums.
|
|
3899
3968
|
* @param albumId The identifier of an album.
|
|
3900
|
-
* @param storyIds The identifiers of the stories to add.
|
|
3901
3969
|
*/
|
|
3902
|
-
async
|
|
3903
|
-
return await this.#storyAlbumManager.
|
|
3970
|
+
async getStoriesInAlbum(chatId, albumId) {
|
|
3971
|
+
return await this.#storyAlbumManager.getStoriesInAlbum(chatId, albumId);
|
|
3904
3972
|
}
|
|
3905
3973
|
/**
|
|
3906
|
-
*
|
|
3974
|
+
* Get story albums in a chat. User-only.
|
|
3907
3975
|
*
|
|
3908
3976
|
* @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.
|
|
3977
|
+
* @param chatId The identifier of a chat including albums.
|
|
3912
3978
|
*/
|
|
3913
|
-
async
|
|
3914
|
-
return await this.#storyAlbumManager.
|
|
3979
|
+
async getStoryAlbums(chatId) {
|
|
3980
|
+
return await this.#storyAlbumManager.getStoryAlbums(chatId);
|
|
3915
3981
|
}
|
|
3916
3982
|
/**
|
|
3917
3983
|
* Remove multiple stories from an album. User-only.
|
|
@@ -3947,23 +4013,15 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3947
4013
|
return await this.#storyAlbumManager.reorderStoriesInAlbum(chatId, albumId, storyIds);
|
|
3948
4014
|
}
|
|
3949
4015
|
/**
|
|
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.
|
|
4016
|
+
* Set the name of a story album. User-only.
|
|
3960
4017
|
*
|
|
3961
4018
|
* @method sa
|
|
3962
|
-
* @param chatId The identifier of the chat including
|
|
3963
|
-
* @param albumId The identifier of
|
|
4019
|
+
* @param chatId The identifier of the chat including the album.
|
|
4020
|
+
* @param albumId The identifier of the album to rename.
|
|
4021
|
+
* @param name The new name of the album.
|
|
3964
4022
|
*/
|
|
3965
|
-
async
|
|
3966
|
-
return await this.#storyAlbumManager.
|
|
4023
|
+
async setStoryAlbumName(chatId, albumId, name) {
|
|
4024
|
+
return await this.#storyAlbumManager.setStoryAlbumName(chatId, albumId, name);
|
|
3967
4025
|
}
|
|
3968
4026
|
//
|
|
3969
4027
|
// ========================= NETWORK STATISTICS ========================= //
|
|
@@ -3980,85 +4038,85 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
3980
4038
|
// ========================= VIDEO CHATS ========================= //
|
|
3981
4039
|
//
|
|
3982
4040
|
/**
|
|
3983
|
-
*
|
|
4041
|
+
* Download a live stream segment. User-only.
|
|
3984
4042
|
*
|
|
3985
4043
|
* @method vc
|
|
3986
|
-
* @param
|
|
3987
|
-
* @
|
|
4044
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
4045
|
+
* @param channelId Stream channel ID.
|
|
4046
|
+
* @param scale Stream channel scale.
|
|
4047
|
+
* @param timestamp Millisecond timestamp of the chunk to download.
|
|
3988
4048
|
*/
|
|
3989
|
-
async
|
|
3990
|
-
return await this.#videoChatManager.
|
|
4049
|
+
async downloadLiveStreamSegment(id, channelId, scale, timestamp, params) {
|
|
4050
|
+
return await this.#videoChatManager.downloadLiveStreamSegment(id, channelId, scale, timestamp, params);
|
|
3991
4051
|
}
|
|
3992
4052
|
/**
|
|
3993
|
-
*
|
|
4053
|
+
* Get live stream channels. User-only.
|
|
3994
4054
|
*
|
|
3995
4055
|
* @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.
|
|
4056
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
3999
4057
|
*/
|
|
4000
|
-
async
|
|
4001
|
-
return await this.#videoChatManager.
|
|
4058
|
+
async getLiveStreamChannels(id) {
|
|
4059
|
+
return await this.#videoChatManager.getLiveStreamChannels(id);
|
|
4002
4060
|
}
|
|
4003
4061
|
/**
|
|
4004
|
-
*
|
|
4062
|
+
* Get a video chat. User-only.
|
|
4005
4063
|
*
|
|
4006
4064
|
* @method vc
|
|
4007
4065
|
* @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.
|
|
4066
|
+
* @cache
|
|
4010
4067
|
*/
|
|
4011
|
-
async
|
|
4012
|
-
return await this.#videoChatManager.
|
|
4068
|
+
async getVideoChat(id) {
|
|
4069
|
+
return await this.#videoChatManager.getVideoChat(id);
|
|
4013
4070
|
}
|
|
4014
4071
|
/**
|
|
4015
|
-
*
|
|
4072
|
+
* Join a live stream. User-only.
|
|
4016
4073
|
*
|
|
4017
4074
|
* @method vc
|
|
4018
4075
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
4019
4076
|
*/
|
|
4020
|
-
async
|
|
4021
|
-
await this.#videoChatManager.
|
|
4077
|
+
async joinLiveStream(id) {
|
|
4078
|
+
await this.#videoChatManager.joinLiveStream(id);
|
|
4022
4079
|
}
|
|
4023
4080
|
/**
|
|
4024
|
-
* Join a
|
|
4081
|
+
* Join a video chat. User-only.
|
|
4025
4082
|
*
|
|
4026
4083
|
* @method vc
|
|
4027
4084
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
4085
|
+
* @param params_ WebRTC connection parameters.
|
|
4086
|
+
* @returns Parameters to be passed to the used WebRTC library.
|
|
4028
4087
|
*/
|
|
4029
|
-
async
|
|
4030
|
-
await this.#videoChatManager.
|
|
4088
|
+
async joinVideoChat(id, params_, params) {
|
|
4089
|
+
return await this.#videoChatManager.joinVideoChat(id, params_, params);
|
|
4031
4090
|
}
|
|
4032
4091
|
/**
|
|
4033
|
-
*
|
|
4092
|
+
* Leave a video chat. User-only.
|
|
4034
4093
|
*
|
|
4035
4094
|
* @method vc
|
|
4036
4095
|
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
4037
|
-
* @cache
|
|
4038
4096
|
*/
|
|
4039
|
-
async
|
|
4040
|
-
|
|
4097
|
+
async leaveVideoChat(id) {
|
|
4098
|
+
await this.#videoChatManager.leaveVideoChat(id);
|
|
4041
4099
|
}
|
|
4042
4100
|
/**
|
|
4043
|
-
*
|
|
4101
|
+
* Schedule a video chat. User-only.
|
|
4044
4102
|
*
|
|
4045
4103
|
* @method vc
|
|
4046
|
-
* @param
|
|
4104
|
+
* @param chatId The identifier of a chat to schedule the video chat in.
|
|
4105
|
+
* @param startAt A point in time in the future when the video chat will be started.
|
|
4106
|
+
* @returns The scheduled video chat.
|
|
4047
4107
|
*/
|
|
4048
|
-
async
|
|
4049
|
-
return await this.#videoChatManager.
|
|
4108
|
+
async scheduleVideoChat(chatId, startAt, params) {
|
|
4109
|
+
return await this.#videoChatManager.scheduleVideoChat(chatId, startAt, params);
|
|
4050
4110
|
}
|
|
4051
4111
|
/**
|
|
4052
|
-
*
|
|
4112
|
+
* Start a video chat. User-only.
|
|
4053
4113
|
*
|
|
4054
4114
|
* @method vc
|
|
4055
|
-
* @param
|
|
4056
|
-
* @
|
|
4057
|
-
* @param scale Stream channel scale.
|
|
4058
|
-
* @param timestamp Millisecond timestamp of the chunk to download.
|
|
4115
|
+
* @param chatId The identifier of a chat to start the video chat in.
|
|
4116
|
+
* @returns The started video chat.
|
|
4059
4117
|
*/
|
|
4060
|
-
async
|
|
4061
|
-
return await this.#videoChatManager.
|
|
4118
|
+
async startVideoChat(chatId, params) {
|
|
4119
|
+
return await this.#videoChatManager.startVideoChat(chatId, params);
|
|
4062
4120
|
}
|
|
4063
4121
|
//
|
|
4064
4122
|
// ========================= PAYMENTS ========================= //
|
|
@@ -4074,23 +4132,22 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4074
4132
|
await this.#paymentManager.answerPreCheckoutQuery(preCheckoutQueryId, ok, params);
|
|
4075
4133
|
}
|
|
4076
4134
|
/**
|
|
4077
|
-
*
|
|
4135
|
+
* Get the star balance of a chat.
|
|
4078
4136
|
*
|
|
4079
4137
|
* @method pa
|
|
4080
|
-
* @param
|
|
4081
|
-
* @param telegramPaymentChargeId The identifier of the charge.
|
|
4138
|
+
* @param chatId The identifier of the chat to get the star balance for.
|
|
4082
4139
|
*/
|
|
4083
|
-
async
|
|
4084
|
-
await this.#paymentManager.
|
|
4140
|
+
async getStarBalance(chatId) {
|
|
4141
|
+
return await this.#paymentManager.getStarBalance(chatId);
|
|
4085
4142
|
}
|
|
4086
4143
|
/**
|
|
4087
|
-
* Get
|
|
4144
|
+
* Get star transactions.
|
|
4088
4145
|
*
|
|
4089
4146
|
* @method pa
|
|
4090
|
-
* @param chatId The identifier of the chat to get
|
|
4147
|
+
* @param chatId The identifier of the chat to get star transactions for.
|
|
4091
4148
|
*/
|
|
4092
|
-
async
|
|
4093
|
-
return await this.#paymentManager.
|
|
4149
|
+
async getStarTransactions(chatId, params) {
|
|
4150
|
+
return await this.#paymentManager.getStarTransactions(chatId, params);
|
|
4094
4151
|
}
|
|
4095
4152
|
/**
|
|
4096
4153
|
* Get the TON balance of a chat.
|
|
@@ -4102,52 +4159,53 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4102
4159
|
return await this.#paymentManager.getTonBalance(chatId);
|
|
4103
4160
|
}
|
|
4104
4161
|
/**
|
|
4105
|
-
*
|
|
4162
|
+
* Refund a star payment. Bot-only.
|
|
4106
4163
|
*
|
|
4107
4164
|
* @method pa
|
|
4108
|
-
* @param
|
|
4165
|
+
* @param userId The identifier of the user that was charged.
|
|
4166
|
+
* @param telegramPaymentChargeId The identifier of the charge.
|
|
4109
4167
|
*/
|
|
4110
|
-
async
|
|
4111
|
-
|
|
4168
|
+
async refundStarPayment(userId, telegramPaymentChargeId) {
|
|
4169
|
+
await this.#paymentManager.refundStarPayment(userId, telegramPaymentChargeId);
|
|
4112
4170
|
}
|
|
4113
4171
|
//
|
|
4114
4172
|
// ========================= CONTACTS ========================= //
|
|
4115
4173
|
//
|
|
4116
4174
|
/**
|
|
4117
|
-
*
|
|
4175
|
+
* Add a contact. User-only.
|
|
4118
4176
|
*
|
|
4119
4177
|
* @method co
|
|
4178
|
+
* @param userId The identifier of the user to add as contact.
|
|
4179
|
+
* @param firstName The contact's first name.
|
|
4120
4180
|
*/
|
|
4121
|
-
async
|
|
4122
|
-
|
|
4181
|
+
async addContact(userId, firstName, params) {
|
|
4182
|
+
await this.#contactManager.addContact(userId, firstName, params);
|
|
4123
4183
|
}
|
|
4124
4184
|
/**
|
|
4125
|
-
* Delete
|
|
4185
|
+
* Delete a single contact. User-only.
|
|
4126
4186
|
*
|
|
4127
4187
|
* @method co
|
|
4128
|
-
* @param
|
|
4188
|
+
* @param userId The identifier of the contact to delete.
|
|
4129
4189
|
*/
|
|
4130
|
-
async
|
|
4131
|
-
await this.#contactManager.
|
|
4190
|
+
async deleteContact(userId) {
|
|
4191
|
+
await this.#contactManager.deleteContact(userId);
|
|
4132
4192
|
}
|
|
4133
4193
|
/**
|
|
4134
|
-
* Delete
|
|
4194
|
+
* Delete multiple contacts. User-only.
|
|
4135
4195
|
*
|
|
4136
4196
|
* @method co
|
|
4137
|
-
* @param
|
|
4197
|
+
* @param userIds The identifiers of contacts to delete.
|
|
4138
4198
|
*/
|
|
4139
|
-
async
|
|
4140
|
-
await this.#contactManager.
|
|
4199
|
+
async deleteContacts(userIds) {
|
|
4200
|
+
await this.#contactManager.deleteContacts(userIds);
|
|
4141
4201
|
}
|
|
4142
4202
|
/**
|
|
4143
|
-
*
|
|
4203
|
+
* Get contacts. User-only.
|
|
4144
4204
|
*
|
|
4145
4205
|
* @method co
|
|
4146
|
-
* @param userId The identifier of the user to add as contact.
|
|
4147
|
-
* @param firstName The contact's first name.
|
|
4148
4206
|
*/
|
|
4149
|
-
async
|
|
4150
|
-
await this.#contactManager.
|
|
4207
|
+
async getContacts() {
|
|
4208
|
+
return await this.#contactManager.getContacts();
|
|
4151
4209
|
}
|
|
4152
4210
|
/**
|
|
4153
4211
|
* Set a contact note.
|
|
@@ -4174,12 +4232,13 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4174
4232
|
// ========================= GIFTS ========================= //
|
|
4175
4233
|
//
|
|
4176
4234
|
/**
|
|
4177
|
-
*
|
|
4235
|
+
* Craft gifts.
|
|
4178
4236
|
*
|
|
4179
4237
|
* @method gf
|
|
4238
|
+
* @param gifts The gifts to craft.
|
|
4180
4239
|
*/
|
|
4181
|
-
async
|
|
4182
|
-
|
|
4240
|
+
async craftGifts(gifts) {
|
|
4241
|
+
await this.#giftManager.craftGifts(gifts);
|
|
4183
4242
|
}
|
|
4184
4243
|
/**
|
|
4185
4244
|
* Get gifts claimed by a user or a channel. User-only.
|
|
@@ -4191,73 +4250,74 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4191
4250
|
return await this.#giftManager.getClaimedGifts(chatId, params);
|
|
4192
4251
|
}
|
|
4193
4252
|
/**
|
|
4194
|
-
*
|
|
4253
|
+
* Get a gift using its slug.
|
|
4195
4254
|
*
|
|
4196
4255
|
* @method gf
|
|
4197
|
-
* @param
|
|
4198
|
-
* @param giftId The identifier of the gift to send.
|
|
4256
|
+
* @param slug The slug of a gift.
|
|
4199
4257
|
*/
|
|
4200
|
-
async
|
|
4201
|
-
await this.#giftManager.
|
|
4258
|
+
async getGift(slug) {
|
|
4259
|
+
return await this.#giftManager.getGift(slug);
|
|
4202
4260
|
}
|
|
4203
4261
|
/**
|
|
4204
|
-
*
|
|
4262
|
+
* Get available gifts.
|
|
4205
4263
|
*
|
|
4206
4264
|
* @method gf
|
|
4207
|
-
* @param gift The gift to sell.
|
|
4208
4265
|
*/
|
|
4209
|
-
async
|
|
4210
|
-
await this.#giftManager.
|
|
4266
|
+
async getGifts() {
|
|
4267
|
+
return await this.#giftManager.getGifts();
|
|
4211
4268
|
}
|
|
4212
4269
|
/**
|
|
4213
|
-
*
|
|
4270
|
+
* Gift a Telegram Premium subscription. Bot-only.
|
|
4214
4271
|
*
|
|
4215
4272
|
* @method gf
|
|
4216
|
-
* @param
|
|
4273
|
+
* @param userId The identifier of a user to gift the Telegram Premium subscription to.
|
|
4274
|
+
* @param duration The duration of the subscription.
|
|
4217
4275
|
*/
|
|
4218
|
-
async
|
|
4219
|
-
await this.#giftManager.
|
|
4276
|
+
async giftPremiumSubscription(userId, duration, params) {
|
|
4277
|
+
return await this.#giftManager.giftPremiumSubscription(userId, duration, params);
|
|
4220
4278
|
}
|
|
4221
4279
|
/**
|
|
4222
|
-
*
|
|
4280
|
+
* Sell a gift.
|
|
4223
4281
|
*
|
|
4224
4282
|
* @method gf
|
|
4225
|
-
* @param
|
|
4283
|
+
* @param gift The gift to sell.
|
|
4226
4284
|
*/
|
|
4227
|
-
async
|
|
4228
|
-
|
|
4285
|
+
async sellGift(gift) {
|
|
4286
|
+
await this.#giftManager.sellGift(gift);
|
|
4229
4287
|
}
|
|
4230
4288
|
/**
|
|
4231
|
-
*
|
|
4289
|
+
* Send a gift.
|
|
4232
4290
|
*
|
|
4233
4291
|
* @method gf
|
|
4234
|
-
* @param chatId The identifier of a
|
|
4235
|
-
* @param
|
|
4292
|
+
* @param chatId The identifier of a user or a channel to send the gift to.
|
|
4293
|
+
* @param giftId The identifier of the gift to send.
|
|
4236
4294
|
*/
|
|
4237
|
-
async
|
|
4238
|
-
|
|
4295
|
+
async sendGift(chatId, giftId, params) {
|
|
4296
|
+
await this.#giftManager.sendGift(chatId, giftId, params);
|
|
4239
4297
|
}
|
|
4240
4298
|
/**
|
|
4241
|
-
*
|
|
4299
|
+
* Transfer a gift. User-only.
|
|
4242
4300
|
*
|
|
4243
4301
|
* @method gf
|
|
4244
|
-
* @param
|
|
4245
|
-
* @param
|
|
4302
|
+
* @param chatId The identifier of a chat to transfer the gift to.
|
|
4303
|
+
* @param gift The gift to transfer.
|
|
4246
4304
|
*/
|
|
4247
|
-
async
|
|
4248
|
-
return await this.#giftManager.
|
|
4305
|
+
async transferGift(chatId, gift) {
|
|
4306
|
+
return await this.#giftManager.transferGift(chatId, gift);
|
|
4249
4307
|
}
|
|
4250
4308
|
//
|
|
4251
4309
|
// ========================= GIFT COLLECTIONS ========================= //
|
|
4252
4310
|
//
|
|
4253
4311
|
/**
|
|
4254
|
-
*
|
|
4312
|
+
* Add gifts to a gift collection. User-only.
|
|
4255
4313
|
*
|
|
4256
4314
|
* @method gc
|
|
4257
|
-
* @param chatId The identifier of
|
|
4315
|
+
* @param chatId The identifier of the chat that includes the gift collection.
|
|
4316
|
+
* @param collectionId The identifier of a gift collection.
|
|
4317
|
+
* @param gifts The gifts to add to the collection.
|
|
4258
4318
|
*/
|
|
4259
|
-
async
|
|
4260
|
-
return await this.#giftCollectionManager.
|
|
4319
|
+
async addGiftsToCollection(chatId, collectionId, gifts) {
|
|
4320
|
+
return await this.#giftCollectionManager.addGiftsToCollection(chatId, collectionId, gifts);
|
|
4261
4321
|
}
|
|
4262
4322
|
/**
|
|
4263
4323
|
* Create a gift collection. User-only.
|
|
@@ -4271,26 +4331,23 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4271
4331
|
return await this.#giftCollectionManager.createGiftCollection(chatId, name, gifts);
|
|
4272
4332
|
}
|
|
4273
4333
|
/**
|
|
4274
|
-
*
|
|
4334
|
+
* Delete a gift collection. User-only.
|
|
4275
4335
|
*
|
|
4276
4336
|
* @method gc
|
|
4277
4337
|
* @param chatId The identifier of the chat that includes the gift collection.
|
|
4278
4338
|
* @param collectionId The identifier of a gift collection.
|
|
4279
|
-
* @param name The gift collection's new name.
|
|
4280
4339
|
*/
|
|
4281
|
-
async
|
|
4282
|
-
return await this.#giftCollectionManager.
|
|
4340
|
+
async deleteGiftCollection(chatId, collectionId) {
|
|
4341
|
+
return await this.#giftCollectionManager.deleteGiftCollection(chatId, collectionId);
|
|
4283
4342
|
}
|
|
4284
4343
|
/**
|
|
4285
|
-
*
|
|
4344
|
+
* Get gift collections of a chat. User-only.
|
|
4286
4345
|
*
|
|
4287
4346
|
* @method gc
|
|
4288
|
-
* @param chatId The identifier of
|
|
4289
|
-
* @param collectionId The identifier of a gift collection.
|
|
4290
|
-
* @param gifts The gifts to add to the collection.
|
|
4347
|
+
* @param chatId The identifier of a chat to get gift collections for.
|
|
4291
4348
|
*/
|
|
4292
|
-
async
|
|
4293
|
-
return await this.#giftCollectionManager.
|
|
4349
|
+
async getGiftCollections(chatId) {
|
|
4350
|
+
return await this.#giftCollectionManager.getGiftCollections(chatId);
|
|
4294
4351
|
}
|
|
4295
4352
|
/**
|
|
4296
4353
|
* Remove gifts from a gift collection. User-only.
|
|
@@ -4315,27 +4372,19 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4315
4372
|
return await this.#giftCollectionManager.reorderGiftsInCollection(chatId, collectionId, gifts);
|
|
4316
4373
|
}
|
|
4317
4374
|
/**
|
|
4318
|
-
*
|
|
4375
|
+
* Set the name of a gift collection. User-only.
|
|
4319
4376
|
*
|
|
4320
4377
|
* @method gc
|
|
4321
4378
|
* @param chatId The identifier of the chat that includes the gift collection.
|
|
4322
4379
|
* @param collectionId The identifier of a gift collection.
|
|
4380
|
+
* @param name The gift collection's new name.
|
|
4323
4381
|
*/
|
|
4324
|
-
async
|
|
4325
|
-
return await this.#giftCollectionManager.
|
|
4382
|
+
async setGiftCollectionName(chatId, collectionId, name) {
|
|
4383
|
+
return await this.#giftCollectionManager.setGiftCollectionName(chatId, collectionId, name);
|
|
4326
4384
|
}
|
|
4327
4385
|
//
|
|
4328
4386
|
// ========================= TAKEOUTS ========================= //
|
|
4329
4387
|
//
|
|
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
4388
|
/**
|
|
4340
4389
|
* End a takeout session. User-only.
|
|
4341
4390
|
*
|
|
@@ -4354,26 +4403,37 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4354
4403
|
async getLeftChannels(takeoutId, params) {
|
|
4355
4404
|
return await this.#takeoutManager.getLeftChannels(takeoutId, params);
|
|
4356
4405
|
}
|
|
4406
|
+
/**
|
|
4407
|
+
* Start a takeout session. User-only.
|
|
4408
|
+
*
|
|
4409
|
+
* @method to
|
|
4410
|
+
* @returns The identifier of the takeout session.
|
|
4411
|
+
*/
|
|
4412
|
+
async startTakeoutSession(params) {
|
|
4413
|
+
return await this.#takeoutManager.startTakeoutSession(params);
|
|
4414
|
+
}
|
|
4357
4415
|
//
|
|
4358
4416
|
// ========================= STICKER SETS ========================= //
|
|
4359
4417
|
//
|
|
4360
4418
|
/**
|
|
4361
|
-
*
|
|
4419
|
+
* Add a sticker to a sticker set.
|
|
4362
4420
|
*
|
|
4363
4421
|
* @method ss
|
|
4364
4422
|
* @param slug The slug of the sticker set or its link.
|
|
4423
|
+
* @param sticker The sticker to add.
|
|
4365
4424
|
*/
|
|
4366
|
-
async
|
|
4367
|
-
return await this.#stickerSetManager.
|
|
4425
|
+
async addStickerToStickerSet(slug, sticker, params) {
|
|
4426
|
+
return await this.#stickerSetManager.addStickerToStickerSet(slug, sticker, params);
|
|
4368
4427
|
}
|
|
4369
4428
|
/**
|
|
4370
|
-
*
|
|
4429
|
+
* Change the position of a sticker in its set.
|
|
4371
4430
|
*
|
|
4372
4431
|
* @method ss
|
|
4373
|
-
* @param
|
|
4432
|
+
* @param fileId The identifier of the sticker.
|
|
4433
|
+
* @param position The new position of the sticker.
|
|
4374
4434
|
*/
|
|
4375
|
-
async
|
|
4376
|
-
return await this.#stickerSetManager.
|
|
4435
|
+
async changeStickerPositionInStickerSet(fileId, position) {
|
|
4436
|
+
return await this.#stickerSetManager.changeStickerPositionInStickerSet(fileId, position);
|
|
4377
4437
|
}
|
|
4378
4438
|
/**
|
|
4379
4439
|
* Check the availability of a sticker set slug.
|
|
@@ -4385,16 +4445,6 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4385
4445
|
async checkStickerSetSlug(slug) {
|
|
4386
4446
|
return await this.#stickerSetManager.checkStickerSetSlug(slug);
|
|
4387
4447
|
}
|
|
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
4448
|
/**
|
|
4399
4449
|
* Create a sticker set.
|
|
4400
4450
|
*
|
|
@@ -4407,14 +4457,31 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4407
4457
|
return await this.#stickerSetManager.createStickerSet(name, slug, stickers, params);
|
|
4408
4458
|
}
|
|
4409
4459
|
/**
|
|
4410
|
-
*
|
|
4460
|
+
* Delete a sticker set.
|
|
4411
4461
|
*
|
|
4412
4462
|
* @method ss
|
|
4413
4463
|
* @param slug The slug of the sticker set or its link.
|
|
4414
|
-
* @param sticker The sticker to add.
|
|
4415
4464
|
*/
|
|
4416
|
-
async
|
|
4417
|
-
return await this.#stickerSetManager.
|
|
4465
|
+
async deleteStickerSet(slug) {
|
|
4466
|
+
return await this.#stickerSetManager.deleteStickerSet(slug);
|
|
4467
|
+
}
|
|
4468
|
+
/**
|
|
4469
|
+
* Get a dice sticker set.
|
|
4470
|
+
*
|
|
4471
|
+
* @method ss
|
|
4472
|
+
* @param emoji The emoji of the dice.
|
|
4473
|
+
*/
|
|
4474
|
+
async getDiceStickerSet(emoji) {
|
|
4475
|
+
return await this.#stickerSetManager.getDiceStickerSet(emoji);
|
|
4476
|
+
}
|
|
4477
|
+
/**
|
|
4478
|
+
* Get a sticker set.
|
|
4479
|
+
*
|
|
4480
|
+
* @method ss
|
|
4481
|
+
* @param slug The slug of the sticker set or its link.
|
|
4482
|
+
*/
|
|
4483
|
+
async getStickerSet(slug) {
|
|
4484
|
+
return await this.#stickerSetManager.getStickerSet(slug);
|
|
4418
4485
|
}
|
|
4419
4486
|
/**
|
|
4420
4487
|
* Remove a sticker from its set.
|
|
@@ -4446,57 +4513,57 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4446
4513
|
return await this.#stickerSetManager.replaceStickerInStickerSet(currentStickerFileId, newSticker, params);
|
|
4447
4514
|
}
|
|
4448
4515
|
/**
|
|
4449
|
-
*
|
|
4516
|
+
* Set a custom emoji as a sticker set's thumbnail.
|
|
4450
4517
|
*
|
|
4451
4518
|
* @method ss
|
|
4452
4519
|
* @param slug The slug of the sticker set or its link.
|
|
4520
|
+
* @param customEmojiId The identifier of the custom emoji to use as thumbnail.
|
|
4453
4521
|
*/
|
|
4454
|
-
async
|
|
4455
|
-
return await this.#stickerSetManager.
|
|
4522
|
+
async setCustomEmojiAsStickerSetThumbnail(slug, customEmojiId) {
|
|
4523
|
+
return await this.#stickerSetManager.setCustomEmojiAsStickerSetThumbnail(slug, customEmojiId);
|
|
4456
4524
|
}
|
|
4457
4525
|
/**
|
|
4458
|
-
* Set
|
|
4526
|
+
* Set a sticker set's thumbnail.
|
|
4459
4527
|
*
|
|
4460
4528
|
* @method ss
|
|
4461
4529
|
* @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.
|
|
4530
|
+
* @param thumbnail The new thumbnail of the sticker set.
|
|
4473
4531
|
*/
|
|
4474
|
-
async
|
|
4475
|
-
return await this.#stickerSetManager.
|
|
4532
|
+
async setStickerSetThumbnail(slug, thumbnail) {
|
|
4533
|
+
return await this.#stickerSetManager.setStickerSetThumbnail(slug, thumbnail);
|
|
4476
4534
|
}
|
|
4477
4535
|
/**
|
|
4478
|
-
* Set a sticker set
|
|
4536
|
+
* Set the title of a sticker set.
|
|
4479
4537
|
*
|
|
4480
4538
|
* @method ss
|
|
4481
4539
|
* @param slug The slug of the sticker set or its link.
|
|
4482
|
-
* @param
|
|
4540
|
+
* @param title The sticker set's new title.
|
|
4483
4541
|
*/
|
|
4484
|
-
async
|
|
4485
|
-
return await this.#stickerSetManager.
|
|
4542
|
+
async setStickerSetTitle(slug, title) {
|
|
4543
|
+
return await this.#stickerSetManager.setStickerSetTitle(slug, title);
|
|
4486
4544
|
}
|
|
4487
4545
|
/**
|
|
4488
|
-
*
|
|
4546
|
+
* Suggest a sticker set slug from its title.
|
|
4489
4547
|
*
|
|
4490
4548
|
* @method ss
|
|
4491
|
-
* @param
|
|
4492
|
-
* @
|
|
4549
|
+
* @param title A title of a sticker set.
|
|
4550
|
+
* @returns The suggested slug.
|
|
4493
4551
|
*/
|
|
4494
|
-
async
|
|
4495
|
-
return await this.#stickerSetManager.
|
|
4552
|
+
async suggestStickerSetSlug(title) {
|
|
4553
|
+
return await this.#stickerSetManager.suggestStickerSetSlug(title);
|
|
4496
4554
|
}
|
|
4497
4555
|
//
|
|
4498
4556
|
// ========================= MANAGED BOTS ========================= //
|
|
4499
4557
|
//
|
|
4558
|
+
/**
|
|
4559
|
+
* Set the access settings of a managed bot. Bot-only.
|
|
4560
|
+
*
|
|
4561
|
+
* @method mb
|
|
4562
|
+
* @param userId The identifier of the bot user.
|
|
4563
|
+
*/
|
|
4564
|
+
async getManagedBotAccessSettings(userId) {
|
|
4565
|
+
return await this.#managedBotManager.getManagedBotAccessSettings(userId);
|
|
4566
|
+
}
|
|
4500
4567
|
/**
|
|
4501
4568
|
* Get the token of a managed bot. Bot-only.
|
|
4502
4569
|
*
|
|
@@ -4527,15 +4594,6 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4527
4594
|
async setManagedBotAccessSettings(userId, isAccessRestricted, params) {
|
|
4528
4595
|
return await this.#managedBotManager.setManagedBotAccessSettings(userId, isAccessRestricted, params);
|
|
4529
4596
|
}
|
|
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
4597
|
//
|
|
4540
4598
|
// ========================= GUEST QUERIES ========================= //
|
|
4541
4599
|
//
|
|
@@ -4552,15 +4610,6 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4552
4610
|
//
|
|
4553
4611
|
// ========================= SECRET CHATS ========================= //
|
|
4554
4612
|
//
|
|
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
4613
|
/**
|
|
4565
4614
|
* Accept a secret chat. User-only.
|
|
4566
4615
|
*
|
|
@@ -4580,38 +4629,43 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4580
4629
|
return await this.#secretChatManager.endSecretChat(id, params);
|
|
4581
4630
|
}
|
|
4582
4631
|
/**
|
|
4583
|
-
*
|
|
4632
|
+
* Request a secret chat. User-only.
|
|
4633
|
+
*
|
|
4634
|
+
* @method sc
|
|
4635
|
+
* @param chatId The identifier of a chat.
|
|
4636
|
+
*/
|
|
4637
|
+
async requestSecretChat(chatId) {
|
|
4638
|
+
return await this.#secretChatManager.requestSecretChat(chatId);
|
|
4639
|
+
}
|
|
4640
|
+
/**
|
|
4641
|
+
* Send an animation to a secret chat. User-only.
|
|
4584
4642
|
*
|
|
4585
4643
|
* @method sc
|
|
4586
4644
|
* @param id The identifier of the secret chat.
|
|
4587
|
-
* @param
|
|
4645
|
+
* @param animation The animation to send.
|
|
4588
4646
|
*/
|
|
4589
|
-
async
|
|
4590
|
-
return await this.#secretChatManager.
|
|
4647
|
+
async sendSecretAnimation(id, animation, params) {
|
|
4648
|
+
return await this.#secretChatManager.sendSecretAnimation(id, animation, params);
|
|
4591
4649
|
}
|
|
4592
4650
|
/**
|
|
4593
|
-
* Send
|
|
4651
|
+
* Send an audio file to a secret chat. User-only.
|
|
4594
4652
|
*
|
|
4595
4653
|
* @method sc
|
|
4596
4654
|
* @param id The identifier of the secret chat.
|
|
4597
|
-
* @param
|
|
4598
|
-
* @param longitude The location's longitude.
|
|
4655
|
+
* @param audio The audio file to send.
|
|
4599
4656
|
*/
|
|
4600
|
-
async
|
|
4601
|
-
return await this.#secretChatManager.
|
|
4657
|
+
async sendSecretAudio(id, audio, params) {
|
|
4658
|
+
return await this.#secretChatManager.sendSecretAudio(id, audio, params);
|
|
4602
4659
|
}
|
|
4603
4660
|
/**
|
|
4604
|
-
* Send a
|
|
4661
|
+
* Send a secret chat action. User-only.
|
|
4605
4662
|
*
|
|
4606
4663
|
* @method sc
|
|
4607
4664
|
* @param id The identifier of the secret chat.
|
|
4608
|
-
* @param
|
|
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.
|
|
4665
|
+
* @param action The type of action to send.
|
|
4612
4666
|
*/
|
|
4613
|
-
async
|
|
4614
|
-
return await this.#secretChatManager.
|
|
4667
|
+
async sendSecretChatAction(id, action) {
|
|
4668
|
+
return await this.#secretChatManager.sendSecretChatAction(id, action);
|
|
4615
4669
|
}
|
|
4616
4670
|
/**
|
|
4617
4671
|
* Send a contact to a secret chat. User-only.
|
|
@@ -4634,6 +4688,27 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4634
4688
|
async sendSecretDocument(id, document, params) {
|
|
4635
4689
|
return await this.#secretChatManager.sendSecretDocument(id, document, params);
|
|
4636
4690
|
}
|
|
4691
|
+
/**
|
|
4692
|
+
* Send a location to a secret chat. User-only.
|
|
4693
|
+
*
|
|
4694
|
+
* @method sc
|
|
4695
|
+
* @param id The identifier of the secret chat.
|
|
4696
|
+
* @param latitude The location's latitude.
|
|
4697
|
+
* @param longitude The location's longitude.
|
|
4698
|
+
*/
|
|
4699
|
+
async sendSecretLocation(id, latitude, longitude, params) {
|
|
4700
|
+
return await this.#secretChatManager.sendSecretLocation(id, latitude, longitude, params);
|
|
4701
|
+
}
|
|
4702
|
+
/**
|
|
4703
|
+
* Send a message to a secret chat. User-only.
|
|
4704
|
+
*
|
|
4705
|
+
* @method sc
|
|
4706
|
+
* @param id The identifier of the secret chat.
|
|
4707
|
+
* @param text The message's text.
|
|
4708
|
+
*/
|
|
4709
|
+
async sendSecretMessage(id, text, params) {
|
|
4710
|
+
return await this.#secretChatManager.sendSecretMessage(id, text, params);
|
|
4711
|
+
}
|
|
4637
4712
|
/**
|
|
4638
4713
|
* Send a photo to a secret chat. User-only.
|
|
4639
4714
|
*
|
|
@@ -4645,64 +4720,67 @@ class Client extends _5_composer_js_1.Composer {
|
|
|
4645
4720
|
return await this.#secretChatManager.sendSecretPhoto(id, photo, params);
|
|
4646
4721
|
}
|
|
4647
4722
|
/**
|
|
4648
|
-
* Send a
|
|
4723
|
+
* Send a secret chat screenshot notification. User-only.
|
|
4649
4724
|
*
|
|
4650
4725
|
* @method sc
|
|
4651
4726
|
* @param id The identifier of the secret chat.
|
|
4652
|
-
* @param
|
|
4727
|
+
* @param messageIds Identifiers of messages.
|
|
4653
4728
|
*/
|
|
4654
|
-
async
|
|
4655
|
-
return await this.#secretChatManager.
|
|
4729
|
+
async sendSecretScreenshotNotification(id, messageIds) {
|
|
4730
|
+
return await this.#secretChatManager.sendSecretScreenshotNotification(id, messageIds);
|
|
4656
4731
|
}
|
|
4657
4732
|
/**
|
|
4658
|
-
* Send a
|
|
4733
|
+
* Send a sticker to a secret chat. User-only.
|
|
4659
4734
|
*
|
|
4660
4735
|
* @method sc
|
|
4661
4736
|
* @param id The identifier of the secret chat.
|
|
4662
|
-
* @param
|
|
4737
|
+
* @param sticker The sticker to send.
|
|
4663
4738
|
*/
|
|
4664
|
-
async
|
|
4665
|
-
return await this.#secretChatManager.
|
|
4739
|
+
async sendSecretSticker(id, sticker, params) {
|
|
4740
|
+
return await this.#secretChatManager.sendSecretSticker(id, sticker, params);
|
|
4666
4741
|
}
|
|
4667
4742
|
/**
|
|
4668
|
-
* Send
|
|
4743
|
+
* Send a venue to a secret chat. User-only.
|
|
4669
4744
|
*
|
|
4670
4745
|
* @method sc
|
|
4671
4746
|
* @param id The identifier of the secret chat.
|
|
4672
|
-
* @param
|
|
4747
|
+
* @param latitude The latitude of the venue.
|
|
4748
|
+
* @param longitude The longitude of the venue.
|
|
4749
|
+
* @param title The title of the venue.
|
|
4750
|
+
* @param address The written address of the venue.
|
|
4673
4751
|
*/
|
|
4674
|
-
async
|
|
4675
|
-
return await this.#secretChatManager.
|
|
4752
|
+
async sendSecretVenue(id, latitude, longitude, title, address, params) {
|
|
4753
|
+
return await this.#secretChatManager.sendSecretVenue(id, latitude, longitude, title, address, params);
|
|
4676
4754
|
}
|
|
4677
4755
|
/**
|
|
4678
|
-
* Send
|
|
4756
|
+
* Send a video to a secret chat. User-only.
|
|
4679
4757
|
*
|
|
4680
4758
|
* @method sc
|
|
4681
4759
|
* @param id The identifier of the secret chat.
|
|
4682
|
-
* @param
|
|
4760
|
+
* @param video The video to send.
|
|
4683
4761
|
*/
|
|
4684
|
-
async
|
|
4685
|
-
return await this.#secretChatManager.
|
|
4762
|
+
async sendSecretVideo(id, video, params) {
|
|
4763
|
+
return await this.#secretChatManager.sendSecretVideo(id, video, params);
|
|
4686
4764
|
}
|
|
4687
4765
|
/**
|
|
4688
|
-
* Send a
|
|
4766
|
+
* Send a video note to a secret chat. User-only.
|
|
4689
4767
|
*
|
|
4690
4768
|
* @method sc
|
|
4691
4769
|
* @param id The identifier of the secret chat.
|
|
4692
|
-
* @param
|
|
4770
|
+
* @param videoNote The video note to send.
|
|
4693
4771
|
*/
|
|
4694
|
-
async
|
|
4695
|
-
return await this.#secretChatManager.
|
|
4772
|
+
async sendSecretVideoNote(id, videoNote, params) {
|
|
4773
|
+
return await this.#secretChatManager.sendSecretVideoNote(id, videoNote, params);
|
|
4696
4774
|
}
|
|
4697
4775
|
/**
|
|
4698
|
-
* Send a
|
|
4776
|
+
* Send a voice message to a secret chat. User-only.
|
|
4699
4777
|
*
|
|
4700
4778
|
* @method sc
|
|
4701
4779
|
* @param id The identifier of the secret chat.
|
|
4702
|
-
* @param
|
|
4780
|
+
* @param voice The voice message to send.
|
|
4703
4781
|
*/
|
|
4704
|
-
async
|
|
4705
|
-
return await this.#secretChatManager.
|
|
4782
|
+
async sendSecretVoice(id, voice, params) {
|
|
4783
|
+
return await this.#secretChatManager.sendSecretVoice(id, voice, params);
|
|
4706
4784
|
}
|
|
4707
4785
|
}
|
|
4708
4786
|
exports.Client = Client;
|