@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_storage_operations.d.ts","sourceRoot":"","sources":["../../src/client/0_storage_operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+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K,EAAE,CAAC,GAAG,IAAI;IAOnB,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,OAAO,IAAI,CAAC,GAAG,IAAI;IAIb,GAAG,IAAI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAOxB,MAAM;CAOb;AAED,UAAU,IAAI;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IACxC,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,cAAM,WAAY,SAAQ,YAAY,CAAC,IAAI,CAAC;;gBAC9B,OAAO,EAAE,OAAO;IAIb,GAAG,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAMjC,OAAO,IAAI,IAAI;IAUT,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAK9B,MAAM,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI;IAerC,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAE7B;CACF"}
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { MINUTE } from "../0_deps.js";
|
|
21
21
|
import { LruCache, unreachable } from "../0_deps.js";
|
|
22
|
-
import { InputError } from "../0_errors.js";
|
|
23
22
|
import { base64DecodeUrlSafe, base64EncodeUrlSafe, getLogger, intFromBytes, rleDecode, rleEncode, sha1, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
24
23
|
import { awaitablePooledMap } from "../1_utilities.js";
|
|
25
24
|
import { fromString, toString } from "../2_storage.js";
|
|
26
25
|
import { Api, TLReader, TLWriter, X } from "../2_tl.js";
|
|
27
26
|
import { constructChatP } from "../3_types.js";
|
|
27
|
+
import { InputError } from "../4_errors.js";
|
|
28
28
|
export const K = {
|
|
29
29
|
session: {
|
|
30
30
|
P: (string) => `session.${string}`,
|
|
@@ -71,6 +71,9 @@ export const K = {
|
|
|
71
71
|
voiceTranscription: (transcriptionId) => [...K.cache.voiceTranscriptions(), transcriptionId],
|
|
72
72
|
voiceTranscriptionReferences: () => [K.cache.P("voiceTranscriptionReferences")],
|
|
73
73
|
voiceTranscriptionReference: (chatId, messageId, messageEditDate) => [...K.cache.voiceTranscriptionReferences(), chatId, messageId, messageEditDate],
|
|
74
|
+
minPeerReferences: () => [K.cache.P("minPeerReferences")],
|
|
75
|
+
minPeerReference: (senderId, chatId) => [...K.cache.minPeerReferences(), senderId, chatId],
|
|
76
|
+
minPeerReferenceSender: (senderId) => [...K.cache.minPeerReferences(), senderId],
|
|
74
77
|
},
|
|
75
78
|
messages: {
|
|
76
79
|
P: (string) => `messages.${string}`,
|
|
@@ -141,7 +144,7 @@ export class StorageOperations {
|
|
|
141
144
|
}
|
|
142
145
|
const auth = this.auth.mustGet();
|
|
143
146
|
if (auth.dc === null || auth.authKey === null || auth.apiId === 0 || auth.userId === 0) {
|
|
144
|
-
throw new
|
|
147
|
+
throw new InputError("Not authorized.");
|
|
145
148
|
}
|
|
146
149
|
const writer = new TLWriter();
|
|
147
150
|
writer.writeString(auth.dc);
|
|
@@ -421,11 +424,7 @@ export class StorageOperations {
|
|
|
421
424
|
await this.setTlObject(K.updates.update(boxId, this.#getUpdateId(update)), update);
|
|
422
425
|
}
|
|
423
426
|
async deleteUpdates() {
|
|
424
|
-
|
|
425
|
-
for await (const [k] of await this.#storage.getMany({ prefix: K.updates.all() })) {
|
|
426
|
-
maybePromises.push(this.#storage.set(k, null));
|
|
427
|
-
}
|
|
428
|
-
await Promise.all(maybePromises.filter((v) => v instanceof Promise));
|
|
427
|
+
await this.#deleteByPrefix(K.updates.all());
|
|
429
428
|
}
|
|
430
429
|
async getFirstUpdate(boxId) {
|
|
431
430
|
for await (const [key, update] of await this.#storage.getMany({ prefix: K.updates.updates(boxId) }, { limit: 1 })) {
|
|
@@ -466,51 +465,41 @@ export class StorageOperations {
|
|
|
466
465
|
return null;
|
|
467
466
|
}
|
|
468
467
|
}
|
|
468
|
+
async #deleteByPrefix(prefix) {
|
|
469
|
+
for await (const [key] of await this.#storage.getMany({ prefix })) {
|
|
470
|
+
await this.#storage.set(key, null);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
469
473
|
async deleteFiles() {
|
|
470
474
|
if (!this.#supportsFiles) {
|
|
471
475
|
return;
|
|
472
476
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
for await (const [key] of await this.#storage.getMany({ prefix: K.cache.files() })) {
|
|
477
|
-
await this.#storage.set(key, null);
|
|
478
|
-
}
|
|
477
|
+
await this.#deleteByPrefix(K.cache.fileParts());
|
|
478
|
+
await this.#deleteByPrefix(K.cache.files());
|
|
479
479
|
}
|
|
480
480
|
async deleteCustomEmojiDocuments() {
|
|
481
|
-
|
|
482
|
-
await this.#storage.set(key, null);
|
|
483
|
-
}
|
|
481
|
+
await this.#deleteByPrefix(K.cache.customEmojiDocuments());
|
|
484
482
|
}
|
|
485
483
|
async deleteBusinessConnections() {
|
|
486
|
-
|
|
487
|
-
await this.#storage.set(key, null);
|
|
488
|
-
}
|
|
484
|
+
await this.#deleteByPrefix(K.cache.businessConnections());
|
|
489
485
|
}
|
|
490
486
|
async deleteInlineQueryAnswers() {
|
|
491
|
-
|
|
492
|
-
await this.#storage.set(key, null);
|
|
493
|
-
}
|
|
487
|
+
await this.#deleteByPrefix(K.cache.inlineQueryAnswers());
|
|
494
488
|
}
|
|
495
489
|
async deleteCallbackQueryAnswers() {
|
|
496
|
-
|
|
497
|
-
await this.#storage.set(key, null);
|
|
498
|
-
}
|
|
490
|
+
await this.#deleteByPrefix(K.cache.callbackQueryAnswers());
|
|
499
491
|
}
|
|
500
492
|
async deleteFullChats() {
|
|
501
|
-
|
|
502
|
-
await this.#storage.set(key, null);
|
|
503
|
-
}
|
|
493
|
+
await this.#deleteByPrefix(K.cache.fullChats());
|
|
504
494
|
}
|
|
505
495
|
async deleteGroupCalls() {
|
|
506
|
-
|
|
507
|
-
await this.#storage.set(key, null);
|
|
508
|
-
}
|
|
496
|
+
await this.#deleteByPrefix(K.cache.groupCalls());
|
|
509
497
|
}
|
|
510
498
|
async deleteStickerSetNames() {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
499
|
+
await this.#deleteByPrefix(K.cache.stickerSetNames());
|
|
500
|
+
}
|
|
501
|
+
async deleteMinPeerReferences() {
|
|
502
|
+
await this.#deleteByPrefix(K.cache.minPeerReferences());
|
|
514
503
|
}
|
|
515
504
|
async clear() {
|
|
516
505
|
await Promise.all([
|
|
@@ -531,12 +520,11 @@ export class StorageOperations {
|
|
|
531
520
|
this.deletePolls(),
|
|
532
521
|
this.deleteVoiceTranscriptions(),
|
|
533
522
|
this.deleteVoiceTranscriptionReferences(),
|
|
523
|
+
this.deleteMinPeerReferences(),
|
|
534
524
|
]);
|
|
535
525
|
}
|
|
536
526
|
async reset() {
|
|
537
|
-
|
|
538
|
-
await this.#storage.set(key, null);
|
|
539
|
-
}
|
|
527
|
+
await this.#deleteByPrefix([]);
|
|
540
528
|
}
|
|
541
529
|
async setPollResults(pollId, pollResults) {
|
|
542
530
|
await this.setTlObject(K.cache.pollResult(pollId), pollResults);
|
|
@@ -545,11 +533,7 @@ export class StorageOperations {
|
|
|
545
533
|
return await this.getTlObject(K.cache.pollResult(pollId));
|
|
546
534
|
}
|
|
547
535
|
async deletePollResults() {
|
|
548
|
-
|
|
549
|
-
for await (const [key] of await this.#storage.getMany({ prefix: K.cache.pollResults() })) {
|
|
550
|
-
maybePromises.push(this.#storage.set(key, null));
|
|
551
|
-
}
|
|
552
|
-
await Promise.all(maybePromises);
|
|
536
|
+
await this.#deleteByPrefix(K.cache.pollResults());
|
|
553
537
|
}
|
|
554
538
|
async setPoll(pollId, poll) {
|
|
555
539
|
await this.setTlObject(K.cache.poll(pollId), poll);
|
|
@@ -558,11 +542,7 @@ export class StorageOperations {
|
|
|
558
542
|
return await this.getTlObject(K.cache.poll(pollId));
|
|
559
543
|
}
|
|
560
544
|
async deletePolls() {
|
|
561
|
-
|
|
562
|
-
for await (const [key] of await this.#storage.getMany({ prefix: K.cache.polls() })) {
|
|
563
|
-
maybePromises.push(this.#storage.set(key, null));
|
|
564
|
-
}
|
|
565
|
-
await Promise.all(maybePromises);
|
|
545
|
+
await this.#deleteByPrefix(K.cache.polls());
|
|
566
546
|
}
|
|
567
547
|
async setVoiceTranscription(voiceTranscription) {
|
|
568
548
|
await this.#storage.set(K.cache.voiceTranscription(BigInt(voiceTranscription.id)), voiceTranscription);
|
|
@@ -584,11 +564,20 @@ export class StorageOperations {
|
|
|
584
564
|
return await this.#storage.get(K.cache.voiceTranscriptionReference(chatId, messageId, messageEditDate.getTime()));
|
|
585
565
|
}
|
|
586
566
|
async deleteVoiceTranscriptionReferences() {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
567
|
+
await this.#deleteByPrefix(K.cache.voiceTranscriptionReferences());
|
|
568
|
+
}
|
|
569
|
+
async addMinPeerReference(chatId, senderId, messageId) {
|
|
570
|
+
await this.#storage.set(K.cache.minPeerReference(senderId, chatId), [{ chatId, messageId }, new Date()]);
|
|
571
|
+
}
|
|
572
|
+
async getLastMinPeerReference(senderId) {
|
|
573
|
+
const references = new Array();
|
|
574
|
+
for await (const [, reference] of await this.#storage.getMany({ prefix: K.cache.minPeerReferenceSender(senderId) })) {
|
|
575
|
+
references.push(reference);
|
|
576
|
+
if (references.length > 99) {
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
590
579
|
}
|
|
591
|
-
|
|
580
|
+
return references.sort((a, b) => b[1].getTime() - a[1].getTime())[0]?.[0] ?? null;
|
|
592
581
|
}
|
|
593
582
|
}
|
|
594
583
|
class StorageMap {
|
|
@@ -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
|
*
|