@mtkruto/node 0.1.155 → 0.1.156
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/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/4_errors.d.ts +1 -1
- package/esm/client/0_params.d.ts +20 -0
- package/esm/client/0_password.d.ts +2 -2
- package/esm/client/0_types.d.ts +1 -0
- package/esm/client/1_composer.d.ts +3 -3
- package/esm/client/2_client_plain.d.ts +1 -4
- package/esm/client/2_client_plain.js +1 -4
- package/esm/client/2_message_manager.d.ts +9 -36
- package/esm/client/2_message_manager.js +73 -1
- package/esm/client/4_client.d.ts +90 -15
- package/esm/client/4_client.js +123 -12
- package/esm/storage/0_storage.d.ts +38 -38
- package/esm/storage/0_storage.js +2 -2
- package/esm/storage/0_utilities.d.ts +2 -2
- package/esm/storage/1_storage_indexed_db.d.ts +1 -1
- package/esm/storage/1_storage_local_storage.d.ts +1 -1
- package/esm/storage/1_storage_memory.d.ts +3 -3
- package/esm/storage/1_storage_session_storage.d.ts +1 -1
- package/esm/tl/0_tl_raw_writer.d.ts +9 -9
- package/esm/tl/1_tl_object.d.ts +1 -1
- package/esm/tl/1_tl_object.js +3 -3
- package/esm/tl/3_functions.d.ts +28 -28
- package/esm/tl/3_functions.js +586 -586
- package/esm/tl/3_utilities.d.ts +3 -3
- package/esm/tl/4_tl_writer.d.ts +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts +2 -2
- package/esm/types/0_chat_member_rights.d.ts +1 -1
- package/esm/types/0_message_entity.d.ts +1 -1
- package/esm/types/0_message_search_filter.d.ts +2 -1
- package/esm/types/1_bot_command_scope.d.ts +2 -1
- package/esm/types/1_keyboard_button.d.ts +1 -1
- package/esm/types/1_story_interactive_area.d.ts +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/2_invite_link.d.ts +6 -6
- package/esm/types/2_invite_link.js +4 -4
- package/esm/types/3_reply_markup.d.ts +2 -2
- package/esm/types/4_inline_query_result.d.ts +2 -1
- package/esm/types/4_message.d.ts +1 -60
- package/esm/types/5_callback_query.d.ts +2 -2
- package/esm/utilities/0_cache_map.d.ts +1 -1
- package/package.json +1 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/4_errors.d.ts +1 -1
- package/script/client/0_params.d.ts +20 -0
- package/script/client/0_password.d.ts +2 -2
- package/script/client/0_types.d.ts +1 -0
- package/script/client/1_composer.d.ts +3 -3
- package/script/client/2_client_plain.d.ts +1 -4
- package/script/client/2_client_plain.js +1 -4
- package/script/client/2_message_manager.d.ts +9 -36
- package/script/client/2_message_manager.js +72 -0
- package/script/client/4_client.d.ts +90 -15
- package/script/client/4_client.js +123 -12
- package/script/storage/0_storage.d.ts +38 -38
- package/script/storage/0_storage.js +2 -2
- package/script/storage/0_utilities.d.ts +2 -2
- package/script/storage/1_storage_indexed_db.d.ts +1 -1
- package/script/storage/1_storage_local_storage.d.ts +1 -1
- package/script/storage/1_storage_memory.d.ts +3 -3
- package/script/storage/1_storage_session_storage.d.ts +1 -1
- package/script/tl/0_tl_raw_writer.d.ts +9 -9
- package/script/tl/1_tl_object.d.ts +1 -1
- package/script/tl/1_tl_object.js +3 -3
- package/script/tl/3_functions.d.ts +28 -28
- package/script/tl/3_functions.js +586 -586
- package/script/tl/3_utilities.d.ts +3 -3
- package/script/tl/4_tl_writer.d.ts +1 -1
- package/script/types/0_chat_administrator_rights.d.ts +2 -2
- package/script/types/0_chat_member_rights.d.ts +1 -1
- package/script/types/0_message_entity.d.ts +1 -1
- package/script/types/0_message_search_filter.d.ts +2 -1
- package/script/types/1_bot_command_scope.d.ts +2 -1
- package/script/types/1_keyboard_button.d.ts +1 -1
- package/script/types/1_story_interactive_area.d.ts +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/2_invite_link.d.ts +6 -6
- package/script/types/2_invite_link.js +4 -4
- package/script/types/3_reply_markup.d.ts +2 -2
- package/script/types/4_inline_query_result.d.ts +2 -1
- package/script/types/4_message.d.ts +1 -60
- package/script/types/5_callback_query.d.ts +2 -2
- package/script/utilities/0_cache_map.d.ts +1 -1
package/esm/4_constants.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type PublicKeys = readonly [bigint, [bigint, bigint]][];
|
|
|
4
4
|
export declare const PUBLIC_KEYS: PublicKeys;
|
|
5
5
|
export declare const INITIAL_DC: DC;
|
|
6
6
|
export declare const LAYER = 174;
|
|
7
|
-
export declare const APP_VERSION = "MTKruto 0.1.
|
|
7
|
+
export declare const APP_VERSION = "MTKruto 0.1.156";
|
|
8
8
|
export declare const DEVICE_MODEL: string;
|
|
9
9
|
export declare const LANG_CODE: string;
|
|
10
10
|
export declare const LANG_PACK = "";
|
package/esm/4_constants.js
CHANGED
|
@@ -53,7 +53,7 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
53
53
|
]);
|
|
54
54
|
export const INITIAL_DC = "2";
|
|
55
55
|
export const LAYER = 174;
|
|
56
|
-
export const APP_VERSION = "MTKruto 0.1.
|
|
56
|
+
export const APP_VERSION = "MTKruto 0.1.156";
|
|
57
57
|
// @ts-ignore: lib
|
|
58
58
|
export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
59
59
|
export const LANG_CODE = typeof navigator === "undefined" || typeof navigator.language !== "string" ? "en" : navigator.language.split("-")[0];
|
package/esm/4_errors.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export declare class FileMigrate extends Migrate {
|
|
|
17
17
|
}
|
|
18
18
|
export declare class StatsMigrate extends Migrate {
|
|
19
19
|
}
|
|
20
|
-
export declare function upgradeInstance(error: types.Rpc_error, call: TLObject):
|
|
20
|
+
export declare function upgradeInstance(error: types.Rpc_error, call: TLObject): types.Rpc_error;
|
package/esm/client/0_params.d.ts
CHANGED
|
@@ -287,3 +287,23 @@ export interface SearchMessagesParams {
|
|
|
287
287
|
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
|
|
288
288
|
limit?: number;
|
|
289
289
|
}
|
|
290
|
+
export interface CreateInviteLinkParams {
|
|
291
|
+
/** An optional title to be attached to the link that can only be seen by admins. */
|
|
292
|
+
title?: string;
|
|
293
|
+
/** The point of time in which the invite link must no longer work. */
|
|
294
|
+
expireAt?: Date;
|
|
295
|
+
/** The times the invite link can be used. Cannot be specified while `requireApproval` is `true`. */
|
|
296
|
+
limit?: number;
|
|
297
|
+
/** Whether an admin must explicitly approve join requests originating from this invite link. Cannot be `true` while `limit` is specified. */
|
|
298
|
+
requireApproval?: boolean;
|
|
299
|
+
}
|
|
300
|
+
export interface GetCreatedInviteLinksParams {
|
|
301
|
+
/** The identifier of an admin. If specified, only invite links created by this admin will be returned. */
|
|
302
|
+
by?: ID;
|
|
303
|
+
/** The maximum number of results to return. Must be in the range 1-100. Defaults to 100. */
|
|
304
|
+
limit?: number;
|
|
305
|
+
/** Whether only revoked invite links must be returned. */
|
|
306
|
+
revoked?: boolean;
|
|
307
|
+
afterDate?: Date;
|
|
308
|
+
afterInviteLink?: string;
|
|
309
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sha256 } from "../1_utilities.js";
|
|
2
|
-
import { enums } from "../2_tl.js";
|
|
2
|
+
import { enums, types } from "../2_tl.js";
|
|
3
3
|
export declare function isSafePrime(primeBytes: Uint8Array, g: number): boolean;
|
|
4
4
|
export declare const h: typeof sha256;
|
|
5
5
|
export declare const sh: (data: Uint8Array, salt: Uint8Array) => Promise<Uint8Array>;
|
|
@@ -8,4 +8,4 @@ export declare function pbkdf2(password: Uint8Array, salt: Uint8Array, iteration
|
|
|
8
8
|
export declare const ph2: (password: Uint8Array, salt1: Uint8Array, salt2: Uint8Array) => Promise<Uint8Array>;
|
|
9
9
|
export declare function isGoodModExpFirst(modexp: bigint, prime: bigint): boolean;
|
|
10
10
|
export declare function pad(bigint: number | bigint | Uint8Array): Uint8Array;
|
|
11
|
-
export declare function checkPassword(password_: string, ap: enums.account.Password): Promise<
|
|
11
|
+
export declare function checkPassword(password_: string, ap: enums.account.Password): Promise<types.InputCheckPasswordSRP>;
|
package/esm/client/0_types.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export interface C {
|
|
|
32
32
|
getSelfId: () => Promise<number>;
|
|
33
33
|
getInputPeer: (id: ID) => Promise<enums.InputPeer>;
|
|
34
34
|
getInputChannel: (id: ID) => Promise<types.InputChannel>;
|
|
35
|
+
getInputUser: (id: ID) => Promise<types.InputUser>;
|
|
35
36
|
getEntity: EntityGetter;
|
|
36
37
|
handleUpdate: (update: Update) => void;
|
|
37
38
|
parseMode: ParseMode;
|
|
@@ -17,14 +17,14 @@ export declare class Composer<C extends {
|
|
|
17
17
|
set prefixes(value: string | string[]);
|
|
18
18
|
constructor(...middleware: Middleware<C>[]);
|
|
19
19
|
middleware(): MiddlewareFn<C>;
|
|
20
|
-
use(...middleware: Middleware<UpdateIntersection<C>>[]): Composer<
|
|
21
|
-
branch(predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>, trueHandler_: Middleware<UpdateIntersection<C>>, falseHandler_: Middleware<UpdateIntersection<C>>): Composer<
|
|
20
|
+
use(...middleware: Middleware<UpdateIntersection<C>>[]): Composer<C>;
|
|
21
|
+
branch(predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>, trueHandler_: Middleware<UpdateIntersection<C>>, falseHandler_: Middleware<UpdateIntersection<C>>): Composer<C>;
|
|
22
22
|
filter<D extends C>(predicate: (ctx: UpdateIntersection<C>) => ctx is D, ...middleware: Middleware<D>[]): Composer<D>;
|
|
23
23
|
filter(predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>, ...middleware: Middleware<UpdateIntersection<C>>[]): Composer<C>;
|
|
24
24
|
on<Q extends FilterQuery>(filter: Q, ...middleawre: Middleware<WithFilter<C, Q>>[]): Composer<UpdateIntersection<WithFilter<C, Q>>>;
|
|
25
25
|
command(commands: string | RegExp | (string | RegExp)[] | {
|
|
26
26
|
names: string | RegExp | (string | RegExp)[];
|
|
27
27
|
prefixes: string | string[];
|
|
28
|
-
}, ...middleawre: Middleware<WithFilter<C, "message:text">>[]): Composer<
|
|
28
|
+
}, ...middleawre: Middleware<WithFilter<C, "message:text">>[]): Composer<WithFilter<C, "message:text">>;
|
|
29
29
|
}
|
|
30
30
|
export {};
|
|
@@ -11,8 +11,5 @@ export declare class ClientPlain extends ClientAbstract {
|
|
|
11
11
|
#private;
|
|
12
12
|
constructor(params?: ClientPlainParams);
|
|
13
13
|
invoke<T extends functions.Function<unknown>>(function_: T): Promise<T["__R"]>;
|
|
14
|
-
createAuthKey(): Promise<
|
|
15
|
-
authKey: Uint8Array;
|
|
16
|
-
salt: bigint;
|
|
17
|
-
}>;
|
|
14
|
+
createAuthKey(): Promise<[Uint8Array, bigint]>;
|
|
18
15
|
}
|
|
@@ -142,10 +142,7 @@ export class ClientPlain extends ClientAbstract {
|
|
|
142
142
|
const authKey_ = modExp(gA, b, dhPrime);
|
|
143
143
|
const authKey = bufferFromBigInt(authKey_, 256, false, false);
|
|
144
144
|
LcreateAuthKey.debug("auth key created");
|
|
145
|
-
return
|
|
146
|
-
authKey,
|
|
147
|
-
salt: bigIntFromBuffer(salt, true, false),
|
|
148
|
-
};
|
|
145
|
+
return [authKey, bigIntFromBuffer(salt, true, false)];
|
|
149
146
|
}
|
|
150
147
|
}
|
|
151
148
|
_ClientPlain_publicKeys = new WeakMap(), _ClientPlain_lastMsgId = new WeakMap();
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { enums, types } from "../2_tl.js";
|
|
2
2
|
import { ChatAction, ChatMember, FileSource, FileType, ID, Message, MessageEntity, ParseMode, Reaction, Update, UsernameResolver } from "../3_types.js";
|
|
3
|
-
import { BanChatMemberParams, DeleteMessagesParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetHistoryParams, PinMessageParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams } from "./0_params.js";
|
|
4
|
-
import { SearchMessagesParams } from "./0_params.js";
|
|
5
|
-
import { AddReactionParams, SetReactionsParams } from "./0_params.js";
|
|
3
|
+
import { AddReactionParams, BanChatMemberParams, CreateInviteLinkParams, DeleteMessagesParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetCreatedInviteLinksParams, GetHistoryParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetReactionsParams } from "./0_params.js";
|
|
6
4
|
import { C as C_ } from "./0_types.js";
|
|
7
5
|
import { FileManager } from "./1_file_manager.js";
|
|
8
6
|
interface C extends C_ {
|
|
@@ -18,40 +16,9 @@ export declare class MessageManager {
|
|
|
18
16
|
parseText(text: string, params?: {
|
|
19
17
|
parseMode?: ParseMode;
|
|
20
18
|
entities?: MessageEntity[];
|
|
21
|
-
}): Promise<readonly [string,
|
|
19
|
+
}): Promise<readonly [string, enums.MessageEntity[] | undefined]>;
|
|
22
20
|
getStickerSetName(inputStickerSet: types.InputStickerSetID, hash?: number): Promise<string>;
|
|
23
|
-
constructMessage(message_: enums.Message, r?: boolean): Promise<
|
|
24
|
-
text: string;
|
|
25
|
-
entities: NonNullable<MessageEntity | null>[];
|
|
26
|
-
out: boolean;
|
|
27
|
-
id: number;
|
|
28
|
-
threadId?: number | undefined;
|
|
29
|
-
from?: import("../3_types.js").User | undefined;
|
|
30
|
-
senderChat?: import("../3_types.js").ChatP | undefined;
|
|
31
|
-
date: Date;
|
|
32
|
-
chat: import("../3_types.js").ChatP;
|
|
33
|
-
link?: string | undefined;
|
|
34
|
-
forwardFrom?: import("../3_types.js").User | undefined;
|
|
35
|
-
forwardFromChat?: import("../3_types.js").ChatP | undefined;
|
|
36
|
-
forwardId?: number | undefined;
|
|
37
|
-
forwardSignature?: string | undefined;
|
|
38
|
-
forwardSenderName?: string | undefined;
|
|
39
|
-
forwardDate?: Date | undefined;
|
|
40
|
-
isTopicMessage: boolean;
|
|
41
|
-
isAutomaticForward?: boolean | undefined;
|
|
42
|
-
replyToMessage?: Message | undefined;
|
|
43
|
-
replyToMessageId?: number | undefined;
|
|
44
|
-
reactions?: import("../3_types.js").MessageReaction[] | undefined;
|
|
45
|
-
replyQuote?: import("../3_types.js").ReplyQuote | undefined;
|
|
46
|
-
viaBot?: import("../3_types.js").User | undefined;
|
|
47
|
-
editDate?: Date | undefined;
|
|
48
|
-
hasProtectedContent?: boolean | undefined;
|
|
49
|
-
mediaGroupId?: string | undefined;
|
|
50
|
-
authorSignature?: string | undefined;
|
|
51
|
-
views?: number | undefined;
|
|
52
|
-
forwards?: number | undefined;
|
|
53
|
-
replyMarkup?: import("../3_types.js").ReplyMarkup | undefined;
|
|
54
|
-
}>;
|
|
21
|
+
constructMessage(message_: enums.Message, r?: boolean): Promise<Message>;
|
|
55
22
|
forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise<Message[]>;
|
|
56
23
|
getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
|
|
57
24
|
usernameResolver: UsernameResolver;
|
|
@@ -101,5 +68,11 @@ export declare class MessageManager {
|
|
|
101
68
|
disableJoinRequests(chatId: ID): Promise<void>;
|
|
102
69
|
searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
|
|
103
70
|
setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
|
|
71
|
+
createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<import("../3_types.js").InviteLink>;
|
|
72
|
+
getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<import("../3_types.js").InviteLink[]>;
|
|
73
|
+
joinChat(chatId: ID): Promise<void>;
|
|
74
|
+
leaveChat(chatId: ID): Promise<void>;
|
|
75
|
+
blockUser(userId: ID): Promise<void>;
|
|
76
|
+
unblockUser(userId: ID): Promise<void>;
|
|
104
77
|
}
|
|
105
78
|
export {};
|
|
@@ -13,7 +13,7 @@ var _MessageManager_instances, _MessageManager_c, _MessageManager_LresolveFileId
|
|
|
13
13
|
import { contentType } from "../0_deps.js";
|
|
14
14
|
import { getLogger, getRandomId, toUnixTimestamp, UNREACHABLE } from "../1_utilities.js";
|
|
15
15
|
import { as, getChannelChatId, peerToChatId, types } from "../2_tl.js";
|
|
16
|
-
import { constructChatMemberUpdated } from "../3_types.js";
|
|
16
|
+
import { constructChatMemberUpdated, constructInviteLink } from "../3_types.js";
|
|
17
17
|
import { assertMessageType, chatMemberRightsToTlObject, constructChatMember, constructMessage as constructMessage_, deserializeInlineMessageId, FileID, FileType, messageEntityToTlObject, reactionEqual, reactionToTlObject, replyMarkupToTlObject } from "../3_types.js";
|
|
18
18
|
import { STICKER_SET_NAME_TTL } from "../4_constants.js";
|
|
19
19
|
import { messageSearchFilterToTlObject } from "../types/0_message_search_filter.js";
|
|
@@ -899,6 +899,78 @@ export class MessageManager {
|
|
|
899
899
|
const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
|
|
900
900
|
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.setBoostsToUnblockRestrictions({ channel, boosts });
|
|
901
901
|
}
|
|
902
|
+
async createInviteLink(chatId, params) {
|
|
903
|
+
if (params?.requireApproval && params?.limit) {
|
|
904
|
+
throw new Error("createInviteLink: requireApproval cannot be true while limit is specified");
|
|
905
|
+
}
|
|
906
|
+
const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.exportChatInvite({
|
|
907
|
+
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
908
|
+
title: params?.title,
|
|
909
|
+
expire_date: params?.expireAt ? toUnixTimestamp(params.expireAt) : undefined,
|
|
910
|
+
request_needed: params?.requireApproval ? true : undefined,
|
|
911
|
+
usage_limit: params?.limit,
|
|
912
|
+
});
|
|
913
|
+
return await constructInviteLink(result[as](types.ChatInviteExported), __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
|
|
914
|
+
}
|
|
915
|
+
async getCreatedInviteLinks(chatId, params) {
|
|
916
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("getCreatedInviteLinks");
|
|
917
|
+
const { invites } = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.getExportedChatInvites({
|
|
918
|
+
peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
|
|
919
|
+
revoked: params?.revoked ? true : undefined,
|
|
920
|
+
admin_id: params?.by ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputUser(params.by) : new types.InputUserEmpty(),
|
|
921
|
+
limit: params?.limit ?? 100,
|
|
922
|
+
offset_date: params?.afterDate ? toUnixTimestamp(params.afterDate) : undefined,
|
|
923
|
+
offset_link: params?.afterInviteLink,
|
|
924
|
+
});
|
|
925
|
+
return await Promise.all(invites.map((v) => v[as](types.ChatInviteExported)).map((v) => constructInviteLink(v, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity)));
|
|
926
|
+
}
|
|
927
|
+
async joinChat(chatId) {
|
|
928
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("joinChat");
|
|
929
|
+
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
930
|
+
if (peer instanceof types.InputPeerUser) {
|
|
931
|
+
throw new Error("joinChat: cannot join private chats");
|
|
932
|
+
}
|
|
933
|
+
else if (peer instanceof types.InputPeerChannel) {
|
|
934
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.joinChannel({ channel: new types.InputChannel(peer) });
|
|
935
|
+
}
|
|
936
|
+
else if (peer instanceof types.InputPeerChat) {
|
|
937
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.addChatUser({ chat_id: peer.chat_id, user_id: new types.InputUserSelf(), fwd_limit: 0 }); // TODO: use potential high-level method for adding participants to chats
|
|
938
|
+
}
|
|
939
|
+
else {
|
|
940
|
+
UNREACHABLE();
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
async leaveChat(chatId) {
|
|
944
|
+
const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
|
|
945
|
+
if (peer instanceof types.InputPeerUser) {
|
|
946
|
+
throw new Error("leaveChat: cannot leave private chats");
|
|
947
|
+
}
|
|
948
|
+
else if (peer instanceof types.InputPeerChannel) {
|
|
949
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.leaveChannel({ channel: new types.InputChannel(peer) });
|
|
950
|
+
}
|
|
951
|
+
else if (peer instanceof types.InputPeerChat) {
|
|
952
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.deleteChatUser({ chat_id: peer.chat_id, user_id: new types.InputUserSelf() }); // TODO: use potential high-level method for adding participants to chats
|
|
953
|
+
}
|
|
954
|
+
else {
|
|
955
|
+
UNREACHABLE();
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
async blockUser(userId) {
|
|
959
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("blockUser");
|
|
960
|
+
const id = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(userId);
|
|
961
|
+
if (!(id instanceof types.User)) {
|
|
962
|
+
throw new Error("blockUser: only users can be blocked or unblocked");
|
|
963
|
+
}
|
|
964
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.contacts.block({ id });
|
|
965
|
+
}
|
|
966
|
+
async unblockUser(userId) {
|
|
967
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("unblockUser");
|
|
968
|
+
const id = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(userId);
|
|
969
|
+
if (!(id instanceof types.User)) {
|
|
970
|
+
throw new Error("unblockUser: only users can be blocked or unblocked");
|
|
971
|
+
}
|
|
972
|
+
await __classPrivateFieldGet(this, _MessageManager_c, "f").api.contacts.unblock({ id });
|
|
973
|
+
}
|
|
902
974
|
}
|
|
903
975
|
_MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(), _MessageManager_instances = new WeakSet(), _MessageManager_updatesToMessages = async function _MessageManager_updatesToMessages(chatId, updates) {
|
|
904
976
|
const messages = new Array();
|
package/esm/client/4_client.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
|
-
import { functions, types } from "../2_tl.js";
|
|
2
|
+
import { enums, functions, types } from "../2_tl.js";
|
|
3
3
|
import { Storage } from "../3_storage.js";
|
|
4
4
|
import { DC } from "../3_transport.js";
|
|
5
5
|
import { InactiveChat } from "../3_types.js";
|
|
6
|
-
import { BotCommand, Chat, ChatAction, ChatMember, ChatP, Document, FileSource, ID, InlineQueryResult, InputStoryContent, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Reaction, Story, Update, UpdateIntersection, User } from "../3_types.js";
|
|
6
|
+
import { BotCommand, Chat, ChatAction, ChatMember, ChatP, Document, FileSource, ID, InlineQueryResult, InputStoryContent, InviteLink, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Reaction, Story, Update, UpdateIntersection, User } from "../3_types.js";
|
|
7
7
|
import { Migrate } from "../4_errors.js";
|
|
8
8
|
import { ClientAbstract } from "./0_client_abstract.js";
|
|
9
9
|
import { FilterQuery, WithFilter } from "./0_filters.js";
|
|
10
|
-
import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, UploadParams } from "./0_params.js";
|
|
10
|
+
import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, UploadParams } from "./0_params.js";
|
|
11
11
|
import { Api } from "./0_types.js";
|
|
12
12
|
import { Composer, Middleware } from "./1_composer.js";
|
|
13
13
|
import { ClientPlainParams } from "./2_client_plain.js";
|
|
@@ -137,6 +137,16 @@ export interface Context {
|
|
|
137
137
|
searchMessages: (query: string, params?: SearchMessagesParams) => Promise<Message[]>;
|
|
138
138
|
/** Set the number of boosts required to circument the chat's default restrictions. */
|
|
139
139
|
setBoostsRequiredToCircumventRestrictions: (boosts: number) => Promise<void>;
|
|
140
|
+
/** Create an invite link for the chat which the message was received from. */
|
|
141
|
+
createInviteLink: (params?: CreateInviteLinkParams) => Promise<InviteLink>;
|
|
142
|
+
/** Get the invite links that were created for the chat which the message was received from. */
|
|
143
|
+
getCreatedInviteLinks: (params?: GetCreatedInviteLinksParams) => Promise<InviteLink[]>;
|
|
144
|
+
/** Leave the chat which the message was received from. */
|
|
145
|
+
leave: () => Promise<void>;
|
|
146
|
+
/** Block the user who sent the message. User-only. */
|
|
147
|
+
block: () => Promise<void>;
|
|
148
|
+
/** Unblock the user who sent the message. */
|
|
149
|
+
unblock: () => Promise<void>;
|
|
140
150
|
toJSON: () => Update;
|
|
141
151
|
}
|
|
142
152
|
export declare function skipInvoke<C extends Context>(): InvokeErrorHandler<Client<C>>;
|
|
@@ -237,10 +247,10 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
237
247
|
* @param function_ The function to invoke.
|
|
238
248
|
*/
|
|
239
249
|
invoke: {
|
|
240
|
-
<T extends
|
|
241
|
-
<
|
|
242
|
-
|
|
243
|
-
use
|
|
250
|
+
<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T): Promise<T extends functions.Function<unknown> ? T["__R"] : void>;
|
|
251
|
+
<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T, noWait: true): Promise<void>;
|
|
252
|
+
<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T, noWait?: boolean): Promise<T | void>;
|
|
253
|
+
use(handler: InvokeErrorHandler<Client<C>>): void;
|
|
244
254
|
};
|
|
245
255
|
/**
|
|
246
256
|
* Alias for `invoke` with its second parameter being `true`.
|
|
@@ -248,22 +258,22 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
248
258
|
send<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T): Promise<void>;
|
|
249
259
|
exportAuthString(): Promise<string>;
|
|
250
260
|
importAuthString(authString: string): Promise<void>;
|
|
251
|
-
getInputPeer(id: ID): Promise<
|
|
252
|
-
getInputChannel(id: ID): Promise<
|
|
253
|
-
getInputUser(id: ID): Promise<
|
|
261
|
+
getInputPeer(id: ID): Promise<enums.InputPeer>;
|
|
262
|
+
getInputChannel(id: ID): Promise<types.InputChannel>;
|
|
263
|
+
getInputUser(id: ID): Promise<types.InputUser>;
|
|
254
264
|
private [getEntity];
|
|
255
265
|
private [getEntity];
|
|
256
266
|
private [getEntity];
|
|
257
267
|
private [getEntity];
|
|
258
|
-
use(...middleware: Middleware<UpdateIntersection<C>>[]): Composer<
|
|
259
|
-
branch(predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>, trueHandler_: Middleware<UpdateIntersection<C>>, falseHandler_: Middleware<UpdateIntersection<C>>): Composer<
|
|
268
|
+
use(...middleware: Middleware<UpdateIntersection<C>>[]): Composer<C>;
|
|
269
|
+
branch(predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>, trueHandler_: Middleware<UpdateIntersection<C>>, falseHandler_: Middleware<UpdateIntersection<C>>): Composer<C>;
|
|
260
270
|
filter<D extends C>(predicate: (ctx: UpdateIntersection<C>) => ctx is D, ...middleware: Middleware<D>[]): Composer<D>;
|
|
261
271
|
filter(predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>, ...middleware: Middleware<UpdateIntersection<C>>[]): Composer<C>;
|
|
262
272
|
on<Q extends FilterQuery>(filter: Q, ...middleawre: Middleware<WithFilter<C, Q>>[]): Composer<UpdateIntersection<WithFilter<C, Q>>>;
|
|
263
273
|
command(commands: string | RegExp | (string | RegExp)[] | {
|
|
264
274
|
names: string | RegExp | (string | RegExp)[];
|
|
265
275
|
prefixes: string | string[];
|
|
266
|
-
}, ...middleawre: Middleware<WithFilter<C, "message:text">>[]): Composer<
|
|
276
|
+
}, ...middleawre: Middleware<WithFilter<C, "message:text">>[]): Composer<WithFilter<C, "message:text">>;
|
|
267
277
|
/**
|
|
268
278
|
* Send a text message.
|
|
269
279
|
*
|
|
@@ -403,8 +413,9 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
403
413
|
*
|
|
404
414
|
* @method fs
|
|
405
415
|
* @param contents The contents of the file.
|
|
416
|
+
* @returns The uploaded file.
|
|
406
417
|
*/
|
|
407
|
-
upload(contents: Uint8Array, params?: UploadParams): Promise<
|
|
418
|
+
upload(contents: Uint8Array, params?: UploadParams): Promise<any>;
|
|
408
419
|
/**
|
|
409
420
|
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
410
421
|
*
|
|
@@ -416,6 +427,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
416
427
|
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
417
428
|
*
|
|
418
429
|
* @method bs
|
|
430
|
+
* @returns The current bot's commands in the specified language.
|
|
419
431
|
*/
|
|
420
432
|
getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
|
|
421
433
|
/**
|
|
@@ -457,14 +469,16 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
457
469
|
* Get the bot's description in the given language. Bot-only.
|
|
458
470
|
*
|
|
459
471
|
* @method bs
|
|
472
|
+
* @returns The current bot's description in the specified language.
|
|
460
473
|
*/
|
|
461
474
|
getMyDescription(params?: {
|
|
462
475
|
languageCode?: string;
|
|
463
476
|
}): Promise<string>;
|
|
464
477
|
/**
|
|
465
|
-
*
|
|
478
|
+
* Get the bot's name in the given language. Bot-only.
|
|
466
479
|
*
|
|
467
480
|
* @method bs
|
|
481
|
+
* @returns The current bot's name in the specified language.
|
|
468
482
|
*/
|
|
469
483
|
getMyName(params?: {
|
|
470
484
|
languageCode?: string;
|
|
@@ -473,6 +487,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
473
487
|
* Get the bot's short description in the given language. Bot-only.
|
|
474
488
|
*
|
|
475
489
|
* @method bs
|
|
490
|
+
* @returns The current bot's short description in the specified language.
|
|
476
491
|
*/
|
|
477
492
|
getMyShortDescription(params?: {
|
|
478
493
|
languageCode?: string;
|
|
@@ -499,6 +514,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
499
514
|
* @method ms
|
|
500
515
|
* @param chatId The chat to send the photo to.
|
|
501
516
|
* @param photo The photo to send.
|
|
517
|
+
* @returns The sent photo.
|
|
502
518
|
*/
|
|
503
519
|
sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
|
|
504
520
|
/**
|
|
@@ -507,6 +523,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
507
523
|
* @method ms
|
|
508
524
|
* @param chatId The chat to send the document to.
|
|
509
525
|
* @param document The document to send.
|
|
526
|
+
* @returns The sent document.
|
|
510
527
|
*/
|
|
511
528
|
sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
|
|
512
529
|
/**
|
|
@@ -515,6 +532,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
515
532
|
* @method ms
|
|
516
533
|
* @param chatId The chat to send the video to.
|
|
517
534
|
* @param video The video to send.
|
|
535
|
+
* @returns The sent video.
|
|
518
536
|
*/
|
|
519
537
|
sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
|
|
520
538
|
/**
|
|
@@ -523,6 +541,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
523
541
|
* @method ms
|
|
524
542
|
* @param chatId The chat to send the animation to.
|
|
525
543
|
* @param animation The animation to send.
|
|
544
|
+
* @returns The sent animation.
|
|
526
545
|
*/
|
|
527
546
|
sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
|
|
528
547
|
/**
|
|
@@ -531,6 +550,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
531
550
|
* @method ms
|
|
532
551
|
* @param chatId The chat to send the voice message to.
|
|
533
552
|
* @param voice The voice to send.
|
|
553
|
+
* @returns The sent voice message.
|
|
534
554
|
*/
|
|
535
555
|
sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
|
|
536
556
|
/**
|
|
@@ -539,6 +559,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
539
559
|
* @method ms
|
|
540
560
|
* @param chatId The chat to send the audio file to.
|
|
541
561
|
* @param audio The audio to send.
|
|
562
|
+
* @returns The sent audio filr.
|
|
542
563
|
*/
|
|
543
564
|
sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
|
|
544
565
|
/**
|
|
@@ -547,6 +568,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
547
568
|
* @method ms
|
|
548
569
|
* @param chatId The chat to send the video note to.
|
|
549
570
|
* @param videoNote The video note to send.
|
|
571
|
+
* @returns The sent video note.
|
|
550
572
|
*/
|
|
551
573
|
sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
|
|
552
574
|
/**
|
|
@@ -556,6 +578,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
556
578
|
* @param chatId The chat to send the location to.
|
|
557
579
|
* @param latitude The location's latitude.
|
|
558
580
|
* @param longitude The location's longitude.
|
|
581
|
+
* @returns The sent location.
|
|
559
582
|
*/
|
|
560
583
|
sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
|
|
561
584
|
/**
|
|
@@ -565,6 +588,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
565
588
|
* @param chatId The chat to send the contact to.
|
|
566
589
|
* @param firstName The contact's first name.
|
|
567
590
|
* @param number The contact's phone number.
|
|
591
|
+
* @returns The sent contact.
|
|
568
592
|
*/
|
|
569
593
|
sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
|
|
570
594
|
/**
|
|
@@ -572,6 +596,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
572
596
|
*
|
|
573
597
|
* @method ms
|
|
574
598
|
* @param chatId The chat to send the dice to.
|
|
599
|
+
* @returns The sent dice.
|
|
575
600
|
*/
|
|
576
601
|
sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
|
|
577
602
|
/**
|
|
@@ -583,6 +608,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
583
608
|
* @param longitude The longitude of the venue.
|
|
584
609
|
* @param title The title of the venue.
|
|
585
610
|
* @param address The written address of the venue.
|
|
611
|
+
* @returns The sent venue.
|
|
586
612
|
*/
|
|
587
613
|
sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
|
|
588
614
|
/**
|
|
@@ -615,6 +641,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
615
641
|
*
|
|
616
642
|
* @method fs
|
|
617
643
|
* @param id Identifier of one or more of custom emojis.
|
|
644
|
+
* @returns The custom emoji documents.
|
|
618
645
|
*/
|
|
619
646
|
getCustomEmojiDocuments(id: string | string[]): Promise<Document[]>;
|
|
620
647
|
/**
|
|
@@ -735,6 +762,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
735
762
|
*
|
|
736
763
|
* @method ch
|
|
737
764
|
* @param chatId The identifier of the chat.
|
|
765
|
+
* @returns The chat's administrators.
|
|
738
766
|
*/
|
|
739
767
|
getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
|
|
740
768
|
/**
|
|
@@ -759,6 +787,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
759
787
|
* @method st
|
|
760
788
|
* @param chatId The identifier of the chat to retrieve the story from.
|
|
761
789
|
* @param storyId The identifier of the story to retrieve.
|
|
790
|
+
* @returns The retrieved story.
|
|
762
791
|
*/
|
|
763
792
|
getStory(chatId: ID, storyId: number): Promise<Story | null>;
|
|
764
793
|
/**
|
|
@@ -845,6 +874,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
845
874
|
* @method ac
|
|
846
875
|
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
847
876
|
* @param order The new order to use.
|
|
877
|
+
* @returns Whether the order was changed.
|
|
848
878
|
*/
|
|
849
879
|
reorderUsernames(id: ID, order: string[]): Promise<boolean>;
|
|
850
880
|
/**
|
|
@@ -858,6 +888,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
858
888
|
* Get inactive chats. User-only.
|
|
859
889
|
*
|
|
860
890
|
* @method ch
|
|
891
|
+
* @retuns A list of inactive chats the current user is member of.
|
|
861
892
|
*/
|
|
862
893
|
getInactiveChats(): Promise<InactiveChat[]>;
|
|
863
894
|
/**
|
|
@@ -876,5 +907,49 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
876
907
|
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
877
908
|
*/
|
|
878
909
|
setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
|
|
910
|
+
/**
|
|
911
|
+
* Create an invite link.
|
|
912
|
+
*
|
|
913
|
+
* @method ch
|
|
914
|
+
* @param chatId The identifier of the chat to create the invite link for.
|
|
915
|
+
* @returns The newly created invite link.
|
|
916
|
+
*/
|
|
917
|
+
createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
|
|
918
|
+
/**
|
|
919
|
+
* Get the invite links created for a chat. User-only.
|
|
920
|
+
*
|
|
921
|
+
* @method ch
|
|
922
|
+
* @param chatId The identifier of the chat.
|
|
923
|
+
* @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
|
|
924
|
+
*/
|
|
925
|
+
getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
|
|
926
|
+
/**
|
|
927
|
+
* Join a chat. User-only.
|
|
928
|
+
*
|
|
929
|
+
* @method ch
|
|
930
|
+
* @param chatId The identifier of the chat to join.
|
|
931
|
+
*/
|
|
932
|
+
joinChat(chatId: ID): Promise<void>;
|
|
933
|
+
/**
|
|
934
|
+
* Leave a chat.
|
|
935
|
+
*
|
|
936
|
+
* @method ch
|
|
937
|
+
* @param chatId The identifier of the chat to leave.
|
|
938
|
+
*/
|
|
939
|
+
leaveChat(chatId: ID): Promise<void>;
|
|
940
|
+
/**
|
|
941
|
+
* Block a user. User-only.
|
|
942
|
+
*
|
|
943
|
+
* @method mc
|
|
944
|
+
* @param userId The identifier of the user to block.
|
|
945
|
+
*/
|
|
946
|
+
blockUser(userId: ID): Promise<void>;
|
|
947
|
+
/**
|
|
948
|
+
* Unblock a user. User-only.
|
|
949
|
+
*
|
|
950
|
+
* @method mc
|
|
951
|
+
* @param userId The identifier of the user to unblock.
|
|
952
|
+
*/
|
|
953
|
+
unblockUser(userId: ID): Promise<void>;
|
|
879
954
|
}
|
|
880
955
|
export {};
|