@mtkruto/node 0.0.998 → 0.1.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/0_deps.d.ts +1 -1
- package/esm/0_deps.js +1 -1
- package/esm/3_errors.d.ts +1531 -0
- package/esm/3_errors.js +1531 -0
- package/esm/3_types.d.ts +39 -3
- package/esm/3_types.js +39 -3
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/4_errors.d.ts +25 -0
- package/esm/4_errors.js +64 -0
- package/esm/client/2_client_plain.js +1 -1
- package/esm/client/3_types.d.ts +1 -5
- package/esm/client/4_client.d.ts +20 -3
- package/esm/client/4_client.js +61 -62
- package/esm/connection/1_connection_web_socket.js +2 -1
- package/esm/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.d.ts +2 -2
- package/esm/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.js +19 -6
- package/esm/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.d.ts +2 -0
- package/esm/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.js +991 -0
- package/esm/mod.d.ts +3 -2
- package/esm/mod.js +3 -2
- package/esm/tl/2_types.d.ts +1 -1
- package/esm/tl/2_types.js +1 -2
- package/esm/tl/3_functions.d.ts +1 -1
- package/esm/tl/3_functions.js +1 -2
- package/esm/types/{!0_file_id.js → 0__file_id.js} +0 -1
- package/esm/types/0_bot_command.d.ts +4 -0
- package/esm/types/0_chat_id.d.ts +4 -0
- package/esm/types/0_chat_id.js +1 -0
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_input_contact_message_content.d.ts +6 -0
- package/esm/types/0_input_contact_message_content.js +1 -0
- package/esm/types/0_input_location_message_content.d.ts +8 -0
- package/esm/types/0_input_location_message_content.js +1 -0
- package/esm/types/0_input_venue_message_content.d.ts +10 -0
- package/esm/types/0_input_venue_message_content.js +1 -0
- package/esm/types/0_labeled_price.d.ts +4 -0
- package/esm/types/0_labeled_price.js +1 -0
- package/esm/types/0_parse_mode.d.ts +1 -0
- package/esm/types/0_parse_mode.js +1 -0
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
- package/esm/types/1__getters.js +1 -0
- package/esm/types/1_bot_command_scope.d.ts +32 -0
- package/esm/types/1_bot_command_scope.js +27 -0
- package/esm/types/1_chat.d.ts +1 -1
- package/esm/types/1_chat.js +1 -1
- package/esm/types/1_inline_query_result_button.d.ts +6 -0
- package/esm/types/1_inline_query_result_button.js +1 -0
- package/esm/types/1_input_invoice_message_content.d.ts +23 -0
- package/esm/types/1_input_invoice_message_content.js +1 -0
- package/esm/types/1_input_text_message_content.d.ts +8 -0
- package/esm/types/1_input_text_message_content.js +1 -0
- package/esm/types/1_photo.js +1 -1
- package/esm/types/1_sticker.d.ts +1 -1
- package/esm/types/1_sticker.js +1 -1
- package/esm/types/1_user.d.ts +1 -1
- package/esm/types/1_user.js +1 -1
- package/esm/types/2_game.js +1 -1
- package/{script/types/1_inline_keyboard_button.d.ts → esm/types/2_inline_keyboard_button.d.ts} +3 -3
- package/esm/types/2_inline_query.d.ts +1 -1
- package/esm/types/2_input_message_content.d.ts +6 -0
- package/esm/types/2_input_message_content.js +1 -0
- package/esm/types/{2_inline_keyboard_markup.d.ts → 3_inline_keyboard_markup.d.ts} +3 -2
- package/esm/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +1 -1
- package/esm/types/3_message.d.ts +13 -13
- package/esm/types/3_message.js +13 -13
- package/esm/types/4_callback_query.d.ts +1 -1
- package/esm/types/4_inline_query_result_article.d.ts +15 -0
- package/esm/types/4_inline_query_result_article.js +1 -0
- package/esm/types/4_inline_query_result_audio.d.ts +17 -0
- package/esm/types/4_inline_query_result_audio.js +1 -0
- package/esm/types/4_inline_query_result_cached_audio.d.ts +14 -0
- package/esm/types/4_inline_query_result_cached_audio.js +1 -0
- package/esm/types/4_inline_query_result_cached_document.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_document.js +1 -0
- package/esm/types/4_inline_query_result_cached_gif.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_gif.js +1 -0
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.js +1 -0
- package/esm/types/4_inline_query_result_cached_photo.d.ts +16 -0
- package/esm/types/4_inline_query_result_cached_photo.js +1 -0
- package/esm/types/4_inline_query_result_cached_sticker.d.ts +9 -0
- package/esm/types/4_inline_query_result_cached_sticker.js +1 -0
- package/esm/types/4_inline_query_result_cached_video.d.ts +16 -0
- package/esm/types/4_inline_query_result_cached_video.js +1 -0
- package/esm/types/4_inline_query_result_cached_voice.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_voice.js +1 -0
- package/esm/types/4_inline_query_result_contact.d.ts +15 -0
- package/esm/types/4_inline_query_result_contact.js +1 -0
- package/esm/types/4_inline_query_result_document.d.ts +18 -0
- package/esm/types/4_inline_query_result_document.js +1 -0
- package/esm/types/4_inline_query_result_game.d.ts +7 -0
- package/esm/types/4_inline_query_result_game.js +1 -0
- package/esm/types/4_inline_query_result_gif.d.ts +20 -0
- package/esm/types/4_inline_query_result_gif.js +1 -0
- package/esm/types/4_inline_query_result_location.d.ts +18 -0
- package/esm/types/4_inline_query_result_location.js +1 -0
- package/esm/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
- package/esm/types/4_inline_query_result_mpeg4_gif.js +1 -0
- package/esm/types/4_inline_query_result_photo.d.ts +19 -0
- package/esm/types/4_inline_query_result_photo.js +1 -0
- package/esm/types/4_inline_query_result_venue.d.ts +19 -0
- package/esm/types/4_inline_query_result_venue.js +1 -0
- package/esm/types/4_inline_query_result_video.d.ts +21 -0
- package/esm/types/4_inline_query_result_video.js +1 -0
- package/esm/types/4_inline_query_result_voice.d.ts +16 -0
- package/esm/types/4_inline_query_result_voice.js +1 -0
- package/esm/types/4_reply_markup.d.ts +7 -0
- package/esm/types/4_reply_markup.js +22 -0
- package/esm/types/5_inline_query_result.d.ts +29 -0
- package/esm/types/5_inline_query_result.js +256 -0
- package/esm/utilities/0_crypto.js +6 -4
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -1
- package/script/0_deps.js +1 -1
- package/script/3_errors.d.ts +1531 -0
- package/script/3_errors.js +2053 -0
- package/script/3_types.d.ts +39 -3
- package/script/3_types.js +39 -3
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/4_errors.d.ts +25 -0
- package/script/4_errors.js +88 -0
- package/script/client/2_client_plain.js +1 -1
- package/script/client/3_types.d.ts +1 -5
- package/script/client/4_client.d.ts +20 -3
- package/script/client/4_client.js +60 -61
- package/script/connection/1_connection_web_socket.js +2 -1
- package/script/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.d.ts +2 -2
- package/script/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.js +19 -6
- package/script/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.d.ts +2 -0
- package/script/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.js +993 -0
- package/script/mod.d.ts +3 -2
- package/script/mod.js +16 -3
- package/script/tl/2_types.d.ts +1 -1
- package/script/tl/2_types.js +0 -1
- package/script/tl/3_functions.d.ts +1 -1
- package/script/tl/3_functions.js +0 -1
- package/script/types/{!0_file_id.js → 0__file_id.js} +0 -1
- package/script/types/0_bot_command.d.ts +4 -0
- package/script/types/0_chat_id.d.ts +4 -0
- package/script/types/0_chat_id.js +2 -0
- package/script/types/0_chat_photo.js +7 -7
- package/script/types/0_input_contact_message_content.d.ts +6 -0
- package/script/types/0_input_contact_message_content.js +2 -0
- package/script/types/0_input_location_message_content.d.ts +8 -0
- package/script/types/0_input_location_message_content.js +2 -0
- package/script/types/0_input_venue_message_content.d.ts +10 -0
- package/script/types/0_input_venue_message_content.js +2 -0
- package/script/types/0_labeled_price.d.ts +4 -0
- package/script/types/0_labeled_price.js +2 -0
- package/script/types/0_parse_mode.d.ts +1 -0
- package/script/types/0_parse_mode.js +2 -0
- package/script/types/0_thumbnail.js +5 -5
- package/script/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
- package/script/types/1__getters.js +2 -0
- package/script/types/1_bot_command_scope.d.ts +32 -0
- package/script/types/1_bot_command_scope.js +31 -0
- package/script/types/1_chat.d.ts +1 -1
- package/script/types/1_chat.js +1 -1
- package/script/types/1_inline_query_result_button.d.ts +6 -0
- package/script/types/1_inline_query_result_button.js +2 -0
- package/script/types/1_input_invoice_message_content.d.ts +23 -0
- package/script/types/1_input_invoice_message_content.js +2 -0
- package/script/types/1_input_text_message_content.d.ts +8 -0
- package/script/types/1_input_text_message_content.js +2 -0
- package/script/types/1_photo.js +5 -5
- package/script/types/1_sticker.d.ts +1 -1
- package/script/types/1_sticker.js +1 -1
- package/script/types/1_user.d.ts +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/2_game.js +3 -3
- package/{esm/types/1_inline_keyboard_button.d.ts → script/types/2_inline_keyboard_button.d.ts} +3 -3
- package/script/types/2_inline_query.d.ts +1 -1
- package/script/types/2_input_message_content.d.ts +6 -0
- package/script/types/2_input_message_content.js +2 -0
- package/script/types/{2_inline_keyboard_markup.d.ts → 3_inline_keyboard_markup.d.ts} +3 -2
- package/script/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +3 -3
- package/script/types/3_message.d.ts +13 -13
- package/script/types/3_message.js +23 -23
- package/script/types/4_callback_query.d.ts +1 -1
- package/script/types/4_inline_query_result_article.d.ts +15 -0
- package/script/types/4_inline_query_result_article.js +2 -0
- package/script/types/4_inline_query_result_audio.d.ts +17 -0
- package/script/types/4_inline_query_result_audio.js +2 -0
- package/script/types/4_inline_query_result_cached_audio.d.ts +14 -0
- package/script/types/4_inline_query_result_cached_audio.js +2 -0
- package/script/types/4_inline_query_result_cached_document.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_document.js +2 -0
- package/script/types/4_inline_query_result_cached_gif.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_gif.js +2 -0
- package/script/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_mpeg4_gif.js +2 -0
- package/script/types/4_inline_query_result_cached_photo.d.ts +16 -0
- package/script/types/4_inline_query_result_cached_photo.js +2 -0
- package/script/types/4_inline_query_result_cached_sticker.d.ts +9 -0
- package/script/types/4_inline_query_result_cached_sticker.js +2 -0
- package/script/types/4_inline_query_result_cached_video.d.ts +16 -0
- package/script/types/4_inline_query_result_cached_video.js +2 -0
- package/script/types/4_inline_query_result_cached_voice.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_voice.js +2 -0
- package/script/types/4_inline_query_result_contact.d.ts +15 -0
- package/script/types/4_inline_query_result_contact.js +2 -0
- package/script/types/4_inline_query_result_document.d.ts +18 -0
- package/script/types/4_inline_query_result_document.js +2 -0
- package/script/types/4_inline_query_result_game.d.ts +7 -0
- package/script/types/4_inline_query_result_game.js +2 -0
- package/script/types/4_inline_query_result_gif.d.ts +20 -0
- package/script/types/4_inline_query_result_gif.js +2 -0
- package/script/types/4_inline_query_result_location.d.ts +18 -0
- package/script/types/4_inline_query_result_location.js +2 -0
- package/script/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
- package/script/types/4_inline_query_result_mpeg4_gif.js +2 -0
- package/script/types/4_inline_query_result_photo.d.ts +19 -0
- package/script/types/4_inline_query_result_photo.js +2 -0
- package/script/types/4_inline_query_result_venue.d.ts +19 -0
- package/script/types/4_inline_query_result_venue.js +2 -0
- package/script/types/4_inline_query_result_video.d.ts +21 -0
- package/script/types/4_inline_query_result_video.js +2 -0
- package/script/types/4_inline_query_result_voice.d.ts +16 -0
- package/script/types/4_inline_query_result_voice.js +2 -0
- package/script/types/4_reply_markup.d.ts +7 -0
- package/script/types/4_reply_markup.js +26 -0
- package/script/types/5_inline_query_result.d.ts +29 -0
- package/script/types/5_inline_query_result.js +260 -0
- package/script/utilities/0_crypto.js +6 -4
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1078
- package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
- package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1080
- /package/esm/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
- /package/esm/types/{!0_misc.js → 0_bot_command.js} +0 -0
- /package/esm/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
- /package/script/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
- /package/script/types/{!0_misc.js → 0_bot_command.js} +0 -0
- /package/script/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
package/esm/mod.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ export declare const utils: {
|
|
|
4
4
|
checkPassword: typeof checkPassword;
|
|
5
5
|
getRandomId: typeof getRandomId;
|
|
6
6
|
};
|
|
7
|
-
export * from "./2_tl.js";
|
|
8
7
|
export * from "./2_connection.js";
|
|
9
8
|
export * from "./3_storage.js";
|
|
10
9
|
export * from "./3_transport.js";
|
|
10
|
+
export * from "./2_tl.js";
|
|
11
|
+
export * from "./3_types.js";
|
|
11
12
|
export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./4_constants.js";
|
|
13
|
+
export * as errors from "./4_errors.js";
|
|
12
14
|
export * from "./5_client.js";
|
|
13
|
-
export * from "./3_types.js";
|
package/esm/mod.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { getRandomId } from "./1_utilities.js";
|
|
2
2
|
import { checkPassword } from "./client/0_password.js";
|
|
3
3
|
export const utils = { checkPassword, getRandomId };
|
|
4
|
-
export * from "./2_tl.js";
|
|
5
4
|
export * from "./2_connection.js";
|
|
6
5
|
export * from "./3_storage.js";
|
|
7
6
|
export * from "./3_transport.js";
|
|
7
|
+
export * from "./2_tl.js";
|
|
8
|
+
export * from "./3_types.js";
|
|
8
9
|
export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./4_constants.js";
|
|
10
|
+
export * as errors from "./4_errors.js";
|
|
9
11
|
export * from "./5_client.js";
|
|
10
|
-
export * from "./3_types.js";
|
package/esm/tl/2_types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { id,
|
|
1
|
+
import { id, ParamDesc, paramDesc, Params, params, TLObject, TLObjectConstructor } from "./1_tl_object.js";
|
|
2
2
|
export declare abstract class Type extends TLObject {
|
|
3
3
|
}
|
|
4
4
|
export declare abstract class TypeX extends Type {
|
package/esm/tl/2_types.js
CHANGED
package/esm/tl/3_functions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { id,
|
|
1
|
+
import { id, ParamDesc, paramDesc, Params, params, TLObject } from "./1_tl_object.js";
|
|
2
2
|
import * as types from "./2_types.js";
|
|
3
3
|
export declare abstract class Function<T> extends TLObject {
|
|
4
4
|
__R: T;
|
package/esm/tl/3_functions.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { id, params, TLObject, paramDesc, flags } from "./1_tl_object.js";
|
|
1
|
+
import { flags, id, paramDesc, params, TLObject } from "./1_tl_object.js";
|
|
3
2
|
import * as types from "./2_types.js";
|
|
4
3
|
export class Function extends TLObject {
|
|
5
4
|
constructor() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "
|
|
2
|
+
import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./0__file_id.js";
|
|
3
3
|
export function constructChatPhoto(photo, chatId, chatAccessHash) {
|
|
4
4
|
const smallFileId = new FileID(null, null, FileType.ChatPhoto, photo.dcId, {
|
|
5
5
|
mediaId: photo.photoId,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ParseMode = "HTML" | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/types/0_thumbnail.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "
|
|
2
|
+
import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./0__file_id.js";
|
|
3
3
|
export function constructThumbnail(size, file) {
|
|
4
4
|
const fileType = file instanceof types.Photo ? FileType.Photo : FileType.Document;
|
|
5
5
|
const fileId = new FileID(null, null, fileType, file.dcId, {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
+
import { ChatID } from "./0_chat_id.js";
|
|
3
4
|
export interface EntityGetter {
|
|
4
5
|
(peer: types.PeerUser): MaybePromise<types.User | null>;
|
|
5
6
|
(peer: types.PeerChat): MaybePromise<types.Chat | null>;
|
|
6
7
|
(peer: types.PeerChannel): MaybePromise<types.Channel | null>;
|
|
7
8
|
}
|
|
9
|
+
export interface InputPeerGetter {
|
|
10
|
+
(id: ChatID): Promise<types.InputPeerUser | types.InputPeerChannel | types.InputPeerChat>;
|
|
11
|
+
}
|
|
12
|
+
export interface UsernameResolver {
|
|
13
|
+
(username: string): MaybePromise<types.InputUser>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
|
+
import { ChatID } from "./0_chat_id.js";
|
|
3
|
+
import { InputPeerGetter } from "./1__getters.js";
|
|
4
|
+
export declare namespace BotCommandScope {
|
|
5
|
+
interface Default {
|
|
6
|
+
type: "default";
|
|
7
|
+
}
|
|
8
|
+
interface AllPrivateChats {
|
|
9
|
+
type: "allPrivateChats";
|
|
10
|
+
}
|
|
11
|
+
interface AllGroupChats {
|
|
12
|
+
type: "allGroupChats";
|
|
13
|
+
}
|
|
14
|
+
interface AllChatAdministrators {
|
|
15
|
+
type: "allChatAdministrators";
|
|
16
|
+
}
|
|
17
|
+
interface Chat {
|
|
18
|
+
type: "chat";
|
|
19
|
+
chatId: ChatID;
|
|
20
|
+
}
|
|
21
|
+
interface ChatAdministrators {
|
|
22
|
+
type: "chatAdministrators";
|
|
23
|
+
chatId: ChatID;
|
|
24
|
+
}
|
|
25
|
+
interface ChatMember {
|
|
26
|
+
type: "chatMember";
|
|
27
|
+
chatId: ChatID;
|
|
28
|
+
userId: number;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export type BotCommandScope = BotCommandScope.Default | BotCommandScope.AllPrivateChats | BotCommandScope.AllGroupChats | BotCommandScope.AllChatAdministrators | BotCommandScope.Chat | BotCommandScope.ChatAdministrators | BotCommandScope.ChatMember;
|
|
32
|
+
export declare function botCommandScopeToTlObject(scope: BotCommandScope, getInputPeer: InputPeerGetter): Promise<types.BotCommandScopeDefault | types.BotCommandScopeUsers | types.BotCommandScopeChats | types.BotCommandScopeChatAdmins | types.BotCommandScopePeer | types.BotCommandScopePeerAdmins | types.BotCommandScopePeerUser>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UNREACHABLE } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
|
+
export async function botCommandScopeToTlObject(scope, getInputPeer) {
|
|
4
|
+
switch (scope.type) {
|
|
5
|
+
case "default":
|
|
6
|
+
return new types.BotCommandScopeDefault();
|
|
7
|
+
case "allPrivateChats":
|
|
8
|
+
return new types.BotCommandScopeUsers();
|
|
9
|
+
case "allGroupChats":
|
|
10
|
+
return new types.BotCommandScopeChats();
|
|
11
|
+
case "allChatAdministrators":
|
|
12
|
+
return new types.BotCommandScopeChatAdmins();
|
|
13
|
+
case "chat":
|
|
14
|
+
return new types.BotCommandScopePeer({ peer: await getInputPeer(scope.chatId) });
|
|
15
|
+
case "chatAdministrators":
|
|
16
|
+
return new types.BotCommandScopePeerAdmins({ peer: await getInputPeer(scope.chatId) });
|
|
17
|
+
case "chatMember": {
|
|
18
|
+
const user = await getInputPeer(scope.userId);
|
|
19
|
+
if (!(user instanceof types.InputPeerUser)) {
|
|
20
|
+
UNREACHABLE();
|
|
21
|
+
}
|
|
22
|
+
return new types.BotCommandScopePeerUser({ peer: await getInputPeer(scope.chatId), userId: new types.InputUser({ userId: user.userId, accessHash: user.accessHash }) });
|
|
23
|
+
}
|
|
24
|
+
default:
|
|
25
|
+
UNREACHABLE();
|
|
26
|
+
}
|
|
27
|
+
}
|
package/esm/types/1_chat.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { Color } from "./0_color.js";
|
|
3
2
|
import { ChatPhoto } from "./0_chat_photo.js";
|
|
3
|
+
import { Color } from "./0_color.js";
|
|
4
4
|
export type ChatType = "private" | "group" | "supergroup" | "channel";
|
|
5
5
|
export declare namespace Chat {
|
|
6
6
|
interface Base {
|
package/esm/types/1_chat.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { cleanObject, UNREACHABLE } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
3
|
import { ZERO_CHANNEL_ID } from "../4_constants.js";
|
|
4
|
-
import { getColor } from "./0_color.js";
|
|
5
4
|
import { constructChatPhoto } from "./0_chat_photo.js";
|
|
5
|
+
import { getColor } from "./0_color.js";
|
|
6
6
|
export function constructChat(chat) {
|
|
7
7
|
if (chat instanceof types.User) {
|
|
8
8
|
const id = Number(chat.id);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LabeledPrice } from "../tl/2_types.js";
|
|
2
|
+
export interface InputInvoiceMessageContent {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
payload: string;
|
|
6
|
+
providerToken: string;
|
|
7
|
+
currency: string;
|
|
8
|
+
prices: LabeledPrice[];
|
|
9
|
+
maxTipAmount?: number;
|
|
10
|
+
suggestedTipAmounts?: number[];
|
|
11
|
+
providerData?: string;
|
|
12
|
+
photoUrl?: string;
|
|
13
|
+
photoSize?: number;
|
|
14
|
+
photoWidth?: number;
|
|
15
|
+
photoHeight?: number;
|
|
16
|
+
needName?: boolean;
|
|
17
|
+
needPhoneNumber?: boolean;
|
|
18
|
+
needEmail?: boolean;
|
|
19
|
+
needShippingAAddress?: boolean;
|
|
20
|
+
sendPhoneNumberToPorvider?: boolean;
|
|
21
|
+
sendEmailToProvider?: boolean;
|
|
22
|
+
isFlexible?: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/types/1_photo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "
|
|
2
|
+
import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./0__file_id.js";
|
|
3
3
|
import { constructThumbnail } from "./0_thumbnail.js";
|
|
4
4
|
export function constructPhoto(photo) {
|
|
5
5
|
const sizes = photo.sizes
|
package/esm/types/1_sticker.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
-
import { Thumbnail } from "./0_thumbnail.js";
|
|
4
3
|
import { MaskPosition } from "./0_mask_position.js";
|
|
4
|
+
import { Thumbnail } from "./0_thumbnail.js";
|
|
5
5
|
/** This object represents a sticker. */
|
|
6
6
|
export interface Sticker {
|
|
7
7
|
/** Identifier for this file, which can be used to download or reuse the file */
|
package/esm/types/1_sticker.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { as, types } from "../2_tl.js";
|
|
2
|
-
import { constructThumbnail } from "./0_thumbnail.js";
|
|
3
2
|
import { constructMaskPosition } from "./0_mask_position.js";
|
|
3
|
+
import { constructThumbnail } from "./0_thumbnail.js";
|
|
4
4
|
export async function constructSticker(document, fileId, fileUniqueId, getStickerSetName) {
|
|
5
5
|
const stickerAttribute = document.attributes.find((v) => v instanceof types.DocumentAttributeSticker);
|
|
6
6
|
const imageSizeAttribute = document.attributes.find((v) => v instanceof types.DocumentAttributeImageSize);
|
package/esm/types/1_user.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { Color } from "./0_color.js";
|
|
3
2
|
import { ChatPhoto } from "./0_chat_photo.js";
|
|
3
|
+
import { Color } from "./0_color.js";
|
|
4
4
|
/** This object represents a Telegram user or bot. */
|
|
5
5
|
export interface User {
|
|
6
6
|
/** Unique identifier for this user or bot */
|
package/esm/types/1_user.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cleanObject } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
-
import { getColor } from "./0_color.js";
|
|
4
3
|
import { constructChatPhoto } from "./0_chat_photo.js";
|
|
4
|
+
import { getColor } from "./0_color.js";
|
|
5
5
|
export function constructUser(user_) {
|
|
6
6
|
const id = Number(user_.id);
|
|
7
7
|
const user = {
|
package/esm/types/2_game.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cleanObject } from "../1_utilities.js";
|
|
2
2
|
import { as, types } from "../2_tl.js";
|
|
3
|
-
import { FileID, FileType, FileUniqueID, FileUniqueType } from "
|
|
3
|
+
import { FileID, FileType, FileUniqueID, FileUniqueType } from "./0__file_id.js";
|
|
4
4
|
import { constructAnimation } from "./1_animation.js";
|
|
5
5
|
import { constructPhoto } from "./1_photo.js";
|
|
6
6
|
export function constructGame(media_) {
|
package/{script/types/1_inline_keyboard_button.d.ts → esm/types/2_inline_keyboard_button.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MaybePromise } from "../1_utilities.js";
|
|
2
1
|
import { types } from "../2_tl.js";
|
|
3
|
-
import { WebAppInfo } from "./0_web_app_info.js";
|
|
4
2
|
import { LoginUrl } from "./0_login_url.js";
|
|
3
|
+
import { WebAppInfo } from "./0_web_app_info.js";
|
|
4
|
+
import { UsernameResolver } from "./1__getters.js";
|
|
5
5
|
export declare namespace InlineKeyboardButton {
|
|
6
6
|
interface Base {
|
|
7
7
|
/** Label text on the button */
|
|
@@ -42,4 +42,4 @@ export declare namespace InlineKeyboardButton {
|
|
|
42
42
|
/** This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. */
|
|
43
43
|
export type InlineKeyboardButton = InlineKeyboardButton.URL | InlineKeyboardButton.Callback | InlineKeyboardButton.WebApp | InlineKeyboardButton.Login | InlineKeyboardButton.SwitchInline | InlineKeyboardButton.SwitchInlineCurrent | InlineKeyboardButton.Game | InlineKeyboardButton.Pay;
|
|
44
44
|
export declare function constructInlineKeyboardButton(button_: types.TypeKeyboardButton): InlineKeyboardButton;
|
|
45
|
-
export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver:
|
|
45
|
+
export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: UsernameResolver): Promise<types.KeyboardButtonURL | types.KeyboardButtonCallback | types.KeyboardButtonSwitchInline | types.KeyboardButtonBuy | types.InputKeyboardButtonURLAuth | types.KeyboardButtonWebView>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { EntityGetter } from "./!0_misc.js";
|
|
3
2
|
import { Location } from "./0_location.js";
|
|
3
|
+
import { EntityGetter } from "./1__getters.js";
|
|
4
4
|
import { User } from "./1_user.js";
|
|
5
5
|
export interface InlineQuery {
|
|
6
6
|
/** Unique identifier for this query */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InputContactMessageContent } from "./0_input_contact_message_content.js";
|
|
2
|
+
import { InputLocationMessageContent } from "./0_input_location_message_content.js";
|
|
3
|
+
import { InputVenuMessageContent } from "./0_input_venue_message_content.js";
|
|
4
|
+
import { InputInvoiceMessageContent } from "./1_input_invoice_message_content.js";
|
|
5
|
+
import { InputTextMessageContent } from "./1_input_text_message_content.js";
|
|
6
|
+
export type InputMessageContent = InputTextMessageContent | InputLocationMessageContent | InputVenuMessageContent | InputContactMessageContent | InputInvoiceMessageContent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import {
|
|
2
|
+
import { UsernameResolver } from "./1__getters.js";
|
|
3
|
+
import { InlineKeyboardButton } from "./2_inline_keyboard_button.js";
|
|
3
4
|
/** This object represents an inline keyboard that appears right next to the message it belongs to. */
|
|
4
5
|
export interface InlineKeyboardMarkup {
|
|
5
6
|
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
|
|
6
7
|
inlineKeyboard: InlineKeyboardButton[][];
|
|
7
8
|
}
|
|
8
9
|
export declare function constructInlineKeyboardMarkup(keyboard_: types.ReplyInlineMarkup): InlineKeyboardMarkup;
|
|
9
|
-
export declare function inlineKeyboardMarkupToTlObject(keyboard: InlineKeyboardMarkup, usernameResolver:
|
|
10
|
+
export declare function inlineKeyboardMarkupToTlObject(keyboard: InlineKeyboardMarkup, usernameResolver: UsernameResolver): Promise<types.ReplyInlineMarkup>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { constructInlineKeyboardButton, inlineKeyboardButtonToTlObject } from "./
|
|
2
|
+
import { constructInlineKeyboardButton, inlineKeyboardButtonToTlObject } from "./2_inline_keyboard_button.js";
|
|
3
3
|
export function constructInlineKeyboardMarkup(keyboard_) {
|
|
4
4
|
const rows = new Array();
|
|
5
5
|
for (const row_ of keyboard_.rows) {
|
package/esm/types/3_message.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
-
import { EntityGetter } from "./!0_misc.js";
|
|
4
|
-
import { ForceReply } from "./0_force_reply.js";
|
|
5
|
-
import { MessageEntity } from "./0_message_entity.js";
|
|
6
3
|
import { Audio } from "./0_audio.js";
|
|
7
4
|
import { Contact } from "./0_contact.js";
|
|
8
|
-
import { Voice } from "./0_voice.js";
|
|
9
|
-
import { Venue } from "./0_venue.js";
|
|
10
|
-
import { Location } from "./0_location.js";
|
|
11
5
|
import { Dice } from "./0_dice.js";
|
|
6
|
+
import { ForceReply } from "./0_force_reply.js";
|
|
7
|
+
import { Location } from "./0_location.js";
|
|
8
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
12
9
|
import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
|
|
10
|
+
import { Venue } from "./0_venue.js";
|
|
11
|
+
import { Voice } from "./0_voice.js";
|
|
12
|
+
import { EntityGetter } from "./1__getters.js";
|
|
13
|
+
import { Animation } from "./1_animation.js";
|
|
13
14
|
import { Chat } from "./1_chat.js";
|
|
14
|
-
import { Photo } from "./1_photo.js";
|
|
15
15
|
import { Document } from "./1_document.js";
|
|
16
|
-
import {
|
|
17
|
-
import { VideoNote } from "./1_video_note.js";
|
|
18
|
-
import { Animation } from "./1_animation.js";
|
|
19
|
-
import { User } from "./1_user.js";
|
|
16
|
+
import { Photo } from "./1_photo.js";
|
|
20
17
|
import { Poll } from "./1_poll.js";
|
|
21
18
|
import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
19
|
+
import { User } from "./1_user.js";
|
|
20
|
+
import { VideoNote } from "./1_video_note.js";
|
|
21
|
+
import { Video } from "./1_video.js";
|
|
24
22
|
import { Game } from "./2_game.js";
|
|
23
|
+
import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
24
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
25
25
|
/** This object represents a message. */
|
|
26
26
|
export interface Message {
|
|
27
27
|
/** Whether the message is outgoing */
|
package/esm/types/3_message.js
CHANGED
|
@@ -2,28 +2,28 @@ import { debug } from "../0_deps.js";
|
|
|
2
2
|
import { cleanObject, UNREACHABLE } from "../1_utilities.js";
|
|
3
3
|
import { as, types } from "../2_tl.js";
|
|
4
4
|
import { ZERO_CHANNEL_ID } from "../4_constants.js";
|
|
5
|
-
import { FileID, FileType, FileUniqueID, FileUniqueType } from "
|
|
6
|
-
import { constructForceReply } from "./0_force_reply.js";
|
|
7
|
-
import { constructMessageEntity } from "./0_message_entity.js";
|
|
5
|
+
import { FileID, FileType, FileUniqueID, FileUniqueType } from "./0__file_id.js";
|
|
8
6
|
import { constructAudio } from "./0_audio.js";
|
|
9
7
|
import { constructContact } from "./0_contact.js";
|
|
10
|
-
import { constructVoice } from "./0_voice.js";
|
|
11
|
-
import { constructVenue } from "./0_venue.js";
|
|
12
|
-
import { constructLocation } from "./0_location.js";
|
|
13
8
|
import { constructDice } from "./0_dice.js";
|
|
9
|
+
import { constructForceReply } from "./0_force_reply.js";
|
|
10
|
+
import { constructLocation } from "./0_location.js";
|
|
11
|
+
import { constructMessageEntity } from "./0_message_entity.js";
|
|
14
12
|
import { constructReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
|
|
13
|
+
import { constructVenue } from "./0_venue.js";
|
|
14
|
+
import { constructVoice } from "./0_voice.js";
|
|
15
|
+
import { constructAnimation } from "./1_animation.js";
|
|
15
16
|
import { constructChat } from "./1_chat.js";
|
|
16
|
-
import { constructPhoto } from "./1_photo.js";
|
|
17
17
|
import { constructDocument } from "./1_document.js";
|
|
18
|
-
import {
|
|
19
|
-
import { constructVideoNote } from "./1_video_note.js";
|
|
20
|
-
import { constructAnimation } from "./1_animation.js";
|
|
21
|
-
import { constructUser } from "./1_user.js";
|
|
18
|
+
import { constructPhoto } from "./1_photo.js";
|
|
22
19
|
import { constructPoll } from "./1_poll.js";
|
|
23
20
|
import { constructSticker } from "./1_sticker.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
21
|
+
import { constructUser } from "./1_user.js";
|
|
22
|
+
import { constructVideoNote } from "./1_video_note.js";
|
|
23
|
+
import { constructVideo } from "./1_video.js";
|
|
26
24
|
import { constructGame } from "./2_game.js";
|
|
25
|
+
import { constructReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
26
|
+
import { constructInlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
27
27
|
const d = debug("types/Message");
|
|
28
28
|
async function getSender(message_, getEntity) {
|
|
29
29
|
if (message_.fromId instanceof types.PeerUser) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
2
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
3
|
+
export interface InlineQueryResultArticle {
|
|
4
|
+
type: "article";
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
inputMessageContent: InputMessageContent;
|
|
8
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
9
|
+
url?: string;
|
|
10
|
+
hideUrl?: boolean;
|
|
11
|
+
description?: string;
|
|
12
|
+
thumbnailUrl?: string;
|
|
13
|
+
thumbnailWidth?: string;
|
|
14
|
+
thumbnailHeight?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultAudio {
|
|
6
|
+
type: "audio";
|
|
7
|
+
id: string;
|
|
8
|
+
audioUrl: string;
|
|
9
|
+
title: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
parseMode?: ParseMode;
|
|
12
|
+
captionEntities?: MessageEntity[];
|
|
13
|
+
performer?: string;
|
|
14
|
+
audioDuration?: number;
|
|
15
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
16
|
+
inputMessageContent?: InputMessageContent;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultCachedAudio {
|
|
6
|
+
type: "audio";
|
|
7
|
+
id: string;
|
|
8
|
+
audioFileId: string;
|
|
9
|
+
caption?: string;
|
|
10
|
+
parseMode?: ParseMode;
|
|
11
|
+
captionEntities?: MessageEntity[];
|
|
12
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
13
|
+
inputMessageContent?: InputMessageContent;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultCachedDocument {
|
|
6
|
+
type: "document";
|
|
7
|
+
id: string;
|
|
8
|
+
documentFileId: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
parseMode?: ParseMode;
|
|
12
|
+
captionEntities?: MessageEntity[];
|
|
13
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
14
|
+
inputMessageContent?: InputMessageContent;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultCachedGif {
|
|
6
|
+
type: "gif";
|
|
7
|
+
id: string;
|
|
8
|
+
gifFileId: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
parseMode?: ParseMode;
|
|
12
|
+
captionEntities?: MessageEntity[];
|
|
13
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
14
|
+
inputMessageContent?: InputMessageContent;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|