@mtkruto/node 0.107.0 → 0.109.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/client/0_params.d.ts +1 -1
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +64 -14
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/2_account_manager.d.ts +2 -0
- package/esm/client/2_account_manager.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +12 -0
- package/esm/client/2_context.d.ts +110 -2
- package/esm/client/2_context.d.ts.map +1 -1
- package/esm/client/2_context.js +189 -0
- package/esm/client/2_file_manager.js +1 -1
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +28 -4
- package/esm/client/4_chat_manager.d.ts +11 -5
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +52 -12
- package/esm/client/5_client.d.ts +64 -14
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +83 -17
- package/esm/client/5_client_dispatcher.d.ts +64 -14
- package/esm/client/5_client_dispatcher.d.ts.map +1 -1
- package/esm/client/5_client_dispatcher.js +83 -17
- package/package.json +1 -1
- package/script/client/0_params.d.ts +1 -1
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +64 -14
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/2_account_manager.d.ts +2 -0
- package/script/client/2_account_manager.d.ts.map +1 -1
- package/script/client/2_account_manager.js +12 -0
- package/script/client/2_context.d.ts +110 -2
- package/script/client/2_context.d.ts.map +1 -1
- package/script/client/2_context.js +189 -0
- package/script/client/2_file_manager.js +1 -1
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +28 -4
- package/script/client/4_chat_manager.d.ts +11 -5
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +52 -12
- package/script/client/5_client.d.ts +64 -14
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +83 -17
- package/script/client/5_client_dispatcher.d.ts +64 -14
- package/script/client/5_client_dispatcher.d.ts.map +1 -1
- package/script/client/5_client_dispatcher.js +83 -17
package/esm/client/2_context.js
CHANGED
|
@@ -728,4 +728,193 @@ export class Context {
|
|
|
728
728
|
}
|
|
729
729
|
return await this.client.setChatMemberTag(chatId, userId, params);
|
|
730
730
|
}
|
|
731
|
+
/**
|
|
732
|
+
* Context-aware alias for {@link Client.enableSharing}.
|
|
733
|
+
*/
|
|
734
|
+
async enableSharing() {
|
|
735
|
+
const chatId = this.#mustGetChatId();
|
|
736
|
+
return await this.client.enableSharing(chatId);
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Context-aware alias for {@link Client.disableSharing}.
|
|
740
|
+
*/
|
|
741
|
+
async disableSharing() {
|
|
742
|
+
const chatId = this.#mustGetChatId();
|
|
743
|
+
return await this.client.disableSharing(chatId);
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Context-aware alias for {@link Client.pauseBusinessBotConnection}.
|
|
747
|
+
*/
|
|
748
|
+
async pauseBusinessBotConnection() {
|
|
749
|
+
const chatId = this.#mustGetChatId();
|
|
750
|
+
return await this.client.pauseBusinessBotConnection(chatId);
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Context-aware alias for {@link Client.resumeBusinessBotConnection}.
|
|
754
|
+
*/
|
|
755
|
+
async resumeBusinessBotConnection() {
|
|
756
|
+
const chatId = this.#mustGetChatId();
|
|
757
|
+
return await this.client.resumeBusinessBotConnection(chatId);
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Context-aware alias for {@link Client.disableSlowMode}.
|
|
761
|
+
*/
|
|
762
|
+
async disableSlowMode() {
|
|
763
|
+
const chatId = this.#mustGetChatId();
|
|
764
|
+
return await this.client.disableSlowMode(chatId);
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Context-aware alias for {@link Client.setSlowMode}.
|
|
768
|
+
*/
|
|
769
|
+
async setSlowMode(duration) {
|
|
770
|
+
const chatId = this.#mustGetChatId();
|
|
771
|
+
return await this.client.setSlowMode(chatId, duration);
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* Context-aware alias for {@link Client.setChatTitle}.
|
|
775
|
+
*/
|
|
776
|
+
async setChatTitle(title) {
|
|
777
|
+
const chatId = this.#mustGetChatId();
|
|
778
|
+
return await this.client.setChatTitle(chatId, title);
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Context-aware alias for {@link Client.setChatDescription}.
|
|
782
|
+
*/
|
|
783
|
+
async setChatDescription(description) {
|
|
784
|
+
const chatId = this.#mustGetChatId();
|
|
785
|
+
return await this.client.setChatDescription(chatId, description);
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Context-aware alias for {@link Client.hideMemberList}.
|
|
789
|
+
*/
|
|
790
|
+
async hideMemberList() {
|
|
791
|
+
const chatId = this.#mustGetChatId();
|
|
792
|
+
return await this.client.hideMemberList(chatId);
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* Context-aware alias for {@link Client.showMemberList}.
|
|
796
|
+
*/
|
|
797
|
+
async showMemberList() {
|
|
798
|
+
const chatId = this.#mustGetChatId();
|
|
799
|
+
return await this.client.showMemberList(chatId);
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Context-aware alias for {@link Client.enableTopics}.
|
|
803
|
+
*/
|
|
804
|
+
async enableTopics(isShownAsTabs) {
|
|
805
|
+
const chatId = this.#mustGetChatId();
|
|
806
|
+
return await this.client.enableTopics(chatId, isShownAsTabs);
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Context-aware alias for {@link Client.disableTopics}.
|
|
810
|
+
*/
|
|
811
|
+
async disableTopics() {
|
|
812
|
+
const chatId = this.#mustGetChatId();
|
|
813
|
+
return await this.client.disableTopics(chatId);
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Context-aware alias for {@link Client.enableAntispam}.
|
|
817
|
+
*/
|
|
818
|
+
async enableAntispam() {
|
|
819
|
+
const chatId = this.#mustGetChatId();
|
|
820
|
+
return await this.client.enableAntispam(chatId);
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Context-aware alias for {@link Client.disableAntispam}.
|
|
824
|
+
*/
|
|
825
|
+
async disableAntispam() {
|
|
826
|
+
const chatId = this.#mustGetChatId();
|
|
827
|
+
return await this.client.disableAntispam(chatId);
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Context-aware alias for {@link Client.enableSignatures}.
|
|
831
|
+
*/
|
|
832
|
+
async enableSignatures(params) {
|
|
833
|
+
const chatId = this.#mustGetChatId();
|
|
834
|
+
return await this.client.enableSignatures(chatId, params);
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Context-aware alias for {@link Client.disableSignatures}.
|
|
838
|
+
*/
|
|
839
|
+
async disableSignatures() {
|
|
840
|
+
const chatId = this.#mustGetChatId();
|
|
841
|
+
return await this.client.disableSignatures(chatId);
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Context-aware alias for {@link Client.deleteChat}.
|
|
845
|
+
*/
|
|
846
|
+
async deleteChat() {
|
|
847
|
+
const chatId = this.#mustGetChatId();
|
|
848
|
+
return await this.client.deleteChat(chatId);
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Context-aware alias for {@link Client.setDiscussionChat}.
|
|
852
|
+
*/
|
|
853
|
+
async setDiscussionChat(discussionChatId) {
|
|
854
|
+
const chatId = this.#mustGetChatId();
|
|
855
|
+
return await this.client.setDiscussionChat(chatId, discussionChatId);
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Context-aware alias for {@link Client.transferChatOwnership}.
|
|
859
|
+
*/
|
|
860
|
+
async transferOwnership(userId, password) {
|
|
861
|
+
const chatId = this.#mustGetChatId();
|
|
862
|
+
return await this.client.transferChatOwnership(chatId, userId, password);
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Context-aware alias for {@link Client.createTopic}.
|
|
866
|
+
*/
|
|
867
|
+
async createTopic(title, params) {
|
|
868
|
+
const chatId = this.#mustGetChatId();
|
|
869
|
+
return await this.client.createTopic(chatId, title, params);
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Context-aware alias for {@link Client.editTopic}.
|
|
873
|
+
*/
|
|
874
|
+
async editTopic(topicId, title, params) {
|
|
875
|
+
const chatId = this.#mustGetChatId();
|
|
876
|
+
return await this.client.editTopic(chatId, topicId, title, params);
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Context-aware alias for {@link Client.hideGeneralTopic}.
|
|
880
|
+
*/
|
|
881
|
+
async hideGeneralTopic() {
|
|
882
|
+
const chatId = this.#mustGetChatId();
|
|
883
|
+
return await this.client.hideGeneralTopic(chatId);
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Context-aware alias for {@link Client.showGeneralTopic}.
|
|
887
|
+
*/
|
|
888
|
+
async showGeneralTopic() {
|
|
889
|
+
const chatId = this.#mustGetChatId();
|
|
890
|
+
return await this.client.showGeneralTopic(chatId);
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Context-aware alias for {@link Client.closeTopic}.
|
|
894
|
+
*/
|
|
895
|
+
async closeTopic(topicId) {
|
|
896
|
+
const chatId = this.#mustGetChatId();
|
|
897
|
+
return await this.client.closeTopic(chatId, topicId);
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Context-aware alias for {@link Client.reopenTopic}.
|
|
901
|
+
*/
|
|
902
|
+
async reopenTopic(topicId) {
|
|
903
|
+
const chatId = this.#mustGetChatId();
|
|
904
|
+
return await this.client.reopenTopic(chatId, topicId);
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Context-aware alias for {@link Client.pinTopic}.
|
|
908
|
+
*/
|
|
909
|
+
async pinTopic(topicId) {
|
|
910
|
+
const chatId = this.#mustGetChatId();
|
|
911
|
+
return await this.client.pinTopic(chatId, topicId);
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Context-aware alias for {@link Client.unpinTopic}.
|
|
915
|
+
*/
|
|
916
|
+
async unpinTopic(topicId) {
|
|
917
|
+
const chatId = this.#mustGetChatId();
|
|
918
|
+
return await this.client.unpinTopic(chatId, topicId);
|
|
919
|
+
}
|
|
731
920
|
}
|
|
@@ -19,7 +19,7 @@ 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 { AssertionError, basename, delay, extension, extname, isAbsolute, MINUTE, SECOND, toFileUrl, unreachable } from "../0_deps.js";
|
|
22
|
+
import { AssertionError, basename, delay, extension, extname, isAbsolute, join, MINUTE, SECOND, toFileUrl, unreachable } from "../0_deps.js";
|
|
23
23
|
import { InputError } from "../0_errors.js";
|
|
24
24
|
import { getLogger, getRandomId, iterateReadableStream, kilobyte, megabyte, mod, PartStream } from "../1_utilities.js";
|
|
25
25
|
import { Api } from "../2_tl.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_message_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_message_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAA6J,KAAK,UAAU,EAAiB,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAoD,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACvV,OAAO,EAAqB,KAAK,UAAU,EAAqE,KAAK,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,EAAE,KAAK,aAAa,EAA2B,KAAK,SAAS,EAAE,KAAK,QAA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E,sBAAsB;IAmC5D,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB;IA0B1C,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB;CAiB5F"}
|
|
@@ -32,6 +32,10 @@ import { canBeInputChannel, checkArray, checkMessageId, getLimit, getUsername, i
|
|
|
32
32
|
const FALLBACK_MIME_TYPE = "application/octet-stream";
|
|
33
33
|
const STICKER_MIME_TYPES = ["image/webp", "video/webm", "application/x-tgsticker"];
|
|
34
34
|
const ANIMATION_MIME_TYPES = ["image/gif", "video/mp4"];
|
|
35
|
+
const AUDIO_MIME_TYPES = ["audio/mpeg", "audio/mp4"];
|
|
36
|
+
const VOICE_MIME_TYPES = ["audio/ogg", "audio/mpeg", "audio/mp4"];
|
|
37
|
+
const VIDEO_MIME_TYPES = ["video/mp4"];
|
|
38
|
+
const VIDEO_NOTE_MIME_TYPES = ["video/mp4"];
|
|
35
39
|
const messageManagerUpdates = [
|
|
36
40
|
"updateNewMessage",
|
|
37
41
|
"updateNewChannelMessage",
|
|
@@ -506,21 +510,41 @@ export class MessageManager {
|
|
|
506
510
|
this.#checkParams(params);
|
|
507
511
|
const message = await this.#sendDocumentInner(chatId, audio, params, FileType.VideoNote, [
|
|
508
512
|
{ _: "documentAttributeVideo", round_message: true, w: params?.length ?? 0, h: params?.length ?? 0, duration: params?.duration ?? 0 },
|
|
509
|
-
], false);
|
|
513
|
+
], false, VIDEO_NOTE_MIME_TYPES, () => "video_note.mp4");
|
|
510
514
|
return assertMessageType(message, "videoNote");
|
|
511
515
|
}
|
|
512
516
|
async sendAudio(chatId, audio, params) {
|
|
513
517
|
this.#checkParams(params);
|
|
514
518
|
const message = await this.#sendDocumentInner(chatId, audio, params, FileType.Audio, [
|
|
515
519
|
{ _: "documentAttributeAudio", duration: params?.duration ?? 0, performer: params?.performer, title: params?.title },
|
|
516
|
-
])
|
|
520
|
+
], undefined, AUDIO_MIME_TYPES, (firstPart) => {
|
|
521
|
+
if (MessageManager.#isM4a(firstPart)) {
|
|
522
|
+
return "audio.m4a";
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
return "audio.mp3";
|
|
526
|
+
}
|
|
527
|
+
});
|
|
517
528
|
return assertMessageType(message, "audio");
|
|
518
529
|
}
|
|
530
|
+
static #isM4a(firstPart) {
|
|
531
|
+
return firstPart.length >= 10 && startsWith(firstPart.subarray(4), new Uint8Array([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34]));
|
|
532
|
+
}
|
|
519
533
|
async sendVoice(chatId, voice, params) {
|
|
520
534
|
this.#checkParams(params);
|
|
521
535
|
const message = await this.#sendDocumentInner(chatId, voice, params, FileType.VoiceNote, [
|
|
522
536
|
{ _: "documentAttributeAudio", voice: true, duration: params?.duration ?? 0 },
|
|
523
|
-
])
|
|
537
|
+
], undefined, VOICE_MIME_TYPES, (firstPart) => {
|
|
538
|
+
if (startsWith(firstPart, new Uint8Array([0x4F, 0x67, 0x67]))) {
|
|
539
|
+
return "voice.ogg";
|
|
540
|
+
}
|
|
541
|
+
else if (MessageManager.#isM4a(firstPart)) {
|
|
542
|
+
return "voice.m4a";
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
return "voice.mp3";
|
|
546
|
+
}
|
|
547
|
+
});
|
|
524
548
|
return assertMessageType(message, "voice");
|
|
525
549
|
}
|
|
526
550
|
async sendAnimation(chatId, animation, params) {
|
|
@@ -542,7 +566,7 @@ export class MessageManager {
|
|
|
542
566
|
this.#checkParams(params);
|
|
543
567
|
const message = await this.#sendDocumentInner(chatId, video, params, FileType.Video, [
|
|
544
568
|
{ _: "documentAttributeVideo", supports_streaming: params?.supportsStreaming ? true : undefined, w: params?.width ?? 0, h: params?.height ?? 0, duration: params?.duration ?? 0 },
|
|
545
|
-
]);
|
|
569
|
+
], undefined, VIDEO_MIME_TYPES, () => "video.mp4");
|
|
546
570
|
return assertMessageType(message, "video");
|
|
547
571
|
}
|
|
548
572
|
async #sendDocumentInner(chatId, document, params, fileType, otherAttribs, urlSupported = true, expectedMimeTypes, createName) {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { type ChatP, type SlowModeDuration } from "../3_types.js";
|
|
22
22
|
import { type FileSource, type ID, type Reaction, type Update } from "../3_types.js";
|
|
23
|
-
import type { AddChatMemberParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateInviteLinkParams, DeclineJoinRequestsParams, GetCreatedInviteLinksParams, GetJoinRequestsParams, PromoteChatMemberParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams
|
|
23
|
+
import type { AddChatMemberParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateInviteLinkParams, DeclineJoinRequestsParams, EnableSignaturesParams, GetCreatedInviteLinksParams, GetJoinRequestsParams, PromoteChatMemberParams, 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";
|
|
@@ -62,16 +62,22 @@ export declare class ChatManager implements UpdateProcessor<ChatManagerUpdate, t
|
|
|
62
62
|
setSlowMode(chatId: ID, duration: SlowModeDuration): Promise<void>;
|
|
63
63
|
setChatTitle(chatId: ID, title: string): Promise<void>;
|
|
64
64
|
setChatDescription(chatId: ID, description: string): Promise<void>;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
hideMemberList(chatId: ID): Promise<void>;
|
|
66
|
+
showMemberList(chatId: ID): Promise<void>;
|
|
67
|
+
disableTopics(chatId: ID): Promise<void>;
|
|
68
|
+
enableTopics(chatId: ID, isShownAsTabs: boolean): Promise<void>;
|
|
69
|
+
enableAntispam(chatId: ID): Promise<void>;
|
|
70
|
+
disableAntispam(chatId: ID): Promise<void>;
|
|
71
|
+
enableSignatures(chatId: ID, params?: EnableSignaturesParams): Promise<void>;
|
|
72
|
+
disableSignatures(chatId: ID): Promise<void>;
|
|
69
73
|
deleteChat(chatId: ID): Promise<void>;
|
|
70
74
|
getDiscussionChatSuggestions(): Promise<ChatP[]>;
|
|
71
75
|
setDiscussionChat(chatId: ID, discussionChatId: ID): Promise<void>;
|
|
72
76
|
transferChatOwnership(chatId: ID, userId: ID, password: string): Promise<void>;
|
|
73
77
|
promoteChatMember(chatId: ID, userId: ID, params?: PromoteChatMemberParams): Promise<void>;
|
|
74
78
|
setChatMemberTag(chatId: ID, userId: ID, params?: SetChatMemberTagParams): Promise<void>;
|
|
79
|
+
enableSharing(chatId: ID): Promise<void>;
|
|
80
|
+
disableSharing(chatId: ID): Promise<void>;
|
|
75
81
|
}
|
|
76
82
|
export {};
|
|
77
83
|
//# 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,EAAqC,KAAK,KAAK,EAA2I,KAAK,gBAAgB,EAA6B,MAAM,eAAe,CAAC;AACzQ,OAAO,EAA8B,KAAK,UAAU,EAAE,KAAK,EAAE,EAAE,KAAK,QAAQ,EAAsB,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAErI,OAAO,KAAK,EAA8E,mBAAmB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"4_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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,MAAM,EAAE,EAAE;IAKxB,cAAc,CAAC,MAAM,EAAE,EAAE;CAIhC"}
|
|
@@ -333,26 +333,54 @@ export class ChatManager {
|
|
|
333
333
|
}
|
|
334
334
|
await this.#c.invoke({ _: "messages.editChatAbout", peer, about: description });
|
|
335
335
|
}
|
|
336
|
-
async
|
|
337
|
-
this.#c.storage.assertUser("setMemberListVisible");
|
|
336
|
+
async #setIsMemberListVisible(chatId, isVisible) {
|
|
338
337
|
const channel = await this.#c.getInputChannel(chatId);
|
|
339
|
-
const enabled = !
|
|
338
|
+
const enabled = !isVisible;
|
|
340
339
|
await this.#c.invoke({ _: "channels.toggleParticipantsHidden", channel, enabled });
|
|
341
340
|
}
|
|
342
|
-
async
|
|
343
|
-
this.#c.storage.assertUser("
|
|
341
|
+
async hideMemberList(chatId) {
|
|
342
|
+
this.#c.storage.assertUser("hideMemberList");
|
|
343
|
+
await this.#setIsMemberListVisible(chatId, false);
|
|
344
|
+
}
|
|
345
|
+
async showMemberList(chatId) {
|
|
346
|
+
this.#c.storage.assertUser("showMemberList");
|
|
347
|
+
await this.#setIsMemberListVisible(chatId, true);
|
|
348
|
+
}
|
|
349
|
+
async #setIsTopicsEnabled(chatId, isEnabled, isShownAsTabs) {
|
|
344
350
|
const channel = await this.#c.getInputChannel(chatId);
|
|
345
|
-
await this.#c.invoke({ _: "channels.toggleForum", channel, enabled, tabs });
|
|
351
|
+
await this.#c.invoke({ _: "channels.toggleForum", channel, enabled: isEnabled, tabs: isShownAsTabs });
|
|
352
|
+
}
|
|
353
|
+
async disableTopics(chatId) {
|
|
354
|
+
this.#c.storage.assertUser("disableTopics");
|
|
355
|
+
await this.#setIsTopicsEnabled(chatId, false, false);
|
|
346
356
|
}
|
|
347
|
-
async
|
|
348
|
-
this.#c.storage.assertUser("
|
|
357
|
+
async enableTopics(chatId, isShownAsTabs) {
|
|
358
|
+
this.#c.storage.assertUser("enableTopics");
|
|
359
|
+
await this.#setIsTopicsEnabled(chatId, true, isShownAsTabs);
|
|
360
|
+
}
|
|
361
|
+
async #setIsAntispamEnabled(chatId, isEnabled) {
|
|
349
362
|
const channel = await this.#c.getInputChannel(chatId);
|
|
350
|
-
await this.#c.invoke({ _: "channels.toggleAntiSpam", channel, enabled });
|
|
363
|
+
await this.#c.invoke({ _: "channels.toggleAntiSpam", channel, enabled: isEnabled });
|
|
364
|
+
}
|
|
365
|
+
async enableAntispam(chatId) {
|
|
366
|
+
this.#c.storage.assertUser("enableAntispam");
|
|
367
|
+
await this.#setIsAntispamEnabled(chatId, true);
|
|
368
|
+
}
|
|
369
|
+
async disableAntispam(chatId) {
|
|
370
|
+
this.#c.storage.assertUser("disableAntispam");
|
|
371
|
+
await this.#setIsAntispamEnabled(chatId, false);
|
|
351
372
|
}
|
|
352
|
-
async
|
|
353
|
-
this.#c.storage.assertUser("setSignaturesEnabled");
|
|
373
|
+
async #setIsSignaturesEnabled(chatId, isEnabled, params) {
|
|
354
374
|
const channel = await this.#c.getInputChannel(chatId);
|
|
355
|
-
await this.#c.invoke({ _: "channels.toggleSignatures", channel, signatures_enabled:
|
|
375
|
+
await this.#c.invoke({ _: "channels.toggleSignatures", channel, signatures_enabled: isEnabled ? true : undefined, profiles_enabled: params?.showAuthorProfile ? true : undefined });
|
|
376
|
+
}
|
|
377
|
+
async enableSignatures(chatId, params) {
|
|
378
|
+
this.#c.storage.assertUser("enableSignatures");
|
|
379
|
+
await this.#setIsSignaturesEnabled(chatId, true, params);
|
|
380
|
+
}
|
|
381
|
+
async disableSignatures(chatId) {
|
|
382
|
+
this.#c.storage.assertUser("disableSignatures");
|
|
383
|
+
await this.#setIsSignaturesEnabled(chatId, false);
|
|
356
384
|
}
|
|
357
385
|
async deleteChat(chatId) {
|
|
358
386
|
this.#c.storage.assertUser("deleteChat");
|
|
@@ -418,4 +446,16 @@ export class ChatManager {
|
|
|
418
446
|
const rank = params?.tag ?? "";
|
|
419
447
|
await this.#c.invoke({ _: "messages.editChatParticipantRank", peer, participant, rank });
|
|
420
448
|
}
|
|
449
|
+
async #setIsSharingEnabled(chatId, isSharingEnabled) {
|
|
450
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
451
|
+
await this.#c.invoke({ _: "messages.toggleNoForwards", peer, enabled: !isSharingEnabled });
|
|
452
|
+
}
|
|
453
|
+
async enableSharing(chatId) {
|
|
454
|
+
this.#c.storage.assertUser("enableSharing");
|
|
455
|
+
await this.#setIsSharingEnabled(chatId, true);
|
|
456
|
+
}
|
|
457
|
+
async disableSharing(chatId) {
|
|
458
|
+
this.#c.storage.assertUser("disableSharing");
|
|
459
|
+
await this.#setIsSharingEnabled(chatId, false);
|
|
460
|
+
}
|
|
421
461
|
}
|
package/esm/client/5_client.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { type DC } from "../3_transport.js";
|
|
|
23
23
|
import { type BotCommand, type BotTokenCheckResult, type BusinessConnection, type CallbackQueryAnswer, type CallbackQueryQuestion, type Chat, type ChatAction, type ChatListItem, type ChatMember, type ChatP, type ChatPChannel, type ChatPGroup, type ChatPSupergroup, type ChatSettings, type ClaimedGifts, type FailedInvitation, type FileSource, type Gift, type ID, type InactiveChat, type InlineQueryAnswer, type InlineQueryResult, type InputGift, type InputMedia, type InputStoryContent, type InviteLink, type JoinRequest, type LinkPreview, type LiveStreamChannel, type Message, type MessageAnimation, type MessageAudio, type MessageContact, type MessageDice, type MessageDocument, type MessageInvoice, type MessageList, type MessageLocation, type MessagePhoto, type MessagePoll, type MessageReactionList, type MessageSticker, type MessageText, type MessageVenue, type MessageVideo, type MessageVideoNote, type MessageVoice, type MiniAppInfo, type NetworkStatistics, type ParseMode, type PasswordCheckResult, type Poll, type PriceTag, type Reaction, type SavedChats, type SlowModeDuration, type Sticker, type StickerSet, type Story, type Topic, type Translation, type User, type VideoChat, type VideoChatActive, type VideoChatScheduled, type VoiceTranscription } from "../3_types.js";
|
|
24
24
|
import { Migrate } from "../4_errors.js";
|
|
25
25
|
import type { CodeCheckResult } from "../types/0_code_check_result.js";
|
|
26
|
-
import type { AddChatMemberParams, AddContactParams, AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, EditTopicParams, ForwardMessagesParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetSavedChatsParams, GetSavedMessagesParams, GetTranslationsParams, InvokeParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetEmojiStatusParams, SetLocationParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams,
|
|
26
|
+
import type { AddChatMemberParams, AddContactParams, AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, ForwardMessagesParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetSavedChatsParams, GetSavedMessagesParams, GetTranslationsParams, InvokeParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetEmojiStatusParams, SetLocationParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartVideoChatParams, StopPollParams, UnpinMessageParams, UpdateProfileParams } from "./0_params.js";
|
|
27
27
|
import { StorageOperations } from "./0_storage_operations.js";
|
|
28
28
|
import type { ClientGeneric } from "./1_client_generic.js";
|
|
29
29
|
import type { ClientPlainParams } from "./1_client_plain.js";
|
|
@@ -347,6 +347,18 @@ export declare class Client<C extends Context = Context> extends Composer<C> imp
|
|
|
347
347
|
* @method ac
|
|
348
348
|
*/
|
|
349
349
|
disableSponsoredMessages(): Promise<void>;
|
|
350
|
+
/**
|
|
351
|
+
* Pause the business bot in a chat. User-only.
|
|
352
|
+
*
|
|
353
|
+
* @method ac
|
|
354
|
+
*/
|
|
355
|
+
pauseBusinessBotConnection(chatId: ID): Promise<void>;
|
|
356
|
+
/**
|
|
357
|
+
* Resume the business bot in a chat. User-only.
|
|
358
|
+
*
|
|
359
|
+
* @method ac
|
|
360
|
+
*/
|
|
361
|
+
resumeBusinessBotConnection(chatId: ID): Promise<void>;
|
|
350
362
|
/**
|
|
351
363
|
* Send a text message.
|
|
352
364
|
*
|
|
@@ -1251,38 +1263,62 @@ export declare class Client<C extends Context = Context> extends Composer<C> imp
|
|
|
1251
1263
|
*/
|
|
1252
1264
|
setChatDescription(chatId: ID, description: string): Promise<void>;
|
|
1253
1265
|
/**
|
|
1254
|
-
* Hide
|
|
1266
|
+
* Hide the member list of a group to non-admins. User-only.
|
|
1267
|
+
*
|
|
1268
|
+
* @method ch
|
|
1269
|
+
* @param chatId The identifier of the group.
|
|
1270
|
+
*/
|
|
1271
|
+
hideMemberList(chatId: ID): Promise<void>;
|
|
1272
|
+
/**
|
|
1273
|
+
* Show the member list of a group to non-admins. User-only.
|
|
1274
|
+
*
|
|
1275
|
+
* @method ch
|
|
1276
|
+
* @param chatId The identifier of the group.
|
|
1277
|
+
*/
|
|
1278
|
+
showMemberList(chatId: ID): Promise<void>;
|
|
1279
|
+
/**
|
|
1280
|
+
* Enable topics in a group. User-only.
|
|
1281
|
+
*
|
|
1282
|
+
* @method ch
|
|
1283
|
+
* @param chatId The identifier of the group.
|
|
1284
|
+
* @param isShownAsTabs Whether topics should be displayed as tabs.
|
|
1285
|
+
*/
|
|
1286
|
+
enableTopics(chatId: ID, isShownAsTabs: boolean): Promise<void>;
|
|
1287
|
+
/**
|
|
1288
|
+
* Disable topics in a group. User-only.
|
|
1255
1289
|
*
|
|
1256
1290
|
* @method ch
|
|
1257
1291
|
* @param chatId The identifier of the group.
|
|
1258
|
-
* @param visible Whether the member list of the group should be visible.
|
|
1259
1292
|
*/
|
|
1260
|
-
|
|
1293
|
+
disableTopics(chatId: ID): Promise<void>;
|
|
1261
1294
|
/**
|
|
1262
|
-
* Enable
|
|
1295
|
+
* Enable automatic anti-spam in a group. User-only.
|
|
1263
1296
|
*
|
|
1264
1297
|
* @method ch
|
|
1265
1298
|
* @param chatId The identifier of the group.
|
|
1266
|
-
* @param enabled Whether topics should be enabled in the group.
|
|
1267
|
-
* @param tabs Whether topics should be displayed as tabs.
|
|
1268
1299
|
*/
|
|
1269
|
-
|
|
1300
|
+
enableAntispam(chatId: ID): Promise<void>;
|
|
1270
1301
|
/**
|
|
1271
|
-
*
|
|
1302
|
+
* Disable automatic anti-spam in a group. User-only.
|
|
1272
1303
|
*
|
|
1273
1304
|
* @method ch
|
|
1274
1305
|
* @param chatId The identifier of the group.
|
|
1275
|
-
* @param enabled Whether automatic anti-spam should be enabled in the group.
|
|
1276
1306
|
*/
|
|
1277
|
-
|
|
1307
|
+
disableAntispam(chatId: ID): Promise<void>;
|
|
1308
|
+
/**
|
|
1309
|
+
* Enable post signatures in a channel. User-only.
|
|
1310
|
+
*
|
|
1311
|
+
* @method ch
|
|
1312
|
+
* @param chatId The identifier of the channel.
|
|
1313
|
+
*/
|
|
1314
|
+
enableSignatures(chatId: ID, params?: EnableSignaturesParams): Promise<void>;
|
|
1278
1315
|
/**
|
|
1279
|
-
*
|
|
1316
|
+
* Disable post signatures in a channel. User-only.
|
|
1280
1317
|
*
|
|
1281
1318
|
* @method ch
|
|
1282
1319
|
* @param chatId The identifier of the channel.
|
|
1283
|
-
* @param enabled Whether post signatures should be enabled in the channel.
|
|
1284
1320
|
*/
|
|
1285
|
-
|
|
1321
|
+
disableSignatures(chatId: ID): Promise<void>;
|
|
1286
1322
|
/**
|
|
1287
1323
|
* Delete a chat. User-only.
|
|
1288
1324
|
*
|
|
@@ -1394,6 +1430,20 @@ export declare class Client<C extends Context = Context> extends Composer<C> imp
|
|
|
1394
1430
|
* @param userId The identifier of the user that is a member of the chat.
|
|
1395
1431
|
*/
|
|
1396
1432
|
setChatMemberTag(chatId: ID, userId: ID, params?: SetChatMemberTagParams): Promise<void>;
|
|
1433
|
+
/**
|
|
1434
|
+
* Enable sharing in a chat. User-only.
|
|
1435
|
+
*
|
|
1436
|
+
* @method ch
|
|
1437
|
+
* @param chatId The identifier of a chat.
|
|
1438
|
+
*/
|
|
1439
|
+
enableSharing(chatId: ID): Promise<void>;
|
|
1440
|
+
/**
|
|
1441
|
+
* Disable sharing in a chat. User-only.
|
|
1442
|
+
*
|
|
1443
|
+
* @method ch
|
|
1444
|
+
* @param chatId The identifier of a chat.
|
|
1445
|
+
*/
|
|
1446
|
+
disableSharing(chatId: ID): Promise<void>;
|
|
1397
1447
|
/**
|
|
1398
1448
|
* Send a callback query. User-only.
|
|
1399
1449
|
*
|