@mtkruto/node 0.154.0 → 0.160.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/3_types.d.ts +3 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +3 -0
- package/esm/client/0_markdown.js +4 -4
- package/esm/client/0_params.d.ts +11 -1
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +100 -3
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.js +12 -2
- package/esm/client/2_file_manager.js +1 -1
- package/esm/client/2_payment_manager.js +2 -2
- package/esm/client/2_takeout_manager.js +2 -2
- package/esm/client/2_update_manager.js +10 -10
- package/esm/client/3_account_manager.js +3 -3
- package/esm/client/3_message_manager.d.ts +11 -0
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +195 -74
- package/esm/client/3_sticker_set_manager.js +3 -3
- package/esm/client/3_video_chat_manager.js +1 -1
- package/esm/client/4_callback_query_manager.js +2 -2
- package/esm/client/4_chat_list_manager.js +3 -3
- package/esm/client/4_chat_manager.d.ts +3 -2
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +12 -5
- package/esm/client/4_contact_manager.js +1 -1
- package/esm/client/4_gift_manager.js +11 -11
- package/esm/client/4_inline_query_manager.js +1 -1
- package/esm/client/4_story_manager.d.ts +3 -1
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +17 -3
- package/esm/client/6_client.d.ts +100 -3
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +126 -1
- package/esm/client/6_client_dispatcher.d.ts +100 -3
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +126 -1
- package/esm/connection/0_get_tls_header.d.ts.map +1 -1
- package/esm/connection/0_get_tls_header.js +19 -0
- package/esm/connection/1_connection_web_socket.js +2 -2
- package/esm/session/2_session_encrypted.js +2 -2
- package/esm/storage/1_utilities.js +2 -2
- package/esm/transport/2_transport_provider_web_socket.js +1 -1
- package/esm/types/0_button_style.js +1 -1
- package/esm/types/0_chat_member_rights.js +34 -34
- package/esm/types/0_chat_photo.js +2 -2
- package/esm/types/0_dice.d.ts +1 -1
- package/esm/types/0_dice.d.ts.map +1 -1
- package/esm/types/0_giveaway_parameters.js +1 -1
- package/esm/types/0_live_stream_channel.d.ts +1 -1
- package/esm/types/0_live_stream_channel.d.ts.map +1 -1
- package/esm/types/0_report_reason.d.ts +53 -0
- package/esm/types/0_report_reason.d.ts.map +1 -0
- package/esm/types/0_report_reason.js +45 -0
- package/esm/types/0_story_report_option.d.ts +26 -0
- package/esm/types/0_story_report_option.d.ts.map +1 -0
- package/esm/types/0_story_report_option.js +25 -0
- package/esm/types/0_video_chat.js +2 -2
- package/esm/types/1_inline_keyboard_button.d.ts +2 -2
- package/esm/types/1_message_reaction.js +1 -1
- package/esm/types/1_sticker.js +1 -1
- package/esm/types/1_story_reaction.js +1 -1
- package/esm/types/1_story_report_result.d.ts +37 -0
- package/esm/types/1_story_report_result.d.ts.map +1 -0
- package/esm/types/1_story_report_result.js +36 -0
- package/esm/types/2_chat.js +2 -2
- package/esm/types/2_chat_member.js +3 -3
- package/esm/types/2_message_entity.js +1 -1
- package/esm/types/2_story_interactive_area.js +3 -3
- package/esm/types/3_chat_settings.js +1 -1
- package/esm/types/3_forward_header.js +3 -3
- package/esm/types/3_inline_query.js +1 -1
- package/esm/types/3_invite_link.js +2 -2
- package/esm/types/3_story.js +3 -3
- package/esm/types/4_gift.js +1 -1
- package/esm/types/5_gift_non_upgraded_information.js +8 -8
- package/esm/types/5_gift_upgraded_information.js +5 -5
- package/esm/types/6_poll_media.d.ts +1 -1
- package/esm/types/6_poll_media.d.ts.map +1 -1
- package/esm/types/7_inline_query_result.js +8 -8
- package/esm/types/7_poll_option.d.ts +1 -1
- package/esm/types/7_poll_option.d.ts.map +1 -1
- package/esm/types/8_inline_query_answer.js +1 -1
- package/esm/types/9_message.js +3 -3
- package/esm/utilities/0_env.js +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +3 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +3 -0
- package/script/client/0_markdown.js +4 -4
- package/script/client/0_params.d.ts +11 -1
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +100 -3
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/2_client_encrypted.d.ts.map +1 -1
- package/script/client/2_client_encrypted.js +12 -2
- package/script/client/2_file_manager.js +1 -1
- package/script/client/2_payment_manager.js +2 -2
- package/script/client/2_takeout_manager.js +2 -2
- package/script/client/2_update_manager.js +10 -10
- package/script/client/3_account_manager.js +3 -3
- package/script/client/3_message_manager.d.ts +11 -0
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +194 -73
- package/script/client/3_sticker_set_manager.js +3 -3
- package/script/client/3_video_chat_manager.js +1 -1
- package/script/client/4_callback_query_manager.js +2 -2
- package/script/client/4_chat_list_manager.js +3 -3
- package/script/client/4_chat_manager.d.ts +3 -2
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +11 -4
- package/script/client/4_contact_manager.js +1 -1
- package/script/client/4_gift_manager.js +11 -11
- package/script/client/4_inline_query_manager.js +1 -1
- package/script/client/4_story_manager.d.ts +3 -1
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +15 -1
- package/script/client/6_client.d.ts +100 -3
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +126 -1
- package/script/client/6_client_dispatcher.d.ts +100 -3
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +126 -1
- package/script/connection/0_get_tls_header.d.ts.map +1 -1
- package/script/connection/0_get_tls_header.js +19 -0
- package/script/connection/1_connection_web_socket.js +2 -2
- package/script/session/2_session_encrypted.js +2 -2
- package/script/storage/1_utilities.js +2 -2
- package/script/transport/2_transport_provider_web_socket.js +1 -1
- package/script/types/0_button_style.js +1 -1
- package/script/types/0_chat_member_rights.js +34 -34
- package/script/types/0_chat_photo.js +2 -2
- package/script/types/0_dice.d.ts +1 -1
- package/script/types/0_dice.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.js +1 -1
- package/script/types/0_live_stream_channel.d.ts +1 -1
- package/script/types/0_live_stream_channel.d.ts.map +1 -1
- package/script/types/0_report_reason.d.ts +53 -0
- package/script/types/0_report_reason.d.ts.map +1 -0
- package/script/types/0_report_reason.js +48 -0
- package/script/types/0_story_report_option.d.ts +26 -0
- package/script/types/0_story_report_option.d.ts.map +1 -0
- package/script/types/0_story_report_option.js +28 -0
- package/script/types/0_video_chat.js +2 -2
- package/script/types/1_inline_keyboard_button.d.ts +2 -2
- package/script/types/1_message_reaction.js +1 -1
- package/script/types/1_sticker.js +1 -1
- package/script/types/1_story_reaction.js +1 -1
- package/script/types/1_story_report_result.d.ts +37 -0
- package/script/types/1_story_report_result.d.ts.map +1 -0
- package/script/types/1_story_report_result.js +39 -0
- package/script/types/2_chat.js +2 -2
- package/script/types/2_chat_member.js +3 -3
- package/script/types/2_message_entity.js +1 -1
- package/script/types/2_story_interactive_area.js +3 -3
- package/script/types/3_chat_settings.js +1 -1
- package/script/types/3_forward_header.js +3 -3
- package/script/types/3_inline_query.js +1 -1
- package/script/types/3_invite_link.js +2 -2
- package/script/types/3_story.js +3 -3
- package/script/types/4_gift.js +1 -1
- package/script/types/5_gift_non_upgraded_information.js +8 -8
- package/script/types/5_gift_upgraded_information.js +5 -5
- package/script/types/6_poll_media.d.ts +1 -1
- package/script/types/6_poll_media.d.ts.map +1 -1
- package/script/types/7_inline_query_result.js +8 -8
- package/script/types/7_poll_option.d.ts +1 -1
- package/script/types/7_poll_option.d.ts.map +1 -1
- package/script/types/8_inline_query_answer.js +1 -1
- package/script/types/9_message.js +3 -3
- package/script/utilities/0_env.js +1 -1
|
@@ -90,7 +90,7 @@ class ConnectionWebSocket {
|
|
|
90
90
|
const unlock = await mutex.lock();
|
|
91
91
|
const data = new Uint8Array(await new Blob([e.data].map((v) => v instanceof Blob || v instanceof Uint8Array ? v : v instanceof ArrayBuffer ? v : (0, _0_deps_js_1.unreachable)())).arrayBuffer());
|
|
92
92
|
this.#buffer = (0, _0_deps_js_1.concat)([this.#buffer, data]);
|
|
93
|
-
if (this.#nextResolve !== null && this.#buffer.
|
|
93
|
+
if (this.#nextResolve !== null && this.#buffer.byteLength >= this.#nextResolve[0]) {
|
|
94
94
|
this.#nextResolve[1].resolve();
|
|
95
95
|
this.#nextResolve = null;
|
|
96
96
|
}
|
|
@@ -132,7 +132,7 @@ class ConnectionWebSocket {
|
|
|
132
132
|
const unlock = await this.#rMutex.lock();
|
|
133
133
|
try {
|
|
134
134
|
this.#assertConnected();
|
|
135
|
-
if (this.#buffer.
|
|
135
|
+
if (this.#buffer.byteLength < p.byteLength) {
|
|
136
136
|
await new Promise((resolve, reject) => this.#nextResolve = [p.byteLength, { resolve, reject }]);
|
|
137
137
|
}
|
|
138
138
|
const slice = this.#buffer.slice(0, p.byteLength);
|
|
@@ -187,7 +187,7 @@ class SessionEncrypted extends _1_session_js_1.Session {
|
|
|
187
187
|
payloadWriter.writeInt64(this.state.serverSalt);
|
|
188
188
|
payloadWriter.writeInt64(this.#id);
|
|
189
189
|
payloadWriter.write(await (0, _2_tl_js_1.serializeMessage)(message));
|
|
190
|
-
payloadWriter.write(new Uint8Array((0, _1_utilities_js_1.mod)(-(payloadWriter.buffer.
|
|
190
|
+
payloadWriter.write(new Uint8Array((0, _1_utilities_js_1.mod)(-(payloadWriter.buffer.byteLength + 12), 16) + 12));
|
|
191
191
|
const payload = payloadWriter.buffer;
|
|
192
192
|
const messageKey = (await (0, _1_utilities_js_1.sha256)((0, _0_deps_js_1.concat)([this.#authKey.subarray(88, 120), payload]))).subarray(8, 24);
|
|
193
193
|
const a = await (0, _1_utilities_js_1.sha256)((0, _0_deps_js_1.concat)([messageKey, this.#authKey.subarray(0, 36)]));
|
|
@@ -333,7 +333,7 @@ class SessionEncrypted extends _1_session_js_1.Session {
|
|
|
333
333
|
//// RECEIVE LOOP HANDLERS ////
|
|
334
334
|
async #onMessage(msgId, body, containerId) {
|
|
335
335
|
this.#LreceiveLoop.debug("received message with ID", msgId, "and size", body.byteLength, "inside", ...(containerId === null ? ["no container"] : ["container", containerId]));
|
|
336
|
-
const logger = this.#LreceiveLoop.branch(msgId
|
|
336
|
+
const logger = this.#LreceiveLoop.branch(String(msgId));
|
|
337
337
|
let reader = new _2_tl_js_1.TLReader(body);
|
|
338
338
|
let id = reader.readInt32(false);
|
|
339
339
|
if (id === GZIP_PACKED) {
|
|
@@ -76,7 +76,7 @@ function fromString(string) {
|
|
|
76
76
|
const [type, value] = [Number(string[0]), string.slice(1)];
|
|
77
77
|
switch (type) {
|
|
78
78
|
case exports.ValueType.Boolean:
|
|
79
|
-
return
|
|
79
|
+
return !!Number(value);
|
|
80
80
|
case exports.ValueType.Number:
|
|
81
81
|
return Number(value);
|
|
82
82
|
case exports.ValueType.String:
|
|
@@ -100,7 +100,7 @@ function fromString(string) {
|
|
|
100
100
|
return arr;
|
|
101
101
|
}
|
|
102
102
|
case exports.ValueType.Map:
|
|
103
|
-
//deno-lint-ignore no-explicit-any
|
|
103
|
+
// deno-lint-ignore no-explicit-any
|
|
104
104
|
return Object.fromEntries(fromString(`${exports.ValueType.Array}${value}`));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -36,7 +36,7 @@ const dcToNameMap = {
|
|
|
36
36
|
const transportProviderWebSocket = (params) => {
|
|
37
37
|
return ({ dc, isMedia }) => {
|
|
38
38
|
params ??= {};
|
|
39
|
-
params.wss ??= typeof location !== "undefined" && location.protocol === "http:" && location.hostname !== "localhost"
|
|
39
|
+
params.wss ??= !(typeof location !== "undefined" && location.protocol === "http:" && location.hostname !== "localhost");
|
|
40
40
|
const url = `${params.wss ? "wss" : "ws"}://${dcToNameMap[dc]}${isMedia ? "-1" : ""}.web.telegram.org/${dc.endsWith("-test") ? "apiws_test" : "apiws"}`;
|
|
41
41
|
const connection = new _2_connection_js_1.ConnectionWebSocket(url);
|
|
42
42
|
const dcId = (0, _1_transport_provider_js_1.getDcId)(dc, isMedia);
|
|
@@ -36,5 +36,5 @@ function buttonStyleToTlObject(buttonStyle) {
|
|
|
36
36
|
if (buttonStyle === undefined) {
|
|
37
37
|
return undefined;
|
|
38
38
|
}
|
|
39
|
-
return { _: "keyboardButtonStyle", bg_danger: buttonStyle.background === "danger"
|
|
39
|
+
return { _: "keyboardButtonStyle", bg_danger: buttonStyle.background === "danger" || undefined, bg_primary: buttonStyle.background === "primary" || undefined, bg_success: buttonStyle.background === "success" || undefined, icon: buttonStyle.customEmojiId ? BigInt(buttonStyle.customEmojiId) : undefined };
|
|
40
40
|
}
|
|
@@ -24,45 +24,45 @@ exports.chatMemberRightsToTlObject = chatMemberRightsToTlObject;
|
|
|
24
24
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
25
25
|
function constructChatMemberRights(rights) {
|
|
26
26
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
27
|
-
canSendMessages: rights.send_messages
|
|
28
|
-
canSendAudio: rights.send_audios
|
|
29
|
-
canSendDocuments: rights.send_docs
|
|
30
|
-
canSendPhotos: rights.send_photos
|
|
31
|
-
canSendVideos: rights.send_messages
|
|
32
|
-
canSendVideoNotes: rights.send_roundvideos
|
|
33
|
-
canSendVoice: rights.send_voices
|
|
34
|
-
canSendPolls: rights.send_polls
|
|
35
|
-
canSendStickers: rights.send_stickers
|
|
36
|
-
canSendAnimations: rights.send_gifs
|
|
37
|
-
canSendGames: rights.send_games
|
|
38
|
-
canSendInlineBotResults: rights.send_inline
|
|
39
|
-
canAddWebPagePreviews: rights.embed_links
|
|
40
|
-
canChangeInfo: rights.change_info
|
|
41
|
-
canInviteUsers: rights.invite_users
|
|
42
|
-
canPinMessages: rights.pin_messages
|
|
43
|
-
canManageTopics: rights.manage_topics
|
|
27
|
+
canSendMessages: !!rights.send_messages,
|
|
28
|
+
canSendAudio: !!rights.send_audios,
|
|
29
|
+
canSendDocuments: !!rights.send_docs,
|
|
30
|
+
canSendPhotos: !!rights.send_photos,
|
|
31
|
+
canSendVideos: !!rights.send_messages,
|
|
32
|
+
canSendVideoNotes: !!rights.send_roundvideos,
|
|
33
|
+
canSendVoice: !!rights.send_voices,
|
|
34
|
+
canSendPolls: !!rights.send_polls,
|
|
35
|
+
canSendStickers: !!rights.send_stickers,
|
|
36
|
+
canSendAnimations: rights.send_gifs || undefined,
|
|
37
|
+
canSendGames: rights.send_games || undefined,
|
|
38
|
+
canSendInlineBotResults: rights.send_inline || undefined,
|
|
39
|
+
canAddWebPagePreviews: rights.embed_links || undefined,
|
|
40
|
+
canChangeInfo: rights.change_info || undefined,
|
|
41
|
+
canInviteUsers: rights.invite_users || undefined,
|
|
42
|
+
canPinMessages: rights.pin_messages || undefined,
|
|
43
|
+
canManageTopics: rights.manage_topics || undefined,
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
function chatMemberRightsToTlObject(rights, until) {
|
|
47
47
|
return {
|
|
48
48
|
_: "chatBannedRights",
|
|
49
49
|
until_date: until ?? 0,
|
|
50
|
-
send_messages: rights?.canSendMessages
|
|
51
|
-
send_audios: rights?.canSendAudio
|
|
52
|
-
send_docs: rights?.canSendDocuments
|
|
53
|
-
send_photos: rights?.canSendPhotos
|
|
54
|
-
send_videos: rights?.canSendVideos
|
|
55
|
-
send_roundvideos: rights?.canSendVideoNotes
|
|
56
|
-
send_voices: rights?.canSendVoice
|
|
57
|
-
send_polls: rights?.canSendPolls
|
|
58
|
-
send_stickers: rights?.canSendStickers
|
|
59
|
-
send_gifs: rights?.canSendAnimations
|
|
60
|
-
send_games: rights?.canSendGames
|
|
61
|
-
send_inline: rights?.canSendInlineBotResults
|
|
62
|
-
embed_links: rights?.canAddWebPagePreviews
|
|
63
|
-
change_info: rights?.canChangeInfo
|
|
64
|
-
invite_users: rights?.canInviteUsers
|
|
65
|
-
pin_messages: rights?.canPinMessages
|
|
66
|
-
manage_topics: rights?.canManageTopics
|
|
50
|
+
send_messages: rights?.canSendMessages === false || undefined,
|
|
51
|
+
send_audios: rights?.canSendAudio === false || undefined,
|
|
52
|
+
send_docs: rights?.canSendDocuments === false || undefined,
|
|
53
|
+
send_photos: rights?.canSendPhotos === false || undefined,
|
|
54
|
+
send_videos: rights?.canSendVideos === false || undefined,
|
|
55
|
+
send_roundvideos: rights?.canSendVideoNotes === false || undefined,
|
|
56
|
+
send_voices: rights?.canSendVoice === false || undefined,
|
|
57
|
+
send_polls: rights?.canSendPolls === false || undefined,
|
|
58
|
+
send_stickers: rights?.canSendStickers === false || undefined,
|
|
59
|
+
send_gifs: rights?.canSendAnimations === false || undefined,
|
|
60
|
+
send_games: rights?.canSendGames === false || undefined,
|
|
61
|
+
send_inline: rights?.canSendInlineBotResults === false || undefined,
|
|
62
|
+
embed_links: rights?.canAddWebPagePreviews === false || undefined,
|
|
63
|
+
change_info: rights?.canChangeInfo === false || undefined,
|
|
64
|
+
invite_users: rights?.canInviteUsers === false || undefined,
|
|
65
|
+
pin_messages: rights?.canPinMessages === false || undefined,
|
|
66
|
+
manage_topics: rights?.canManageTopics === false || undefined,
|
|
67
67
|
};
|
|
68
68
|
}
|
|
@@ -54,8 +54,8 @@ function constructChatPhoto(photo, chatId, chatAccessHash) {
|
|
|
54
54
|
smallFileUniqueId,
|
|
55
55
|
bigFileId,
|
|
56
56
|
bigFileUniqueId,
|
|
57
|
-
hasVideo: photo.has_video
|
|
58
|
-
isPersonal: photo.personal
|
|
57
|
+
hasVideo: !!photo.has_video,
|
|
58
|
+
isPersonal: !!photo.personal,
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
}
|
package/script/types/0_dice.d.ts
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import type { Api } from "../2_tl.js";
|
|
21
21
|
/** A rolled dice. */
|
|
22
22
|
export interface Dice {
|
|
23
|
-
/** The emoji on which the dice is based
|
|
23
|
+
/** The emoji on which the dice is based. */
|
|
24
24
|
emoji: string;
|
|
25
25
|
/** The result of the roll, which is in the range of 1-6 for the emojis "🎲", "🎯" and "🎳", 1-5 for the emojis "🏀" and "⚽", and 1-64 for the emoji "🎰". */
|
|
26
26
|
value: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_dice.d.ts","sourceRoot":"","sources":["../../src/types/0_dice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,qBAAqB;AACrB,MAAM,WAAW,IAAI;IACnB
|
|
1
|
+
{"version":3,"file":"0_dice.d.ts","sourceRoot":"","sources":["../../src/types/0_dice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,qBAAqB;AACrB,MAAM,WAAW,IAAI;IACnB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,6JAA6J;IAC7J,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAE/D"}
|
|
@@ -25,7 +25,7 @@ function constructGiveawayParameters(g) {
|
|
|
25
25
|
const countries = g.countries_iso2 ?? [];
|
|
26
26
|
const boostedChatId = _2_tl_js_1.Api.peerToChatId({ _: "peerChannel", channel_id: g.channels[0] });
|
|
27
27
|
const additionalChatIds = g.channels.slice(1).map((v) => _2_tl_js_1.Api.peerToChatId({ _: "peerChannel", channel_id: v }));
|
|
28
|
-
const onlyNewMembers = g.only_new_subscribers
|
|
28
|
+
const onlyNewMembers = !!g.only_new_subscribers;
|
|
29
29
|
const winnerSelectionDate = g.until_date;
|
|
30
30
|
return { boostedChatId, additionalChatIds, winnerSelectionDate, onlyNewMembers, countries };
|
|
31
31
|
}
|
|
@@ -22,7 +22,7 @@ import type { Api } from "../2_tl.js";
|
|
|
22
22
|
export interface LiveStreamChannel {
|
|
23
23
|
/** The live stream channel's unique identifier. */
|
|
24
24
|
id: number;
|
|
25
|
-
/** The scale of the live stream channel's chunks. Duration of each chunk is equal to 1000 / 2 ^ scale.
|
|
25
|
+
/** The scale of the live stream channel's chunks. Duration of each chunk is equal to 1000 / 2 ^ scale. */
|
|
26
26
|
scale: number;
|
|
27
27
|
/** The live stream channel's last timestamp. */
|
|
28
28
|
timestamp: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_live_stream_channel.d.ts","sourceRoot":"","sources":["../../src/types/0_live_stream_channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,6BAA6B;AAC7B,MAAM,WAAW,iBAAiB;IAChC,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,
|
|
1
|
+
{"version":3,"file":"0_live_stream_channel.d.ts","sourceRoot":"","sources":["../../src/types/0_live_stream_channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,6BAA6B;AAC7B,MAAM,WAAW,iBAAiB;IAChC,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,0GAA0G;IAC1G,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,GAAG,CAAC,sBAAsB,GAAG,iBAAiB,CAMjG"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import type { Api } from "../2_tl.js";
|
|
21
|
+
export interface ReportReasonSpam {
|
|
22
|
+
type: "spam";
|
|
23
|
+
}
|
|
24
|
+
export interface ReportReasonViolence {
|
|
25
|
+
type: "violence";
|
|
26
|
+
}
|
|
27
|
+
export interface ReportReasonPornography {
|
|
28
|
+
type: "pornography";
|
|
29
|
+
}
|
|
30
|
+
export interface ReportReasonChildAbuse {
|
|
31
|
+
type: "childAbuse";
|
|
32
|
+
}
|
|
33
|
+
export interface ReportReasonOther {
|
|
34
|
+
type: "other";
|
|
35
|
+
}
|
|
36
|
+
export interface ReportReasonCopyright {
|
|
37
|
+
type: "copyright";
|
|
38
|
+
}
|
|
39
|
+
export interface ReportReasonLocationIrrelevant {
|
|
40
|
+
type: "locationIrrelevant";
|
|
41
|
+
}
|
|
42
|
+
export interface ReportReasonFake {
|
|
43
|
+
type: "fake";
|
|
44
|
+
}
|
|
45
|
+
export interface ReportReasonIllegalDrugs {
|
|
46
|
+
type: "illegalDrugs";
|
|
47
|
+
}
|
|
48
|
+
export interface ReportReasonPersonalDetails {
|
|
49
|
+
type: "personalDetails";
|
|
50
|
+
}
|
|
51
|
+
export type ReportReason = ReportReasonSpam | ReportReasonViolence | ReportReasonPornography | ReportReasonChildAbuse | ReportReasonOther | ReportReasonCopyright | ReportReasonLocationIrrelevant | ReportReasonFake | ReportReasonIllegalDrugs | ReportReasonPersonalDetails;
|
|
52
|
+
export declare function reportReasonToTlObject(reportReason: ReportReason): Api.ReportReason;
|
|
53
|
+
//# sourceMappingURL=0_report_reason.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_report_reason.d.ts","sourceRoot":"","sources":["../../src/types/0_report_reason.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,oBAAoB,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,uBAAuB,GAAG,sBAAsB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,8BAA8B,GAAG,gBAAgB,GAAG,wBAAwB,GAAG,2BAA2B,CAAC;AAE/Q,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,GAAG,CAAC,YAAY,CAyBnF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.reportReasonToTlObject = reportReasonToTlObject;
|
|
23
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
|
+
function reportReasonToTlObject(reportReason) {
|
|
25
|
+
switch (reportReason.type) {
|
|
26
|
+
case "spam":
|
|
27
|
+
return { _: "inputReportReasonSpam" };
|
|
28
|
+
case "violence":
|
|
29
|
+
return { _: "inputReportReasonViolence" };
|
|
30
|
+
case "pornography":
|
|
31
|
+
return { _: "inputReportReasonPornography" };
|
|
32
|
+
case "childAbuse":
|
|
33
|
+
return { _: "inputReportReasonChildAbuse" };
|
|
34
|
+
case "other":
|
|
35
|
+
return { _: "inputReportReasonOther" };
|
|
36
|
+
case "copyright":
|
|
37
|
+
return { _: "inputReportReasonCopyright" };
|
|
38
|
+
case "locationIrrelevant":
|
|
39
|
+
return { _: "inputReportReasonGeoIrrelevant" };
|
|
40
|
+
case "fake":
|
|
41
|
+
return { _: "inputReportReasonFake" };
|
|
42
|
+
case "illegalDrugs":
|
|
43
|
+
return { _: "inputReportReasonIllegalDrugs" };
|
|
44
|
+
case "personalDetails":
|
|
45
|
+
return { _: "inputReportReasonPersonalDetails" };
|
|
46
|
+
}
|
|
47
|
+
(0, _0_deps_js_1.unreachable)();
|
|
48
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import type { Api } from "../2_tl.js";
|
|
21
|
+
export interface StoryReportOption {
|
|
22
|
+
text: string;
|
|
23
|
+
option: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function constructStoryReportOption(rr: Api.messageReportOption): StoryReportOption;
|
|
26
|
+
//# sourceMappingURL=0_story_report_option.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_story_report_option.d.ts","sourceRoot":"","sources":["../../src/types/0_story_report_option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,GAAG,CAAC,mBAAmB,GAAG,iBAAiB,CAIzF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.constructStoryReportOption = constructStoryReportOption;
|
|
23
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
24
|
+
function constructStoryReportOption(rr) {
|
|
25
|
+
const text = rr.text;
|
|
26
|
+
const option = (0, _1_utilities_js_1.base64EncodeUrlSafe)(rr.option);
|
|
27
|
+
return { text, option };
|
|
28
|
+
}
|
|
@@ -32,7 +32,7 @@ function constructVideoChat(call) {
|
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
const title = call.title ?? "";
|
|
35
|
-
const liveStream = call.rtmp_stream
|
|
35
|
+
const liveStream = !!call.rtmp_stream;
|
|
36
36
|
const participantCount = call.participants_count;
|
|
37
37
|
if (call.schedule_date) {
|
|
38
38
|
return {
|
|
@@ -50,7 +50,7 @@ function constructVideoChat(call) {
|
|
|
50
50
|
id,
|
|
51
51
|
title,
|
|
52
52
|
isLiveStream: liveStream,
|
|
53
|
-
isRecording: call.record_video_active
|
|
53
|
+
isRecording: !!call.record_video_active,
|
|
54
54
|
participantCount,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
@@ -102,14 +102,14 @@ export interface InlineKeyboardButtonGame extends _InlineKeyboardButtonBase {
|
|
|
102
102
|
type: "callbackGame";
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
|
-
* An inline keyboard that, when pressed, initiates a payment.
|
|
105
|
+
* An inline keyboard button that, when pressed, initiates a payment.
|
|
106
106
|
* @unlisted
|
|
107
107
|
*/
|
|
108
108
|
export interface InlineKeyboardButtonPay extends _InlineKeyboardButtonBase {
|
|
109
109
|
type: "pay";
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
|
-
* An inline keyboard that, when pressed, copies the text inside its `copy` field.
|
|
112
|
+
* An inline keyboard button that, when pressed, copies the text inside its `copy` field.
|
|
113
113
|
* @unlisted
|
|
114
114
|
*/
|
|
115
115
|
export interface InlineKeyboardButtonCopy extends _InlineKeyboardButtonBase {
|
|
@@ -39,6 +39,6 @@ function constructMessageReaction(reaction_, recentReactions) {
|
|
|
39
39
|
.map((v) => _2_tl_js_1.Api.peerToChatId(v.peer_id));
|
|
40
40
|
const reaction = (0, _0_reaction_js_1.constructReaction)(reaction_.reaction);
|
|
41
41
|
const count = reaction_.count;
|
|
42
|
-
const chosen = reaction_.chosen_order !== undefined
|
|
42
|
+
const chosen = reaction_.chosen_order !== undefined;
|
|
43
43
|
return { reaction, count, choosers, isChosen: chosen };
|
|
44
44
|
}
|
|
@@ -49,7 +49,7 @@ function constructSticker2(document, fileId, fileUniqueId, setName, customEmojiI
|
|
|
49
49
|
premiumAnimation: undefined, // TODO
|
|
50
50
|
maskPosition: stickerAttribute ? stickerAttribute.mask_coords ? (0, _0_mask_position_js_1.constructMaskPosition)(stickerAttribute.mask_coords) : undefined : undefined,
|
|
51
51
|
customEmojiId: customEmojiAttribute ? customEmojiId : undefined,
|
|
52
|
-
needsRepainting: customEmojiAttribute ?
|
|
52
|
+
needsRepainting: customEmojiAttribute ? !!customEmojiAttribute.text_color : undefined,
|
|
53
53
|
fileSize: Number(document.size),
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -24,6 +24,6 @@ const _0_reaction_js_1 = require("./0_reaction.js");
|
|
|
24
24
|
function constructStoryReaction(reaction_) {
|
|
25
25
|
const reaction = (0, _0_reaction_js_1.constructReaction)(reaction_.reaction);
|
|
26
26
|
const count = reaction_.count;
|
|
27
|
-
const chosen = reaction_.chosen_order !== undefined
|
|
27
|
+
const chosen = reaction_.chosen_order !== undefined;
|
|
28
28
|
return { reaction, count, isChosen: chosen };
|
|
29
29
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import type { Api } from "../2_tl.js";
|
|
21
|
+
import { type StoryReportOption } from "./0_story_report_option.js";
|
|
22
|
+
export interface StoryReportResultOptionRequired {
|
|
23
|
+
type: "optionRequired";
|
|
24
|
+
title: string;
|
|
25
|
+
options: StoryReportOption[];
|
|
26
|
+
}
|
|
27
|
+
export interface StoryReportResultTextRequired {
|
|
28
|
+
type: "textRequired";
|
|
29
|
+
option: string;
|
|
30
|
+
isOptional: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface StoryReportResultReported {
|
|
33
|
+
type: "reported";
|
|
34
|
+
}
|
|
35
|
+
export type StoryReportResult = StoryReportResultOptionRequired | StoryReportResultTextRequired | StoryReportResultReported;
|
|
36
|
+
export declare function constructStoryReportResult(rr: Api.ReportResult): StoryReportResult;
|
|
37
|
+
//# sourceMappingURL=1_story_report_result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1_story_report_result.d.ts","sourceRoot":"","sources":["../../src/types/1_story_report_result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEhG,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,MAAM,iBAAiB,GAAG,+BAA+B,GAAG,6BAA6B,GAAG,yBAAyB,CAAC;AAE5H,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,GAAG,CAAC,YAAY,GAAG,iBAAiB,CAclF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.constructStoryReportResult = constructStoryReportResult;
|
|
23
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
25
|
+
const _0_story_report_option_js_1 = require("./0_story_report_option.js");
|
|
26
|
+
function constructStoryReportResult(rr) {
|
|
27
|
+
switch (rr._) {
|
|
28
|
+
case "reportResultChooseOption": {
|
|
29
|
+
const title = rr.title;
|
|
30
|
+
const options = rr.options.map(_0_story_report_option_js_1.constructStoryReportOption);
|
|
31
|
+
return { type: "optionRequired", title, options };
|
|
32
|
+
}
|
|
33
|
+
case "reportResultAddComment":
|
|
34
|
+
return { type: "textRequired", option: (0, _1_utilities_js_1.base64EncodeUrlSafe)(rr.option), isOptional: !!rr.optional };
|
|
35
|
+
case "reportResultReported":
|
|
36
|
+
return { type: "reported" };
|
|
37
|
+
}
|
|
38
|
+
(0, _0_deps_js_1.unreachable)();
|
|
39
|
+
}
|
package/script/types/2_chat.js
CHANGED
|
@@ -43,7 +43,7 @@ function constructChat(fullChat, getPeer) {
|
|
|
43
43
|
}
|
|
44
44
|
else if (_2_tl_js_1.Api.is("chatFull", fullChat)) {
|
|
45
45
|
const peer = getPeer({ _: "peerChat", chat_id: fullChat.id });
|
|
46
|
-
if (peer
|
|
46
|
+
if (!peer)
|
|
47
47
|
(0, _0_deps_js_1.unreachable)();
|
|
48
48
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
49
49
|
...peer[0],
|
|
@@ -53,7 +53,7 @@ function constructChat(fullChat, getPeer) {
|
|
|
53
53
|
}
|
|
54
54
|
else if (_2_tl_js_1.Api.is("channelFull", fullChat)) {
|
|
55
55
|
const peer = getPeer({ _: "peerChannel", channel_id: fullChat.id });
|
|
56
|
-
if (peer
|
|
56
|
+
if (!peer)
|
|
57
57
|
(0, _0_deps_js_1.unreachable)();
|
|
58
58
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
59
59
|
...peer[0],
|
|
@@ -27,7 +27,7 @@ const _0_chat_administrator_rights_js_1 = require("./0_chat_administrator_rights
|
|
|
27
27
|
const _0_chat_member_rights_js_1 = require("./0_chat_member_rights.js");
|
|
28
28
|
function constructChatMember(member, participant, getPeer) {
|
|
29
29
|
const peer = "user_id" in participant ? getPeer({ ...participant, _: "peerUser" }) : "peer" in participant ? Array.isArray(participant.peer) ? participant.peer : _2_tl_js_1.Api.is("peerUser", participant.peer) ? getPeer(participant.peer) : (0, _0_deps_js_1.unreachable)() : (0, _0_deps_js_1.unreachable)(); // TODO: support other peer types
|
|
30
|
-
if (peer
|
|
30
|
+
if (!peer || peer[0].type !== "private")
|
|
31
31
|
(0, _0_deps_js_1.unreachable)();
|
|
32
32
|
if (_2_tl_js_1.Api.is("channelParticipant", participant) || _2_tl_js_1.Api.is("chatParticipant", participant)) {
|
|
33
33
|
return {
|
|
@@ -39,7 +39,7 @@ function constructChatMember(member, participant, getPeer) {
|
|
|
39
39
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
40
40
|
status: "creator",
|
|
41
41
|
member,
|
|
42
|
-
isAnonymous: participant.admin_rights.anonymous
|
|
42
|
+
isAnonymous: !!participant.admin_rights.anonymous,
|
|
43
43
|
title: participant.rank,
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -61,7 +61,7 @@ function constructChatMember(member, participant, getPeer) {
|
|
|
61
61
|
until,
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
const isMember = participant.left
|
|
64
|
+
const isMember = !!participant.left;
|
|
65
65
|
const rights = (0, _0_chat_member_rights_js_1.constructChatMemberRights)(participant.banned_rights);
|
|
66
66
|
const tag = participant.rank;
|
|
67
67
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
@@ -123,7 +123,7 @@ function constructMessageEntity(obj) {
|
|
|
123
123
|
return { type: "strikethrough", offset: obj.offset, length: obj.length };
|
|
124
124
|
}
|
|
125
125
|
else if (_2_tl_js_1.Api.is("messageEntityBlockquote", obj)) {
|
|
126
|
-
return (0, _1_utilities_js_1.cleanObject)({ type: "blockquote", offset: obj.offset, length: obj.length, collapsible: obj.collapsed
|
|
126
|
+
return (0, _1_utilities_js_1.cleanObject)({ type: "blockquote", offset: obj.offset, length: obj.length, collapsible: obj.collapsed || undefined });
|
|
127
127
|
}
|
|
128
128
|
else if (_2_tl_js_1.Api.is("messageEntityBankCard", obj)) {
|
|
129
129
|
return { type: "bankCard", offset: obj.offset, length: obj.length };
|
|
@@ -55,8 +55,8 @@ function constructStoryInteractiveArea(area) {
|
|
|
55
55
|
position,
|
|
56
56
|
reaction,
|
|
57
57
|
count: 0, // TODO: count
|
|
58
|
-
isFlipped: area.flipped
|
|
59
|
-
isDark: area.dark
|
|
58
|
+
isFlipped: !!area.flipped,
|
|
59
|
+
isDark: !!area.dark,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
else if (_2_tl_js_1.Api.is("mediaAreaChannelPost", area)) {
|
|
@@ -121,7 +121,7 @@ function storyInteractiveAreaToTlObject(area, getPeer) {
|
|
|
121
121
|
}
|
|
122
122
|
case "reaction": {
|
|
123
123
|
const reaction = (0, _0_reaction_js_1.reactionToTlObject)(area.reaction);
|
|
124
|
-
return { _: "mediaAreaSuggestedReaction", coordinates, reaction, dark: area.isDark
|
|
124
|
+
return { _: "mediaAreaSuggestedReaction", coordinates, reaction, dark: area.isDark || undefined, flipped: area.isFlipped || undefined };
|
|
125
125
|
}
|
|
126
126
|
case "messageReference": {
|
|
127
127
|
const peer = getPeer(_2_tl_js_1.Api.chatIdToPeer(area.messageReference.chatId));
|
|
@@ -38,7 +38,7 @@ function constructChatSettings(settings_) {
|
|
|
38
38
|
businessBotCanReply: settings_.settings.business_bot_can_reply || false,
|
|
39
39
|
distance: settings_.settings.geo_distance,
|
|
40
40
|
joinRequestChatTitle: settings_.settings.request_chat_title,
|
|
41
|
-
joinRequestDate: settings_.settings.request_chat_date
|
|
41
|
+
joinRequestDate: settings_.settings.request_chat_date || undefined,
|
|
42
42
|
businessBotUrl: settings_.settings.business_bot_manage_url,
|
|
43
43
|
messagePrice: settings_.settings.charge_paid_message_stars ? Number(settings_.settings.charge_paid_message_stars) : undefined,
|
|
44
44
|
registrationMonth: settings_.settings.registration_month,
|