@mtkruto/node 0.1.138 → 0.1.140
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/3_types.d.ts +10 -36
- package/esm/3_types.js +10 -36
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/_dnt.polyfills.d.ts +6 -0
- package/esm/client/0_filters.d.ts +60 -0
- package/esm/client/0_filters.js +27 -0
- package/esm/client/0_message.js +2 -2
- package/esm/client/{3_params.d.ts → 0_params.d.ts} +30 -33
- package/esm/client/0_types.d.ts +39 -0
- package/esm/client/0_types.js +2 -0
- package/esm/client/0_utilities.d.ts +1 -47
- package/esm/client/0_utilities.js +0 -27
- package/esm/client/1_composer.d.ts +1 -1
- package/esm/client/1_composer.js +1 -1
- package/esm/client/1_file_manager.d.ts +10 -0
- package/esm/client/1_file_manager.js +241 -0
- package/esm/client/1_update_manager.d.ts +18 -0
- package/esm/client/1_update_manager.js +553 -0
- package/esm/client/2_message_manager.d.ts +40 -0
- package/esm/client/2_message_manager.js +621 -0
- package/esm/client/3_chat_list_manager.d.ts +21 -0
- package/esm/client/3_chat_list_manager.js +353 -0
- package/esm/client/3_reaction_manager.d.ts +16 -0
- package/esm/client/3_reaction_manager.js +61 -0
- package/esm/client/4_client.d.ts +187 -60
- package/esm/client/4_client.js +492 -1699
- package/esm/connection/1_connection_web_socket.js +6 -6
- package/esm/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.d.ts +1 -1
- package/esm/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.js +1 -1
- package/esm/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.d.ts +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.js +524 -0
- package/esm/mod.d.ts +1 -0
- package/esm/mod.js +1 -0
- package/esm/storage/0_storage.d.ts +5 -3
- package/esm/storage/0_storage.js +14 -4
- package/esm/tl/1_tl_object.d.ts +1 -0
- package/esm/tl/1_tl_object.js +24 -0
- package/esm/types/0_bot_command.d.ts +1 -0
- package/esm/types/0_chat_member_rights.d.ts +37 -0
- package/esm/types/0_chat_photo.d.ts +4 -4
- package/esm/types/0_file_source.d.ts +5 -0
- package/esm/types/0_giveaway_parameters.js +2 -1
- package/esm/types/0_id.d.ts +4 -0
- package/esm/types/0_message_entity.d.ts +20 -20
- package/esm/types/1__getters.d.ts +2 -2
- package/esm/types/1_animation.d.ts +1 -1
- package/esm/types/1_bot_command_scope.d.ts +5 -4
- package/esm/types/1_chat_p.d.ts +5 -6
- package/esm/types/1_document.d.ts +1 -0
- package/esm/types/1_input_message_content.d.ts +88 -0
- package/esm/types/1_photo.d.ts +1 -1
- package/esm/types/1_sticker.d.ts +1 -1
- package/esm/types/1_user.d.ts +1 -1
- package/esm/types/1_video.d.ts +1 -1
- package/esm/types/1_video_note.d.ts +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +10 -10
- package/esm/types/2_message_reaction_count.d.ts +3 -0
- package/esm/types/2_message_reaction_count.js +17 -1
- package/esm/types/2_message_reactions.d.ts +15 -0
- package/esm/types/2_message_reactions.js +37 -0
- package/esm/types/3_reply_markup.d.ts +42 -0
- package/esm/types/3_reply_markup.js +117 -0
- package/esm/types/4_inline_query_result.d.ts +193 -0
- package/esm/types/{5_inline_query_result.js → 4_inline_query_result.js} +2 -2
- package/esm/types/4_message.d.ts +36 -39
- package/esm/types/4_message.js +7 -24
- package/esm/types/5_callback_query.d.ts +2 -1
- package/esm/types/5_chat.d.ts +8 -5
- package/esm/types/6_update.d.ts +12 -2
- package/esm/utilities/0_buffer.js +9 -6
- package/esm/utilities/0_object.d.ts +1 -1
- package/esm/utilities/0_object.js +1 -6
- package/esm/utilities/1_misc.d.ts +2 -0
- package/esm/utilities/1_misc.js +6 -0
- package/package.json +1 -2
- package/script/3_types.d.ts +10 -36
- package/script/3_types.js +10 -36
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/_dnt.polyfills.d.ts +6 -0
- package/script/client/0_filters.d.ts +60 -0
- package/script/client/0_filters.js +31 -0
- package/script/client/0_message.js +1 -1
- package/script/client/{3_params.d.ts → 0_params.d.ts} +30 -33
- package/script/client/0_types.d.ts +39 -0
- package/script/client/0_types.js +6 -0
- package/script/client/0_utilities.d.ts +1 -47
- package/script/client/0_utilities.js +1 -29
- package/script/client/1_composer.d.ts +1 -1
- package/script/client/1_composer.js +2 -2
- package/script/client/1_file_manager.d.ts +10 -0
- package/script/client/1_file_manager.js +245 -0
- package/script/client/1_update_manager.d.ts +18 -0
- package/script/client/1_update_manager.js +557 -0
- package/script/client/2_message_manager.d.ts +40 -0
- package/script/client/2_message_manager.js +625 -0
- package/script/client/3_chat_list_manager.d.ts +21 -0
- package/script/client/3_chat_list_manager.js +357 -0
- package/script/client/3_reaction_manager.d.ts +16 -0
- package/script/client/3_reaction_manager.js +65 -0
- package/script/client/4_client.d.ts +187 -60
- package/script/client/4_client.js +491 -1699
- package/script/connection/1_connection_web_socket.js +5 -5
- package/script/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.d.ts +1 -1
- package/script/deps/raw.githubusercontent.com/MTKruto/debug/main/deps.js +2 -2
- package/script/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.d.ts +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/object-inspect/main/index.js +550 -0
- package/script/mod.d.ts +1 -0
- package/script/mod.js +1 -0
- package/script/storage/0_storage.d.ts +5 -3
- package/script/storage/0_storage.js +14 -4
- package/script/tl/1_tl_object.d.ts +1 -0
- package/script/tl/1_tl_object.js +24 -0
- package/script/types/0_bot_command.d.ts +1 -0
- package/script/types/0_chat_member_rights.d.ts +37 -0
- package/script/types/0_chat_photo.d.ts +4 -4
- package/script/types/0_file_source.d.ts +5 -0
- package/script/types/0_giveaway_parameters.js +2 -1
- package/script/types/0_id.d.ts +4 -0
- package/script/types/0_message_entity.d.ts +20 -20
- package/script/types/1__getters.d.ts +2 -2
- package/script/types/1_animation.d.ts +1 -1
- package/script/types/1_bot_command_scope.d.ts +5 -4
- package/script/types/1_chat_p.d.ts +5 -6
- package/script/types/1_document.d.ts +1 -0
- package/script/types/1_input_message_content.d.ts +88 -0
- package/script/types/1_photo.d.ts +1 -1
- package/script/types/1_sticker.d.ts +1 -1
- package/script/types/1_user.d.ts +1 -1
- package/script/types/1_video.d.ts +1 -1
- package/script/types/1_video_note.d.ts +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +10 -10
- package/script/types/2_message_reaction_count.d.ts +3 -0
- package/script/types/2_message_reaction_count.js +19 -0
- package/script/types/2_message_reactions.d.ts +15 -0
- package/script/types/2_message_reactions.js +41 -0
- package/script/types/3_reply_markup.d.ts +42 -0
- package/script/types/3_reply_markup.js +122 -0
- package/script/types/4_inline_query_result.d.ts +193 -0
- package/script/types/{5_inline_query_result.js → 4_inline_query_result.js} +3 -3
- package/script/types/4_message.d.ts +36 -39
- package/script/types/4_message.js +6 -23
- package/script/types/5_callback_query.d.ts +2 -1
- package/script/types/5_chat.d.ts +8 -5
- package/script/types/6_update.d.ts +12 -2
- package/script/utilities/0_buffer.js +9 -6
- package/script/utilities/0_object.d.ts +1 -1
- package/script/utilities/0_object.js +1 -6
- package/script/utilities/1_misc.d.ts +2 -0
- package/script/utilities/1_misc.js +9 -1
- package/esm/types/0_chat_id.d.ts +0 -4
- package/esm/types/0_force_reply.d.ts +0 -12
- package/esm/types/0_force_reply.js +0 -17
- package/esm/types/0_input_contact_message_content.d.ts +0 -11
- package/esm/types/0_input_location_message_content.d.ts +0 -15
- package/esm/types/0_input_venue_message_content.d.ts +0 -19
- package/esm/types/0_reply_keyboard_remove.d.ts +0 -10
- package/esm/types/0_reply_keyboard_remove.js +0 -8
- package/esm/types/1_input_invoice_message_content.d.ts +0 -23
- package/esm/types/1_input_text_message_content.d.ts +0 -8
- package/esm/types/1_input_text_message_content.js +0 -1
- package/esm/types/2_input_message_content.d.ts +0 -6
- package/esm/types/2_input_message_content.js +0 -1
- package/esm/types/2_reply_keyboard_markup.d.ts +0 -12
- package/esm/types/2_reply_keyboard_markup.js +0 -37
- package/esm/types/3_inline_keyboard_markup.d.ts +0 -8
- package/esm/types/3_inline_keyboard_markup.js +0 -24
- package/esm/types/4_inline_query_result_article.d.ts +0 -15
- package/esm/types/4_inline_query_result_article.js +0 -1
- package/esm/types/4_inline_query_result_audio.d.ts +0 -17
- package/esm/types/4_inline_query_result_audio.js +0 -1
- package/esm/types/4_inline_query_result_cached_audio.d.ts +0 -14
- package/esm/types/4_inline_query_result_cached_audio.js +0 -1
- package/esm/types/4_inline_query_result_cached_document.d.ts +0 -15
- package/esm/types/4_inline_query_result_cached_document.js +0 -1
- package/esm/types/4_inline_query_result_cached_gif.d.ts +0 -15
- package/esm/types/4_inline_query_result_cached_gif.js +0 -1
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.d.ts +0 -15
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.js +0 -1
- package/esm/types/4_inline_query_result_cached_photo.d.ts +0 -16
- package/esm/types/4_inline_query_result_cached_photo.js +0 -1
- package/esm/types/4_inline_query_result_cached_sticker.d.ts +0 -9
- package/esm/types/4_inline_query_result_cached_sticker.js +0 -1
- package/esm/types/4_inline_query_result_cached_video.d.ts +0 -16
- package/esm/types/4_inline_query_result_cached_video.js +0 -1
- package/esm/types/4_inline_query_result_cached_voice.d.ts +0 -15
- package/esm/types/4_inline_query_result_cached_voice.js +0 -1
- package/esm/types/4_inline_query_result_contact.d.ts +0 -15
- package/esm/types/4_inline_query_result_contact.js +0 -1
- package/esm/types/4_inline_query_result_document.d.ts +0 -18
- package/esm/types/4_inline_query_result_document.js +0 -1
- package/esm/types/4_inline_query_result_game.d.ts +0 -7
- package/esm/types/4_inline_query_result_game.js +0 -1
- package/esm/types/4_inline_query_result_gif.d.ts +0 -20
- package/esm/types/4_inline_query_result_gif.js +0 -1
- package/esm/types/4_inline_query_result_location.d.ts +0 -18
- package/esm/types/4_inline_query_result_location.js +0 -1
- package/esm/types/4_inline_query_result_mpeg4_gif.d.ts +0 -20
- package/esm/types/4_inline_query_result_mpeg4_gif.js +0 -1
- package/esm/types/4_inline_query_result_photo.d.ts +0 -19
- package/esm/types/4_inline_query_result_photo.js +0 -1
- package/esm/types/4_inline_query_result_venue.d.ts +0 -19
- package/esm/types/4_inline_query_result_venue.js +0 -1
- package/esm/types/4_inline_query_result_video.d.ts +0 -21
- package/esm/types/4_inline_query_result_video.js +0 -1
- package/esm/types/4_inline_query_result_voice.d.ts +0 -16
- package/esm/types/4_inline_query_result_voice.js +0 -1
- package/esm/types/4_reply_markup.d.ts +0 -7
- package/esm/types/4_reply_markup.js +0 -22
- package/esm/types/5_inline_query_result.d.ts +0 -28
- package/script/types/0_chat_id.d.ts +0 -4
- package/script/types/0_force_reply.d.ts +0 -12
- package/script/types/0_force_reply.js +0 -22
- package/script/types/0_input_contact_message_content.d.ts +0 -11
- package/script/types/0_input_location_message_content.d.ts +0 -15
- package/script/types/0_input_venue_message_content.d.ts +0 -19
- package/script/types/0_reply_keyboard_remove.d.ts +0 -10
- package/script/types/0_reply_keyboard_remove.js +0 -13
- package/script/types/1_input_invoice_message_content.d.ts +0 -23
- package/script/types/1_input_text_message_content.d.ts +0 -8
- package/script/types/1_input_text_message_content.js +0 -2
- package/script/types/2_input_message_content.d.ts +0 -6
- package/script/types/2_input_message_content.js +0 -2
- package/script/types/2_reply_keyboard_markup.d.ts +0 -12
- package/script/types/2_reply_keyboard_markup.js +0 -42
- package/script/types/3_inline_keyboard_markup.d.ts +0 -8
- package/script/types/3_inline_keyboard_markup.js +0 -29
- package/script/types/4_inline_query_result_article.d.ts +0 -15
- package/script/types/4_inline_query_result_article.js +0 -2
- package/script/types/4_inline_query_result_audio.d.ts +0 -17
- package/script/types/4_inline_query_result_audio.js +0 -2
- package/script/types/4_inline_query_result_cached_audio.d.ts +0 -14
- package/script/types/4_inline_query_result_cached_audio.js +0 -2
- package/script/types/4_inline_query_result_cached_document.d.ts +0 -15
- package/script/types/4_inline_query_result_cached_document.js +0 -2
- package/script/types/4_inline_query_result_cached_gif.d.ts +0 -15
- package/script/types/4_inline_query_result_cached_gif.js +0 -2
- package/script/types/4_inline_query_result_cached_mpeg4_gif.d.ts +0 -15
- package/script/types/4_inline_query_result_cached_mpeg4_gif.js +0 -2
- package/script/types/4_inline_query_result_cached_photo.d.ts +0 -16
- package/script/types/4_inline_query_result_cached_photo.js +0 -2
- package/script/types/4_inline_query_result_cached_sticker.d.ts +0 -9
- package/script/types/4_inline_query_result_cached_sticker.js +0 -2
- package/script/types/4_inline_query_result_cached_video.d.ts +0 -16
- package/script/types/4_inline_query_result_cached_video.js +0 -2
- package/script/types/4_inline_query_result_cached_voice.d.ts +0 -15
- package/script/types/4_inline_query_result_cached_voice.js +0 -2
- package/script/types/4_inline_query_result_contact.d.ts +0 -15
- package/script/types/4_inline_query_result_contact.js +0 -2
- package/script/types/4_inline_query_result_document.d.ts +0 -18
- package/script/types/4_inline_query_result_document.js +0 -2
- package/script/types/4_inline_query_result_game.d.ts +0 -7
- package/script/types/4_inline_query_result_game.js +0 -2
- package/script/types/4_inline_query_result_gif.d.ts +0 -20
- package/script/types/4_inline_query_result_gif.js +0 -2
- package/script/types/4_inline_query_result_location.d.ts +0 -18
- package/script/types/4_inline_query_result_location.js +0 -2
- package/script/types/4_inline_query_result_mpeg4_gif.d.ts +0 -20
- package/script/types/4_inline_query_result_mpeg4_gif.js +0 -2
- package/script/types/4_inline_query_result_photo.d.ts +0 -19
- package/script/types/4_inline_query_result_photo.js +0 -2
- package/script/types/4_inline_query_result_venue.d.ts +0 -19
- package/script/types/4_inline_query_result_venue.js +0 -2
- package/script/types/4_inline_query_result_video.d.ts +0 -21
- package/script/types/4_inline_query_result_video.js +0 -2
- package/script/types/4_inline_query_result_voice.d.ts +0 -16
- package/script/types/4_inline_query_result_voice.js +0 -2
- package/script/types/4_reply_markup.d.ts +0 -7
- package/script/types/4_reply_markup.js +0 -26
- package/script/types/5_inline_query_result.d.ts +0 -28
- /package/esm/{client/3_params.js → _dnt.polyfills.js} +0 -0
- /package/esm/{types/0_chat_id.js → client/0_params.js} +0 -0
- /package/esm/types/{0_input_contact_message_content.js → 0_chat_member_rights.js} +0 -0
- /package/esm/types/{0_input_location_message_content.js → 0_file_source.js} +0 -0
- /package/esm/types/{0_input_venue_message_content.js → 0_id.js} +0 -0
- /package/esm/types/{1_input_invoice_message_content.js → 1_input_message_content.js} +0 -0
- /package/script/{client/3_params.js → _dnt.polyfills.js} +0 -0
- /package/script/{types/0_chat_id.js → client/0_params.js} +0 -0
- /package/script/types/{0_input_contact_message_content.js → 0_chat_member_rights.js} +0 -0
- /package/script/types/{0_input_location_message_content.js → 0_file_source.js} +0 -0
- /package/script/types/{0_input_venue_message_content.js → 0_id.js} +0 -0
- /package/script/types/{1_input_invoice_message_content.js → 1_input_message_content.js} +0 -0
|
@@ -2,10 +2,8 @@ import { MaybePromise } from "../1_utilities.js";
|
|
|
2
2
|
import { enums } from "../2_tl.js";
|
|
3
3
|
import { Contact } from "./0_contact.js";
|
|
4
4
|
import { Dice } from "./0_dice.js";
|
|
5
|
-
import { ForceReply } from "./0_force_reply.js";
|
|
6
5
|
import { Location } from "./0_location.js";
|
|
7
6
|
import { MessageEntity } from "./0_message_entity.js";
|
|
8
|
-
import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
|
|
9
7
|
import { Venue } from "./0_venue.js";
|
|
10
8
|
import { Voice } from "./0_voice.js";
|
|
11
9
|
import { EntityGetter } from "./1__getters.js";
|
|
@@ -23,13 +21,12 @@ import { User } from "./1_user.js";
|
|
|
23
21
|
import { VideoNote } from "./1_video_note.js";
|
|
24
22
|
import { Video } from "./1_video.js";
|
|
25
23
|
import { Game } from "./2_game.js";
|
|
26
|
-
import {
|
|
27
|
-
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
24
|
+
import { ReplyMarkup } from "./3_reply_markup.js";
|
|
28
25
|
/**
|
|
29
26
|
* Properties shared between all message types.
|
|
30
27
|
* @unlisted
|
|
31
28
|
*/
|
|
32
|
-
export interface
|
|
29
|
+
export interface _MessageBase {
|
|
33
30
|
/** Whether the message is outgoing (sent by the current user). */
|
|
34
31
|
out: boolean;
|
|
35
32
|
/** The identifier of the message. */
|
|
@@ -85,13 +82,13 @@ export interface MessageBase {
|
|
|
85
82
|
/** The number of times the message was forwarded. */
|
|
86
83
|
forwards?: number;
|
|
87
84
|
/** The message's reply markup. */
|
|
88
|
-
replyMarkup?:
|
|
85
|
+
replyMarkup?: ReplyMarkup;
|
|
89
86
|
}
|
|
90
87
|
/**
|
|
91
88
|
* Properties shared between media message types.
|
|
92
89
|
* @unlisted
|
|
93
90
|
*/
|
|
94
|
-
export interface MessageMediaBase extends
|
|
91
|
+
export interface MessageMediaBase extends _MessageBase {
|
|
95
92
|
caption?: string;
|
|
96
93
|
captionEntities?: MessageEntity[];
|
|
97
94
|
hasMediaSpoiler?: boolean;
|
|
@@ -100,7 +97,7 @@ export interface MessageMediaBase extends MessageBase {
|
|
|
100
97
|
* A text message.
|
|
101
98
|
* @unlisted
|
|
102
99
|
*/
|
|
103
|
-
export interface MessageText extends
|
|
100
|
+
export interface MessageText extends _MessageBase {
|
|
104
101
|
/** The text included in the message. */
|
|
105
102
|
text: string;
|
|
106
103
|
/** Entities of the text. */
|
|
@@ -131,7 +128,7 @@ export interface MessageVideo extends MessageMediaBase {
|
|
|
131
128
|
* A sticker message.
|
|
132
129
|
* @unlisted
|
|
133
130
|
*/
|
|
134
|
-
export interface MessageSticker extends
|
|
131
|
+
export interface MessageSticker extends _MessageBase {
|
|
135
132
|
/** The sticker included in the message. */
|
|
136
133
|
sticker: Sticker;
|
|
137
134
|
}
|
|
@@ -163,7 +160,7 @@ export interface MessageAudio extends MessageMediaBase {
|
|
|
163
160
|
* A dice message.
|
|
164
161
|
* @unlisted
|
|
165
162
|
*/
|
|
166
|
-
export interface MessageDice extends
|
|
163
|
+
export interface MessageDice extends _MessageBase {
|
|
167
164
|
/** The dice included in the message. */
|
|
168
165
|
dice: Dice;
|
|
169
166
|
}
|
|
@@ -171,7 +168,7 @@ export interface MessageDice extends MessageBase {
|
|
|
171
168
|
* A video note message.
|
|
172
169
|
* @unlisted
|
|
173
170
|
*/
|
|
174
|
-
export interface MessageVideoNote extends
|
|
171
|
+
export interface MessageVideoNote extends _MessageBase {
|
|
175
172
|
/** The video note included in the message. */
|
|
176
173
|
videoNote: VideoNote;
|
|
177
174
|
}
|
|
@@ -179,7 +176,7 @@ export interface MessageVideoNote extends MessageBase {
|
|
|
179
176
|
* A contact message.
|
|
180
177
|
* @unlisted
|
|
181
178
|
*/
|
|
182
|
-
export interface MessageContact extends
|
|
179
|
+
export interface MessageContact extends _MessageBase {
|
|
183
180
|
/** The contact included in the message. */
|
|
184
181
|
contact: Contact;
|
|
185
182
|
}
|
|
@@ -187,7 +184,7 @@ export interface MessageContact extends MessageBase {
|
|
|
187
184
|
* A game message.
|
|
188
185
|
* @unlisted
|
|
189
186
|
*/
|
|
190
|
-
export interface MessageGame extends
|
|
187
|
+
export interface MessageGame extends _MessageBase {
|
|
191
188
|
/** The game included in the message. */
|
|
192
189
|
game: Game;
|
|
193
190
|
}
|
|
@@ -195,7 +192,7 @@ export interface MessageGame extends MessageBase {
|
|
|
195
192
|
* A poll message.
|
|
196
193
|
* @unlisted
|
|
197
194
|
*/
|
|
198
|
-
export interface MessagePoll extends
|
|
195
|
+
export interface MessagePoll extends _MessageBase {
|
|
199
196
|
/** The poll included in the message. */
|
|
200
197
|
poll: Poll;
|
|
201
198
|
}
|
|
@@ -203,7 +200,7 @@ export interface MessagePoll extends MessageBase {
|
|
|
203
200
|
* A venue message.
|
|
204
201
|
* @unlisted
|
|
205
202
|
*/
|
|
206
|
-
export interface MessageVenue extends
|
|
203
|
+
export interface MessageVenue extends _MessageBase {
|
|
207
204
|
/** The venue included in the message. */
|
|
208
205
|
venue: Venue;
|
|
209
206
|
}
|
|
@@ -211,7 +208,7 @@ export interface MessageVenue extends MessageBase {
|
|
|
211
208
|
* A location message.
|
|
212
209
|
* @unlisted
|
|
213
210
|
*/
|
|
214
|
-
export interface MessageLocation extends
|
|
211
|
+
export interface MessageLocation extends _MessageBase {
|
|
215
212
|
/** The location included in the message. */
|
|
216
213
|
location: Location;
|
|
217
214
|
}
|
|
@@ -219,7 +216,7 @@ export interface MessageLocation extends MessageBase {
|
|
|
219
216
|
* A message that is received when new members join a chat.
|
|
220
217
|
* @unlisted
|
|
221
218
|
*/
|
|
222
|
-
export interface MessageNewChatMembers extends
|
|
219
|
+
export interface MessageNewChatMembers extends _MessageBase {
|
|
223
220
|
/** The new members of the chat. */
|
|
224
221
|
newChatMembers: User[];
|
|
225
222
|
}
|
|
@@ -227,7 +224,7 @@ export interface MessageNewChatMembers extends MessageBase {
|
|
|
227
224
|
* A message that is received when a member leaves a chat.
|
|
228
225
|
* @unlisted
|
|
229
226
|
*/
|
|
230
|
-
export interface MessageLeftChatMember extends
|
|
227
|
+
export interface MessageLeftChatMember extends _MessageBase {
|
|
231
228
|
/** The member who left the chat. */
|
|
232
229
|
leftChatMember: User;
|
|
233
230
|
}
|
|
@@ -235,7 +232,7 @@ export interface MessageLeftChatMember extends MessageBase {
|
|
|
235
232
|
* A message that is received when a chat's title is changed.
|
|
236
233
|
* @unlisted
|
|
237
234
|
*/
|
|
238
|
-
export interface MessageNewChatTitle extends
|
|
235
|
+
export interface MessageNewChatTitle extends _MessageBase {
|
|
239
236
|
/** The new title of the chat. */
|
|
240
237
|
newChatTitle: string;
|
|
241
238
|
}
|
|
@@ -243,7 +240,7 @@ export interface MessageNewChatTitle extends MessageBase {
|
|
|
243
240
|
* A message that is received when a chat's photo is changed.
|
|
244
241
|
* @unlisted
|
|
245
242
|
*/
|
|
246
|
-
export interface MessageNewChatPhoto extends
|
|
243
|
+
export interface MessageNewChatPhoto extends _MessageBase {
|
|
247
244
|
/** The new photo of the chat. */
|
|
248
245
|
newChatPhoto: Photo;
|
|
249
246
|
}
|
|
@@ -251,7 +248,7 @@ export interface MessageNewChatPhoto extends MessageBase {
|
|
|
251
248
|
* A message that is received when a chat's photo is removed.
|
|
252
249
|
* @unlisted
|
|
253
250
|
*/
|
|
254
|
-
export interface MessageDeletedChatPhoto extends
|
|
251
|
+
export interface MessageDeletedChatPhoto extends _MessageBase {
|
|
255
252
|
deletedChatPhoto: true;
|
|
256
253
|
}
|
|
257
254
|
/**
|
|
@@ -259,7 +256,7 @@ export interface MessageDeletedChatPhoto extends MessageBase {
|
|
|
259
256
|
* While bots don't receive them, they are able to see them if someone replies to them.
|
|
260
257
|
* @unlisted
|
|
261
258
|
*/
|
|
262
|
-
export interface MessageGroupCreated extends
|
|
259
|
+
export interface MessageGroupCreated extends _MessageBase {
|
|
263
260
|
groupCreated: true;
|
|
264
261
|
/** The initial members of the group. */
|
|
265
262
|
newChatMembers: User[];
|
|
@@ -269,7 +266,7 @@ export interface MessageGroupCreated extends MessageBase {
|
|
|
269
266
|
* While bots don't receive them, they are able to see them if someone replies to them.
|
|
270
267
|
* @unlisted
|
|
271
268
|
*/
|
|
272
|
-
export interface MessageSupergroupCreated extends
|
|
269
|
+
export interface MessageSupergroupCreated extends _MessageBase {
|
|
273
270
|
supergroupCreated: true;
|
|
274
271
|
}
|
|
275
272
|
/**
|
|
@@ -277,14 +274,14 @@ export interface MessageSupergroupCreated extends MessageBase {
|
|
|
277
274
|
* While bots don't receive them, they are able to see them if someone replies to them.
|
|
278
275
|
* @unlisted
|
|
279
276
|
*/
|
|
280
|
-
export interface MessageChannelCreated extends
|
|
277
|
+
export interface MessageChannelCreated extends _MessageBase {
|
|
281
278
|
channelCreated: true;
|
|
282
279
|
}
|
|
283
280
|
/**
|
|
284
281
|
* A message that is received when a chat's auto-delete timer is changed.
|
|
285
282
|
* @unlisted
|
|
286
283
|
*/
|
|
287
|
-
export interface MessageAutoDeleteTimerChanged extends
|
|
284
|
+
export interface MessageAutoDeleteTimerChanged extends _MessageBase {
|
|
288
285
|
/** The new auto-delete time in seconds. */
|
|
289
286
|
newAutoDeleteTime: number;
|
|
290
287
|
}
|
|
@@ -292,7 +289,7 @@ export interface MessageAutoDeleteTimerChanged extends MessageBase {
|
|
|
292
289
|
* A message that is received when a supergroup is created as a result of a group migration.
|
|
293
290
|
* @unlisted
|
|
294
291
|
*/
|
|
295
|
-
export interface MessageChatMigratedTo extends
|
|
292
|
+
export interface MessageChatMigratedTo extends _MessageBase {
|
|
296
293
|
/** The supergroup's ID. */
|
|
297
294
|
chatMigratedTo: number;
|
|
298
295
|
}
|
|
@@ -300,7 +297,7 @@ export interface MessageChatMigratedTo extends MessageBase {
|
|
|
300
297
|
* A message that is received when a group is migrated to a supergroup.
|
|
301
298
|
* @unlisted
|
|
302
299
|
*/
|
|
303
|
-
export interface MessageChatMigratedFrom extends
|
|
300
|
+
export interface MessageChatMigratedFrom extends _MessageBase {
|
|
304
301
|
/** The group's ID. */
|
|
305
302
|
chatMigratedFrom: number;
|
|
306
303
|
}
|
|
@@ -308,7 +305,7 @@ export interface MessageChatMigratedFrom extends MessageBase {
|
|
|
308
305
|
* A message that is received when a message is pinned in a chat.
|
|
309
306
|
* @unlisted
|
|
310
307
|
*/
|
|
311
|
-
export interface MessagePinnedMessage extends
|
|
308
|
+
export interface MessagePinnedMessage extends _MessageBase {
|
|
312
309
|
/** The message that was pinned. */
|
|
313
310
|
pinnedMessage: Message;
|
|
314
311
|
}
|
|
@@ -316,7 +313,7 @@ export interface MessagePinnedMessage extends MessageBase {
|
|
|
316
313
|
* A message that is received when a bot account receives a shared user.
|
|
317
314
|
* @unlisted
|
|
318
315
|
*/
|
|
319
|
-
export interface MessageUserShared extends
|
|
316
|
+
export interface MessageUserShared extends _MessageBase {
|
|
320
317
|
userShared: {
|
|
321
318
|
requestId: number;
|
|
322
319
|
userId: number;
|
|
@@ -326,7 +323,7 @@ export interface MessageUserShared extends MessageBase {
|
|
|
326
323
|
* A message that is received when a bot is allowed to message a user.
|
|
327
324
|
* @unlisted
|
|
328
325
|
*/
|
|
329
|
-
export interface MessageWriteAccessAllowed extends
|
|
326
|
+
export interface MessageWriteAccessAllowed extends _MessageBase {
|
|
330
327
|
writeAccessAllowed: {
|
|
331
328
|
webAppName?: string;
|
|
332
329
|
};
|
|
@@ -335,7 +332,7 @@ export interface MessageWriteAccessAllowed extends MessageBase {
|
|
|
335
332
|
* A message that is received when a new topic is created in a forum.
|
|
336
333
|
* @unlisted
|
|
337
334
|
*/
|
|
338
|
-
export interface MessageForumTopicCreated extends
|
|
335
|
+
export interface MessageForumTopicCreated extends _MessageBase {
|
|
339
336
|
forumTopicCreated: {
|
|
340
337
|
name: string;
|
|
341
338
|
iconColor: string;
|
|
@@ -346,7 +343,7 @@ export interface MessageForumTopicCreated extends MessageBase {
|
|
|
346
343
|
* A message that is received when a topic is edited in a forum.
|
|
347
344
|
* @unlisted
|
|
348
345
|
*/
|
|
349
|
-
export interface MessageForumTopicEdited extends
|
|
346
|
+
export interface MessageForumTopicEdited extends _MessageBase {
|
|
350
347
|
forumTopicEdited: {
|
|
351
348
|
name: string;
|
|
352
349
|
iconCutsomEmojiId?: string;
|
|
@@ -356,21 +353,21 @@ export interface MessageForumTopicEdited extends MessageBase {
|
|
|
356
353
|
* A message that is received when a topic is closed in a forum.
|
|
357
354
|
* @unlisted
|
|
358
355
|
*/
|
|
359
|
-
export interface MessageForumTopicClosed extends
|
|
356
|
+
export interface MessageForumTopicClosed extends _MessageBase {
|
|
360
357
|
forumTopicClosed: true;
|
|
361
358
|
}
|
|
362
359
|
/**
|
|
363
360
|
* A message that is received when a topic is reopened in a forum.
|
|
364
361
|
* @unlisted
|
|
365
362
|
*/
|
|
366
|
-
export interface MessageForumTopicReopened extends
|
|
363
|
+
export interface MessageForumTopicReopened extends _MessageBase {
|
|
367
364
|
forumTopicReopened: true;
|
|
368
365
|
}
|
|
369
366
|
/**
|
|
370
367
|
* A message that is received when a video chat is scheduled in a chat.
|
|
371
368
|
* @unlisted
|
|
372
369
|
*/
|
|
373
|
-
export interface MessageVideoChatScheduled extends
|
|
370
|
+
export interface MessageVideoChatScheduled extends _MessageBase {
|
|
374
371
|
videoChatScheduled: {
|
|
375
372
|
startDate: Date;
|
|
376
373
|
};
|
|
@@ -379,14 +376,14 @@ export interface MessageVideoChatScheduled extends MessageBase {
|
|
|
379
376
|
* A message that is received when a video chat is started in a chat.
|
|
380
377
|
* @unlisted
|
|
381
378
|
*/
|
|
382
|
-
export interface MessageVideoChatStarted extends
|
|
379
|
+
export interface MessageVideoChatStarted extends _MessageBase {
|
|
383
380
|
videoChatStarted: true;
|
|
384
381
|
}
|
|
385
382
|
/**
|
|
386
383
|
* A message that is received when a video chat is ended in a chat.
|
|
387
384
|
* @unlisted
|
|
388
385
|
*/
|
|
389
|
-
export interface MessageVideoChatEnded extends
|
|
386
|
+
export interface MessageVideoChatEnded extends _MessageBase {
|
|
390
387
|
videoChatEnded: {
|
|
391
388
|
duration: number;
|
|
392
389
|
};
|
|
@@ -395,14 +392,14 @@ export interface MessageVideoChatEnded extends MessageBase {
|
|
|
395
392
|
* A message that is received when a giveaway is started in a chat.
|
|
396
393
|
* @unlisted
|
|
397
394
|
*/
|
|
398
|
-
export interface MessageGiveaway extends
|
|
395
|
+
export interface MessageGiveaway extends _MessageBase {
|
|
399
396
|
giveaway: Giveaway;
|
|
400
397
|
}
|
|
401
398
|
/**
|
|
402
399
|
* An unsupported message.
|
|
403
400
|
* @unlisted
|
|
404
401
|
*/
|
|
405
|
-
export interface MessageUnsupported extends
|
|
402
|
+
export interface MessageUnsupported extends _MessageBase {
|
|
406
403
|
unsupported: true;
|
|
407
404
|
}
|
|
408
405
|
/** @unlisted */
|
|
@@ -7,10 +7,8 @@ const _2_tl_js_1 = require("../2_tl.js");
|
|
|
7
7
|
const _0__file_id_js_1 = require("./0__file_id.js");
|
|
8
8
|
const _0_contact_js_1 = require("./0_contact.js");
|
|
9
9
|
const _0_dice_js_1 = require("./0_dice.js");
|
|
10
|
-
const _0_force_reply_js_1 = require("./0_force_reply.js");
|
|
11
10
|
const _0_location_js_1 = require("./0_location.js");
|
|
12
11
|
const _0_message_entity_js_1 = require("./0_message_entity.js");
|
|
13
|
-
const _0_reply_keyboard_remove_js_1 = require("./0_reply_keyboard_remove.js");
|
|
14
12
|
const _0_venue_js_1 = require("./0_venue.js");
|
|
15
13
|
const _0_voice_js_1 = require("./0_voice.js");
|
|
16
14
|
const _1_animation_js_1 = require("./1_animation.js");
|
|
@@ -27,8 +25,7 @@ const _1_user_js_1 = require("./1_user.js");
|
|
|
27
25
|
const _1_video_note_js_1 = require("./1_video_note.js");
|
|
28
26
|
const _1_video_js_1 = require("./1_video.js");
|
|
29
27
|
const _2_game_js_1 = require("./2_game.js");
|
|
30
|
-
const
|
|
31
|
-
const _3_inline_keyboard_markup_js_1 = require("./3_inline_keyboard_markup.js");
|
|
28
|
+
const _3_reply_markup_js_1 = require("./3_reply_markup.js");
|
|
32
29
|
const d = (0, _0_deps_js_1.debug)("types/Message");
|
|
33
30
|
const keys = {
|
|
34
31
|
text: ["text"],
|
|
@@ -120,7 +117,7 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
120
117
|
out: message_.out ?? false,
|
|
121
118
|
id: message_.id,
|
|
122
119
|
chat: chat,
|
|
123
|
-
date:
|
|
120
|
+
date: (0, _1_utilities_js_1.fromUnixTimestamp)(message_.date),
|
|
124
121
|
isTopicMessage: false,
|
|
125
122
|
};
|
|
126
123
|
Object.assign(message, await getSender(message_, getEntity));
|
|
@@ -298,7 +295,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
298
295
|
id: message_.id,
|
|
299
296
|
chat: chat_,
|
|
300
297
|
link,
|
|
301
|
-
date:
|
|
298
|
+
date: (0, _1_utilities_js_1.fromUnixTimestamp)(message_.date),
|
|
302
299
|
views: message_.views,
|
|
303
300
|
forwards: message_.forwards,
|
|
304
301
|
isTopicMessage: false,
|
|
@@ -319,21 +316,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
319
316
|
}
|
|
320
317
|
Object.assign(message, await getSender(message_, getEntity));
|
|
321
318
|
if (message_.reply_markup) {
|
|
322
|
-
|
|
323
|
-
message.replyMarkup = (0, _2_reply_keyboard_markup_js_1.constructReplyKeyboardMarkup)(message_.reply_markup);
|
|
324
|
-
}
|
|
325
|
-
else if (message_.reply_markup instanceof _2_tl_js_1.types.ReplyInlineMarkup) {
|
|
326
|
-
message.replyMarkup = (0, _3_inline_keyboard_markup_js_1.constructInlineKeyboardMarkup)(message_.reply_markup);
|
|
327
|
-
}
|
|
328
|
-
else if (message_.reply_markup instanceof _2_tl_js_1.types.ReplyKeyboardHide) {
|
|
329
|
-
message.replyMarkup = (0, _0_reply_keyboard_remove_js_1.constructReplyKeyboardRemove)(message_.reply_markup);
|
|
330
|
-
}
|
|
331
|
-
else if (message_.reply_markup instanceof _2_tl_js_1.types.ReplyKeyboardForceReply) {
|
|
332
|
-
message.replyMarkup = (0, _0_force_reply_js_1.constructForceReply)(message_.reply_markup);
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
336
|
-
}
|
|
319
|
+
message.replyMarkup = (0, _3_reply_markup_js_1.constructReplyMarkup)(message_.reply_markup);
|
|
337
320
|
}
|
|
338
321
|
if (message_.via_bot_id != undefined) {
|
|
339
322
|
const viaBot = await getEntity(new _2_tl_js_1.types.PeerUser({ user_id: message_.via_bot_id }));
|
|
@@ -352,7 +335,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
352
335
|
message.forwardSenderName = message_.fwd_from.from_name;
|
|
353
336
|
message.forwardId = message_.fwd_from.channel_post;
|
|
354
337
|
message.forwardSignature = message_.fwd_from.post_author;
|
|
355
|
-
message.forwardDate =
|
|
338
|
+
message.forwardDate = (0, _1_utilities_js_1.fromUnixTimestamp)(message_.fwd_from.date);
|
|
356
339
|
if (message_.fwd_from.from_id instanceof _2_tl_js_1.types.PeerUser) {
|
|
357
340
|
const entity = await getEntity(message_.fwd_from.from_id);
|
|
358
341
|
if (entity) {
|
|
@@ -376,7 +359,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
376
359
|
message.mediaGroupId = String(message_.grouped_id);
|
|
377
360
|
}
|
|
378
361
|
if (message_.edit_date != undefined) {
|
|
379
|
-
message.editDate =
|
|
362
|
+
message.editDate = (0, _1_utilities_js_1.fromUnixTimestamp)(message_.edit_date);
|
|
380
363
|
}
|
|
381
364
|
if (message_.message && message_.media === undefined) {
|
|
382
365
|
return {
|
|
@@ -2,12 +2,13 @@ import { types } from "../2_tl.js";
|
|
|
2
2
|
import { EntityGetter } from "./1__getters.js";
|
|
3
3
|
import { User } from "./1_user.js";
|
|
4
4
|
import { Message, MessageGetter } from "./4_message.js";
|
|
5
|
+
/** A received callback query. */
|
|
5
6
|
export interface CallbackQuery {
|
|
6
7
|
id: string;
|
|
7
8
|
from: User;
|
|
8
9
|
message?: Message;
|
|
9
10
|
inlineMessageId?: string;
|
|
10
|
-
chatInstance
|
|
11
|
+
chatInstance: string;
|
|
11
12
|
data?: string;
|
|
12
13
|
gameShortName?: string;
|
|
13
14
|
}
|
package/script/types/5_chat.d.ts
CHANGED
|
@@ -5,30 +5,33 @@ import { ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup } from "./1_cha
|
|
|
5
5
|
import { StickerSetNameGetter } from "./1_sticker.js";
|
|
6
6
|
import { Message, MessageGetter } from "./4_message.js";
|
|
7
7
|
/** @unlisted */
|
|
8
|
-
export interface
|
|
8
|
+
export interface _ChatBase {
|
|
9
9
|
order: string;
|
|
10
10
|
lastMessage?: Omit<Message, "replyToMessage">;
|
|
11
11
|
pinned: number;
|
|
12
12
|
}
|
|
13
13
|
/** @unlisted */
|
|
14
|
-
export interface ChatChannel extends
|
|
14
|
+
export interface ChatChannel extends _ChatBase, ChatPChannel {
|
|
15
15
|
also?: string[];
|
|
16
16
|
photo?: ChatPhotoChat;
|
|
17
17
|
}
|
|
18
18
|
/** @unlisted */
|
|
19
|
-
export interface ChatSupergroup extends
|
|
19
|
+
export interface ChatSupergroup extends _ChatBase, ChatPSupergroup {
|
|
20
20
|
also?: string[];
|
|
21
21
|
photo?: ChatPhotoChat;
|
|
22
22
|
}
|
|
23
23
|
/** @unlisted */
|
|
24
|
-
export interface ChatGroup extends
|
|
24
|
+
export interface ChatGroup extends _ChatBase, ChatPGroup {
|
|
25
25
|
photo?: ChatPhotoChat;
|
|
26
26
|
}
|
|
27
27
|
/** @unlisted */
|
|
28
|
-
export interface ChatPrivate extends
|
|
28
|
+
export interface ChatPrivate extends _ChatBase, ChatPPrivate {
|
|
29
29
|
also?: string[];
|
|
30
30
|
photo?: ChatPhotoUser;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* A chat with more fields.
|
|
34
|
+
*/
|
|
32
35
|
export type Chat = ChatChannel | ChatSupergroup | ChatGroup | ChatPrivate;
|
|
33
36
|
export declare function getChatOrder(lastMessage: Omit<Message, "replyToMessage"> | undefined, pinned: number): string;
|
|
34
37
|
export declare function constructChat(dialog: enums.Dialog, dialogs: types.messages.Dialogs | types.messages.DialogsSlice, pinnedChats: number[], getEntity: EntityGetter, getMessage: MessageGetter, getStickerSetName: StickerSetNameGetter): Promise<Chat>;
|
|
@@ -5,6 +5,7 @@ import { ChosenInlineResult } from "./2_chosen_inline_result.js";
|
|
|
5
5
|
import { InlineQuery } from "./2_inline_query.js";
|
|
6
6
|
import { MessageInteractions } from "./2_message_interactions.js";
|
|
7
7
|
import { MessageReactionCount } from "./2_message_reaction_count.js";
|
|
8
|
+
import { MessageReactions } from "./2_message_reactions.js";
|
|
8
9
|
import { Message } from "./4_message.js";
|
|
9
10
|
import { CallbackQuery } from "./5_callback_query.js";
|
|
10
11
|
import { Chat } from "./5_chat.js";
|
|
@@ -175,6 +176,13 @@ export interface UpdateMessageReactionCount {
|
|
|
175
176
|
/** The new message reactions. */
|
|
176
177
|
messageReactionCount: MessageReactionCount;
|
|
177
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* The reactions made to a message by a user were changed. Bot-only.
|
|
181
|
+
* @unlisted
|
|
182
|
+
*/
|
|
183
|
+
export interface UpdateMessageReactions {
|
|
184
|
+
messageReactions: MessageReactions;
|
|
185
|
+
}
|
|
178
186
|
/** @unlisted */
|
|
179
187
|
export interface UpdateMap {
|
|
180
188
|
message: UpdateNewMessage;
|
|
@@ -190,7 +198,9 @@ export interface UpdateMap {
|
|
|
190
198
|
deletedChat: UpdateDeletedChat;
|
|
191
199
|
messageInteractions: UpdateMessageInteractions;
|
|
192
200
|
messageReactionCount: UpdateMessageReactionCount;
|
|
201
|
+
messageReactions: UpdateMessageReactions;
|
|
193
202
|
}
|
|
194
203
|
/** @unlisted */
|
|
195
|
-
export type UpdateIntersection<T> = T & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & UpdateEditedMessage & UpdateDeletedMessages & UpdateCallbackQuery & UpdateInlineQuery & UpdateChosenInlineResult & UpdateNewChat & UpdateEditedChat & UpdateDeletedChat & UpdateMessageInteractions & UpdateMessageReactionCount>;
|
|
196
|
-
|
|
204
|
+
export type UpdateIntersection<T> = T & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & UpdateEditedMessage & UpdateDeletedMessages & UpdateCallbackQuery & UpdateInlineQuery & UpdateChosenInlineResult & UpdateNewChat & UpdateEditedChat & UpdateDeletedChat & UpdateMessageInteractions & UpdateMessageReactionCount & UpdateMessageReactions>;
|
|
205
|
+
/** An incoming update. */
|
|
206
|
+
export type Update = UpdateConnectionState | UpdateAuthorizationState | UpdateNewMessage | UpdateEditedMessage | UpdateDeletedMessages | UpdateCallbackQuery | UpdateInlineQuery | UpdateChosenInlineResult | UpdateNewChat | UpdateEditedChat | UpdateDeletedChat | UpdateMessageInteractions | UpdateMessageReactionCount | UpdateMessageReactions;
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.bufferFromBigInt = exports.concat = void 0;
|
|
4
4
|
function concat(...buffers) {
|
|
5
|
-
|
|
6
|
-
for (const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
let length = 0;
|
|
6
|
+
for (const b of buffers) {
|
|
7
|
+
length += b.length;
|
|
8
|
+
}
|
|
9
|
+
const buffer = new Uint8Array(length);
|
|
10
|
+
let offset = 0;
|
|
11
|
+
for (const b of buffers) {
|
|
12
|
+
buffer.set(b, offset);
|
|
13
|
+
offset += b.length;
|
|
10
14
|
}
|
|
11
|
-
const buffer = new Uint8Array(bytes);
|
|
12
15
|
return buffer;
|
|
13
16
|
}
|
|
14
17
|
exports.concat = concat;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function cleanObject<T extends Record<string, any>>(object: T
|
|
1
|
+
export declare function cleanObject<T extends Record<string, any>>(object: T): T;
|
|
@@ -2,17 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cleanObject = void 0;
|
|
4
4
|
// deno-lint-ignore no-explicit-any
|
|
5
|
-
function cleanObject(object
|
|
5
|
+
function cleanObject(object) {
|
|
6
6
|
for (const [k, v] of Object.entries(object)) {
|
|
7
7
|
switch (typeof v) {
|
|
8
8
|
case "undefined":
|
|
9
9
|
delete object[k];
|
|
10
10
|
break;
|
|
11
|
-
case "object":
|
|
12
|
-
if (recursive) {
|
|
13
|
-
// @ts-ignore: this works, no idea why it complains
|
|
14
|
-
object[k] = cleanObject(v);
|
|
15
|
-
}
|
|
16
11
|
}
|
|
17
12
|
}
|
|
18
13
|
return object;
|
|
@@ -4,3 +4,5 @@ export declare function mustPromptNumber(message: string): number;
|
|
|
4
4
|
export declare function mustPromptOneOf<T extends readonly string[]>(message: string, choices: T): T[number];
|
|
5
5
|
export declare const ZERO_CHANNEL_ID = -1000000000000;
|
|
6
6
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
7
|
+
export declare function toUnixTimestamp(date: Date): number;
|
|
8
|
+
export declare function fromUnixTimestamp(date: number): Date;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VECTOR_CONSTRUCTOR = exports.ZERO_CHANNEL_ID = exports.mustPromptOneOf = exports.mustPromptNumber = exports.mustPrompt = exports.drop = void 0;
|
|
3
|
+
exports.fromUnixTimestamp = exports.toUnixTimestamp = exports.VECTOR_CONSTRUCTOR = exports.ZERO_CHANNEL_ID = exports.mustPromptOneOf = exports.mustPromptNumber = exports.mustPrompt = exports.drop = void 0;
|
|
4
4
|
const _0_control_js_1 = require("./0_control.js");
|
|
5
5
|
function drop(promise) {
|
|
6
6
|
promise.catch(() => { });
|
|
@@ -35,3 +35,11 @@ function mustPromptOneOf(message, choices) {
|
|
|
35
35
|
exports.mustPromptOneOf = mustPromptOneOf;
|
|
36
36
|
exports.ZERO_CHANNEL_ID = -1000000000000;
|
|
37
37
|
exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
38
|
+
function toUnixTimestamp(date) {
|
|
39
|
+
return Math.floor(date.getTime() / 1000);
|
|
40
|
+
}
|
|
41
|
+
exports.toUnixTimestamp = toUnixTimestamp;
|
|
42
|
+
function fromUnixTimestamp(date) {
|
|
43
|
+
return new Date(date * 1000);
|
|
44
|
+
}
|
|
45
|
+
exports.fromUnixTimestamp = fromUnixTimestamp;
|
package/esm/types/0_chat_id.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { types } from "../2_tl.js";
|
|
2
|
-
/** Forces the user's client to select the message as the one that is to be replied. */
|
|
3
|
-
export interface ForceReply {
|
|
4
|
-
/** Differentiate from other reply markup types. */
|
|
5
|
-
forceReply: true;
|
|
6
|
-
/** A placeholder to be shown in the client's message box. */
|
|
7
|
-
inputFieldPlaceholder?: string;
|
|
8
|
-
/** Whether to only affect specific users. If true, only users that were mentioned will be affected along with the author of the replied message if any. */
|
|
9
|
-
selective?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function constructForceReply(replyMarkup_: types.ReplyKeyboardForceReply): ForceReply;
|
|
12
|
-
export declare function forceReplyToTlObject(replyMarkup: ForceReply): import("../tl/2_types.js").ReplyKeyboardForceReply_;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { types } from "../2_tl.js";
|
|
2
|
-
export function constructForceReply(replyMarkup_) {
|
|
3
|
-
const replyMarkup = { forceReply: true };
|
|
4
|
-
if (replyMarkup_.placeholder) {
|
|
5
|
-
replyMarkup.inputFieldPlaceholder = replyMarkup_.placeholder;
|
|
6
|
-
}
|
|
7
|
-
if (replyMarkup_.selective) {
|
|
8
|
-
replyMarkup.selective = true;
|
|
9
|
-
}
|
|
10
|
-
return replyMarkup;
|
|
11
|
-
}
|
|
12
|
-
export function forceReplyToTlObject(replyMarkup) {
|
|
13
|
-
return new types.ReplyKeyboardForceReply({
|
|
14
|
-
selective: replyMarkup.selective || undefined,
|
|
15
|
-
placeholder: replyMarkup.inputFieldPlaceholder,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** A message content that shares a contact. */
|
|
2
|
-
export interface InputContactMessageContent {
|
|
3
|
-
/** The contact's phone number. */
|
|
4
|
-
phoneNumber: string;
|
|
5
|
-
/** The contact's first name. */
|
|
6
|
-
firstName: string;
|
|
7
|
-
/** The contact's last name. */
|
|
8
|
-
lastName?: string;
|
|
9
|
-
/** Additional information in the vCard format. */
|
|
10
|
-
vcard?: string;
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** A message content that shares a location. */
|
|
2
|
-
export interface InputLocationMessageContent {
|
|
3
|
-
/** The latitude of the location. */
|
|
4
|
-
latitude: number;
|
|
5
|
-
/** The longitude of the location. */
|
|
6
|
-
longitude: number;
|
|
7
|
-
/** The accuracy radius of the location in meters. Must be in the range of 0-1500. */
|
|
8
|
-
horizontalAccuracy?: number;
|
|
9
|
-
/** The duration in which the location can be updated in seconds. Must be in the range of 80-864,000. */
|
|
10
|
-
livePeriod?: number;
|
|
11
|
-
/** The direction which the user is moving towards. Must be in the range of 1-350. */
|
|
12
|
-
heading?: number;
|
|
13
|
-
/** The maximum distance for proximity alerts on approaching another chat member in meters. Must be in the range 1-100,000. */
|
|
14
|
-
proximityAlertRadius?: number;
|
|
15
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** A message content that shares a venue. */
|
|
2
|
-
export interface InputVenuMessageContent {
|
|
3
|
-
/** The latitude of the venue. */
|
|
4
|
-
latitude: number;
|
|
5
|
-
/** The longitude of the venue. */
|
|
6
|
-
longitude: number;
|
|
7
|
-
/** The name of the venue. */
|
|
8
|
-
title: string;
|
|
9
|
-
/** The address of the venue. */
|
|
10
|
-
address: string;
|
|
11
|
-
/** The Foursquare identifier of the venue. */
|
|
12
|
-
foursquareId?: string;
|
|
13
|
-
/** The Foursquare type of the venue. */
|
|
14
|
-
foursquareType?: string;
|
|
15
|
-
/** The Google Places identifier of the venue. */
|
|
16
|
-
googlePlaceId?: string;
|
|
17
|
-
/** The Google Places type of the venue. */
|
|
18
|
-
googlePlaceType?: string;
|
|
19
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { types } from "../2_tl.js";
|
|
2
|
-
/** Makes the user's client hide the current custom keyboard. */
|
|
3
|
-
export interface ReplyKeyboardRemove {
|
|
4
|
-
/** Differentiate from other reply markup types. */
|
|
5
|
-
removeKeyboard: true;
|
|
6
|
-
/** Whether to only affect specific users. If true, only users that were mentioned will be affected along with the author of the replied message if any. */
|
|
7
|
-
selective?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function constructReplyKeyboardRemove(replyMarkup_: types.ReplyKeyboardHide): ReplyKeyboardRemove;
|
|
10
|
-
export declare function replyKeyboardRemoveToTlObject(replyMarkup: ReplyKeyboardRemove): import("../tl/2_types.js").ReplyKeyboardHide_;
|