@mtkruto/node 0.0.990 → 0.0.992
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/1_utilities.d.ts +12 -0
- package/esm/1_utilities.js +12 -0
- package/esm/2_connection.d.ts +2 -0
- package/esm/2_connection.js +2 -0
- package/esm/2_tl.d.ts +10 -0
- package/esm/2_tl.js +10 -0
- package/esm/3_storage.d.ts +6 -0
- package/esm/3_storage.js +6 -0
- package/esm/3_transport.d.ts +4 -0
- package/esm/3_transport.js +4 -0
- package/esm/3_types.d.ts +35 -0
- package/esm/3_types.js +35 -0
- package/esm/{constants.d.ts → 4_constants.d.ts} +2 -2
- package/esm/{constants.js → 4_constants.js} +1 -1
- package/esm/5_client.d.ts +2 -0
- package/esm/5_client.js +2 -0
- package/esm/client/0_html.d.ts +1 -1
- package/esm/client/0_html.js +1 -1
- package/esm/client/0_message.d.ts +1 -2
- package/esm/client/0_message.js +7 -14
- package/esm/client/0_password.d.ts +2 -2
- package/esm/client/0_password.js +2 -4
- package/esm/client/0_utilities.d.ts +3 -5
- package/esm/client/0_utilities.js +3 -22
- package/esm/client/1_client_abstract.d.ts +2 -2
- package/esm/client/1_client_abstract.js +3 -3
- package/esm/client/2_client_plain.d.ts +3 -3
- package/esm/client/2_client_plain.js +13 -20
- package/esm/client/3_client.d.ts +43 -18
- package/esm/client/3_client.js +107 -46
- package/esm/connection/0_connection.d.ts +1 -1
- package/esm/connection/1_connection_web_socket.js +1 -1
- package/esm/mod.d.ts +7 -21
- package/esm/mod.js +7 -21
- package/esm/storage/0_storage.d.ts +4 -5
- package/esm/storage/0_storage.js +3 -8
- package/esm/storage/0_utilities.js +2 -2
- package/esm/storage/1_storage_local_storage.d.ts +1 -1
- package/esm/storage/1_storage_memory.d.ts +1 -1
- package/esm/storage/1_storage_session_storage.d.ts +1 -1
- package/esm/tl/0_tl_raw_reader.js +1 -1
- package/esm/tl/0_tl_raw_writer.js +1 -1
- package/esm/tl/1_tl_object.js +1 -1
- package/esm/tl/3_deserialize.js +1 -1
- package/esm/tl/3_utilities.d.ts +3 -0
- package/esm/tl/3_utilities.js +20 -0
- package/esm/tl/4_tl_writer.js +1 -1
- package/esm/transport/0_obfuscation.d.ts +2 -2
- package/esm/transport/0_obfuscation.js +1 -2
- package/esm/transport/0_transport.d.ts +1 -2
- package/esm/transport/1_transport_abridged.d.ts +1 -1
- package/esm/transport/1_transport_abridged.js +1 -1
- package/esm/transport/1_transport_intermediate.d.ts +1 -1
- package/esm/transport/1_transport_intermediate.js +1 -1
- package/esm/transport/2_transport_provider.d.ts +1 -1
- package/esm/transport/2_transport_provider.js +1 -1
- package/esm/types/!0_file_id.js +6 -9
- package/esm/types/!0_misc.d.ts +7 -0
- package/esm/types/!0_misc.js +1 -0
- package/esm/types/0_audio.d.ts +3 -3
- package/esm/types/0_audio.js +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts +1 -1
- package/esm/types/0_chat_administrator_rights.js +1 -1
- package/esm/types/0_chat_photo.d.ts +3 -3
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_color.d.ts +2 -0
- package/esm/types/0_color.js +16 -0
- package/esm/types/0_contact.d.ts +2 -2
- package/esm/types/0_dice.d.ts +1 -1
- package/esm/types/0_force_reply.d.ts +1 -1
- package/esm/types/0_force_reply.js +1 -1
- package/esm/types/0_location.d.ts +1 -1
- package/esm/types/0_location.js +1 -2
- package/esm/types/0_mask_position.d.ts +1 -1
- package/esm/types/0_message_entity.d.ts +5 -5
- package/esm/types/0_message_entity.js +1 -1
- package/esm/types/0_poll_option.d.ts +1 -1
- package/esm/types/0_reply_keyboard_remove.d.ts +1 -1
- package/esm/types/0_reply_keyboard_remove.js +2 -2
- package/esm/types/0_thumbnail.d.ts +2 -2
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/0_venue.d.ts +1 -1
- package/esm/types/0_venue.js +1 -2
- package/esm/types/0_voice.d.ts +3 -3
- package/esm/types/0_web_app_info.d.ts +2 -2
- package/esm/types/1_animation.d.ts +3 -3
- package/esm/types/1_animation.js +1 -1
- package/esm/types/1_chat.d.ts +5 -4
- package/esm/types/1_chat.js +8 -9
- package/esm/types/1_document.d.ts +4 -4
- package/esm/types/1_document.js +1 -1
- package/esm/types/1_inline_keyboard_button.d.ts +4 -4
- package/esm/types/1_inline_keyboard_button.js +2 -2
- package/esm/types/1_keyboard_button.d.ts +8 -8
- package/esm/types/1_keyboard_button.js +2 -2
- package/esm/types/1_photo.d.ts +2 -2
- package/esm/types/1_photo.js +1 -1
- package/esm/types/1_poll.d.ts +8 -8
- package/esm/types/1_poll.js +1 -1
- package/esm/types/1_sticker.d.ts +3 -3
- package/esm/types/1_sticker.js +1 -2
- package/esm/types/1_user.d.ts +4 -3
- package/esm/types/1_user.js +4 -4
- package/esm/types/1_video.d.ts +3 -3
- package/esm/types/1_video.js +1 -1
- package/esm/types/1_video_note.d.ts +2 -2
- package/esm/types/1_video_note.js +1 -1
- package/esm/types/2_game.d.ts +3 -3
- package/esm/types/2_game.js +2 -3
- package/esm/types/2_inline_keyboard_markup.d.ts +2 -2
- package/esm/types/2_inline_keyboard_markup.js +1 -1
- package/esm/types/2_inline_query.d.ts +19 -0
- package/esm/types/2_inline_query.js +41 -0
- package/esm/types/2_reply_keyboard_markup.d.ts +2 -2
- package/esm/types/2_reply_keyboard_markup.js +1 -1
- package/esm/types/3_message.d.ts +23 -23
- package/esm/types/3_message.js +19 -18
- package/esm/types/4_callback_query.d.ts +14 -0
- package/esm/types/4_callback_query.js +24 -0
- package/esm/utilities/0_base64.js +1 -1
- package/esm/utilities/0_crypto.js +1 -1
- package/esm/utilities/0_queue.js +1 -1
- package/esm/utilities/1_auth.js +1 -1
- package/package.json +1 -1
- package/script/1_utilities.d.ts +12 -0
- package/script/1_utilities.js +28 -0
- package/script/2_connection.d.ts +2 -0
- package/script/2_connection.js +18 -0
- package/script/2_tl.d.ts +10 -0
- package/script/2_tl.js +40 -0
- package/script/3_storage.d.ts +6 -0
- package/script/3_storage.js +22 -0
- package/script/3_transport.d.ts +4 -0
- package/script/3_transport.js +20 -0
- package/script/3_types.d.ts +35 -0
- package/script/3_types.js +51 -0
- package/script/{constants.d.ts → 4_constants.d.ts} +2 -2
- package/script/{constants.js → 4_constants.js} +1 -1
- package/script/5_client.d.ts +2 -0
- package/script/5_client.js +18 -0
- package/script/client/0_html.d.ts +1 -1
- package/script/client/0_html.js +2 -2
- package/script/client/0_message.d.ts +1 -2
- package/script/client/0_message.js +32 -39
- package/script/client/0_password.d.ts +2 -2
- package/script/client/0_password.js +20 -22
- package/script/client/0_utilities.d.ts +3 -5
- package/script/client/0_utilities.js +24 -68
- package/script/client/1_client_abstract.d.ts +2 -2
- package/script/client/1_client_abstract.js +6 -6
- package/script/client/2_client_plain.d.ts +3 -3
- package/script/client/2_client_plain.js +45 -52
- package/script/client/3_client.d.ts +43 -18
- package/script/client/3_client.js +342 -305
- package/script/connection/0_connection.d.ts +1 -1
- package/script/connection/1_connection_web_socket.js +5 -5
- package/script/mod.d.ts +7 -21
- package/script/mod.js +17 -45
- package/script/storage/0_storage.d.ts +4 -5
- package/script/storage/0_storage.js +11 -39
- package/script/storage/0_utilities.js +6 -6
- package/script/storage/1_storage_local_storage.d.ts +1 -1
- package/script/storage/1_storage_memory.d.ts +1 -1
- package/script/storage/1_storage_session_storage.d.ts +1 -1
- package/script/tl/0_tl_raw_reader.js +6 -6
- package/script/tl/0_tl_raw_writer.js +7 -7
- package/script/tl/1_tl_object.js +3 -3
- package/script/tl/3_deserialize.js +2 -2
- package/script/tl/3_utilities.d.ts +3 -0
- package/script/tl/3_utilities.js +48 -0
- package/script/tl/4_tl_writer.js +2 -2
- package/script/transport/0_obfuscation.d.ts +2 -2
- package/script/transport/0_obfuscation.js +5 -6
- package/script/transport/0_transport.d.ts +1 -2
- package/script/transport/1_transport_abridged.d.ts +1 -1
- package/script/transport/1_transport_abridged.js +3 -3
- package/script/transport/1_transport_intermediate.d.ts +1 -1
- package/script/transport/1_transport_intermediate.js +3 -3
- package/script/transport/2_transport_provider.d.ts +1 -1
- package/script/transport/2_transport_provider.js +2 -2
- package/script/types/!0_file_id.js +24 -27
- package/script/types/!0_misc.d.ts +7 -0
- package/script/types/!0_misc.js +2 -0
- package/script/types/0_audio.d.ts +3 -3
- package/script/types/0_audio.js +2 -25
- package/script/types/0_chat_administrator_rights.d.ts +1 -1
- package/script/types/0_chat_administrator_rights.js +2 -25
- package/script/types/0_chat_photo.d.ts +3 -3
- package/script/types/0_chat_photo.js +2 -25
- package/script/types/0_color.d.ts +2 -0
- package/script/types/{!0_id_color.js → 0_color.js} +10 -10
- package/script/types/0_contact.d.ts +2 -2
- package/script/types/0_dice.d.ts +1 -1
- package/script/types/0_force_reply.d.ts +1 -1
- package/script/types/0_force_reply.js +2 -25
- package/script/types/0_location.d.ts +1 -1
- package/script/types/0_location.js +5 -29
- package/script/types/0_mask_position.d.ts +1 -1
- package/script/types/0_message_entity.d.ts +5 -5
- package/script/types/0_message_entity.js +39 -62
- package/script/types/0_poll_option.d.ts +1 -1
- package/script/types/0_reply_keyboard_remove.d.ts +1 -1
- package/script/types/0_reply_keyboard_remove.js +4 -27
- package/script/types/0_thumbnail.d.ts +2 -2
- package/script/types/0_thumbnail.js +2 -25
- package/script/types/0_venue.d.ts +1 -1
- package/script/types/0_venue.js +2 -26
- package/script/types/0_voice.d.ts +3 -3
- package/script/types/0_web_app_info.d.ts +2 -2
- package/script/types/1_animation.d.ts +3 -3
- package/script/types/1_animation.js +2 -25
- package/script/types/1_chat.d.ts +5 -4
- package/script/types/1_chat.js +20 -44
- package/script/types/1_document.d.ts +4 -4
- package/script/types/1_document.js +2 -25
- package/script/types/1_inline_keyboard_button.d.ts +4 -4
- package/script/types/1_inline_keyboard_button.js +19 -42
- package/script/types/1_keyboard_button.d.ts +8 -8
- package/script/types/1_keyboard_button.js +24 -47
- package/script/types/1_photo.d.ts +2 -2
- package/script/types/1_photo.js +4 -27
- package/script/types/1_poll.d.ts +8 -8
- package/script/types/1_poll.js +2 -2
- package/script/types/1_sticker.d.ts +3 -3
- package/script/types/1_sticker.js +6 -30
- package/script/types/1_user.d.ts +4 -3
- package/script/types/1_user.js +6 -29
- package/script/types/1_video.d.ts +3 -3
- package/script/types/1_video.js +2 -25
- package/script/types/1_video_note.d.ts +2 -2
- package/script/types/1_video_note.js +2 -25
- package/script/types/2_game.d.ts +3 -3
- package/script/types/2_game.js +6 -30
- package/script/types/2_inline_keyboard_markup.d.ts +2 -2
- package/script/types/2_inline_keyboard_markup.js +3 -26
- package/script/types/2_inline_query.d.ts +19 -0
- package/script/types/2_inline_query.js +45 -0
- package/script/types/2_reply_keyboard_markup.d.ts +2 -2
- package/script/types/2_reply_keyboard_markup.js +3 -26
- package/script/types/3_message.d.ts +23 -23
- package/script/types/3_message.js +97 -119
- package/script/types/4_callback_query.d.ts +14 -0
- package/script/types/4_callback_query.js +28 -0
- package/script/utilities/0_base64.js +3 -3
- package/script/utilities/0_crypto.js +3 -3
- package/script/utilities/0_queue.js +2 -2
- package/script/utilities/1_auth.js +5 -5
- package/esm/types/!0_id_color.d.ts +0 -1
- package/esm/types/!0_id_color.js +0 -16
- package/script/types/!0_id_color.d.ts +0 -1
- /package/esm/{deps.d.ts → 0_deps.d.ts} +0 -0
- /package/esm/{deps.js → 0_deps.js} +0 -0
- /package/script/{deps.d.ts → 0_deps.d.ts} +0 -0
- /package/script/{deps.js → 0_deps.js} +0 -0
package/script/types/1_video.js
CHANGED
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.constructVideo = void 0;
|
|
27
|
-
const
|
|
4
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
28
5
|
const _0_thumbnail_js_1 = require("./0_thumbnail.js");
|
|
29
6
|
function constructVideo(document, videoAttribute, fileName, fileId, fileUniqueId) {
|
|
30
7
|
return {
|
|
@@ -33,7 +10,7 @@ function constructVideo(document, videoAttribute, fileName, fileId, fileUniqueId
|
|
|
33
10
|
width: videoAttribute.w,
|
|
34
11
|
height: videoAttribute.h,
|
|
35
12
|
duration: videoAttribute.duration,
|
|
36
|
-
thumbnails: document.thumbs ? document.thumbs.map((v) => v instanceof types.PhotoSize ? (0, _0_thumbnail_js_1.constructThumbnail)(v, document) : null).filter((v) => v) : [],
|
|
13
|
+
thumbnails: document.thumbs ? document.thumbs.map((v) => v instanceof _2_tl_js_1.types.PhotoSize ? (0, _0_thumbnail_js_1.constructThumbnail)(v, document) : null).filter((v) => v) : [],
|
|
37
14
|
fileName,
|
|
38
15
|
mimeType: document.mimeType,
|
|
39
16
|
fileSize: Number(document.size),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
import { Thumbnail } from "./0_thumbnail.js";
|
|
3
3
|
/** This object represents a video message (available in Telegram apps as of v.4.0). */
|
|
4
4
|
export interface VideoNote {
|
|
5
5
|
/** Identifier for this file, which can be used to download or reuse the file */
|
|
6
6
|
fileId: string;
|
|
7
|
-
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
|
|
7
|
+
/** Unique identifier for this file, which is supposed to be the same over time and for different users and bots. Can't be used to download or reuse the file. */
|
|
8
8
|
fileUniqueId: string;
|
|
9
9
|
/** Video width and height (diameter of the video message) as defined by sender */
|
|
10
10
|
length: number;
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.constructVideoNote = void 0;
|
|
27
|
-
const
|
|
4
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
28
5
|
const _0_thumbnail_js_1 = require("./0_thumbnail.js");
|
|
29
6
|
function constructVideoNote(document, videoAttribute, fileId, fileUniqueId) {
|
|
30
7
|
return {
|
|
@@ -32,7 +9,7 @@ function constructVideoNote(document, videoAttribute, fileId, fileUniqueId) {
|
|
|
32
9
|
fileUniqueId,
|
|
33
10
|
length: videoAttribute.w,
|
|
34
11
|
duration: videoAttribute.duration,
|
|
35
|
-
thumbnails: document.thumbs ? document.thumbs.map((v) => v instanceof types.PhotoSize ? (0, _0_thumbnail_js_1.constructThumbnail)(v, document) : null).filter((v) => v) : [],
|
|
12
|
+
thumbnails: document.thumbs ? document.thumbs.map((v) => v instanceof _2_tl_js_1.types.PhotoSize ? (0, _0_thumbnail_js_1.constructThumbnail)(v, document) : null).filter((v) => v) : [],
|
|
36
13
|
fileSize: Number(document.size),
|
|
37
14
|
};
|
|
38
15
|
}
|
package/script/types/2_game.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
import { MessageEntity } from "./0_message_entity.js";
|
|
3
3
|
import { Animation } from "./1_animation.js";
|
|
4
4
|
import { Photo } from "./1_photo.js";
|
|
@@ -10,11 +10,11 @@ export interface Game {
|
|
|
10
10
|
description: string;
|
|
11
11
|
/** Photo that will be displayed in the game message in chats. */
|
|
12
12
|
photo: Photo;
|
|
13
|
-
/** Brief description of the game or high scores included in the game message
|
|
13
|
+
/** Brief description of the game or high scores included in the game message */
|
|
14
14
|
text?: string;
|
|
15
15
|
/** Special entities that appear in text, such as usernames, URLs, bot commands, etc. */
|
|
16
16
|
textEntities?: MessageEntity[];
|
|
17
|
-
/** Animation that will be displayed in the game message in chats
|
|
17
|
+
/** Animation that will be displayed in the game message in chats */
|
|
18
18
|
animation?: Animation;
|
|
19
19
|
}
|
|
20
20
|
export declare function constructGame(media_: types.MessageMediaGame): Game;
|
package/script/types/2_game.js
CHANGED
|
@@ -1,44 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.constructGame = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const _0_object_js_1 = require("../utilities/0_object.js");
|
|
4
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
5
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
30
6
|
const _0_file_id_js_1 = require("./!0_file_id.js");
|
|
31
7
|
const _1_animation_js_1 = require("./1_animation.js");
|
|
32
8
|
const _1_photo_js_1 = require("./1_photo.js");
|
|
33
9
|
function constructGame(media_) {
|
|
34
10
|
const game_ = media_.game;
|
|
35
|
-
const document_ = game_.document ? game_.document[
|
|
36
|
-
return (0,
|
|
11
|
+
const document_ = game_.document ? game_.document[_2_tl_js_1.as](_2_tl_js_1.types.Document) : undefined;
|
|
12
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
37
13
|
title: game_.title,
|
|
38
14
|
description: media_.game.description,
|
|
39
|
-
photo: (0, _1_photo_js_1.constructPhoto)(game_.photo[
|
|
15
|
+
photo: (0, _1_photo_js_1.constructPhoto)(game_.photo[_2_tl_js_1.as](_2_tl_js_1.types.Photo)),
|
|
40
16
|
animation: document_
|
|
41
|
-
? (0, _1_animation_js_1.constructAnimation)(document_, document_.attributes.find((v) => v instanceof types.DocumentAttributeVideo), document_.attributes.find((v) => v instanceof types.DocumentAttributeFilename), new _0_file_id_js_1.FileID(null, null, _0_file_id_js_1.FileType.Animation, document_.dcId, {
|
|
17
|
+
? (0, _1_animation_js_1.constructAnimation)(document_, document_.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeVideo), document_.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeFilename), new _0_file_id_js_1.FileID(null, null, _0_file_id_js_1.FileType.Animation, document_.dcId, {
|
|
42
18
|
mediaId: document_.id,
|
|
43
19
|
accessHash: document_.accessHash,
|
|
44
20
|
fileReference: document_.fileReference,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
import { InlineKeyboardButton, inlineKeyboardButtonToTlObject } from "./1_inline_keyboard_button.js";
|
|
3
|
-
/** This object represents an
|
|
3
|
+
/** This object represents an inline keyboard that appears right next to the message it belongs to. */
|
|
4
4
|
export interface InlineKeyboardMarkup {
|
|
5
5
|
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
|
|
6
6
|
inlineKeyboard: InlineKeyboardButton[][];
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.inlineKeyboardMarkupToTlObject = exports.constructInlineKeyboardMarkup = void 0;
|
|
27
|
-
const
|
|
4
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
28
5
|
const _1_inline_keyboard_button_js_1 = require("./1_inline_keyboard_button.js");
|
|
29
6
|
function constructInlineKeyboardMarkup(keyboard_) {
|
|
30
7
|
const rows = new Array();
|
|
@@ -45,8 +22,8 @@ async function inlineKeyboardMarkupToTlObject(keyboard, usernameResolver) {
|
|
|
45
22
|
for (const button of row) {
|
|
46
23
|
row_.push(await (0, _1_inline_keyboard_button_js_1.inlineKeyboardButtonToTlObject)(button, usernameResolver));
|
|
47
24
|
}
|
|
48
|
-
rows_.push(new types.KeyboardButtonRow({ buttons: row_ }));
|
|
25
|
+
rows_.push(new _2_tl_js_1.types.KeyboardButtonRow({ buttons: row_ }));
|
|
49
26
|
}
|
|
50
|
-
return new types.ReplyInlineMarkup({ rows: rows_ });
|
|
27
|
+
return new _2_tl_js_1.types.ReplyInlineMarkup({ rows: rows_ });
|
|
51
28
|
}
|
|
52
29
|
exports.inlineKeyboardMarkupToTlObject = inlineKeyboardMarkupToTlObject;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
|
+
import { EntityGetter } from "./!0_misc.js";
|
|
3
|
+
import { Location } from "./0_location.js";
|
|
4
|
+
import { User } from "./1_user.js";
|
|
5
|
+
export interface InlineQuery {
|
|
6
|
+
/** Unique identifier for this query */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The user who made this query */
|
|
9
|
+
from: User;
|
|
10
|
+
/** The text of the query */
|
|
11
|
+
query: string;
|
|
12
|
+
/** Result offset */
|
|
13
|
+
offset: string;
|
|
14
|
+
/** Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat */
|
|
15
|
+
chatType?: "sender" | "private" | "group" | "supergroup" | "channel";
|
|
16
|
+
/** The location of the user who made this query */
|
|
17
|
+
location?: Location;
|
|
18
|
+
}
|
|
19
|
+
export declare function constructInlineQuery(query_: types.UpdateBotInlineQuery, getEntity: EntityGetter): Promise<InlineQuery>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.constructInlineQuery = void 0;
|
|
4
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
5
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
6
|
+
const _0_location_js_1 = require("./0_location.js");
|
|
7
|
+
const _1_user_js_1 = require("./1_user.js");
|
|
8
|
+
async function constructInlineQuery(query_, getEntity) {
|
|
9
|
+
const user_ = await getEntity(new _2_tl_js_1.types.PeerUser({ userId: query_.userId }));
|
|
10
|
+
if (user_ == null) {
|
|
11
|
+
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
12
|
+
}
|
|
13
|
+
const user = (0, _1_user_js_1.constructUser)(user_);
|
|
14
|
+
let chatType;
|
|
15
|
+
if (query_.peerType !== undefined) {
|
|
16
|
+
if (query_.peerType instanceof _2_tl_js_1.types.InlineQueryPeerTypeSameBotPM) {
|
|
17
|
+
chatType = "private";
|
|
18
|
+
}
|
|
19
|
+
else if (query_.peerType instanceof _2_tl_js_1.types.InlineQueryPeerTypeBotPM || query_.peerType instanceof _2_tl_js_1.types.InlineQueryPeerTypePM) {
|
|
20
|
+
chatType = "sender";
|
|
21
|
+
}
|
|
22
|
+
else if (query_.peerType instanceof _2_tl_js_1.types.InlineQueryPeerTypeChat) {
|
|
23
|
+
chatType = "group";
|
|
24
|
+
}
|
|
25
|
+
else if (query_.peerType instanceof _2_tl_js_1.types.InlineQueryPeerTypeMegagroup) {
|
|
26
|
+
chatType = "supergroup";
|
|
27
|
+
}
|
|
28
|
+
else if (query_.peerType instanceof _2_tl_js_1.types.InlineQueryPeerTypeBroadcast) {
|
|
29
|
+
chatType = "channel";
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const location = query_.geo !== undefined && query_.geo instanceof _2_tl_js_1.types.GeoPoint ? (0, _0_location_js_1.constructLocation)(query_.geo) : undefined;
|
|
36
|
+
return {
|
|
37
|
+
id: String(query_.queryId),
|
|
38
|
+
from: user,
|
|
39
|
+
query: query_.query,
|
|
40
|
+
offset: query_.offset,
|
|
41
|
+
chatType,
|
|
42
|
+
location,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.constructInlineQuery = constructInlineQuery;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
import { KeyboardButton } from "./1_keyboard_button.js";
|
|
3
|
-
/** This object represents a
|
|
3
|
+
/** This object represents a custom keyboard with reply options. */
|
|
4
4
|
export interface ReplyKeyboardMarkup {
|
|
5
5
|
/** Array of button rows, each represented by an Array of `KeyboardButton` objects */
|
|
6
6
|
keyboard: KeyboardButton[][];
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.replyKeyboardMarkupToTlObject = exports.constructReplyKeyboardMarkup = void 0;
|
|
27
|
-
const
|
|
4
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
28
5
|
const _1_keyboard_button_js_1 = require("./1_keyboard_button.js");
|
|
29
6
|
function constructReplyKeyboardMarkup(keyboard_) {
|
|
30
7
|
const rows = new Array();
|
|
@@ -51,9 +28,9 @@ function replyKeyboardMarkupToTlObject(replyMarkup) {
|
|
|
51
28
|
for (const button of row) {
|
|
52
29
|
row_.push((0, _1_keyboard_button_js_1.keyboardButtonToTlObject)(button));
|
|
53
30
|
}
|
|
54
|
-
rows_.push(new types.KeyboardButtonRow({ buttons: row_ }));
|
|
31
|
+
rows_.push(new _2_tl_js_1.types.KeyboardButtonRow({ buttons: row_ }));
|
|
55
32
|
}
|
|
56
|
-
return new types.ReplyKeyboardMarkup({
|
|
33
|
+
return new _2_tl_js_1.types.ReplyKeyboardMarkup({
|
|
57
34
|
resize: replyMarkup.resizeKeyboard || undefined,
|
|
58
35
|
singleUse: replyMarkup.oneTimeKeyboard || undefined,
|
|
59
36
|
selective: replyMarkup.selective || undefined,
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { MaybePromise } from "../
|
|
2
|
-
import
|
|
1
|
+
import { MaybePromise } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
|
+
import { EntityGetter } from "./!0_misc.js";
|
|
3
4
|
import { ForceReply } from "./0_force_reply.js";
|
|
4
5
|
import { MessageEntity } from "./0_message_entity.js";
|
|
6
|
+
import { Audio } from "./0_audio.js";
|
|
7
|
+
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
|
+
import { Dice } from "./0_dice.js";
|
|
5
12
|
import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
|
|
6
13
|
import { Chat } from "./1_chat.js";
|
|
7
|
-
import { User } from "./1_user.js";
|
|
8
|
-
import { InlineKeyboardMarkup } from "./2_inline_keyboard_markup.js";
|
|
9
|
-
import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
10
|
-
import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
|
|
11
14
|
import { Photo } from "./1_photo.js";
|
|
12
15
|
import { Document } from "./1_document.js";
|
|
13
16
|
import { Video } from "./1_video.js";
|
|
14
17
|
import { VideoNote } from "./1_video_note.js";
|
|
15
18
|
import { Animation } from "./1_animation.js";
|
|
16
|
-
import {
|
|
17
|
-
import { Voice } from "./0_voice.js";
|
|
18
|
-
import { Dice } from "./0_dice.js";
|
|
19
|
-
import { Contact } from "./0_contact.js";
|
|
20
|
-
import { Game } from "./2_game.js";
|
|
19
|
+
import { User } from "./1_user.js";
|
|
21
20
|
import { Poll } from "./1_poll.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
21
|
+
import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
|
|
22
|
+
import { InlineKeyboardMarkup } from "./2_inline_keyboard_markup.js";
|
|
23
|
+
import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
24
|
+
import { Game } from "./2_game.js";
|
|
24
25
|
/** This object represents a message. */
|
|
25
26
|
export interface Message {
|
|
26
27
|
/** Whether the message is outgoing */
|
|
@@ -37,6 +38,8 @@ export interface Message {
|
|
|
37
38
|
date?: Date;
|
|
38
39
|
/** Conversation the message belongs to */
|
|
39
40
|
chat: Chat;
|
|
41
|
+
/** A link to the message */
|
|
42
|
+
link?: string;
|
|
40
43
|
/** For forwarded messages, sender of the original message */
|
|
41
44
|
forwardFrom?: User;
|
|
42
45
|
/** For messages forwarded from channels or from anonymous administrators, information about the original sender chat */
|
|
@@ -101,6 +104,7 @@ export interface Message {
|
|
|
101
104
|
contact?: Contact;
|
|
102
105
|
/** Message is a game, information about the game. */
|
|
103
106
|
game?: Game;
|
|
107
|
+
/** New poll state. Bots receive only updates about stopped polls and polls, which were sent by the bot. */
|
|
104
108
|
poll?: Poll;
|
|
105
109
|
/** Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */
|
|
106
110
|
venue?: Venue;
|
|
@@ -122,9 +126,9 @@ export interface Message {
|
|
|
122
126
|
supergroupCreated?: true;
|
|
123
127
|
/** Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */
|
|
124
128
|
channelCreated?: true;
|
|
125
|
-
/** The group has been migrated to a supergroup with the specified identifier
|
|
129
|
+
/** The group has been migrated to a supergroup with the specified identifier */
|
|
126
130
|
chatMigratedTo?: number;
|
|
127
|
-
/** The supergroup has been migrated from a group with the specified identifier
|
|
131
|
+
/** The supergroup has been migrated from a group with the specified identifier */
|
|
128
132
|
chatMigratedFrom?: number;
|
|
129
133
|
/** Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. */
|
|
130
134
|
pinnedMessage?: Message;
|
|
@@ -163,13 +167,9 @@ export interface Message {
|
|
|
163
167
|
duration: number;
|
|
164
168
|
};
|
|
165
169
|
}
|
|
166
|
-
interface
|
|
167
|
-
(
|
|
168
|
-
(peer: types.PeerChat): MaybePromise<types.Chat | null>;
|
|
169
|
-
(peer: types.PeerChannel): MaybePromise<types.Channel | null>;
|
|
170
|
+
export interface MessageGetter<O extends keyof Message | null = null> {
|
|
171
|
+
(chatId: number, messageId: number): MaybePromise<(O extends null ? Message : Omit<Message, "replyToMessage">) | null>;
|
|
170
172
|
}
|
|
171
|
-
type
|
|
172
|
-
|
|
173
|
-
} | null;
|
|
174
|
-
export declare function constructMessage(message_: types.TypeMessage, getEntity: EntityGetter, getMessage: MessageGetter, getStickerSetName: StickerSetNameGetter): Promise<Message>;
|
|
173
|
+
type Message_MessageGetter = MessageGetter<"replyToMessage"> | null;
|
|
174
|
+
export declare function constructMessage(message_: types.TypeMessage, getEntity: EntityGetter, getMessage: Message_MessageGetter, getStickerSetName: StickerSetNameGetter): Promise<Message>;
|
|
175
175
|
export {};
|