@mtkruto/node 0.180.0 → 0.190.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/0_params.d.ts +44 -38
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +51 -5
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.js +19 -12
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +20 -14
- package/esm/client/3_account_manager.d.ts +2 -0
- package/esm/client/3_account_manager.d.ts.map +1 -1
- package/esm/client/3_account_manager.js +10 -0
- package/esm/client/3_message_manager.d.ts +1 -0
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +26 -19
- package/esm/client/3_secret_chat_manager.d.ts +3 -2
- package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
- package/esm/client/3_secret_chat_manager.js +53 -10
- package/esm/client/4_chat_manager.d.ts +2 -1
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +7 -1
- package/esm/client/4_context.d.ts +126 -32
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +321 -77
- package/esm/client/4_poll_manager.d.ts +3 -1
- package/esm/client/4_poll_manager.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +16 -5
- package/esm/client/6_client.d.ts +53 -5
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +63 -3
- package/esm/client/6_client_dispatcher.d.ts +51 -5
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +61 -3
- package/esm/types/0_checklist_changed.d.ts +1 -1
- package/esm/types/0_checklist_changed.d.ts.map +1 -1
- package/esm/types/0_location.d.ts +2 -2
- package/esm/types/0_location.d.ts.map +1 -1
- package/esm/types/0_message_viewer.d.ts +29 -0
- package/esm/types/0_message_viewer.d.ts.map +1 -0
- package/esm/types/0_message_viewer.js +25 -0
- package/esm/types/1_input_poll_media.d.ts +5 -5
- package/esm/types/1_input_poll_media.d.ts.map +1 -1
- package/esm/types/1_input_sticker.d.ts +1 -1
- package/esm/types/1_sticker.d.ts +3 -3
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_video.d.ts +3 -3
- package/esm/types/1_video.d.ts.map +1 -1
- package/esm/types/1_video_note.d.ts +3 -3
- package/esm/types/1_video_note.d.ts.map +1 -1
- package/esm/types/2_poll_voter.d.ts +13 -0
- package/esm/types/2_poll_voter.d.ts.map +1 -0
- package/esm/types/2_poll_voter.js +18 -0
- package/esm/types/3_input_media.d.ts +5 -5
- package/esm/types/3_input_media.d.ts.map +1 -1
- package/esm/types/3_poll_voter_list.d.ts +31 -0
- package/esm/types/3_poll_voter_list.d.ts.map +1 -0
- package/esm/types/3_poll_voter_list.js +28 -0
- package/esm/types/4_reply_to.d.ts +2 -2
- package/esm/types/4_reply_to.d.ts.map +1 -1
- package/esm/types/6_message_content.d.ts +2 -2
- package/esm/types/6_message_content.d.ts.map +1 -1
- package/esm/types/B_update.d.ts +9 -9
- 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/0_params.d.ts +44 -38
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +51 -5
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/2_client_encrypted.d.ts.map +1 -1
- package/script/client/2_client_encrypted.js +19 -12
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +20 -14
- package/script/client/3_account_manager.d.ts +2 -0
- package/script/client/3_account_manager.d.ts.map +1 -1
- package/script/client/3_account_manager.js +10 -0
- package/script/client/3_message_manager.d.ts +1 -0
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +25 -18
- package/script/client/3_secret_chat_manager.d.ts +3 -2
- package/script/client/3_secret_chat_manager.d.ts.map +1 -1
- package/script/client/3_secret_chat_manager.js +50 -7
- package/script/client/4_chat_manager.d.ts +2 -1
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +7 -1
- package/script/client/4_context.d.ts +126 -32
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +321 -77
- package/script/client/4_poll_manager.d.ts +3 -1
- package/script/client/4_poll_manager.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +15 -4
- package/script/client/6_client.d.ts +53 -5
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +63 -3
- package/script/client/6_client_dispatcher.d.ts +51 -5
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +61 -3
- package/script/types/0_checklist_changed.d.ts +1 -1
- package/script/types/0_checklist_changed.d.ts.map +1 -1
- package/script/types/0_location.d.ts +2 -2
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_message_viewer.d.ts +29 -0
- package/script/types/0_message_viewer.d.ts.map +1 -0
- package/script/types/0_message_viewer.js +28 -0
- package/script/types/1_input_poll_media.d.ts +5 -5
- package/script/types/1_input_poll_media.d.ts.map +1 -1
- package/script/types/1_input_sticker.d.ts +1 -1
- package/script/types/1_sticker.d.ts +3 -3
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_video.d.ts +3 -3
- package/script/types/1_video.d.ts.map +1 -1
- package/script/types/1_video_note.d.ts +3 -3
- package/script/types/1_video_note.d.ts.map +1 -1
- package/script/types/2_poll_voter.d.ts +13 -0
- package/script/types/2_poll_voter.d.ts.map +1 -0
- package/script/types/2_poll_voter.js +21 -0
- package/script/types/3_input_media.d.ts +5 -5
- package/script/types/3_input_media.d.ts.map +1 -1
- package/script/types/3_poll_voter_list.d.ts +31 -0
- package/script/types/3_poll_voter_list.d.ts.map +1 -0
- package/script/types/3_poll_voter_list.js +31 -0
- package/script/types/4_reply_to.d.ts +2 -2
- package/script/types/4_reply_to.d.ts.map +1 -1
- package/script/types/6_message_content.d.ts +2 -2
- package/script/types/6_message_content.d.ts.map +1 -1
- package/script/types/B_update.d.ts +9 -9
- package/script/types/B_update.d.ts.map +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Api } from "../2_tl.js";
|
|
2
|
-
import { type FileSource, type ID, type Update } from "../3_types.js";
|
|
3
|
-
import type { EndSecretChatParams, SendSecretAnimationParams, SendSecretAudioParams, SendSecretContactParams, SendSecretDocumentParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretPhotoParams, SendSecretVenueParams, SendSecretVideoNoteParams, SendSecretVideoParams, SendSecretVoiceParams } from "./0_params.js";
|
|
2
|
+
import { type FileSource, type ID, type Sticker, type Update } from "../3_types.js";
|
|
3
|
+
import type { EndSecretChatParams, SendSecretAnimationParams, SendSecretAudioParams, SendSecretContactParams, SendSecretDocumentParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretPhotoParams, SendSecretStickerParams, SendSecretVenueParams, SendSecretVideoNoteParams, SendSecretVideoParams, SendSecretVoiceParams } from "./0_params.js";
|
|
4
4
|
import type { UpdateProcessor } from "./0_update_processor.js";
|
|
5
5
|
import type { C as C_ } from "./1_types.js";
|
|
6
6
|
import type { FileManager } from "./2_file_manager.js";
|
|
@@ -27,6 +27,7 @@ export declare class SecretChatManager implements UpdateProcessor<SecretChatMana
|
|
|
27
27
|
sendSecretVoice(id: number, voice: FileSource, params?: SendSecretVoiceParams): Promise<void>;
|
|
28
28
|
sendSecretAnimation(id: number, animation: FileSource, params?: SendSecretAnimationParams): Promise<void>;
|
|
29
29
|
sendSecretPhoto(id: number, photo: FileSource, params?: SendSecretPhotoParams): Promise<void>;
|
|
30
|
+
sendSecretSticker(id: number, sticker: Sticker, params?: SendSecretStickerParams): Promise<void>;
|
|
30
31
|
canHandleUpdate(update: Api.Update): update is SecretChatManagerUpdate;
|
|
31
32
|
handleUpdate(update: SecretChatManagerUpdate): Promise<Update | null>;
|
|
32
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_secret_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_secret_chat_manager.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"3_secret_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_secret_chat_manager.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,GAAG,EAA4C,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAqB,KAAK,UAAU,EAAE,KAAK,EAAE,EAAiC,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAGtI,OAAO,KAAK,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGjW,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,UAAU,CAAE,SAAQ,EAAE;IACpB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,QAAA,MAAM,wBAAwB,4DAGpB,CAAC;AAEX,KAAK,uBAAuB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpF,qBAAa,iBAAkB,YAAW,eAAe,CAAC,uBAAuB,EAAE,IAAI,C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AE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,yBAAyB;IAwCzF,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,qBAAqB;IAoC7E,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,uBAAuB;IA4gBtF,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,uBAAuB;IAIhE,YAAY,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAuG5E"}
|
|
@@ -19,11 +19,11 @@ var _a;
|
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
import * as dntShim from "../_dnt.shims.js";
|
|
22
|
-
import { concat, equals, ige256Decrypt, ige256Encrypt, WEEK } from "../0_deps.js";
|
|
22
|
+
import { concat, equals, ige256Decrypt, ige256Encrypt, unreachable, WEEK } from "../0_deps.js";
|
|
23
23
|
import { InputError } from "../0_errors.js";
|
|
24
24
|
import { getLogger, getRandomId, getRandomInt, intFromBytes, intToBytes, mod, modExp, sha1, sha256 } from "../1_utilities.js";
|
|
25
|
-
import { Api, SecretChats, TLReader, TLWriter, X } from "../2_tl.js";
|
|
26
|
-
import { secretMessageEntityToTlObject } from "../3_types.js";
|
|
25
|
+
import { Api, repr, SecretChats, TLReader, TLWriter, X } from "../2_tl.js";
|
|
26
|
+
import { deserializeFileId, secretMessageEntityToTlObject } from "../3_types.js";
|
|
27
27
|
import { constructSecretChat } from "../types/0_secret_chat.js";
|
|
28
28
|
import { constructSecretMessage } from "../types/2_secret_message.js";
|
|
29
29
|
import { isGoodModExpFirst, isSafePrime } from "./0_password.js";
|
|
@@ -504,6 +504,45 @@ export class SecretChatManager {
|
|
|
504
504
|
await this.#sendMessage(decryptedMessage, state.encryptedChat, state.authKey, state.authKeyId_, inputEncryptedFile);
|
|
505
505
|
await this.#postSendMessage(state);
|
|
506
506
|
}
|
|
507
|
+
async sendSecretSticker(id, sticker, params) {
|
|
508
|
+
this.#c.storage.assertUser("sendSecretSticker");
|
|
509
|
+
if (!sticker.setName) {
|
|
510
|
+
throw new InputError("This sticker cannot be sent to a secret chat.");
|
|
511
|
+
}
|
|
512
|
+
const state = this.#mustGetEncryptedChat(id);
|
|
513
|
+
let inputEncryptedFile;
|
|
514
|
+
const fileID = deserializeFileId(sticker.fileId);
|
|
515
|
+
if (fileID.location.type !== "common") {
|
|
516
|
+
unreachable();
|
|
517
|
+
}
|
|
518
|
+
const media = {
|
|
519
|
+
_: "decryptedMessageMediaExternalDocument",
|
|
520
|
+
dc_id: fileID.dcId,
|
|
521
|
+
access_hash: fileID.location.accessHash,
|
|
522
|
+
attributes: [
|
|
523
|
+
{ _: "documentAttributeImageSize", w: sticker.width, h: sticker.height },
|
|
524
|
+
{ _: "documentAttributeSticker", alt: sticker.emoji ?? "", stickerset: { _: "inputStickerSetShortName", short_name: sticker.setName } },
|
|
525
|
+
],
|
|
526
|
+
date: 0,
|
|
527
|
+
id: fileID.location.id,
|
|
528
|
+
size: sticker.fileSize ?? 0,
|
|
529
|
+
thumb: { _: "photoSizeEmpty", type: "s" },
|
|
530
|
+
mime_type: sticker.isVideo ? "video/webm" : sticker.isAnimated ? "application/x-tgsticker" : "image/webp",
|
|
531
|
+
};
|
|
532
|
+
const random_id = getRandomId();
|
|
533
|
+
const decryptedMessage = {
|
|
534
|
+
_: "decryptedMessage",
|
|
535
|
+
message: "",
|
|
536
|
+
random_id,
|
|
537
|
+
ttl: params?.ttl ?? 0,
|
|
538
|
+
silent: params?.isSilent || undefined,
|
|
539
|
+
reply_to_random_id: params?.replyToMessageId ? BigInt(params.replyToMessageId) : undefined,
|
|
540
|
+
via_bot_name: params?.viaBot,
|
|
541
|
+
media,
|
|
542
|
+
};
|
|
543
|
+
await this.#sendMessage(decryptedMessage, state.encryptedChat, state.authKey, state.authKeyId_, inputEncryptedFile);
|
|
544
|
+
await this.#postSendMessage(state);
|
|
545
|
+
}
|
|
507
546
|
#sendTails = new Map();
|
|
508
547
|
async #sendMessage(message, encryptedChat, authKey, authKeyId, file) {
|
|
509
548
|
try {
|
|
@@ -530,7 +569,6 @@ export class SecretChatManager {
|
|
|
530
569
|
}
|
|
531
570
|
}
|
|
532
571
|
async #sendMessageUnlocked(message, encryptedChat, authKey, authKeyId, file) {
|
|
533
|
-
const random_id = getRandomId();
|
|
534
572
|
const isCreator = Number(encryptedChat.admin_id) === await this.#c.getSelfId();
|
|
535
573
|
const out_seq_no = this.#getNextOutSeqNo(encryptedChat.id, isCreator);
|
|
536
574
|
const in_seq_no = this.#getInSeqNo(encryptedChat.id, isCreator);
|
|
@@ -538,19 +576,24 @@ export class SecretChatManager {
|
|
|
538
576
|
const data = await this.#encryptMessage(isCreator, authKeyId, authKey, decryptedMessageLayer);
|
|
539
577
|
this.#getSecretChatState(encryptedChat.id).outgoingMessages.set((out_seq_no - (isCreator ? 1 : 0)) / 2, data);
|
|
540
578
|
if (file) {
|
|
541
|
-
await this.#c.invoke({
|
|
579
|
+
const result = await this.#c.invoke({
|
|
542
580
|
_: "messages.sendEncryptedFile",
|
|
581
|
+
silent: SecretChats.is("decryptedMessage", message) && message.silent ? true : undefined,
|
|
543
582
|
peer: { _: "inputEncryptedChat", chat_id: encryptedChat.id, access_hash: encryptedChat.access_hash },
|
|
544
|
-
random_id,
|
|
583
|
+
random_id: message.random_id,
|
|
545
584
|
data,
|
|
546
585
|
file,
|
|
547
586
|
});
|
|
587
|
+
if (!Api.is("messages.sentEncryptedFile", result) || !Api.is("encryptedFile", result.file) || result.file.size <= 0n) {
|
|
588
|
+
throw new InputError("Telegram did not attach the encrypted file to the secret message.");
|
|
589
|
+
}
|
|
548
590
|
}
|
|
549
591
|
else {
|
|
550
592
|
await this.#c.invoke({
|
|
551
593
|
_: "messages.sendEncrypted",
|
|
594
|
+
silent: SecretChats.is("decryptedMessage", message) && message.silent ? true : undefined,
|
|
552
595
|
peer: { _: "inputEncryptedChat", chat_id: encryptedChat.id, access_hash: encryptedChat.access_hash },
|
|
553
|
-
random_id,
|
|
596
|
+
random_id: message.random_id,
|
|
554
597
|
data,
|
|
555
598
|
});
|
|
556
599
|
}
|
|
@@ -709,7 +752,7 @@ export class SecretChatManager {
|
|
|
709
752
|
const start = (action.start_seq_no - x) / 2;
|
|
710
753
|
const end = (action.end_seq_no - x) / 2;
|
|
711
754
|
if (start % 1 !== 0 || end % 1 !== 0 || start < 0 || end < start || end >= state.outSeqNo) {
|
|
712
|
-
this.#L.debug("discarding secret chat", state.encryptedChat.id, "because an invalid resend
|
|
755
|
+
this.#L.debug("discarding secret chat", state.encryptedChat.id, "because an invalid resend range was received");
|
|
713
756
|
await this.#c.invoke({ _: "messages.discardEncryption", chat_id: state.encryptedChat.id });
|
|
714
757
|
throw new TypeError("Received invalid secret chat resend range.");
|
|
715
758
|
}
|
|
@@ -717,7 +760,7 @@ export class SecretChatManager {
|
|
|
717
760
|
for (let seqNo = start; seqNo <= end; ++seqNo) {
|
|
718
761
|
const message = state.outgoingMessages.get(seqNo);
|
|
719
762
|
if (!message) {
|
|
720
|
-
this.#L.debug("discarding secret chat", state.encryptedChat.id, "because
|
|
763
|
+
this.#L.debug("discarding secret chat", state.encryptedChat.id, "because the message could not be resent");
|
|
721
764
|
await this.#c.invoke({ _: "messages.discardEncryption", chat_id: state.encryptedChat.id });
|
|
722
765
|
throw new TypeError("Unable to resend secret chat message.");
|
|
723
766
|
}
|
|
@@ -913,7 +956,7 @@ export class SecretChatManager {
|
|
|
913
956
|
authKeyId = state.previousAuthKeyId_;
|
|
914
957
|
}
|
|
915
958
|
const decryptedMessage = await this.#decryptMessage(authKeyId, authKey, isCreator, update.message.bytes);
|
|
916
|
-
this.#L.debug("received", decryptedMessage);
|
|
959
|
+
this.#L.debug("received", repr(decryptedMessage));
|
|
917
960
|
if (SecretChats.is("decryptedMessageLayer", decryptedMessage)) {
|
|
918
961
|
const x = isCreator ? 0 : 1;
|
|
919
962
|
const rawOutSeqNo = (decryptedMessage.out_seq_no - x) / 2;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { type AvailableReactions, type ChatP, type SlowModeDuration } from "../3_types.js";
|
|
22
22
|
import { type FileSource, type ID, type ReportReason, type Update } from "../3_types.js";
|
|
23
|
-
import type { AddChatMemberParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateInviteLinkParams, DeclineJoinRequestsParams, EnableSignaturesParams, GetCreatedInviteLinksParams, GetJoinRequestsParams, PromoteChatMemberParams, ReportChatParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams } from "./0_params.js";
|
|
23
|
+
import type { AddChatMemberParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateInviteLinkParams, DeclineJoinRequestsParams, EnableSignaturesParams, GetCreatedInviteLinksParams, GetJoinRequestsParams, MarkAllMentionsAsReadParams, PromoteChatMemberParams, ReportChatParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams } from "./0_params.js";
|
|
24
24
|
import type { UpdateProcessor } from "./0_update_processor.js";
|
|
25
25
|
import type { C as C_ } from "./1_types.js";
|
|
26
26
|
import type { FileManager } from "./2_file_manager.js";
|
|
@@ -88,6 +88,7 @@ export declare class ChatManager implements UpdateProcessor<ChatManagerUpdate, t
|
|
|
88
88
|
reportChat(chatId: ID, reason_: ReportReason, params?: ReportChatParams): Promise<void>;
|
|
89
89
|
markChatAsUnread(chatId: ID): Promise<void>;
|
|
90
90
|
markChatAsRead(chatId: ID): Promise<void>;
|
|
91
|
+
markAllMentionsAsRead(chatId: ID, params?: MarkAllMentionsAsReadParams): Promise<void>;
|
|
91
92
|
}
|
|
92
93
|
export {};
|
|
93
94
|
//# sourceMappingURL=4_chat_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,kBAAkB,EAAmE,KAAK,KAAK,EAAmK,KAAK,gBAAgB,EAA6B,MAAM,eAAe,CAAC;AACxV,OAAO,EAA8B,KAAK,UAAU,EAAE,KAAK,EAAE,EAAE,KAAK,YAAY,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,KAAK,EAA8E,mBAAmB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"4_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,kBAAkB,EAAmE,KAAK,KAAK,EAAmK,KAAK,gBAAgB,EAA6B,MAAM,eAAe,CAAC;AACxV,OAAO,EAA8B,KAAK,UAAU,EAAE,KAAK,EAAE,EAAE,KAAK,YAAY,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,KAAK,EAA8E,mBAAmB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnc,OAAO,KAAK,EAAE,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AM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,2BAA2B;CAM7E"}
|
|
@@ -376,7 +376,7 @@ export class ChatManager {
|
|
|
376
376
|
const user_id = await this.#c.getInputUser(userId);
|
|
377
377
|
const isSelf = Api.is("inputUserSelf", user_id);
|
|
378
378
|
if (isSelf || Api.peerToChatId(user_id) === await this.#c.getSelfId()) {
|
|
379
|
-
throw new InputError("A user ID
|
|
379
|
+
throw new InputError("A user ID other than that of the current user was expected.");
|
|
380
380
|
}
|
|
381
381
|
const peer = await this.#c.getInputPeer(chatId);
|
|
382
382
|
const ap = await this.#c.invoke({ _: "account.getPassword" });
|
|
@@ -519,4 +519,10 @@ export class ChatManager {
|
|
|
519
519
|
this.#c.storage.assertUser("markChatAsRead");
|
|
520
520
|
await this.#setIsChatUnread(chatId, false);
|
|
521
521
|
}
|
|
522
|
+
async markAllMentionsAsRead(chatId, params) {
|
|
523
|
+
this.#c.storage.assertUser("markAllMentionsAsRead");
|
|
524
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
525
|
+
const top_msg_id = params?.topicId;
|
|
526
|
+
await this.#c.invoke({ _: "messages.readMentions", peer, top_msg_id });
|
|
527
|
+
}
|
|
522
528
|
}
|
|
@@ -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 } from "../2_tl.js";
|
|
21
|
-
import type { AvailableReactions, BusinessConnection, CallbackQuery, Chat, ChatActionType, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ChosenInlineResult, ClaimedGifts, FailedInvitation, FileSource, GuestQuery, ID, InlineQuery, InlineQueryResult, InputChecklistItem, InputMedia, InputPollOption, InputRichText, InputStoryContent, InviteLink, JoinRequest, Message, MessageAnimation, MessageAudio, MessageChecklist, MessageContact, MessageDice, MessageDocument, MessageInvoice, MessageList, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageRichText, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, Poll, PriceTag, Reaction, RichText, SecretChat, SecretMessage, SlowModeDuration, Story, Topic, Update, User, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
|
|
22
|
-
import type { AddChatMemberParams, AddContactParams, AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteMessagesParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndSecretChatParams, ForwardMessagesParams, GetChatMembersParams, GetClaimedGiftsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetSavedMessagesParams, PinMessageParams, PromoteChatMemberParams, ReplyParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendSecretContactParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretVenueParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetReactionsParams, StartVideoChatParams, StopPollParams, UpdateChecklistParams } from "./0_params.js";
|
|
21
|
+
import type { AlbumStoryList, AvailableReactions, BusinessConnection, CallbackQuery, Chat, ChatActionType, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ChosenInlineResult, ClaimedGifts, FailedInvitation, FileSource, GuestQuery, ID, InlineQuery, InlineQueryResult, InputChecklistItem, InputGift, InputMedia, InputPollOption, InputRichText, InputStoryContent, InviteLink, JoinRequest, Message, MessageAnimation, MessageAudio, MessageChecklist, MessageContact, MessageCounters, MessageDice, MessageDocument, MessageInvoice, MessageList, MessageLivePhoto, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageRichText, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, Poll, PollVoterList, PriceTag, Reaction, ReportReason, RichText, SecretChat, SecretMessage, SlowModeDuration, StarAmount, StarTransactionList, Sticker, Story, StoryAlbum, StoryReportResult, Topic, TranslatedText, Update, User, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
|
|
22
|
+
import type { AddChatMemberParams, AddContactParams, AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteMessagesParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndSecretChatParams, ForwardMessagesParams, GetChatMembersParams, GetClaimedGiftsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetPollVotersParams, GetSavedMessagesParams, GetStarTransactionsParams, PinMessageParams, PromoteChatMemberParams, ReplyParams, ReportChatParams, ReportStoryParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendSecretAnimationParams, SendSecretContactParams, SendSecretDocumentParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretPhotoParams, SendSecretStickerParams, SendSecretVenueParams, SendSecretVideoParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetReactionsParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UpdateChecklistParams } from "./0_params.js";
|
|
23
23
|
import type { ClientGeneric } from "./1_client_generic.js";
|
|
24
24
|
import { type FilterQuery, type WithChatType, type WithFilter } from "./3_filters.js";
|
|
25
25
|
export type ContextCommands = string | RegExp | (string | RegExp)[] | {
|
|
@@ -73,16 +73,24 @@ export declare class Context {
|
|
|
73
73
|
toJSON(): Update | {
|
|
74
74
|
update: Api.Update;
|
|
75
75
|
};
|
|
76
|
+
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
77
|
+
acceptSecretChat(): Promise<SecretChat>;
|
|
76
78
|
/** Context-aware alias for {@link Client.addContact}. */
|
|
77
79
|
addAsContact(firstName: string, params?: AddContactParams): Promise<void>;
|
|
78
80
|
/** Context-aware alias for {@link Client.addChatMember}. */
|
|
79
81
|
addMember(userId: ID, params?: AddChatMemberParams): Promise<FailedInvitation[]>;
|
|
80
82
|
/** Context-aware alias for {@link Client.addChatMembers}. */
|
|
81
83
|
addMembers(userIds: ID[]): Promise<FailedInvitation[]>;
|
|
84
|
+
/** Context-aware alias for {@link Client.addPollOption}. */
|
|
85
|
+
addPollOption(messageId: number, option: InputPollOption): Promise<void>;
|
|
82
86
|
/** Context-aware alias for {@link Client.addReaction}. */
|
|
83
87
|
addReaction(messageId: number, reaction: Reaction, params?: AddReactionParams): Promise<void>;
|
|
88
|
+
/** Context-aware alias for {@link Client.addStoriesToAlbum}. */
|
|
89
|
+
addStoriesToAlbum(albumId: number, storyIds: number[]): Promise<StoryAlbum>;
|
|
84
90
|
/** Context-aware alias for {@link Client.addStoriesToHighlights}. */
|
|
85
91
|
addStoriesToHighlights(storyIds: number[]): Promise<void>;
|
|
92
|
+
/** Context-aware alias for {@link Client.addStoryToAlbum}. */
|
|
93
|
+
addStoryToAlbum(albumId: number, storyId: number): Promise<StoryAlbum>;
|
|
86
94
|
/** Context-aware alias for {@link Client.addStoryToHighlights}. */
|
|
87
95
|
addStoryToHighlights(storyId: number): Promise<void>;
|
|
88
96
|
/** Context-aware alias for {@link Client.addToChecklist}. */
|
|
@@ -119,20 +127,22 @@ export declare class Context {
|
|
|
119
127
|
createInviteLink(params?: CreateInviteLinkParams): Promise<InviteLink>;
|
|
120
128
|
/** Context-aware alias for {@link Client.createStory}. */
|
|
121
129
|
createStory(content: InputStoryContent, params?: CreateStoryParams): Promise<Story>;
|
|
130
|
+
/** Context-aware alias for {@link Client.createStoryAlbum}. */
|
|
131
|
+
createStoryAlbum(name: string, storyIds: number[]): Promise<StoryAlbum>;
|
|
122
132
|
/** Context-aware alias for {@link Client.createTopic}. */
|
|
123
133
|
createTopic(title: string, params?: CreateTopicParams): Promise<Topic>;
|
|
124
134
|
/** Context-aware alias for {@link Client.declineJoinRequest}. */
|
|
125
135
|
declineJoinRequest(): Promise<void>;
|
|
126
136
|
/** Context-aware alias for {@link Client.declineJoinRequests}. */
|
|
127
137
|
declineJoinRequests(params?: DeclineJoinRequestsParams): Promise<void>;
|
|
128
|
-
/** Context-aware alias for {@link Client.deleteChatPhoto}. */
|
|
129
|
-
deleteChatPhoto(): Promise<void>;
|
|
130
138
|
/** Context-aware alias for {@link Client.deleteMessage}. */
|
|
131
139
|
delete(): Promise<void>;
|
|
132
140
|
/** Context-aware alias for {@link Client.deleteChat}. */
|
|
133
141
|
deleteChat(): Promise<void>;
|
|
134
142
|
/** Context-aware alias for {@link Client.deleteChatMemberMessages}. */
|
|
135
143
|
deleteChatMemberMessages(userId: ID): Promise<void>;
|
|
144
|
+
/** Context-aware alias for {@link Client.deleteChatPhoto}. */
|
|
145
|
+
deleteChatPhoto(): Promise<void>;
|
|
136
146
|
/** Context-aware alias for {@link Client.deleteChatStickerSet}. */
|
|
137
147
|
deleteChatStickerSet(): Promise<void>;
|
|
138
148
|
/** Context-aware alias for {@link Client.deleteMessage}. */
|
|
@@ -151,6 +161,8 @@ export declare class Context {
|
|
|
151
161
|
disableAntispam(): Promise<void>;
|
|
152
162
|
/** Context-aware alias for {@link Client.disableBusinessBots}. */
|
|
153
163
|
disableBusinessBots(): Promise<void>;
|
|
164
|
+
/** Context-aware alias for {@link Client.disableChatHistoryForNewMembers}. */
|
|
165
|
+
disableChatHistoryForNewMembers(): Promise<void>;
|
|
154
166
|
/** Context-aware alias for {@link Client.disableJoinRequests}. */
|
|
155
167
|
disableJoinRequests(): Promise<void>;
|
|
156
168
|
/** Context-aware alias for {@link Client.disableSharing}. */
|
|
@@ -169,10 +181,10 @@ export declare class Context {
|
|
|
169
181
|
editInlineMessageMedia(media: InputMedia, params?: EditInlineMessageMediaParams): Promise<void>;
|
|
170
182
|
/** Context-aware alias for {@link Client.editInlineMessageReplyMarkup}. */
|
|
171
183
|
editInlineMessageReplyMarkup(params?: EditMessageReplyMarkupParams): Promise<void>;
|
|
172
|
-
/** Context-aware alias for {@link Client.editInlineMessageText}. */
|
|
173
|
-
editInlineMessageText(text: string, params?: EditInlineMessageTextParams): Promise<void>;
|
|
174
184
|
/** Context-aware alias for {@link Client.editInlineMessageRichText}. */
|
|
175
185
|
editInlineMessageRichText(richText: InputRichText, params?: EditInlineMessageRichTextParams): Promise<void>;
|
|
186
|
+
/** Context-aware alias for {@link Client.editInlineMessageText}. */
|
|
187
|
+
editInlineMessageText(text: string, params?: EditInlineMessageTextParams): Promise<void>;
|
|
176
188
|
/** Context-aware alias for {@link Client.editMessageCaption}. */
|
|
177
189
|
editMessageCaption(messageId: number, params?: EditMessageCaptionParams): Promise<Message>;
|
|
178
190
|
/** Context-aware alias for {@link Client.editMessageLiveLocation}. */
|
|
@@ -181,18 +193,18 @@ export declare class Context {
|
|
|
181
193
|
editMessageMedia(messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise<Message>;
|
|
182
194
|
/** Context-aware alias for {@link Client.editMessageReplyMarkup}. */
|
|
183
195
|
editMessageReplyMarkup(messageId: number, params?: EditMessageReplyMarkupParams): Promise<Message>;
|
|
184
|
-
/** Context-aware alias for {@link Client.editMessageText}. */
|
|
185
|
-
editMessageText(messageId: number, text: string, params?: EditMessageTextParams): Promise<MessageText>;
|
|
186
|
-
/** Context-aware alias for {@link Client.getRichText}. */
|
|
187
|
-
getRichText(messageId: number): Promise<RichText | null>;
|
|
188
196
|
/** Context-aware alias for {@link Client.editMessageRichText}. */
|
|
189
197
|
editMessageRichText(messageId: number, richText: InputRichText, params?: EditMessageRichTextParams): Promise<MessageRichText>;
|
|
198
|
+
/** Context-aware alias for {@link Client.editMessageText}. */
|
|
199
|
+
editMessageText(messageId: number, text: string, params?: EditMessageTextParams): Promise<MessageText>;
|
|
190
200
|
/** Context-aware alias for {@link Client.editTopic}. */
|
|
191
201
|
editTopic(topicId: number, title: string, params?: EditTopicParams): Promise<Topic>;
|
|
192
202
|
/** Context-aware alias for {@link Client.enableAntispam}. */
|
|
193
203
|
enableAntispam(): Promise<void>;
|
|
194
204
|
/** Context-aware alias for {@link Client.enableBusinessBots}. */
|
|
195
205
|
enableBusinessBots(): Promise<void>;
|
|
206
|
+
/** Context-aware alias for {@link Client.enableChatHistoryForNewMembers}. */
|
|
207
|
+
enableChatHistoryForNewMembers(): Promise<void>;
|
|
196
208
|
/** Context-aware alias for {@link Client.enableJoinRequests}. */
|
|
197
209
|
enableJoinRequests(): Promise<void>;
|
|
198
210
|
/** Context-aware alias for {@link Client.enableSharing}. */
|
|
@@ -201,6 +213,8 @@ export declare class Context {
|
|
|
201
213
|
enableSignatures(params?: EnableSignaturesParams): Promise<void>;
|
|
202
214
|
/** Context-aware alias for {@link Client.enableTopics}. */
|
|
203
215
|
enableTopics(isShownAsTabs: boolean): Promise<void>;
|
|
216
|
+
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
217
|
+
endSecretChat(params?: EndSecretChatParams): Promise<SecretChat>;
|
|
204
218
|
/** Context-aware alias for {@link Client.forwardMessage}. */
|
|
205
219
|
forward(to: ID, params?: ForwardMessagesParams): Promise<Message>;
|
|
206
220
|
/** Context-aware alias for {@link Client.forwardMessage}. */
|
|
@@ -231,32 +245,62 @@ export declare class Context {
|
|
|
231
245
|
getJoinRequests(params?: GetJoinRequestsParams): Promise<JoinRequest[]>;
|
|
232
246
|
/** Context-aware alias for {@link Client.getMessage}. */
|
|
233
247
|
getMessage(messageId: number): Promise<Message | null>;
|
|
248
|
+
/** Context-aware alias for {@link Client.getMessageCounters}. */
|
|
249
|
+
getMessageCounters(messageId: number): Promise<MessageCounters>;
|
|
234
250
|
/** Context-aware alias for {@link Client.getMessageReactions}. */
|
|
235
251
|
getMessageReactions(messageId: number): Promise<MessageReactionList>;
|
|
252
|
+
/** Context-aware alias for {@link Client.getMessageReadDate}. */
|
|
253
|
+
getMessageReadDate(messageId: number): Promise<number>;
|
|
236
254
|
/** Context-aware alias for {@link Client.getMessages}. */
|
|
237
255
|
getMessages(messageIds: number[]): Promise<Message[]>;
|
|
256
|
+
/** Context-aware alias for {@link Client.getMessagesCounters}. */
|
|
257
|
+
getMessagesCounters(messageIds: number[]): Promise<MessageCounters[]>;
|
|
258
|
+
/** Context-aware alias for {@link Client.getOnlineCount}. */
|
|
259
|
+
getOnlineCount(): Promise<number>;
|
|
260
|
+
/** Context-aware alias for {@link Client.getPollVoters}. */
|
|
261
|
+
getPollVoters(messageId: number, params?: GetPollVotersParams): Promise<PollVoterList>;
|
|
262
|
+
/** Context-aware alias for {@link Client.getRichText}. */
|
|
263
|
+
getRichText(messageId: number): Promise<RichText | null>;
|
|
238
264
|
/** Context-aware alias for {@link Client.getSavedMessages}. */
|
|
239
265
|
getSavedMessages(params?: GetSavedMessagesParams): Promise<Message[]>;
|
|
266
|
+
/** Context-aware alias for {@link Client.getScheduledMessages}. */
|
|
267
|
+
getScheduledMessages(): Promise<Message[]>;
|
|
240
268
|
/** Context-aware alias for {@link Client.getSimilarBots}. */
|
|
241
269
|
getSimilarBots(): Promise<ChatPPrivate[]>;
|
|
242
270
|
/** Context-aware alias for {@link Client.getSimilarChannels}. */
|
|
243
271
|
getSimilarChannels(): Promise<ChatPChannel[]>;
|
|
272
|
+
/** Context-aware alias for {@link Client.getStarBalance}. */
|
|
273
|
+
getStarBalance(): Promise<StarAmount>;
|
|
274
|
+
/** Context-aware alias for {@link Client.getStarTransactions}. */
|
|
275
|
+
getStarTransactions(params?: GetStarTransactionsParams): Promise<StarTransactionList>;
|
|
244
276
|
/** Context-aware alias for {@link Client.getStories}. */
|
|
245
277
|
getStories(storyIds: number[]): Promise<Story[]>;
|
|
278
|
+
/** Context-aware alias for {@link Client.getStoriesInAlbum}. */
|
|
279
|
+
getStoriesInAlbum(albumId: number): Promise<AlbumStoryList>;
|
|
246
280
|
/** Context-aware alias for {@link Client.getStory}. */
|
|
247
281
|
getStory(storyId: number): Promise<Story | null>;
|
|
282
|
+
/** Context-aware alias for {@link Client.getStoryAlbums}. */
|
|
283
|
+
getStoryAlbums(): Promise<StoryAlbum[]>;
|
|
284
|
+
/** Context-aware alias for {@link Client.getTonBalance}. */
|
|
285
|
+
getTonBalance(): Promise<number>;
|
|
248
286
|
/** Context-aware alias for {@link Client.sendGift}. */
|
|
249
287
|
gift(giftId: string, params?: SendGiftParams): Promise<void>;
|
|
250
288
|
/** Context-aware alias for {@link Client.hideGeneralTopic}. */
|
|
251
289
|
hideGeneralTopic(): Promise<void>;
|
|
252
290
|
/** Context-aware alias for {@link Client.hideMemberList}. */
|
|
253
291
|
hideMemberList(): Promise<void>;
|
|
292
|
+
/** Context-aware alias for {@link Client.joinChat}. */
|
|
293
|
+
joinChat(): Promise<void>;
|
|
254
294
|
/** Context-aware alias for {@link Client.kickChatMember}. */
|
|
255
295
|
kickChatMember(memberId: ID): Promise<void>;
|
|
256
296
|
/** Context-aware alias for {@link Client.kickChatMember}. */
|
|
257
297
|
kickSender(): Promise<void>;
|
|
258
298
|
/** Context-aware alias for {@link Client.leaveChat}. */
|
|
259
299
|
leaveChat(): Promise<void>;
|
|
300
|
+
/** Context-aware alias for {@link Client.markChatAsRead}. */
|
|
301
|
+
markChatAsRead(): Promise<void>;
|
|
302
|
+
/** Context-aware alias for {@link Client.markChatAsUnread}. */
|
|
303
|
+
markChatAsUnread(): Promise<void>;
|
|
260
304
|
/** Context-aware alias for {@link Client.openChat}. */
|
|
261
305
|
open(): Promise<void>;
|
|
262
306
|
/** Context-aware alias for {@link Client.pauseBusinessBotConnection}. */
|
|
@@ -277,36 +321,28 @@ export declare class Context {
|
|
|
277
321
|
refundStarPayment(telegramPaymentChargeId: string): Promise<void>;
|
|
278
322
|
/** Context-aware alias for {@link Client.deleteContact}. */
|
|
279
323
|
removeAsContact(): Promise<void>;
|
|
324
|
+
/** Context-aware alias for {@link Client.removePollOption}. */
|
|
325
|
+
removePollOption(messageId: number, optionIndex: number): Promise<void>;
|
|
280
326
|
/** Context-aware alias for {@link Client.removeReaction}. */
|
|
281
327
|
removeReaction(messageId: number, reaction: Reaction): Promise<void>;
|
|
282
|
-
/** Context-aware alias for {@link Client.
|
|
283
|
-
|
|
284
|
-
/** Context-aware alias for {@link Client.removeUserReactions}. */
|
|
285
|
-
removeUserReactions(userId: ID): Promise<void>;
|
|
328
|
+
/** Context-aware alias for {@link Client.removeStoriesFromAlbum}. */
|
|
329
|
+
removeStoriesFromAlbum(albumId: number, storyIds: number[]): Promise<StoryAlbum>;
|
|
286
330
|
/** Context-aware alias for {@link Client.removeStoriesFromHighlights}. */
|
|
287
331
|
removeStoriesFromHighlights(storyIds: number[]): Promise<void>;
|
|
332
|
+
/** Context-aware alias for {@link Client.removeStoryFromAlbum}. */
|
|
333
|
+
removeStoryFromAlbum(albumId: number, storyId: number): Promise<StoryAlbum>;
|
|
288
334
|
/** Context-aware alias for {@link Client.removeStoryFromHighlights}. */
|
|
289
335
|
removeStoryFromHighlights(storyId: number): Promise<void>;
|
|
336
|
+
/** Context-aware alias for {@link Client.removeUserReaction}. */
|
|
337
|
+
removeUserReaction(messageId: number, userId: ID): Promise<void>;
|
|
338
|
+
/** Context-aware alias for {@link Client.removeUserReactions}. */
|
|
339
|
+
removeUserReactions(userId: ID): Promise<void>;
|
|
290
340
|
/** Context-aware alias for {@link Client.reopenTopic}. */
|
|
291
341
|
reopenTopic(topicId: number): Promise<void>;
|
|
292
|
-
/** Context-aware alias for {@link Client.
|
|
293
|
-
|
|
294
|
-
/** Context-aware alias for {@link Client.sendSecretLocation}. */
|
|
295
|
-
replySecretLocation(latitude: number, longitude: number, params?: Omit<SendSecretLocationParams, "replyToMessaegId"> & ReplyParams): Promise<void>;
|
|
296
|
-
/** Context-aware alias for {@link Client.sendSecretVenue}. */
|
|
297
|
-
replySecretVenue(latitude: number, longitude: number, title: string, address: string, params?: Omit<SendSecretVenueParams, "replyToMessaegId"> & ReplyParams): Promise<void>;
|
|
298
|
-
/** Context-aware alias for {@link Client.sendSecretContact}. */
|
|
299
|
-
replySecretContact(firstName: string, phoneNumber: string, params?: Omit<SendSecretContactParams, "replyToMessaegId"> & ReplyParams): Promise<void>;
|
|
300
|
-
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
301
|
-
acceptSecretChat(): Promise<SecretChat>;
|
|
302
|
-
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
303
|
-
endSecretChat(params?: EndSecretChatParams): Promise<SecretChat>;
|
|
304
|
-
/** Context-aware alias for {@link Client.requestSecretChat}. */
|
|
305
|
-
requestSecretChat(): Promise<SecretChat>;
|
|
342
|
+
/** Context-aware alias for {@link Client.reorderStoriesInAlbum}. */
|
|
343
|
+
reorderStoriesInAlbum(albumId: number, storyIds: number[]): Promise<StoryAlbum>;
|
|
306
344
|
/** Context-aware alias for {@link Client.sendMessage}. */
|
|
307
345
|
reply(text: string, params?: Omit<SendMessageParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageText>;
|
|
308
|
-
/** Context-aware alias for {@link Client.sendRichText}. */
|
|
309
|
-
replyRichText(richText: InputRichText, params?: Omit<SendMessageParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageRichText>;
|
|
310
346
|
/** Context-aware alias for {@link Client.sendAnimation}. */
|
|
311
347
|
replyAnimation(animation: FileSource, params?: Omit<SendAnimationParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageAnimation>;
|
|
312
348
|
/** Context-aware alias for {@link Client.sendAudio}. */
|
|
@@ -321,10 +357,10 @@ export declare class Context {
|
|
|
321
357
|
replyDocument(document: FileSource, params?: Omit<SendDocumentParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageDocument>;
|
|
322
358
|
/** Context-aware alias for {@link Client.sendMessageDraft}. */
|
|
323
359
|
replyDraft(draftId: number, text: string, params?: Omit<SendMessageDraftParams, "messageThreadId"> & ReplyParams): Promise<void>;
|
|
324
|
-
/** Context-aware alias for {@link Client.sendRichTextDraft}. */
|
|
325
|
-
replyRichTextDraft(draftId: number, richText: InputRichText, params?: Omit<SendRichTextDraftParams, "messageThreadId"> & ReplyParams): Promise<void>;
|
|
326
360
|
/** Context-aware alias for {@link Client.sendInvoice}. */
|
|
327
361
|
replyInvoice(title: string, description: string, payload: string, currency: string, prices: PriceTag[], params?: Omit<SendInvoiceParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageInvoice>;
|
|
362
|
+
/** Context-aware alias for {@link Client.sendLivePhoto}. */
|
|
363
|
+
replyLivePhoto(photo: FileSource, video: FileSource, params?: Omit<SendLivePhotoParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageLivePhoto>;
|
|
328
364
|
/** Context-aware alias for {@link Client.sendLocation}. */
|
|
329
365
|
replyLocation(latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageLocation>;
|
|
330
366
|
/** Context-aware alias for {@link Client.sendMediaGroup}. */
|
|
@@ -333,6 +369,34 @@ export declare class Context {
|
|
|
333
369
|
replyPhoto(photo: FileSource, params?: Omit<SendPhotoParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessagePhoto>;
|
|
334
370
|
/** Context-aware alias for {@link Client.sendPoll}. */
|
|
335
371
|
replyPoll(question: string, options: InputPollOption[], params?: Omit<SendPollParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessagePoll>;
|
|
372
|
+
/** Context-aware alias for {@link Client.sendRichText}. */
|
|
373
|
+
replyRichText(richText: InputRichText, params?: Omit<SendMessageParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageRichText>;
|
|
374
|
+
/** Context-aware alias for {@link Client.sendRichTextDraft}. */
|
|
375
|
+
replyRichTextDraft(draftId: number, richText: InputRichText, params?: Omit<SendRichTextDraftParams, "messageThreadId"> & ReplyParams): Promise<void>;
|
|
376
|
+
/** Context-aware alias for {@link Client.sendSecretMessage}. */
|
|
377
|
+
replySecret(text: string, params?: Omit<SendSecretMessageParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
378
|
+
/** Context-aware alias for {@link Client.sendSecretAnimation}. */
|
|
379
|
+
replySecretAnimation(animation: FileSource, params?: Omit<SendSecretAnimationParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
380
|
+
/** Context-aware alias for {@link Client.sendSecretAudio}. */
|
|
381
|
+
replySecretAudio(audio: FileSource, params?: Omit<SendSecretAnimationParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
382
|
+
/** Context-aware alias for {@link Client.sendSecretContact}. */
|
|
383
|
+
replySecretContact(firstName: string, phoneNumber: string, params?: Omit<SendSecretContactParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
384
|
+
/** Context-aware alias for {@link Client.sendSecretDocument}. */
|
|
385
|
+
replySecretDocument(document: FileSource, params?: Omit<SendSecretDocumentParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
386
|
+
/** Context-aware alias for {@link Client.sendSecretLocation}. */
|
|
387
|
+
replySecretLocation(latitude: number, longitude: number, params?: Omit<SendSecretLocationParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
388
|
+
/** Context-aware alias for {@link Client.sendSecretPhoto}. */
|
|
389
|
+
replySecretPhoto(photo: FileSource, params?: Omit<SendSecretPhotoParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
390
|
+
/** Context-aware alias for {@link Client.sendSecretSticker}. */
|
|
391
|
+
replySecretSticker(sticker: Sticker, params?: Omit<SendSecretStickerParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
392
|
+
/** Context-aware alias for {@link Client.sendSecretVenue}. */
|
|
393
|
+
replySecretVenue(latitude: number, longitude: number, title: string, address: string, params?: Omit<SendSecretVenueParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
394
|
+
/** Context-aware alias for {@link Client.sendSecretVideo}. */
|
|
395
|
+
replySecretVideo(video: FileSource, params?: Omit<SendSecretVideoParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
396
|
+
/** Context-aware alias for {@link Client.sendSecretVideoNote}. */
|
|
397
|
+
replySecretVideoNote(videoNote: FileSource, params?: Omit<SendSecretVideoParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
398
|
+
/** Context-aware alias for {@link Client.sendSecretVoice}. */
|
|
399
|
+
replySecretVoice(voice: FileSource, params?: Omit<SendSecretAnimationParams, "replyToMessageId"> & ReplyParams): Promise<void>;
|
|
336
400
|
/** Context-aware alias for {@link Client.sendSticker}. */
|
|
337
401
|
replySticker(sticker: FileSource, params?: Omit<SendStickerParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageSticker>;
|
|
338
402
|
/** Context-aware alias for {@link Client.sendVenue}. */
|
|
@@ -343,8 +407,18 @@ export declare class Context {
|
|
|
343
407
|
replyVideoNote(videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageVideoNote>;
|
|
344
408
|
/** Context-aware alias for {@link Client.sendVoice}. */
|
|
345
409
|
replyVoice(voice: FileSource, params?: Omit<SendVoiceParams, "replyTo" | "messageThreadId" | "businessConnectionId"> & ReplyParams): Promise<MessageVoice>;
|
|
410
|
+
/** Context-aware alias for {@link Client.reportChat}. */
|
|
411
|
+
reportChat(reason: ReportReason, params?: ReportChatParams): Promise<void>;
|
|
412
|
+
/** Context-aware alias for {@link Client.reportStories}. */
|
|
413
|
+
reportStories(storyIds: number[], params?: ReportStoryParams): Promise<StoryReportResult>;
|
|
414
|
+
/** Context-aware alias for {@link Client.reportStory}. */
|
|
415
|
+
reportStory(storyId: number, params?: ReportStoryParams): Promise<StoryReportResult>;
|
|
416
|
+
/** Context-aware alias for {@link Client.requestSecretChat}. */
|
|
417
|
+
requestSecretChat(): Promise<SecretChat>;
|
|
346
418
|
/** Context-aware alias for {@link Client.resumeBusinessBotConnection}. */
|
|
347
419
|
resumeBusinessBotConnection(): Promise<void>;
|
|
420
|
+
/** Context-aware alias for {@link Client.retractVote}. */
|
|
421
|
+
retractVote(messageId: number): Promise<void>;
|
|
348
422
|
/** Context-aware alias for {@link Client.scheduleVideoChat}. */
|
|
349
423
|
scheduleVideoChat(startAt: number, params?: ScheduleVideoChatParams): Promise<VideoChatScheduled>;
|
|
350
424
|
/** Context-aware alias for {@link Client.searchMessages}. */
|
|
@@ -355,6 +429,8 @@ export declare class Context {
|
|
|
355
429
|
}): Promise<void>;
|
|
356
430
|
/** Context-aware alias for {@link Client.sendScheduledMessage}. */
|
|
357
431
|
sendScheduledMessage(messageId: number): Promise<Message>;
|
|
432
|
+
/** Context-aware alias for {@link Client.sendScheduledMessages}. */
|
|
433
|
+
sendScheduledMessages(messageIds: number[]): Promise<Message[]>;
|
|
358
434
|
/** Context-aware alias for {@link Client.setAvailableReactions}. */
|
|
359
435
|
setAvailableReactions(availableReactions: AvailableReactions): Promise<void>;
|
|
360
436
|
/** Context-aware alias for {@link Client.setBoostsRequiredToCircumventRestrictions}. */
|
|
@@ -369,6 +445,8 @@ export declare class Context {
|
|
|
369
445
|
setChatStickerSet(setName: string): Promise<void>;
|
|
370
446
|
/** Context-aware alias for {@link Client.setChatTitle}. */
|
|
371
447
|
setChatTitle(title: string): Promise<void>;
|
|
448
|
+
/** Context-aware alias for {@link Client.setDefaultSendAs}. */
|
|
449
|
+
setDefaultSendAs(sendAs: ID): Promise<void>;
|
|
372
450
|
/** Context-aware alias for {@link Client.setDiscussionChat}. */
|
|
373
451
|
setDiscussionChat(discussionChatId: ID): Promise<void>;
|
|
374
452
|
/** Context-aware alias for {@link Client.setChatMemberTag}. */
|
|
@@ -381,6 +459,8 @@ export declare class Context {
|
|
|
381
459
|
setSenderRights(params?: SetChatMemberRightsParams): Promise<void>;
|
|
382
460
|
/** Context-aware alias for {@link Client.setSlowMode}. */
|
|
383
461
|
setSlowMode(duration: SlowModeDuration): Promise<void>;
|
|
462
|
+
/** Context-aware alias for {@link Client.setStoryAlbumName}. */
|
|
463
|
+
setStoryAlbumName(albumId: number, name: string): Promise<StoryAlbum>;
|
|
384
464
|
/** Context-aware alias for {@link Client.showGeneralTopic}. */
|
|
385
465
|
showGeneralTopic(): Promise<void>;
|
|
386
466
|
/** Context-aware alias for {@link Client.showMemberList}. */
|
|
@@ -389,10 +469,18 @@ export declare class Context {
|
|
|
389
469
|
startVideoChat(params?: StartVideoChatParams): Promise<VideoChatActive>;
|
|
390
470
|
/** Context-aware alias for {@link Client.stopPoll}. */
|
|
391
471
|
stopPoll(messageId: number, params?: StopPollParams): Promise<Poll>;
|
|
472
|
+
/** Context-aware alias for {@link Client.summarizeText}. */
|
|
473
|
+
summarizeText(messageId: number, params?: SummarizeTextParams): Promise<TranslatedText>;
|
|
392
474
|
/** Context-aware alias for {@link Client.transcribeVoice}. */
|
|
393
475
|
transcribeVoice(messageId: number): Promise<VoiceTranscription>;
|
|
476
|
+
/** Context-aware alias for {@link Client.transferGift}. */
|
|
477
|
+
transferGift(gift: InputGift): Promise<void>;
|
|
394
478
|
/** Context-aware alias for {@link Client.transferChatOwnership}. */
|
|
395
479
|
transferOwnership(userId: ID, password: string): Promise<void>;
|
|
480
|
+
/** Context-aware alias for {@link Client.translateMessage}. */
|
|
481
|
+
translateMessage(toLanguage: string, messageId: number, params?: TranslateTextParams): Promise<TranslatedText>;
|
|
482
|
+
/** Context-aware alias for {@link Client.translateMessages}. */
|
|
483
|
+
translateMessages(toLanguage: string, messageIds: number[], params?: TranslateTextParams): Promise<TranslatedText[]>;
|
|
396
484
|
/** Context-aware alias for {@link Client.unarchiveChat}. */
|
|
397
485
|
unarchive(): Promise<void>;
|
|
398
486
|
/** Context-aware alias for {@link Client.unbanChatMember}. */
|
|
@@ -413,6 +501,12 @@ export declare class Context {
|
|
|
413
501
|
unpinTopic(topicId: number): Promise<void>;
|
|
414
502
|
/** Context-aware alias for {@link Client.updateChecklist}. */
|
|
415
503
|
updateChecklist(messageId: number, params?: UpdateChecklistParams): Promise<void>;
|
|
504
|
+
/** Context-aware alias for {@link Client.viewMessage}. */
|
|
505
|
+
viewMessage(messageId: number): Promise<void>;
|
|
506
|
+
/** Context-aware alias for {@link Client.viewMessages}. */
|
|
507
|
+
viewMessages(messageIds: number[]): Promise<void>;
|
|
508
|
+
/** Context-aware alias for {@link Client.vote}. */
|
|
509
|
+
vote(messageId: number, optionIndexes: number[]): Promise<void>;
|
|
416
510
|
}
|
|
417
511
|
export {};
|
|
418
512
|
//# sourceMappingURL=4_context.d.ts.map
|