@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
|
@@ -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,41 @@
|
|
|
1
|
+
import { UNREACHABLE } from "../1_utilities.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
|
+
import { constructLocation } from "./0_location.js";
|
|
4
|
+
import { constructUser } from "./1_user.js";
|
|
5
|
+
export async function constructInlineQuery(query_, getEntity) {
|
|
6
|
+
const user_ = await getEntity(new types.PeerUser({ userId: query_.userId }));
|
|
7
|
+
if (user_ == null) {
|
|
8
|
+
UNREACHABLE();
|
|
9
|
+
}
|
|
10
|
+
const user = constructUser(user_);
|
|
11
|
+
let chatType;
|
|
12
|
+
if (query_.peerType !== undefined) {
|
|
13
|
+
if (query_.peerType instanceof types.InlineQueryPeerTypeSameBotPM) {
|
|
14
|
+
chatType = "private";
|
|
15
|
+
}
|
|
16
|
+
else if (query_.peerType instanceof types.InlineQueryPeerTypeBotPM || query_.peerType instanceof types.InlineQueryPeerTypePM) {
|
|
17
|
+
chatType = "sender";
|
|
18
|
+
}
|
|
19
|
+
else if (query_.peerType instanceof types.InlineQueryPeerTypeChat) {
|
|
20
|
+
chatType = "group";
|
|
21
|
+
}
|
|
22
|
+
else if (query_.peerType instanceof types.InlineQueryPeerTypeMegagroup) {
|
|
23
|
+
chatType = "supergroup";
|
|
24
|
+
}
|
|
25
|
+
else if (query_.peerType instanceof types.InlineQueryPeerTypeBroadcast) {
|
|
26
|
+
chatType = "channel";
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
UNREACHABLE();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const location = query_.geo !== undefined && query_.geo instanceof types.GeoPoint ? constructLocation(query_.geo) : undefined;
|
|
33
|
+
return {
|
|
34
|
+
id: String(query_.queryId),
|
|
35
|
+
from: user,
|
|
36
|
+
query: query_.query,
|
|
37
|
+
offset: query_.offset,
|
|
38
|
+
chatType,
|
|
39
|
+
location,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -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[][];
|
package/esm/types/3_message.d.ts
CHANGED
|
@@ -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 */
|
|
@@ -103,6 +104,7 @@ export interface Message {
|
|
|
103
104
|
contact?: Contact;
|
|
104
105
|
/** Message is a game, information about the game. */
|
|
105
106
|
game?: Game;
|
|
107
|
+
/** New poll state. Bots receive only updates about stopped polls and polls, which were sent by the bot. */
|
|
106
108
|
poll?: Poll;
|
|
107
109
|
/** Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */
|
|
108
110
|
venue?: Venue;
|
|
@@ -124,9 +126,9 @@ export interface Message {
|
|
|
124
126
|
supergroupCreated?: true;
|
|
125
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. */
|
|
126
128
|
channelCreated?: true;
|
|
127
|
-
/** 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 */
|
|
128
130
|
chatMigratedTo?: number;
|
|
129
|
-
/** 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 */
|
|
130
132
|
chatMigratedFrom?: number;
|
|
131
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. */
|
|
132
134
|
pinnedMessage?: Message;
|
|
@@ -165,13 +167,9 @@ export interface Message {
|
|
|
165
167
|
duration: number;
|
|
166
168
|
};
|
|
167
169
|
}
|
|
168
|
-
interface
|
|
169
|
-
(
|
|
170
|
-
(peer: types.PeerChat): MaybePromise<types.Chat | null>;
|
|
171
|
-
(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>;
|
|
172
172
|
}
|
|
173
|
-
type
|
|
174
|
-
|
|
175
|
-
} | null;
|
|
176
|
-
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>;
|
|
177
175
|
export {};
|
package/esm/types/3_message.js
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { debug } from "../
|
|
2
|
-
import { UNREACHABLE } from "../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { debug } from "../0_deps.js";
|
|
2
|
+
import { cleanObject, UNREACHABLE } from "../1_utilities.js";
|
|
3
|
+
import { as, types } from "../2_tl.js";
|
|
4
|
+
import { ZERO_CHANNEL_ID } from "../4_constants.js";
|
|
5
|
+
import { FileID, FileType, FileUniqueID, FileUniqueType } from "./!0_file_id.js";
|
|
6
6
|
import { constructForceReply } from "./0_force_reply.js";
|
|
7
7
|
import { constructMessageEntity } from "./0_message_entity.js";
|
|
8
|
+
import { constructAudio } from "./0_audio.js";
|
|
9
|
+
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
|
+
import { constructDice } from "./0_dice.js";
|
|
8
14
|
import { constructReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
|
|
9
15
|
import { ChatType, constructChat } from "./1_chat.js";
|
|
10
|
-
import { constructUser } from "./1_user.js";
|
|
11
|
-
import { constructInlineKeyboardMarkup } from "./2_inline_keyboard_markup.js";
|
|
12
|
-
import { constructReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
13
|
-
import { constructSticker } from "./1_sticker.js";
|
|
14
16
|
import { constructPhoto } from "./1_photo.js";
|
|
15
17
|
import { constructDocument } from "./1_document.js";
|
|
16
18
|
import { constructVideo } from "./1_video.js";
|
|
17
19
|
import { constructVideoNote } from "./1_video_note.js";
|
|
18
20
|
import { constructAnimation } from "./1_animation.js";
|
|
19
|
-
import {
|
|
20
|
-
import { constructVoice } from "./0_voice.js";
|
|
21
|
-
import { constructDice } from "./0_dice.js";
|
|
22
|
-
import { FileID, FileType, FileUniqueID, FileUniqueType } from "./!0_file_id.js";
|
|
23
|
-
import { constructContact } from "./0_contact.js";
|
|
24
|
-
import { constructGame } from "./2_game.js";
|
|
21
|
+
import { constructUser } from "./1_user.js";
|
|
25
22
|
import { constructPoll } from "./1_poll.js";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
23
|
+
import { constructSticker } from "./1_sticker.js";
|
|
24
|
+
import { constructInlineKeyboardMarkup } from "./2_inline_keyboard_markup.js";
|
|
25
|
+
import { constructReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
26
|
+
import { constructGame } from "./2_game.js";
|
|
29
27
|
const d = debug("types/Message");
|
|
30
28
|
async function getSender(message_, getEntity) {
|
|
31
29
|
if (message_.fromId instanceof types.PeerUser) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
|
+
import { EntityGetter } from "./!0_misc.js";
|
|
3
|
+
import { User } from "./1_user.js";
|
|
4
|
+
import { Message, MessageGetter } from "./3_message.js";
|
|
5
|
+
export interface CallbackQuery {
|
|
6
|
+
id: string;
|
|
7
|
+
from: User;
|
|
8
|
+
message?: Message;
|
|
9
|
+
inlineMessageId?: number;
|
|
10
|
+
chatInstance?: string;
|
|
11
|
+
data?: string;
|
|
12
|
+
gameShortName?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function constructCallbackQuery(callbackQuery: types.UpdateBotCallbackQuery | types.UpdateInlineBotCallbackQuery, getEntity: EntityGetter, getMessage: MessageGetter): Promise<CallbackQuery>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cleanObject, UNREACHABLE } from "../1_utilities.js";
|
|
2
|
+
import { peerToChatId, types } from "../2_tl.js";
|
|
3
|
+
import { constructUser } from "./1_user.js";
|
|
4
|
+
export async function constructCallbackQuery(callbackQuery, getEntity, getMessage) {
|
|
5
|
+
const user_ = await getEntity(new types.PeerUser({ userId: callbackQuery.userId }));
|
|
6
|
+
if (!user_) {
|
|
7
|
+
UNREACHABLE();
|
|
8
|
+
}
|
|
9
|
+
const user = constructUser(user_);
|
|
10
|
+
const id = String(callbackQuery.queryId);
|
|
11
|
+
const gameShortName = callbackQuery.gameShortName;
|
|
12
|
+
const data = callbackQuery.data !== undefined ? new TextDecoder().decode(callbackQuery.data) : undefined;
|
|
13
|
+
const chatInstance = callbackQuery.chatInstance == 0n ? "" : String(callbackQuery.chatInstance);
|
|
14
|
+
if (callbackQuery instanceof types.UpdateBotCallbackQuery) {
|
|
15
|
+
const message = await getMessage(peerToChatId(callbackQuery.peer), Number(callbackQuery.msgId));
|
|
16
|
+
if (message == null) {
|
|
17
|
+
UNREACHABLE();
|
|
18
|
+
}
|
|
19
|
+
return cleanObject({ id, from: user, message, chatInstance, data, gameShortName });
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return cleanObject({ id, from: user, inlineMessageId: Number(callbackQuery.msgId.id), chatInstance, data, gameShortName });
|
|
23
|
+
}
|
|
24
|
+
}
|
package/esm/utilities/0_queue.js
CHANGED
package/esm/utilities/1_auth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
|
2
|
-
import { assert, assertEquals, ige256Encrypt } from "../
|
|
2
|
+
import { assert, assertEquals, ige256Encrypt } from "../0_deps.js";
|
|
3
3
|
import { bigIntFromBuffer, modExp } from "./0_bigint.js";
|
|
4
4
|
import { bufferFromBigInt, concat } from "./0_buffer.js";
|
|
5
5
|
import { sha256 } from "./0_hash.js";
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./utilities/0_base64.js";
|
|
2
|
+
export * from "./utilities/0_bigint.js";
|
|
3
|
+
export * from "./utilities/0_buffer.js";
|
|
4
|
+
export * from "./utilities/0_control.js";
|
|
5
|
+
export * from "./utilities/0_crypto.js";
|
|
6
|
+
export * from "./utilities/0_hash.js";
|
|
7
|
+
export * from "./utilities/0_object.js";
|
|
8
|
+
export * from "./utilities/0_queue.js";
|
|
9
|
+
export * from "./utilities/0_rle.js";
|
|
10
|
+
export * from "./utilities/0_types.js";
|
|
11
|
+
export * from "./utilities/1_auth.js";
|
|
12
|
+
export * from "./utilities/1_misc.js";
|
|
@@ -0,0 +1,28 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./utilities/0_base64.js"), exports);
|
|
18
|
+
__exportStar(require("./utilities/0_bigint.js"), exports);
|
|
19
|
+
__exportStar(require("./utilities/0_buffer.js"), exports);
|
|
20
|
+
__exportStar(require("./utilities/0_control.js"), exports);
|
|
21
|
+
__exportStar(require("./utilities/0_crypto.js"), exports);
|
|
22
|
+
__exportStar(require("./utilities/0_hash.js"), exports);
|
|
23
|
+
__exportStar(require("./utilities/0_object.js"), exports);
|
|
24
|
+
__exportStar(require("./utilities/0_queue.js"), exports);
|
|
25
|
+
__exportStar(require("./utilities/0_rle.js"), exports);
|
|
26
|
+
__exportStar(require("./utilities/0_types.js"), exports);
|
|
27
|
+
__exportStar(require("./utilities/1_auth.js"), exports);
|
|
28
|
+
__exportStar(require("./utilities/1_misc.js"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./connection/0_connection.js"), exports);
|
|
18
|
+
__exportStar(require("./connection/1_connection_web_socket.js"), exports);
|
package/script/2_tl.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { TLError } from "./tl/0_tl_raw_reader.js";
|
|
2
|
+
export * from "./tl/1_tl_object.js";
|
|
3
|
+
export * as types from "./tl/2_types.js";
|
|
4
|
+
export * as functions from "./tl/3_functions.js";
|
|
5
|
+
export * from "./tl/3_tl_reader.js";
|
|
6
|
+
export * from "./tl/3_utilities.js";
|
|
7
|
+
export * from "./tl/4_tl_writer.js";
|
|
8
|
+
export * from "./tl/5_rpc_result.js";
|
|
9
|
+
export * from "./tl/6_message.js";
|
|
10
|
+
export * from "./tl/7_message_container.js";
|
package/script/2_tl.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.functions = exports.types = exports.TLError = void 0;
|
|
30
|
+
var _0_tl_raw_reader_js_1 = require("./tl/0_tl_raw_reader.js");
|
|
31
|
+
Object.defineProperty(exports, "TLError", { enumerable: true, get: function () { return _0_tl_raw_reader_js_1.TLError; } });
|
|
32
|
+
__exportStar(require("./tl/1_tl_object.js"), exports);
|
|
33
|
+
exports.types = __importStar(require("./tl/2_types.js"));
|
|
34
|
+
exports.functions = __importStar(require("./tl/3_functions.js"));
|
|
35
|
+
__exportStar(require("./tl/3_tl_reader.js"), exports);
|
|
36
|
+
__exportStar(require("./tl/3_utilities.js"), exports);
|
|
37
|
+
__exportStar(require("./tl/4_tl_writer.js"), exports);
|
|
38
|
+
__exportStar(require("./tl/5_rpc_result.js"), exports);
|
|
39
|
+
__exportStar(require("./tl/6_message.js"), exports);
|
|
40
|
+
__exportStar(require("./tl/7_message_container.js"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./storage/0_storage.js";
|
|
2
|
+
export * from "./storage/0_utilities.js";
|
|
3
|
+
export * from "./storage/1_storage_indexed_db.js";
|
|
4
|
+
export * from "./storage/1_storage_local_storage.js";
|
|
5
|
+
export * from "./storage/1_storage_memory.js";
|
|
6
|
+
export * from "./storage/1_storage_session_storage.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./storage/0_storage.js"), exports);
|
|
18
|
+
__exportStar(require("./storage/0_utilities.js"), exports);
|
|
19
|
+
__exportStar(require("./storage/1_storage_indexed_db.js"), exports);
|
|
20
|
+
__exportStar(require("./storage/1_storage_local_storage.js"), exports);
|
|
21
|
+
__exportStar(require("./storage/1_storage_memory.js"), exports);
|
|
22
|
+
__exportStar(require("./storage/1_storage_session_storage.js"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./transport/0_transport.js"), exports);
|
|
18
|
+
__exportStar(require("./transport/1_transport_abridged.js"), exports);
|
|
19
|
+
__exportStar(require("./transport/1_transport_intermediate.js"), exports);
|
|
20
|
+
__exportStar(require("./transport/2_transport_provider.js"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export * from "./types/!0_file_id.js";
|
|
2
|
+
export * from "./types/0_audio.js";
|
|
3
|
+
export * from "./types/0_chat_administrator_rights.js";
|
|
4
|
+
export * from "./types/0_chat_photo.js";
|
|
5
|
+
export * from "./types/0_contact.js";
|
|
6
|
+
export * from "./types/0_dice.js";
|
|
7
|
+
export * from "./types/0_force_reply.js";
|
|
8
|
+
export * from "./types/0_keyboard_button_poll_type.js";
|
|
9
|
+
export * from "./types/0_location.js";
|
|
10
|
+
export * from "./types/0_login_url.js";
|
|
11
|
+
export * from "./types/0_mask_position.js";
|
|
12
|
+
export * from "./types/0_message_entity.js";
|
|
13
|
+
export * from "./types/0_poll_option.js";
|
|
14
|
+
export * from "./types/0_reply_keyboard_remove.js";
|
|
15
|
+
export * from "./types/0_thumbnail.js";
|
|
16
|
+
export * from "./types/0_venue.js";
|
|
17
|
+
export * from "./types/0_voice.js";
|
|
18
|
+
export * from "./types/0_web_app_info.js";
|
|
19
|
+
export * from "./types/1_animation.js";
|
|
20
|
+
export * from "./types/1_chat.js";
|
|
21
|
+
export * from "./types/1_document.js";
|
|
22
|
+
export * from "./types/1_inline_keyboard_button.js";
|
|
23
|
+
export * from "./types/1_keyboard_button.js";
|
|
24
|
+
export * from "./types/1_photo.js";
|
|
25
|
+
export * from "./types/1_poll.js";
|
|
26
|
+
export * from "./types/1_sticker.js";
|
|
27
|
+
export * from "./types/1_user.js";
|
|
28
|
+
export * from "./types/1_video_note.js";
|
|
29
|
+
export * from "./types/1_video.js";
|
|
30
|
+
export * from "./types/2_game.js";
|
|
31
|
+
export * from "./types/2_inline_keyboard_markup.js";
|
|
32
|
+
export * from "./types/2_inline_query.js";
|
|
33
|
+
export * from "./types/2_reply_keyboard_markup.js";
|
|
34
|
+
export * from "./types/3_message.js";
|
|
35
|
+
export * from "./types/4_callback_query.js";
|
|
@@ -0,0 +1,51 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types/!0_file_id.js"), exports);
|
|
18
|
+
__exportStar(require("./types/0_audio.js"), exports);
|
|
19
|
+
__exportStar(require("./types/0_chat_administrator_rights.js"), exports);
|
|
20
|
+
__exportStar(require("./types/0_chat_photo.js"), exports);
|
|
21
|
+
__exportStar(require("./types/0_contact.js"), exports);
|
|
22
|
+
__exportStar(require("./types/0_dice.js"), exports);
|
|
23
|
+
__exportStar(require("./types/0_force_reply.js"), exports);
|
|
24
|
+
__exportStar(require("./types/0_keyboard_button_poll_type.js"), exports);
|
|
25
|
+
__exportStar(require("./types/0_location.js"), exports);
|
|
26
|
+
__exportStar(require("./types/0_login_url.js"), exports);
|
|
27
|
+
__exportStar(require("./types/0_mask_position.js"), exports);
|
|
28
|
+
__exportStar(require("./types/0_message_entity.js"), exports);
|
|
29
|
+
__exportStar(require("./types/0_poll_option.js"), exports);
|
|
30
|
+
__exportStar(require("./types/0_reply_keyboard_remove.js"), exports);
|
|
31
|
+
__exportStar(require("./types/0_thumbnail.js"), exports);
|
|
32
|
+
__exportStar(require("./types/0_venue.js"), exports);
|
|
33
|
+
__exportStar(require("./types/0_voice.js"), exports);
|
|
34
|
+
__exportStar(require("./types/0_web_app_info.js"), exports);
|
|
35
|
+
__exportStar(require("./types/1_animation.js"), exports);
|
|
36
|
+
__exportStar(require("./types/1_chat.js"), exports);
|
|
37
|
+
__exportStar(require("./types/1_document.js"), exports);
|
|
38
|
+
__exportStar(require("./types/1_inline_keyboard_button.js"), exports);
|
|
39
|
+
__exportStar(require("./types/1_keyboard_button.js"), exports);
|
|
40
|
+
__exportStar(require("./types/1_photo.js"), exports);
|
|
41
|
+
__exportStar(require("./types/1_poll.js"), exports);
|
|
42
|
+
__exportStar(require("./types/1_sticker.js"), exports);
|
|
43
|
+
__exportStar(require("./types/1_user.js"), exports);
|
|
44
|
+
__exportStar(require("./types/1_video_note.js"), exports);
|
|
45
|
+
__exportStar(require("./types/1_video.js"), exports);
|
|
46
|
+
__exportStar(require("./types/2_game.js"), exports);
|
|
47
|
+
__exportStar(require("./types/2_inline_keyboard_markup.js"), exports);
|
|
48
|
+
__exportStar(require("./types/2_inline_query.js"), exports);
|
|
49
|
+
__exportStar(require("./types/2_reply_keyboard_markup.js"), exports);
|
|
50
|
+
__exportStar(require("./types/3_message.js"), exports);
|
|
51
|
+
__exportStar(require("./types/4_callback_query.js"), exports);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DC } from "./
|
|
1
|
+
import { DC } from "./3_transport.js";
|
|
2
2
|
export declare const ACK_THRESHOLD = 10;
|
|
3
3
|
export type PublicKeys = readonly [bigint, [bigint, bigint]][];
|
|
4
4
|
export declare const PUBLIC_KEYS: PublicKeys;
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
7
|
export declare const LAYER = 161;
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.0.
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.0.992";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
|
@@ -80,7 +80,7 @@ exports.PUBLIC_KEYS = Object.freeze([
|
|
|
80
80
|
exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
81
81
|
exports.INITIAL_DC = "2-test";
|
|
82
82
|
exports.LAYER = 161;
|
|
83
|
-
exports.APP_VERSION = "MTKruto 0.0.
|
|
83
|
+
exports.APP_VERSION = "MTKruto 0.0.992";
|
|
84
84
|
// @ts-ignore: lib
|
|
85
85
|
exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
86
86
|
exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/2_client_plain.js"), exports);
|
|
18
|
+
__exportStar(require("./client/3_client.js"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MessageEntity } from "../
|
|
1
|
+
import { MessageEntity } from "../3_types.js";
|
|
2
2
|
export declare function parseHtml(html: string): readonly [string, MessageEntity[]];
|
package/script/client/0_html.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseHtml = void 0;
|
|
4
|
-
const
|
|
4
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
5
5
|
function parseHtml(html) {
|
|
6
6
|
let text = "";
|
|
7
7
|
const entities = new Array();
|
|
8
8
|
const queue = new Array();
|
|
9
|
-
const parser = new
|
|
9
|
+
const parser = new _0_deps_js_1.Parser({
|
|
10
10
|
onopentag(name, attribs) {
|
|
11
11
|
switch (name) {
|
|
12
12
|
case "b":
|