@mtkruto/node 0.0.991 → 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 +33 -18
- package/esm/client/3_client.js +47 -35
- 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 +21 -23
- package/esm/types/3_message.js +16 -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 +33 -18
- package/script/client/3_client.js +291 -303
- 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 +21 -23
- package/script/types/3_message.js +94 -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/esm/types/0_location.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
/** This object describes the position on faces where a mask should be placed by default. */
|
|
3
3
|
export interface MaskPosition {
|
|
4
4
|
/** The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin". */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
export type MessageEntityType = "mention" | "hashtag" | "bot_command" | "url" | "email" | "bold" | "italic" | "code" | "pre" | "text_link" | "text_mention" | "cashtag" | "phone_number" | "underline" | "strikethrough" | "blockquote" | "bank_card" | "spoiler" | "custom_emoji";
|
|
3
3
|
export declare namespace MessageEntity {
|
|
4
4
|
interface Base {
|
|
@@ -31,7 +31,7 @@ export declare namespace MessageEntity {
|
|
|
31
31
|
}
|
|
32
32
|
interface Pre extends Base {
|
|
33
33
|
type: "pre";
|
|
34
|
-
/** For
|
|
34
|
+
/** For "pre" only, the programming language of the entity text */
|
|
35
35
|
language: string;
|
|
36
36
|
}
|
|
37
37
|
interface Code extends Base {
|
|
@@ -39,12 +39,12 @@ export declare namespace MessageEntity {
|
|
|
39
39
|
}
|
|
40
40
|
interface TextLink extends Base {
|
|
41
41
|
type: "text_link";
|
|
42
|
-
/** For
|
|
42
|
+
/** For "text_link" only, URL that will be opened after user taps on the text */
|
|
43
43
|
url: string;
|
|
44
44
|
}
|
|
45
45
|
interface TextMention extends Base {
|
|
46
46
|
type: "text_mention";
|
|
47
|
-
/** For
|
|
47
|
+
/** For "text_mention" only, the ID of the mentioned user */
|
|
48
48
|
userId: number;
|
|
49
49
|
}
|
|
50
50
|
interface Cashtag extends Base {
|
|
@@ -70,7 +70,7 @@ export declare namespace MessageEntity {
|
|
|
70
70
|
}
|
|
71
71
|
interface CustomEmoji extends Base {
|
|
72
72
|
type: "custom_emoji";
|
|
73
|
-
/** For
|
|
73
|
+
/** For "custom_emoji" only, unique identifier of the custom emoji */
|
|
74
74
|
customEmojiId: string;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
/** Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button. */
|
|
3
3
|
export interface ReplyKeyboardRemove {
|
|
4
4
|
/** Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use _one_time_keyboard_ in `ReplyKeyboardMarkup`) */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cleanObject } from "../
|
|
2
|
-
import
|
|
1
|
+
import { cleanObject } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
3
|
export function constructReplyKeyboardRemove(replyMarkup_) {
|
|
4
4
|
return cleanObject({ removeKeyboard: true, selective: replyMarkup_.selective });
|
|
5
5
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
/** This object represents thumbnail of a file or a sticker. */
|
|
3
3
|
export interface Thumbnail {
|
|
4
4
|
/** Identifier for this file, which can be used to download or reuse the file */
|
|
5
5
|
fileId: string;
|
|
6
|
-
/** 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. */
|
|
6
|
+
/** 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. */
|
|
7
7
|
fileUniqueId: string;
|
|
8
8
|
/** Photo width */
|
|
9
9
|
width: number;
|
package/esm/types/0_thumbnail.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
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;
|
package/esm/types/0_venue.d.ts
CHANGED
package/esm/types/0_venue.js
CHANGED
package/esm/types/0_voice.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
/** This object represents a voice note. */
|
|
3
3
|
export interface Voice {
|
|
4
4
|
/** Identifier for this file, which can be used to download or reuse the file */
|
|
5
5
|
fileId: string;
|
|
6
|
-
/** 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. */
|
|
6
|
+
/** 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. */
|
|
7
7
|
fileUniqueId: string;
|
|
8
8
|
/** Duration of the audio in seconds as defined by sender */
|
|
9
9
|
duration: number;
|
|
10
10
|
/** MIME type of the file as defined by sender */
|
|
11
11
|
mimeType: string;
|
|
12
|
-
/** File size in bytes
|
|
12
|
+
/** File size in bytes */
|
|
13
13
|
fileSize: number;
|
|
14
14
|
}
|
|
15
15
|
export declare function constructVoice(document: types.Document, audioAttributes: types.DocumentAttributeAudio, fileId: string, fileUniqueId: string): Voice;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** Describes a
|
|
1
|
+
/** Describes a Web App */
|
|
2
2
|
export interface WebAppInfo {
|
|
3
|
-
/** An HTTPS URL of a Web App to be opened with additional data
|
|
3
|
+
/** An HTTPS URL of a Web App to be opened with additional data */
|
|
4
4
|
url: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function constructWebAppInfo(url: string): WebAppInfo;
|
|
@@ -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 an animation file (GIF or H.264/MPEG-4 AVC video without sound). */
|
|
4
4
|
export interface Animation {
|
|
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 as defined by sender */
|
|
10
10
|
width: number;
|
|
@@ -18,7 +18,7 @@ export interface Animation {
|
|
|
18
18
|
fileName?: string;
|
|
19
19
|
/** MIME type of the file as defined by sender */
|
|
20
20
|
mimeType: string;
|
|
21
|
-
/** File size in bytes
|
|
21
|
+
/** File size in bytes */
|
|
22
22
|
fileSize: number;
|
|
23
23
|
}
|
|
24
24
|
export declare function constructAnimation(document: types.Document, videoAttribute: types.DocumentAttributeVideo | undefined, fileAttribute: types.DocumentAttributeFilename | undefined, fileId: string, fileUniqueId: string): Animation;
|
package/esm/types/1_animation.js
CHANGED
package/esm/types/1_chat.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
|
+
import { Color } from "./0_color.js";
|
|
2
3
|
import { ChatPhoto } from "./0_chat_photo.js";
|
|
3
4
|
export declare enum ChatType {
|
|
4
5
|
Private = "private",
|
|
@@ -8,11 +9,11 @@ export declare enum ChatType {
|
|
|
8
9
|
}
|
|
9
10
|
export declare namespace Chat {
|
|
10
11
|
interface Base {
|
|
11
|
-
/** Type of chat, can be either
|
|
12
|
+
/** Type of chat, can be either "private", "group", "supergroup" or "channel" */
|
|
12
13
|
type: ChatType;
|
|
13
|
-
/** Unique identifier for this chat
|
|
14
|
+
/** Unique identifier for this chat */
|
|
14
15
|
id: number;
|
|
15
|
-
|
|
16
|
+
color: Color;
|
|
16
17
|
/** Chat photo. */
|
|
17
18
|
photo?: ChatPhoto;
|
|
18
19
|
}
|
package/esm/types/1_chat.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { getIdColor } from "./!0_id_color.js";
|
|
1
|
+
import { cleanObject, UNREACHABLE } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
|
+
import { ZERO_CHANNEL_ID } from "../4_constants.js";
|
|
4
|
+
import { getColor } from "./0_color.js";
|
|
6
5
|
import { constructChatPhoto } from "./0_chat_photo.js";
|
|
7
6
|
export var ChatType;
|
|
8
7
|
(function (ChatType) {
|
|
@@ -18,7 +17,7 @@ export function constructChat(chat) {
|
|
|
18
17
|
type: ChatType.Private,
|
|
19
18
|
isBot: chat.bot || false,
|
|
20
19
|
id,
|
|
21
|
-
|
|
20
|
+
color: getColor(id),
|
|
22
21
|
firstName: chat.firstName || "",
|
|
23
22
|
lastName: chat.lastName,
|
|
24
23
|
isScam: chat.scam || false,
|
|
@@ -40,7 +39,7 @@ export function constructChat(chat) {
|
|
|
40
39
|
const chat_ = {
|
|
41
40
|
type: ChatType.Group,
|
|
42
41
|
id,
|
|
43
|
-
|
|
42
|
+
color: getColor(id),
|
|
44
43
|
title: chat.title,
|
|
45
44
|
isCreator: chat.creator || false,
|
|
46
45
|
};
|
|
@@ -56,7 +55,7 @@ export function constructChat(chat) {
|
|
|
56
55
|
if (chat.megagroup) {
|
|
57
56
|
chat_ = {
|
|
58
57
|
id,
|
|
59
|
-
|
|
58
|
+
color: getColor(id),
|
|
60
59
|
type: ChatType.Supergroup,
|
|
61
60
|
title,
|
|
62
61
|
isScam,
|
|
@@ -70,7 +69,7 @@ export function constructChat(chat) {
|
|
|
70
69
|
const id = ZERO_CHANNEL_ID + -Number(chat.id);
|
|
71
70
|
chat_ = {
|
|
72
71
|
id,
|
|
73
|
-
|
|
72
|
+
color: getColor(id),
|
|
74
73
|
type: ChatType.Channel,
|
|
75
74
|
title,
|
|
76
75
|
isScam,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
import { Thumbnail } from "./0_thumbnail.js";
|
|
3
|
-
/** This object represents a general file (as opposed to
|
|
3
|
+
/** This object represents a general file (as opposed to photos, voice messages and audio files). */
|
|
4
4
|
export interface Document {
|
|
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
|
/** Document thumbnail as defined by sender */
|
|
10
10
|
thumbnails: Thumbnail[];
|
|
@@ -12,7 +12,7 @@ export interface Document {
|
|
|
12
12
|
fileName: string;
|
|
13
13
|
/** MIME type of the file as defined by sender */
|
|
14
14
|
mimeType: string;
|
|
15
|
-
/** File size in bytes
|
|
15
|
+
/** File size in bytes */
|
|
16
16
|
fileSize: number;
|
|
17
17
|
}
|
|
18
18
|
export declare function constructDocument(document: types.Document, fileNameAttribute: types.DocumentAttributeFilename, fileId: string, fileUniqueId: string): Document;
|
package/esm/types/1_document.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MaybePromise } from "../
|
|
2
|
-
import
|
|
1
|
+
import { MaybePromise } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
3
|
import { WebAppInfo } from "./0_web_app_info.js";
|
|
4
4
|
import { LoginUrl } from "./0_login_url.js";
|
|
5
5
|
export declare namespace InlineKeyboardButton {
|
|
@@ -16,7 +16,7 @@ export declare namespace InlineKeyboardButton {
|
|
|
16
16
|
callbackData: string;
|
|
17
17
|
}
|
|
18
18
|
interface WebApp extends Base {
|
|
19
|
-
/** Description of the
|
|
19
|
+
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. */
|
|
20
20
|
webApp: WebAppInfo;
|
|
21
21
|
}
|
|
22
22
|
interface Login extends Base {
|
|
@@ -35,7 +35,7 @@ export declare namespace InlineKeyboardButton {
|
|
|
35
35
|
callbackGame: Record<never, never>;
|
|
36
36
|
}
|
|
37
37
|
interface Pay extends Base {
|
|
38
|
-
/** Specify True
|
|
38
|
+
/** Specify True to send a Pay button */
|
|
39
39
|
pay: boolean;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UNREACHABLE } from "../
|
|
2
|
-
import
|
|
1
|
+
import { UNREACHABLE } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
3
|
import { constructWebAppInfo } from "./0_web_app_info.js";
|
|
4
4
|
export function constructInlineKeyboardButton(button_) {
|
|
5
5
|
if (button_ instanceof types.KeyboardButtonURL) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
import { ChatAdministratorRights } from "./0_chat_administrator_rights.js";
|
|
3
3
|
import { KeyboardButtonPollType } from "./0_keyboard_button_poll_type.js";
|
|
4
4
|
import { WebAppInfo } from "./0_web_app_info.js";
|
|
@@ -7,11 +7,11 @@ export declare namespace KeyboardButton {
|
|
|
7
7
|
/** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
|
|
8
8
|
text: string;
|
|
9
9
|
}
|
|
10
|
-
/** This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.
|
|
10
|
+
/** This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. */
|
|
11
11
|
interface RequestUser extends Text {
|
|
12
|
-
/** If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a
|
|
12
|
+
/** If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a "user_shared" service message. Available in private chats only. */
|
|
13
13
|
requestUser: {
|
|
14
|
-
/** Signed 32-bit identifier of the request
|
|
14
|
+
/** Signed 32-bit identifier of the request */
|
|
15
15
|
requestId: number;
|
|
16
16
|
/** Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. */
|
|
17
17
|
userIsBot?: boolean;
|
|
@@ -19,11 +19,11 @@ export declare namespace KeyboardButton {
|
|
|
19
19
|
userIsPremium?: boolean;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
/** This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.
|
|
22
|
+
/** This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. */
|
|
23
23
|
interface RequestChat extends Text {
|
|
24
|
-
/** If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a
|
|
24
|
+
/** If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a "chat_shared" service message. Available in private chats only. */
|
|
25
25
|
requestChat: {
|
|
26
|
-
/** Signed 32-bit identifier of the request
|
|
26
|
+
/** Signed 32-bit identifier of the request */
|
|
27
27
|
requestId: number;
|
|
28
28
|
/** Pass True to request a channel chat, pass False to request a group or a supergroup chat. */
|
|
29
29
|
chatIsChannel: boolean;
|
|
@@ -54,7 +54,7 @@ export declare namespace KeyboardButton {
|
|
|
54
54
|
requestPoll: KeyboardButtonPollType;
|
|
55
55
|
}
|
|
56
56
|
interface WebApp extends Text {
|
|
57
|
-
/** If specified, the described
|
|
57
|
+
/** If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a "web_app_data" service message. Available in private chats only. */
|
|
58
58
|
webApp: WebAppInfo;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UNREACHABLE } from "../
|
|
2
|
-
import
|
|
1
|
+
import { UNREACHABLE } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
3
|
import { chatAdministratorRightsToTlObject, constructChatAdministratorRights } from "./0_chat_administrator_rights.js";
|
|
4
4
|
export function constructKeyboardButton(button_) {
|
|
5
5
|
if (button_ instanceof types.KeyboardButton) {
|
package/esm/types/1_photo.d.ts
CHANGED
|
@@ -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 photo. */
|
|
4
4
|
export interface Photo {
|
|
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
|
/** Photo width */
|
|
10
10
|
width: number;
|
package/esm/types/1_photo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
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) {
|
package/esm/types/1_poll.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 { PollOption } from "./0_poll_option.js";
|
|
4
4
|
export interface Poll {
|
|
@@ -14,19 +14,19 @@ export interface Poll {
|
|
|
14
14
|
isClosed: boolean;
|
|
15
15
|
/** True, if the poll is anonymous */
|
|
16
16
|
isAnonymous: boolean;
|
|
17
|
-
/** Poll type, currently can be
|
|
17
|
+
/** Poll type, currently can be "regular" or "quiz" */
|
|
18
18
|
type: "regular" | "quiz";
|
|
19
19
|
/** True, if the poll allows multiple answers */
|
|
20
20
|
allowMultipleAnswers?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/**
|
|
21
|
+
/** Index of the correct answer in `options`. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */
|
|
22
|
+
correctOptionIndex?: number;
|
|
23
|
+
/** Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */
|
|
24
24
|
explanation?: string;
|
|
25
|
-
/**
|
|
25
|
+
/** Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */
|
|
26
26
|
explanationEntities?: MessageEntity[];
|
|
27
|
-
/**
|
|
27
|
+
/** Amount of time in seconds the poll will be active after creation */
|
|
28
28
|
openPeriod?: number;
|
|
29
|
-
/**
|
|
29
|
+
/** Point in time (Unix timestamp) when the poll will be automatically closed */
|
|
30
30
|
closeDate?: Date;
|
|
31
31
|
}
|
|
32
32
|
export declare function constructPoll(media_: types.MessageMediaPoll): Poll;
|
package/esm/types/1_poll.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cleanObject } from "../
|
|
1
|
+
import { cleanObject } from "../1_utilities.js";
|
|
2
2
|
import { constructMessageEntity } from "./0_message_entity.js";
|
|
3
3
|
import { constructPollOption } from "./0_poll_option.js";
|
|
4
4
|
export function constructPoll(media_) {
|
package/esm/types/1_sticker.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { MaybePromise } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
3
|
import { Thumbnail } from "./0_thumbnail.js";
|
|
4
4
|
import { MaskPosition } from "./0_mask_position.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 */
|
|
8
8
|
fileId: string;
|
|
9
|
-
/** 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. */
|
|
9
|
+
/** 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. */
|
|
10
10
|
fileUniqueId: string;
|
|
11
11
|
/** Type of the sticker, currently one of "regular", "mask", "custom_emoji". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
|
|
12
12
|
type: "regular" | "mask" | "custom_emoji";
|
package/esm/types/1_sticker.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { as } from "../
|
|
2
|
-
import * as types from "../tl/2_types.js";
|
|
1
|
+
import { as, types } from "../2_tl.js";
|
|
3
2
|
import { constructThumbnail } from "./0_thumbnail.js";
|
|
4
3
|
import { constructMaskPosition } from "./0_mask_position.js";
|
|
5
4
|
export async function constructSticker(document, fileId, fileUniqueId, getStickerSetName) {
|
package/esm/types/1_user.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
|
+
import { Color } from "./0_color.js";
|
|
2
3
|
import { ChatPhoto } from "./0_chat_photo.js";
|
|
3
4
|
/** This object represents a Telegram user or bot. */
|
|
4
5
|
export interface User {
|
|
5
|
-
/** Unique identifier for this user or bot
|
|
6
|
+
/** Unique identifier for this user or bot */
|
|
6
7
|
id: number;
|
|
7
|
-
|
|
8
|
+
color: Color;
|
|
8
9
|
/** True, if this user is a bot */
|
|
9
10
|
isBot: boolean;
|
|
10
11
|
/** User's or bot's first name */
|
package/esm/types/1_user.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { cleanObject } from "../
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { cleanObject } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
|
+
import { getColor } from "./0_color.js";
|
|
4
4
|
import { constructChatPhoto } from "./0_chat_photo.js";
|
|
5
5
|
export function constructUser(user_) {
|
|
6
6
|
const id = Number(user_.id);
|
|
7
7
|
const user = {
|
|
8
8
|
id,
|
|
9
|
-
|
|
9
|
+
color: getColor(id),
|
|
10
10
|
isBot: user_.bot || false,
|
|
11
11
|
firstName: user_.firstName || "",
|
|
12
12
|
lastName: user_.lastName,
|
package/esm/types/1_video.d.ts
CHANGED
|
@@ -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 file. */
|
|
4
4
|
export interface Video {
|
|
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 as defined by sender */
|
|
10
10
|
width: number;
|
|
@@ -18,7 +18,7 @@ export interface Video {
|
|
|
18
18
|
fileName?: string;
|
|
19
19
|
/** MIME type of the file as defined by sender */
|
|
20
20
|
mimeType: string;
|
|
21
|
-
/** File size in bytes
|
|
21
|
+
/** File size in bytes */
|
|
22
22
|
fileSize: number;
|
|
23
23
|
}
|
|
24
24
|
export declare function constructVideo(document: types.Document, videoAttribute: types.DocumentAttributeVideo, fileName: string | undefined, fileId: string, fileUniqueId: string): Video;
|
package/esm/types/1_video.js
CHANGED
|
@@ -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;
|
package/esm/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/esm/types/2_game.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { cleanObject } from "../utilities/0_object.js";
|
|
1
|
+
import { cleanObject } from "../1_utilities.js";
|
|
2
|
+
import { as, types } from "../2_tl.js";
|
|
4
3
|
import { FileID, FileType, FileUniqueID, FileUniqueType } from "./!0_file_id.js";
|
|
5
4
|
import { constructAnimation } from "./1_animation.js";
|
|
6
5
|
import { constructPhoto } from "./1_photo.js";
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
2
|
import { constructInlineKeyboardButton, inlineKeyboardButtonToTlObject } from "./1_inline_keyboard_button.js";
|
|
3
3
|
export function constructInlineKeyboardMarkup(keyboard_) {
|
|
4
4
|
const rows = new Array();
|