@mtkruto/node 0.192.0 → 0.194.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/README.md +5 -5
- package/esm/0_errors.d.ts +6 -0
- package/esm/0_errors.d.ts.map +1 -1
- package/esm/0_errors.js +12 -0
- package/esm/3_types.d.ts +8 -2
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +8 -2
- package/esm/client/0_html.d.ts +2 -1
- package/esm/client/0_html.d.ts.map +1 -1
- package/esm/client/0_html.js +18 -16
- package/esm/client/0_markdown.d.ts +3 -2
- package/esm/client/0_markdown.d.ts.map +1 -1
- package/esm/client/0_markdown.js +9 -7
- package/esm/client/0_params.d.ts +51 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.js +5 -5
- package/esm/client/0_storage_operations.d.ts +9 -0
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +40 -51
- package/esm/client/1_client_generic.d.ts +161 -13
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +2 -1
- package/esm/client/2_client_encrypted.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.js +2 -4
- package/esm/client/2_reaction_manager.d.ts +2 -1
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +7 -0
- package/esm/client/2_update_manager.d.ts +1 -1
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +13 -12
- package/esm/client/3_account_manager.d.ts +8 -2
- package/esm/client/3_account_manager.d.ts.map +1 -1
- package/esm/client/3_account_manager.js +54 -2
- package/esm/client/3_message_manager.js +6 -6
- package/esm/client/3_secret_chat_manager.d.ts +7 -2
- package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
- package/esm/client/3_secret_chat_manager.js +65 -16
- package/esm/client/3_sticker_set_manager.d.ts +5 -0
- package/esm/client/3_sticker_set_manager.d.ts.map +1 -1
- package/esm/client/3_sticker_set_manager.js +40 -9
- package/esm/client/4_chat_manager.d.ts +9 -3
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +102 -3
- package/esm/client/4_checklist_manager.js +1 -1
- package/esm/client/4_context.d.ts +17 -3
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +38 -0
- package/esm/client/4_forum_manager.d.ts +1 -0
- package/esm/client/4_forum_manager.d.ts.map +1 -1
- package/esm/client/4_forum_manager.js +5 -0
- package/esm/client/6_client.d.ts +159 -11
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +223 -25
- package/esm/client/6_client_dispatcher.d.ts +160 -12
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +198 -8
- package/esm/storage/2_storage_indexed_db.js +5 -5
- package/esm/storage/2_storage_session_storage.js +2 -2
- package/esm/tl/0_utilities.d.ts +1 -1
- package/esm/tl/0_utilities.d.ts.map +1 -1
- package/esm/tl/0_utilities.js +3 -2
- package/esm/tl/1_tl_reader.js +1 -1
- package/esm/tl/1_tl_writer.js +1 -1
- package/esm/types/1_available_reactions.d.ts +3 -2
- package/esm/types/1_available_reactions.d.ts.map +1 -1
- package/esm/types/1_available_reactions.js +18 -1
- package/esm/types/1_channel_location.d.ts +27 -0
- package/esm/types/1_channel_location.d.ts.map +1 -0
- package/esm/types/1_channel_location.js +30 -0
- package/esm/types/1_sticker_set_p.d.ts +48 -0
- package/esm/types/1_sticker_set_p.d.ts.map +1 -0
- package/esm/types/1_sticker_set_p.js +73 -0
- package/esm/types/2_poll_voter.d.ts +19 -0
- package/esm/types/2_poll_voter.d.ts.map +1 -1
- package/esm/types/2_poll_voter.js +19 -0
- package/esm/types/3_chat_join_result.d.ts +40 -0
- package/esm/types/3_chat_join_result.d.ts.map +1 -0
- package/esm/types/3_chat_join_result.js +45 -0
- package/esm/types/3_resolved_invite_link.d.ts +63 -0
- package/esm/types/3_resolved_invite_link.d.ts.map +1 -0
- package/esm/types/3_resolved_invite_link.js +45 -0
- package/esm/types/3_rich_text_component.d.ts +24 -0
- package/esm/types/3_rich_text_component.d.ts.map +1 -1
- package/esm/types/4_page_block.d.ts +45 -1
- package/esm/types/4_page_block.d.ts.map +1 -1
- package/esm/types/B_recent_action.d.ts +244 -0
- package/esm/types/B_recent_action.d.ts.map +1 -0
- package/esm/types/B_recent_action.js +322 -0
- package/esm/types/B_topic_list_item.d.ts +22 -0
- package/esm/types/B_topic_list_item.d.ts.map +1 -1
- package/esm/types/B_topic_list_item.js +19 -0
- package/esm/types/C_recent_actions_entry.d.ts +32 -0
- package/esm/types/C_recent_actions_entry.d.ts.map +1 -0
- package/esm/types/C_recent_actions_entry.js +32 -0
- package/esm/types/C_topic_list.d.ts +20 -0
- package/esm/types/C_topic_list.d.ts.map +1 -1
- package/esm/types/C_topic_list.js +19 -0
- package/esm/utilities/1_auth.d.ts.map +1 -1
- package/esm/utilities/1_auth.js +2 -1
- package/package.json +1 -1
- package/script/0_errors.d.ts +6 -0
- package/script/0_errors.d.ts.map +1 -1
- package/script/0_errors.js +15 -1
- package/script/3_types.d.ts +8 -2
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +8 -2
- package/script/client/0_html.d.ts +2 -1
- package/script/client/0_html.d.ts.map +1 -1
- package/script/client/0_html.js +17 -15
- package/script/client/0_markdown.d.ts +3 -2
- package/script/client/0_markdown.d.ts.map +1 -1
- package/script/client/0_markdown.js +8 -6
- package/script/client/0_params.d.ts +51 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.js +5 -5
- package/script/client/0_storage_operations.d.ts +9 -0
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +42 -53
- package/script/client/1_client_generic.d.ts +161 -13
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +2 -1
- package/script/client/2_client_encrypted.d.ts.map +1 -1
- package/script/client/2_client_encrypted.js +4 -6
- package/script/client/2_reaction_manager.d.ts +2 -1
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +7 -0
- package/script/client/2_update_manager.d.ts +1 -1
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +13 -12
- package/script/client/3_account_manager.d.ts +8 -2
- package/script/client/3_account_manager.d.ts.map +1 -1
- package/script/client/3_account_manager.js +54 -2
- package/script/client/3_message_manager.js +6 -6
- package/script/client/3_secret_chat_manager.d.ts +7 -2
- package/script/client/3_secret_chat_manager.d.ts.map +1 -1
- package/script/client/3_secret_chat_manager.js +65 -16
- package/script/client/3_sticker_set_manager.d.ts +5 -0
- package/script/client/3_sticker_set_manager.d.ts.map +1 -1
- package/script/client/3_sticker_set_manager.js +39 -8
- package/script/client/4_chat_manager.d.ts +9 -3
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +101 -2
- package/script/client/4_checklist_manager.js +1 -1
- package/script/client/4_context.d.ts +17 -3
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +38 -0
- package/script/client/4_forum_manager.d.ts +1 -0
- package/script/client/4_forum_manager.d.ts.map +1 -1
- package/script/client/4_forum_manager.js +5 -0
- package/script/client/6_client.d.ts +159 -11
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +223 -25
- package/script/client/6_client_dispatcher.d.ts +160 -12
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +198 -8
- package/script/storage/2_storage_indexed_db.js +5 -5
- package/script/storage/2_storage_session_storage.js +2 -2
- package/script/tl/0_utilities.d.ts +1 -1
- package/script/tl/0_utilities.d.ts.map +1 -1
- package/script/tl/0_utilities.js +3 -2
- package/script/tl/1_tl_reader.js +1 -1
- package/script/tl/1_tl_writer.js +1 -1
- package/script/types/1_available_reactions.d.ts +3 -2
- package/script/types/1_available_reactions.d.ts.map +1 -1
- package/script/types/1_available_reactions.js +18 -0
- package/script/types/1_channel_location.d.ts +27 -0
- package/script/types/1_channel_location.d.ts.map +1 -0
- package/script/types/1_channel_location.js +33 -0
- package/script/types/1_sticker_set_p.d.ts +48 -0
- package/script/types/1_sticker_set_p.d.ts.map +1 -0
- package/script/types/1_sticker_set_p.js +76 -0
- package/script/types/2_poll_voter.d.ts +19 -0
- package/script/types/2_poll_voter.d.ts.map +1 -1
- package/script/types/2_poll_voter.js +19 -0
- package/script/types/3_chat_join_result.d.ts +40 -0
- package/script/types/3_chat_join_result.d.ts.map +1 -0
- package/script/types/3_chat_join_result.js +48 -0
- package/script/types/3_resolved_invite_link.d.ts +63 -0
- package/script/types/3_resolved_invite_link.d.ts.map +1 -0
- package/script/types/3_resolved_invite_link.js +48 -0
- package/script/types/3_rich_text_component.d.ts +24 -0
- package/script/types/3_rich_text_component.d.ts.map +1 -1
- package/script/types/4_page_block.d.ts +45 -1
- package/script/types/4_page_block.d.ts.map +1 -1
- package/script/types/B_recent_action.d.ts +244 -0
- package/script/types/B_recent_action.d.ts.map +1 -0
- package/script/types/B_recent_action.js +325 -0
- package/script/types/B_topic_list_item.d.ts +22 -0
- package/script/types/B_topic_list_item.d.ts.map +1 -1
- package/script/types/B_topic_list_item.js +19 -0
- package/script/types/C_recent_actions_entry.d.ts +32 -0
- package/script/types/C_recent_actions_entry.d.ts.map +1 -0
- package/script/types/C_recent_actions_entry.js +35 -0
- package/script/types/C_topic_list.d.ts +20 -0
- package/script/types/C_topic_list.d.ts.map +1 -1
- package/script/types/C_topic_list.js +19 -0
- package/script/utilities/1_auth.d.ts.map +1 -1
- package/script/utilities/1_auth.js +2 -1
|
@@ -22,12 +22,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.StorageOperations = exports.K = void 0;
|
|
23
23
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
24
|
const _0_deps_js_2 = require("../0_deps.js");
|
|
25
|
-
const _0_errors_js_1 = require("../0_errors.js");
|
|
26
25
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
27
26
|
const _1_utilities_js_2 = require("../1_utilities.js");
|
|
28
27
|
const _2_storage_js_1 = require("../2_storage.js");
|
|
29
28
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
30
29
|
const _3_types_js_1 = require("../3_types.js");
|
|
30
|
+
const _4_errors_js_1 = require("../4_errors.js");
|
|
31
31
|
exports.K = {
|
|
32
32
|
session: {
|
|
33
33
|
P: (string) => `session.${string}`,
|
|
@@ -74,6 +74,9 @@ exports.K = {
|
|
|
74
74
|
voiceTranscription: (transcriptionId) => [...exports.K.cache.voiceTranscriptions(), transcriptionId],
|
|
75
75
|
voiceTranscriptionReferences: () => [exports.K.cache.P("voiceTranscriptionReferences")],
|
|
76
76
|
voiceTranscriptionReference: (chatId, messageId, messageEditDate) => [...exports.K.cache.voiceTranscriptionReferences(), chatId, messageId, messageEditDate],
|
|
77
|
+
minPeerReferences: () => [exports.K.cache.P("minPeerReferences")],
|
|
78
|
+
minPeerReference: (senderId, chatId) => [...exports.K.cache.minPeerReferences(), senderId, chatId],
|
|
79
|
+
minPeerReferenceSender: (senderId) => [...exports.K.cache.minPeerReferences(), senderId],
|
|
77
80
|
},
|
|
78
81
|
messages: {
|
|
79
82
|
P: (string) => `messages.${string}`,
|
|
@@ -144,7 +147,7 @@ class StorageOperations {
|
|
|
144
147
|
}
|
|
145
148
|
const auth = this.auth.mustGet();
|
|
146
149
|
if (auth.dc === null || auth.authKey === null || auth.apiId === 0 || auth.userId === 0) {
|
|
147
|
-
throw new
|
|
150
|
+
throw new _4_errors_js_1.InputError("Not authorized.");
|
|
148
151
|
}
|
|
149
152
|
const writer = new _2_tl_js_1.TLWriter();
|
|
150
153
|
writer.writeString(auth.dc);
|
|
@@ -424,11 +427,7 @@ class StorageOperations {
|
|
|
424
427
|
await this.setTlObject(exports.K.updates.update(boxId, this.#getUpdateId(update)), update);
|
|
425
428
|
}
|
|
426
429
|
async deleteUpdates() {
|
|
427
|
-
|
|
428
|
-
for await (const [k] of await this.#storage.getMany({ prefix: exports.K.updates.all() })) {
|
|
429
|
-
maybePromises.push(this.#storage.set(k, null));
|
|
430
|
-
}
|
|
431
|
-
await Promise.all(maybePromises.filter((v) => v instanceof Promise));
|
|
430
|
+
await this.#deleteByPrefix(exports.K.updates.all());
|
|
432
431
|
}
|
|
433
432
|
async getFirstUpdate(boxId) {
|
|
434
433
|
for await (const [key, update] of await this.#storage.getMany({ prefix: exports.K.updates.updates(boxId) }, { limit: 1 })) {
|
|
@@ -438,12 +437,12 @@ class StorageOperations {
|
|
|
438
437
|
}
|
|
439
438
|
assertUser(source) {
|
|
440
439
|
if (this.isBot) {
|
|
441
|
-
throw new
|
|
440
|
+
throw new _4_errors_js_1.InputError(`${source}: not a user client`);
|
|
442
441
|
}
|
|
443
442
|
}
|
|
444
443
|
assertBot(source) {
|
|
445
444
|
if (!this.isBot) {
|
|
446
|
-
throw new
|
|
445
|
+
throw new _4_errors_js_1.InputError(`${source}: not a bot client`);
|
|
447
446
|
}
|
|
448
447
|
}
|
|
449
448
|
get isBot() {
|
|
@@ -469,51 +468,41 @@ class StorageOperations {
|
|
|
469
468
|
return null;
|
|
470
469
|
}
|
|
471
470
|
}
|
|
471
|
+
async #deleteByPrefix(prefix) {
|
|
472
|
+
for await (const [key] of await this.#storage.getMany({ prefix })) {
|
|
473
|
+
await this.#storage.set(key, null);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
472
476
|
async deleteFiles() {
|
|
473
477
|
if (!this.#supportsFiles) {
|
|
474
478
|
return;
|
|
475
479
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
for await (const [key] of await this.#storage.getMany({ prefix: exports.K.cache.files() })) {
|
|
480
|
-
await this.#storage.set(key, null);
|
|
481
|
-
}
|
|
480
|
+
await this.#deleteByPrefix(exports.K.cache.fileParts());
|
|
481
|
+
await this.#deleteByPrefix(exports.K.cache.files());
|
|
482
482
|
}
|
|
483
483
|
async deleteCustomEmojiDocuments() {
|
|
484
|
-
|
|
485
|
-
await this.#storage.set(key, null);
|
|
486
|
-
}
|
|
484
|
+
await this.#deleteByPrefix(exports.K.cache.customEmojiDocuments());
|
|
487
485
|
}
|
|
488
486
|
async deleteBusinessConnections() {
|
|
489
|
-
|
|
490
|
-
await this.#storage.set(key, null);
|
|
491
|
-
}
|
|
487
|
+
await this.#deleteByPrefix(exports.K.cache.businessConnections());
|
|
492
488
|
}
|
|
493
489
|
async deleteInlineQueryAnswers() {
|
|
494
|
-
|
|
495
|
-
await this.#storage.set(key, null);
|
|
496
|
-
}
|
|
490
|
+
await this.#deleteByPrefix(exports.K.cache.inlineQueryAnswers());
|
|
497
491
|
}
|
|
498
492
|
async deleteCallbackQueryAnswers() {
|
|
499
|
-
|
|
500
|
-
await this.#storage.set(key, null);
|
|
501
|
-
}
|
|
493
|
+
await this.#deleteByPrefix(exports.K.cache.callbackQueryAnswers());
|
|
502
494
|
}
|
|
503
495
|
async deleteFullChats() {
|
|
504
|
-
|
|
505
|
-
await this.#storage.set(key, null);
|
|
506
|
-
}
|
|
496
|
+
await this.#deleteByPrefix(exports.K.cache.fullChats());
|
|
507
497
|
}
|
|
508
498
|
async deleteGroupCalls() {
|
|
509
|
-
|
|
510
|
-
await this.#storage.set(key, null);
|
|
511
|
-
}
|
|
499
|
+
await this.#deleteByPrefix(exports.K.cache.groupCalls());
|
|
512
500
|
}
|
|
513
501
|
async deleteStickerSetNames() {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
502
|
+
await this.#deleteByPrefix(exports.K.cache.stickerSetNames());
|
|
503
|
+
}
|
|
504
|
+
async deleteMinPeerReferences() {
|
|
505
|
+
await this.#deleteByPrefix(exports.K.cache.minPeerReferences());
|
|
517
506
|
}
|
|
518
507
|
async clear() {
|
|
519
508
|
await Promise.all([
|
|
@@ -534,12 +523,11 @@ class StorageOperations {
|
|
|
534
523
|
this.deletePolls(),
|
|
535
524
|
this.deleteVoiceTranscriptions(),
|
|
536
525
|
this.deleteVoiceTranscriptionReferences(),
|
|
526
|
+
this.deleteMinPeerReferences(),
|
|
537
527
|
]);
|
|
538
528
|
}
|
|
539
529
|
async reset() {
|
|
540
|
-
|
|
541
|
-
await this.#storage.set(key, null);
|
|
542
|
-
}
|
|
530
|
+
await this.#deleteByPrefix([]);
|
|
543
531
|
}
|
|
544
532
|
async setPollResults(pollId, pollResults) {
|
|
545
533
|
await this.setTlObject(exports.K.cache.pollResult(pollId), pollResults);
|
|
@@ -548,11 +536,7 @@ class StorageOperations {
|
|
|
548
536
|
return await this.getTlObject(exports.K.cache.pollResult(pollId));
|
|
549
537
|
}
|
|
550
538
|
async deletePollResults() {
|
|
551
|
-
|
|
552
|
-
for await (const [key] of await this.#storage.getMany({ prefix: exports.K.cache.pollResults() })) {
|
|
553
|
-
maybePromises.push(this.#storage.set(key, null));
|
|
554
|
-
}
|
|
555
|
-
await Promise.all(maybePromises);
|
|
539
|
+
await this.#deleteByPrefix(exports.K.cache.pollResults());
|
|
556
540
|
}
|
|
557
541
|
async setPoll(pollId, poll) {
|
|
558
542
|
await this.setTlObject(exports.K.cache.poll(pollId), poll);
|
|
@@ -561,11 +545,7 @@ class StorageOperations {
|
|
|
561
545
|
return await this.getTlObject(exports.K.cache.poll(pollId));
|
|
562
546
|
}
|
|
563
547
|
async deletePolls() {
|
|
564
|
-
|
|
565
|
-
for await (const [key] of await this.#storage.getMany({ prefix: exports.K.cache.polls() })) {
|
|
566
|
-
maybePromises.push(this.#storage.set(key, null));
|
|
567
|
-
}
|
|
568
|
-
await Promise.all(maybePromises);
|
|
548
|
+
await this.#deleteByPrefix(exports.K.cache.polls());
|
|
569
549
|
}
|
|
570
550
|
async setVoiceTranscription(voiceTranscription) {
|
|
571
551
|
await this.#storage.set(exports.K.cache.voiceTranscription(BigInt(voiceTranscription.id)), voiceTranscription);
|
|
@@ -587,11 +567,20 @@ class StorageOperations {
|
|
|
587
567
|
return await this.#storage.get(exports.K.cache.voiceTranscriptionReference(chatId, messageId, messageEditDate.getTime()));
|
|
588
568
|
}
|
|
589
569
|
async deleteVoiceTranscriptionReferences() {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
570
|
+
await this.#deleteByPrefix(exports.K.cache.voiceTranscriptionReferences());
|
|
571
|
+
}
|
|
572
|
+
async addMinPeerReference(chatId, senderId, messageId) {
|
|
573
|
+
await this.#storage.set(exports.K.cache.minPeerReference(senderId, chatId), [{ chatId, messageId }, new Date()]);
|
|
574
|
+
}
|
|
575
|
+
async getLastMinPeerReference(senderId) {
|
|
576
|
+
const references = new Array();
|
|
577
|
+
for await (const [, reference] of await this.#storage.getMany({ prefix: exports.K.cache.minPeerReferenceSender(senderId) })) {
|
|
578
|
+
references.push(reference);
|
|
579
|
+
if (references.length > 99) {
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
593
582
|
}
|
|
594
|
-
|
|
583
|
+
return references.sort((a, b) => b[1].getTime() - a[1].getTime())[0]?.[0] ?? null;
|
|
595
584
|
}
|
|
596
585
|
}
|
|
597
586
|
exports.StorageOperations = StorageOperations;
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import type { Api, Mtproto } from "../2_tl.js";
|
|
21
|
-
import type { AlbumStoryList, Animation, AppSupport, AuthorizationSession, AvailableReactions, Birthday, BlockedUserList, BotAccessSettings, BotCommand, BotTokenCheckResult, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatActionType, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, ConnectedWebsite, Country, FailedInvitation, FileSource, Gift, GiftCollection, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputChecklistItem, InputEmojiStatus, InputGift, InputMedia, InputPollOption, InputRichText, InputSticker, InputStoryContent, InviteLink, JoinRequest, LeftChannelList, LinkPreview, LiveStreamChannel, Message, MessageAnimation, MessageAudio, MessageChecklist, MessageContact, MessageCounters, MessageDice, MessageDocument, MessageInvoice, MessageList, MessageLivePhoto, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageRichText, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageViewer, MessageVoice, MiniAppInfo, NetworkStatistics, PasswordCheckResult, Poll, PollVoterList, PremiumSubscriptionDuration, PriceTag, ProfilePhotoList, Reaction, ReportReason, RichText, SavedChats, SecretChat, SlowModeDuration, StarAmount, StarTransactionList, Sticker, StickerSet, Story, StoryAlbum, StoryReportResult, SummarizedText, TextToTranslate, Timezone, Topic, TopicList, TopicListItem, TranslatedText, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
|
|
22
|
-
import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteAccountParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndSecretChatParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetPollVotersParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTopicsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, MarkAllMentionsAsReadParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ReportChatParams, ReportStoryParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendRichTextParams, SendSecretAnimationParams, SendSecretAudioParams, SendSecretContactParams, SendSecretDocumentParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretPhotoParams, SendSecretStickerParams, SendSecretVenueParams, SendSecretVideoNoteParams, SendSecretVideoParams, SendSecretVoiceParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
|
|
21
|
+
import type { AlbumStoryList, Animation, AppSupport, AuthorizationSession, AvailableReactions, Birthday, BlockedUserList, BotAccessSettings, BotCommand, BotTokenCheckResult, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatActionType, ChatJoinResult, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, ConnectedWebsite, Country, EmojiStatus, FailedInvitation, FileSource, Gift, GiftCollection, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputChecklistItem, InputEmojiStatus, InputGift, InputMedia, InputPollOption, InputRichText, InputSticker, InputStoryContent, InviteLink, JoinRequest, LeftChannelList, LinkPreview, LiveStreamChannel, Message, MessageAnimation, MessageAudio, MessageChecklist, MessageContact, MessageCounters, MessageDice, MessageDocument, MessageInvoice, MessageList, MessageLivePhoto, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageRichText, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageViewer, MessageVoice, MiniAppInfo, NetworkStatistics, PasswordCheckResult, Poll, PollVoterList, PremiumSubscriptionDuration, PriceTag, ProfilePhotoList, Reaction, RecentActionsEntry, ReportReason, ResolvedInviteLink, RichText, SavedChats, SecretChat, SlowModeDuration, StarAmount, StarTransactionList, Sticker, StickerSet, StickerSetP, Story, StoryAlbum, StoryReportResult, SummarizedText, TextToTranslate, Timezone, Topic, TopicList, TopicListItem, TranslatedText, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
|
|
22
|
+
import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AllowUnpaidMessagesFromUserParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, BoostChatParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteAccountParams, DeleteMessageParams, DeleteMessagesParams, DisallowUnpaidMessagesFromUserParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndSecretChatParams, EndTakeoutSessionParams, ForwardMessagesParams, GetAdministeredChatsParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetPollVotersParams, GetProfilePhotosParams, GetRecentActionsParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTopicsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, MarkAllMentionsAsReadParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ReportChatParams, ReportStoryParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendRichTextParams, SendSecretAnimationParams, SendSecretAudioParams, SendSecretContactParams, SendSecretDocumentParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretPhotoParams, SendSecretStickerParams, SendSecretVenueParams, SendSecretVideoNoteParams, SendSecretVideoParams, SendSecretVoiceParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
|
|
23
23
|
/** A generic MTKruto client. */
|
|
24
24
|
export declare abstract class ClientGeneric {
|
|
25
25
|
abstract connect(): Promise<void>;
|
|
@@ -33,6 +33,38 @@ export declare abstract class ClientGeneric {
|
|
|
33
33
|
* @method ac
|
|
34
34
|
*/
|
|
35
35
|
abstract sendCode(phoneNumber: string): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Get application configuration. User-only.
|
|
38
|
+
*
|
|
39
|
+
* @method ac
|
|
40
|
+
*/
|
|
41
|
+
abstract getApplicationConfiguration(): Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* Get recent emoji statuses. User-only.
|
|
44
|
+
*
|
|
45
|
+
* @method ac
|
|
46
|
+
*/
|
|
47
|
+
abstract getRecentEmojiStatuses(): Promise<EmojiStatus[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Clear recent emoji statuses. User-only.
|
|
50
|
+
*
|
|
51
|
+
* @method ac
|
|
52
|
+
*/
|
|
53
|
+
abstract clearRecentEmojiStatuses(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Allow a bot to set custom emoji status. User-only.
|
|
56
|
+
*
|
|
57
|
+
* @param botId The user identifier of the bot.
|
|
58
|
+
* @method ac
|
|
59
|
+
*/
|
|
60
|
+
abstract allowBotToSetCustomEmojiStatus(botId: ID): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Disallow a bot to set custom emoji status. User-only.
|
|
63
|
+
*
|
|
64
|
+
* @param botId The user identifier of the bot.
|
|
65
|
+
* @method ac
|
|
66
|
+
*/
|
|
67
|
+
abstract disallowBotToSetCustomEmojiStatus(botId: ID): Promise<void>;
|
|
36
68
|
/**
|
|
37
69
|
* Check if a code entered by the user was the same as the verification code.
|
|
38
70
|
*
|
|
@@ -99,6 +131,13 @@ export declare abstract class ClientGeneric {
|
|
|
99
131
|
* @param botId The identifier of the bot to add to the attachments menu.
|
|
100
132
|
*/
|
|
101
133
|
abstract addBotToAttachmentsMenu(botId: ID, params?: AddBotToAttachmentsMenuParams): Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* Allow unpaid messages from a user. User-only.
|
|
136
|
+
*
|
|
137
|
+
* @method ac
|
|
138
|
+
* @param userId The identifier of the user.
|
|
139
|
+
*/
|
|
140
|
+
abstract allowUnpaidMessagesFromUser(userId: ID, params?: AllowUnpaidMessagesFromUserParams): Promise<void>;
|
|
102
141
|
/**
|
|
103
142
|
* Block a user. User-only.
|
|
104
143
|
*
|
|
@@ -127,6 +166,13 @@ export declare abstract class ClientGeneric {
|
|
|
127
166
|
* @method ac
|
|
128
167
|
*/
|
|
129
168
|
abstract disableSponsoredMessages(): Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* Disallow unpaid messages from a user. User-only.
|
|
171
|
+
*
|
|
172
|
+
* @method ac
|
|
173
|
+
* @param userId The identifier of the user.
|
|
174
|
+
*/
|
|
175
|
+
abstract disallowUnpaidMessagesFromUser(userId: ID, params?: DisallowUnpaidMessagesFromUserParams): Promise<void>;
|
|
130
176
|
/**
|
|
131
177
|
* Disconnect a connected website. User-only.
|
|
132
178
|
*
|
|
@@ -517,7 +563,7 @@ export declare abstract class ClientGeneric {
|
|
|
517
563
|
*/
|
|
518
564
|
abstract deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
|
|
519
565
|
/**
|
|
520
|
-
* Delete a scheduled message.
|
|
566
|
+
* Delete a scheduled message. User-only.
|
|
521
567
|
*
|
|
522
568
|
* @method ms
|
|
523
569
|
* @param chatId The identifier of a chat.
|
|
@@ -525,7 +571,7 @@ export declare abstract class ClientGeneric {
|
|
|
525
571
|
*/
|
|
526
572
|
abstract deleteScheduledMessage(chatId: ID, messageId: number): Promise<void>;
|
|
527
573
|
/**
|
|
528
|
-
* Delete multiple scheduled messages.
|
|
574
|
+
* Delete multiple scheduled messages. User-only.
|
|
529
575
|
*
|
|
530
576
|
* @method ms
|
|
531
577
|
* @param chatId The identifier of a chat.
|
|
@@ -550,7 +596,7 @@ export declare abstract class ClientGeneric {
|
|
|
550
596
|
*/
|
|
551
597
|
abstract editInlineMessageLiveLocation(inlineMessageId: string, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise<void>;
|
|
552
598
|
/**
|
|
553
|
-
* Edit an inline message's media.
|
|
599
|
+
* Edit an inline message's media. User-only.
|
|
554
600
|
*
|
|
555
601
|
* @method ms
|
|
556
602
|
* @param inlineMessageId The identifier of the inline message.
|
|
@@ -773,7 +819,7 @@ export declare abstract class ClientGeneric {
|
|
|
773
819
|
*/
|
|
774
820
|
abstract getSavedChats(params?: GetSavedChatsParams): Promise<SavedChats>;
|
|
775
821
|
/**
|
|
776
|
-
* Get messages saved from a specific chat.
|
|
822
|
+
* Get messages saved from a specific chat. User-only.
|
|
777
823
|
*
|
|
778
824
|
* @method ms
|
|
779
825
|
* @param chatId The identifier of a chat.
|
|
@@ -825,6 +871,15 @@ export declare abstract class ClientGeneric {
|
|
|
825
871
|
* @param fileId The file identifier of the sticker.
|
|
826
872
|
*/
|
|
827
873
|
abstract removeStickerFromRecents(fileId: string): Promise<void>;
|
|
874
|
+
/**
|
|
875
|
+
* Report a message reaction. User-only.
|
|
876
|
+
*
|
|
877
|
+
* @method ms
|
|
878
|
+
* @param chatId The identifier of the chat including the messages.
|
|
879
|
+
* @param messageId The identifiers of the message.
|
|
880
|
+
* @param reactionActorId The identifier of the chat that made the reaction.
|
|
881
|
+
*/
|
|
882
|
+
abstract reportReaction(chatId: ID, messageId: number, reactionActorId: ID): Promise<void>;
|
|
828
883
|
/**
|
|
829
884
|
* Retrieve a message using its link.
|
|
830
885
|
*
|
|
@@ -1012,7 +1067,7 @@ export declare abstract class ClientGeneric {
|
|
|
1012
1067
|
*/
|
|
1013
1068
|
abstract sendRichTextDraft(chatId: ID, draftId: number, richText: InputRichText, params?: SendRichTextDraftParams): Promise<void>;
|
|
1014
1069
|
/**
|
|
1015
|
-
* Send a scheduled message before its schedule.
|
|
1070
|
+
* Send a scheduled message before its schedule. User-only.
|
|
1016
1071
|
*
|
|
1017
1072
|
* @method ms
|
|
1018
1073
|
* @param chatId The identifier of a chat.
|
|
@@ -1020,7 +1075,7 @@ export declare abstract class ClientGeneric {
|
|
|
1020
1075
|
*/
|
|
1021
1076
|
abstract sendScheduledMessage(chatId: ID, messageId: number): Promise<Message>;
|
|
1022
1077
|
/**
|
|
1023
|
-
* Send multiple scheduled messages before their schedule.
|
|
1078
|
+
* Send multiple scheduled messages before their schedule. User-only.
|
|
1024
1079
|
*
|
|
1025
1080
|
* @method ms
|
|
1026
1081
|
* @param chatId The identifier of a chat.
|
|
@@ -1328,7 +1383,7 @@ export declare abstract class ClientGeneric {
|
|
|
1328
1383
|
*/
|
|
1329
1384
|
abstract getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
|
|
1330
1385
|
/**
|
|
1331
|
-
* Add a single user to a chat.
|
|
1386
|
+
* Add a single user to a chat. User-only.
|
|
1332
1387
|
*
|
|
1333
1388
|
* @method ch
|
|
1334
1389
|
* @param chatId The identifier of a chat to add the user to.
|
|
@@ -1337,7 +1392,7 @@ export declare abstract class ClientGeneric {
|
|
|
1337
1392
|
*/
|
|
1338
1393
|
abstract addChatMember(chatId: ID, userId: ID, params?: AddChatMemberParams): Promise<FailedInvitation[]>;
|
|
1339
1394
|
/**
|
|
1340
|
-
* Add multiple users at once to a channel or a supergroup.
|
|
1395
|
+
* Add multiple users at once to a channel or a supergroup. User-only.
|
|
1341
1396
|
*
|
|
1342
1397
|
* @method ch
|
|
1343
1398
|
* @param chatId The identifier of the channel or supergroup to add the users to.
|
|
@@ -1382,6 +1437,13 @@ export declare abstract class ClientGeneric {
|
|
|
1382
1437
|
* @param memberId The identifier of the member.
|
|
1383
1438
|
*/
|
|
1384
1439
|
abstract banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
|
|
1440
|
+
/**
|
|
1441
|
+
* Add a single user to a chat. User-only.
|
|
1442
|
+
*
|
|
1443
|
+
* @method ch
|
|
1444
|
+
* @param chatId The identifier of the chat to boost.
|
|
1445
|
+
*/
|
|
1446
|
+
abstract boostChat(chatId: ID, params?: BoostChatParams): Promise<void>;
|
|
1385
1447
|
/**
|
|
1386
1448
|
* Close a chat previously opened by openChat.
|
|
1387
1449
|
*
|
|
@@ -1474,6 +1536,22 @@ export declare abstract class ClientGeneric {
|
|
|
1474
1536
|
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
1475
1537
|
*/
|
|
1476
1538
|
abstract deleteChatStickerSet(chatId: ID): Promise<void>;
|
|
1539
|
+
/**
|
|
1540
|
+
* Delete revoked invite links. User-only.
|
|
1541
|
+
*
|
|
1542
|
+
* @method ch
|
|
1543
|
+
* @param chatId The identifier of the chat.
|
|
1544
|
+
* @param userId The user identifier of a chat admin.
|
|
1545
|
+
*/
|
|
1546
|
+
abstract deleteRevokedInviteLinks(chatId: ID, userId: ID): Promise<void>;
|
|
1547
|
+
/**
|
|
1548
|
+
* Delete a forum topic.
|
|
1549
|
+
*
|
|
1550
|
+
* @method ch
|
|
1551
|
+
* @param chatId The identifier of the chat.
|
|
1552
|
+
* @param topicId The identifier of the topic.
|
|
1553
|
+
*/
|
|
1554
|
+
abstract deleteTopic(chatId: ID, topicId: number): Promise<void>;
|
|
1477
1555
|
/**
|
|
1478
1556
|
* Disable automatic anti-spam in a group. User-only.
|
|
1479
1557
|
*
|
|
@@ -1590,6 +1668,13 @@ export declare abstract class ClientGeneric {
|
|
|
1590
1668
|
* @param isShownAsTabs Whether topics should be displayed as tabs.
|
|
1591
1669
|
*/
|
|
1592
1670
|
abstract enableTopics(chatId: ID, isShownAsTabs: boolean): Promise<void>;
|
|
1671
|
+
/**
|
|
1672
|
+
* Get administered chats. User-only.
|
|
1673
|
+
*
|
|
1674
|
+
* @method ch
|
|
1675
|
+
* @returns A list of administered chats.
|
|
1676
|
+
*/
|
|
1677
|
+
abstract getAdministeredChats(params?: GetAdministeredChatsParams): Promise<ChatP[]>;
|
|
1593
1678
|
/**
|
|
1594
1679
|
* Get a chat.
|
|
1595
1680
|
*
|
|
@@ -1697,6 +1782,13 @@ export declare abstract class ClientGeneric {
|
|
|
1697
1782
|
* @param from The chat list to get the pinned chats from. Defaults to main.
|
|
1698
1783
|
*/
|
|
1699
1784
|
abstract getPinnedChats(from?: "archived" | "main"): Promise<ChatListItem[]>;
|
|
1785
|
+
/**
|
|
1786
|
+
* Get the recent actions of a channel or a supergroup. User-only.
|
|
1787
|
+
*
|
|
1788
|
+
* @method ch
|
|
1789
|
+
* @param chatId The identifier of the chat.
|
|
1790
|
+
*/
|
|
1791
|
+
abstract getRecentActions(chatId: ID, params?: GetRecentActionsParams): Promise<RecentActionsEntry[]>;
|
|
1700
1792
|
/**
|
|
1701
1793
|
* Get recommended channels. User-only.
|
|
1702
1794
|
*
|
|
@@ -1763,7 +1855,14 @@ export declare abstract class ClientGeneric {
|
|
|
1763
1855
|
* @method ch
|
|
1764
1856
|
* @param chatId The identifier of a chat.
|
|
1765
1857
|
*/
|
|
1766
|
-
abstract joinChat(chatId: ID): Promise<
|
|
1858
|
+
abstract joinChat(chatId: ID): Promise<ChatJoinResult>;
|
|
1859
|
+
/**
|
|
1860
|
+
* Join a chat using an invite link. User-only.
|
|
1861
|
+
*
|
|
1862
|
+
* @method ch
|
|
1863
|
+
* @param inviteLink The chat's invite link.
|
|
1864
|
+
*/
|
|
1865
|
+
abstract joinChatByInviteLink(inviteLink: string): Promise<ChatJoinResult>;
|
|
1767
1866
|
/**
|
|
1768
1867
|
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
1769
1868
|
*
|
|
@@ -1839,6 +1938,13 @@ export declare abstract class ClientGeneric {
|
|
|
1839
1938
|
* @param reason The reason of the report.
|
|
1840
1939
|
*/
|
|
1841
1940
|
abstract reportChat(chatId: ID, reason: ReportReason, params?: ReportChatParams): Promise<void>;
|
|
1941
|
+
/**
|
|
1942
|
+
* Resolve an invite link. User-only.
|
|
1943
|
+
*
|
|
1944
|
+
* @method ch
|
|
1945
|
+
* @param inviteLink The invite link to resolve.
|
|
1946
|
+
*/
|
|
1947
|
+
abstract resolveInviteLink(inviteLink: string): Promise<ChatP | ResolvedInviteLink>;
|
|
1842
1948
|
/**
|
|
1843
1949
|
* Set a chat's available reactions. User-only.
|
|
1844
1950
|
*
|
|
@@ -2447,7 +2553,7 @@ export declare abstract class ClientGeneric {
|
|
|
2447
2553
|
*/
|
|
2448
2554
|
abstract getContacts(): Promise<User[]>;
|
|
2449
2555
|
/**
|
|
2450
|
-
* Set a contact note.
|
|
2556
|
+
* Set a contact note. User-only.
|
|
2451
2557
|
*
|
|
2452
2558
|
* @method co
|
|
2453
2559
|
* @param userId The identifier of the user to update the note for.
|
|
@@ -2560,6 +2666,14 @@ export declare abstract class ClientGeneric {
|
|
|
2560
2666
|
* @param gifts The gifts to remove from the collection.
|
|
2561
2667
|
*/
|
|
2562
2668
|
abstract removeGiftsFromCollection(chatId: ID, collectionId: number, gifts: InputGift[]): Promise<GiftCollection>;
|
|
2669
|
+
/**
|
|
2670
|
+
* Reorder gift collections. User-only.
|
|
2671
|
+
*
|
|
2672
|
+
* @method gc
|
|
2673
|
+
* @param chatId The identifier of the chat that includes the gift collections.
|
|
2674
|
+
* @param collectionIds The identifiers of the gift collections.
|
|
2675
|
+
*/
|
|
2676
|
+
abstract reorderGiftCollections(chatId: ID, collectionIds: number[]): Promise<void>;
|
|
2563
2677
|
/**
|
|
2564
2678
|
* Reorder gifts in a gift collection. User-only.
|
|
2565
2679
|
*
|
|
@@ -2599,6 +2713,13 @@ export declare abstract class ClientGeneric {
|
|
|
2599
2713
|
* @returns The identifier of the takeout session.
|
|
2600
2714
|
*/
|
|
2601
2715
|
abstract startTakeoutSession(params?: StartTakeoutSessionParams): Promise<string>;
|
|
2716
|
+
/**
|
|
2717
|
+
* Add a sticker set. User-only.
|
|
2718
|
+
*
|
|
2719
|
+
* @method ss
|
|
2720
|
+
* @param slug The slug of the sticker set or its link.
|
|
2721
|
+
*/
|
|
2722
|
+
abstract addStickerSet(slug: string): Promise<void>;
|
|
2602
2723
|
/**
|
|
2603
2724
|
* Add a sticker to a sticker set.
|
|
2604
2725
|
*
|
|
@@ -2607,6 +2728,13 @@ export declare abstract class ClientGeneric {
|
|
|
2607
2728
|
* @param sticker The sticker to add.
|
|
2608
2729
|
*/
|
|
2609
2730
|
abstract addStickerToStickerSet(slug: string, sticker: InputSticker, params?: AddStickerToStickerSetParams): Promise<void>;
|
|
2731
|
+
/**
|
|
2732
|
+
* Archive a sticker set. User-only.
|
|
2733
|
+
*
|
|
2734
|
+
* @method ss
|
|
2735
|
+
* @param slug The slug of the sticker set or its link.
|
|
2736
|
+
*/
|
|
2737
|
+
abstract archiveStickerSet(slug: string): Promise<void>;
|
|
2610
2738
|
/**
|
|
2611
2739
|
* Change the position of a sticker in its set.
|
|
2612
2740
|
*
|
|
@@ -2639,6 +2767,12 @@ export declare abstract class ClientGeneric {
|
|
|
2639
2767
|
* @param slug The slug of the sticker set or its link.
|
|
2640
2768
|
*/
|
|
2641
2769
|
abstract deleteStickerSet(slug: string): Promise<void>;
|
|
2770
|
+
/**
|
|
2771
|
+
* Get added sticker sets. User-only.
|
|
2772
|
+
*
|
|
2773
|
+
* @method ss
|
|
2774
|
+
*/
|
|
2775
|
+
abstract getAddedStickerSets(): Promise<StickerSetP[]>;
|
|
2642
2776
|
/**
|
|
2643
2777
|
* Get a dice sticker set.
|
|
2644
2778
|
*
|
|
@@ -2660,6 +2794,13 @@ export declare abstract class ClientGeneric {
|
|
|
2660
2794
|
* @param fileId The identifier of the sticker.
|
|
2661
2795
|
*/
|
|
2662
2796
|
abstract removeStickerFromStickerSet(fileId: string): Promise<void>;
|
|
2797
|
+
/**
|
|
2798
|
+
* Remove a sticker set. User-only.
|
|
2799
|
+
*
|
|
2800
|
+
* @method ss
|
|
2801
|
+
* @param slug The slug of the sticker set or its link.
|
|
2802
|
+
*/
|
|
2803
|
+
abstract removeStickerSet(slug: string): Promise<void>;
|
|
2663
2804
|
/**
|
|
2664
2805
|
* Replace a sticker's emoji.
|
|
2665
2806
|
*
|
|
@@ -2704,10 +2845,17 @@ export declare abstract class ClientGeneric {
|
|
|
2704
2845
|
* Suggest a sticker set slug from its title.
|
|
2705
2846
|
*
|
|
2706
2847
|
* @method ss
|
|
2707
|
-
* @param title A
|
|
2848
|
+
* @param title A sticker set title.
|
|
2708
2849
|
* @returns The suggested slug.
|
|
2709
2850
|
*/
|
|
2710
2851
|
abstract suggestStickerSetSlug(title: string): Promise<string>;
|
|
2852
|
+
/**
|
|
2853
|
+
* Unarchive a sticker set. User-only.
|
|
2854
|
+
*
|
|
2855
|
+
* @method ss
|
|
2856
|
+
* @param slug The slug of the sticker set or its link.
|
|
2857
|
+
*/
|
|
2858
|
+
abstract unarchiveStickerSet(slug: string): Promise<void>;
|
|
2711
2859
|
/**
|
|
2712
2860
|
* Set the access settings of a managed bot. Bot-only.
|
|
2713
2861
|
*
|