@mtkruto/node 0.153.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/4_constants.d.ts +1 -0
- package/esm/4_constants.d.ts.map +1 -1
- package/esm/4_constants.js +1 -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/1_client_plain.d.ts +1 -1
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +25 -13
- package/esm/client/2_client_encrypted.d.ts +6 -3
- package/esm/client/2_client_encrypted.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.js +166 -49
- package/esm/client/2_file_manager.js +1 -1
- package/esm/client/2_network_statistics_manager.d.ts.map +1 -1
- package/esm/client/2_network_statistics_manager.js +3 -2
- package/esm/client/2_payment_manager.js +2 -2
- package/esm/client/2_takeout_manager.js +2 -2
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +16 -11
- 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 +102 -3
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +130 -2
- 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/0_session_state.d.ts +1 -0
- package/esm/session/0_session_state.d.ts.map +1 -1
- package/esm/session/0_session_state.js +8 -4
- package/esm/session/1_session.d.ts +1 -0
- package/esm/session/1_session.d.ts.map +1 -1
- package/esm/session/1_session.js +3 -0
- package/esm/session/2_session_encrypted.d.ts +11 -6
- package/esm/session/2_session_encrypted.d.ts.map +1 -1
- package/esm/session/2_session_encrypted.js +20 -12
- 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/4_constants.d.ts +1 -0
- package/script/4_constants.d.ts.map +1 -1
- package/script/4_constants.js +2 -1
- 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/1_client_plain.d.ts +1 -1
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +24 -12
- package/script/client/2_client_encrypted.d.ts +6 -3
- package/script/client/2_client_encrypted.d.ts.map +1 -1
- package/script/client/2_client_encrypted.js +166 -49
- package/script/client/2_file_manager.js +1 -1
- package/script/client/2_network_statistics_manager.d.ts.map +1 -1
- package/script/client/2_network_statistics_manager.js +3 -2
- package/script/client/2_payment_manager.js +2 -2
- package/script/client/2_takeout_manager.js +2 -2
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +16 -11
- 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 +102 -3
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +130 -2
- 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/0_session_state.d.ts +1 -0
- package/script/session/0_session_state.d.ts.map +1 -1
- package/script/session/0_session_state.js +8 -4
- package/script/session/1_session.d.ts +1 -0
- package/script/session/1_session.d.ts.map +1 -1
- package/script/session/1_session.js +3 -0
- package/script/session/2_session_encrypted.d.ts +11 -6
- package/script/session/2_session_encrypted.d.ts.map +1 -1
- package/script/session/2_session_encrypted.js +20 -12
- 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
|
@@ -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,
|
|
@@ -26,7 +26,7 @@ const _2_user_js_1 = require("./2_user.js");
|
|
|
26
26
|
function constructForwardHeader(fwdHeader, getPeer) {
|
|
27
27
|
if (fwdHeader.channel_post && fwdHeader.from_id?._ === "peerChannel") {
|
|
28
28
|
const peer = getPeer(fwdHeader.from_id);
|
|
29
|
-
if (peer
|
|
29
|
+
if (!peer) {
|
|
30
30
|
(0, _0_deps_js_1.unreachable)();
|
|
31
31
|
}
|
|
32
32
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
@@ -39,7 +39,7 @@ function constructForwardHeader(fwdHeader, getPeer) {
|
|
|
39
39
|
}
|
|
40
40
|
else if (fwdHeader.from_id?._ === "peerChannel") {
|
|
41
41
|
const peer = getPeer(fwdHeader.from_id);
|
|
42
|
-
if (peer
|
|
42
|
+
if (!peer) {
|
|
43
43
|
(0, _0_deps_js_1.unreachable)();
|
|
44
44
|
}
|
|
45
45
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
@@ -51,7 +51,7 @@ function constructForwardHeader(fwdHeader, getPeer) {
|
|
|
51
51
|
}
|
|
52
52
|
else if (fwdHeader.from_id?._ === "peerUser") {
|
|
53
53
|
const peer = getPeer(fwdHeader.from_id);
|
|
54
|
-
if (peer
|
|
54
|
+
if (!peer || peer[0].type !== "private") {
|
|
55
55
|
(0, _0_deps_js_1.unreachable)();
|
|
56
56
|
}
|
|
57
57
|
return {
|
|
@@ -27,7 +27,7 @@ const _0_location_js_1 = require("./0_location.js");
|
|
|
27
27
|
const _2_user_js_1 = require("./2_user.js");
|
|
28
28
|
function constructInlineQuery(query_, getPeer) {
|
|
29
29
|
const peer = getPeer({ _: "peerUser", user_id: query_.user_id });
|
|
30
|
-
if (peer
|
|
30
|
+
if (!peer) {
|
|
31
31
|
(0, _0_deps_js_1.unreachable)();
|
|
32
32
|
}
|
|
33
33
|
const user = (0, _2_user_js_1.constructUser2)(peer[0]);
|
|
@@ -30,8 +30,8 @@ function constructInviteLink(inviteLink_, getPeer) {
|
|
|
30
30
|
}
|
|
31
31
|
const inviteLink = inviteLink_.link;
|
|
32
32
|
const creator = (0, _2_user_js_1.constructUser2)(peer[0]);
|
|
33
|
-
const requiresApproval = inviteLink_.request_needed
|
|
34
|
-
const isRevoked = inviteLink_.revoked
|
|
33
|
+
const requiresApproval = !!inviteLink_.request_needed;
|
|
34
|
+
const isRevoked = !!inviteLink_.revoked;
|
|
35
35
|
const title = inviteLink_.title;
|
|
36
36
|
const expiresAt = inviteLink_.expire_date;
|
|
37
37
|
const limit = inviteLink_.usage_limit;
|
package/script/types/3_story.js
CHANGED
|
@@ -36,19 +36,19 @@ function constructStory(story, peer, getPeer) {
|
|
|
36
36
|
const chat = peer_[0];
|
|
37
37
|
const date = story.date;
|
|
38
38
|
const interactiveAreas = (story.media_areas ?? []).map(_2_story_interactive_area_js_1.constructStoryInteractiveArea);
|
|
39
|
-
const isHighlighted = story.pinned
|
|
39
|
+
const isHighlighted = !!story.pinned;
|
|
40
40
|
const content = (0, _2_story_content_js_1.constructStoryContent)(story.media);
|
|
41
41
|
const caption = story.caption;
|
|
42
42
|
const captionEntities = story.entities?.map(_2_message_entity_js_1.constructMessageEntity).filter((v) => !!v);
|
|
43
43
|
const privacy = story.privacy ? (0, _2_story_privacy_js_1.constructStoryPrivacy)(story.privacy) : undefined;
|
|
44
44
|
const interactions = story.views ? (0, _2_story_interactions_js_1.constructStoryInteractions)(story.views) : undefined;
|
|
45
45
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
46
|
-
isOutgoing: story.out
|
|
46
|
+
isOutgoing: !!story.out,
|
|
47
47
|
id,
|
|
48
48
|
chat,
|
|
49
49
|
date,
|
|
50
50
|
content,
|
|
51
|
-
isEdited: story.edited
|
|
51
|
+
isEdited: !!story.edited,
|
|
52
52
|
interactiveAreas,
|
|
53
53
|
isHighlighted,
|
|
54
54
|
interactions,
|
package/script/types/4_gift.js
CHANGED
|
@@ -96,7 +96,7 @@ function constructGiftNonUpgraded(gift) {
|
|
|
96
96
|
const isSoldOut = isLimited ? !!gift.sold_out : undefined;
|
|
97
97
|
const isBirthday = !!gift.birthday;
|
|
98
98
|
const conversionPrice = Number(gift.convert_stars);
|
|
99
|
-
const firstSaleDate = isLimited ? gift.first_sale_date
|
|
99
|
+
const firstSaleDate = isLimited ? gift.first_sale_date || undefined : undefined;
|
|
100
100
|
const lastSaleDate = isLimited ? gift.last_sale_date ? gift.last_sale_date : undefined : undefined;
|
|
101
101
|
const upgradePrice = gift.upgrade_stars ? Number(gift.upgrade_stars) : undefined;
|
|
102
102
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
@@ -26,14 +26,14 @@ const _2_tl_js_1 = require("../2_tl.js");
|
|
|
26
26
|
const _2_message_entity_js_1 = require("./2_message_entity.js");
|
|
27
27
|
const _4_gift_js_1 = require("./4_gift.js");
|
|
28
28
|
function constructGiftNonUpgradedInformation(action, getPeer) {
|
|
29
|
-
const isNameHidden = action.name_hidden
|
|
30
|
-
const isSaved = action.saved
|
|
31
|
-
const isConverted = action.converted
|
|
32
|
-
const isUpgraded = action.upgraded
|
|
33
|
-
const isRefunded = action.refunded
|
|
34
|
-
const isUpgradable = action.can_upgrade
|
|
35
|
-
const isPrepaidUpgrade = action.prepaid_upgrade
|
|
36
|
-
const isUpgradedSeparately = action.upgrade_separate
|
|
29
|
+
const isNameHidden = !!action.name_hidden;
|
|
30
|
+
const isSaved = !!action.saved;
|
|
31
|
+
const isConverted = !!action.converted;
|
|
32
|
+
const isUpgraded = !!action.upgraded;
|
|
33
|
+
const isRefunded = !!action.refunded;
|
|
34
|
+
const isUpgradable = !!action.can_upgrade;
|
|
35
|
+
const isPrepaidUpgrade = !!action.prepaid_upgrade;
|
|
36
|
+
const isUpgradedSeparately = !!action.upgrade_separate;
|
|
37
37
|
const gift = (0, _4_gift_js_1.constructGiftNonUpgraded)(_2_tl_js_1.Api.as("starGift", action.gift));
|
|
38
38
|
const message = action.message?.text;
|
|
39
39
|
const messageEntities = action.message?.entities.map((v) => (0, _2_message_entity_js_1.constructMessageEntity)(v)).filter((v) => v !== null);
|
|
@@ -25,11 +25,11 @@ const _1_utilities_js_1 = require("../1_utilities.js");
|
|
|
25
25
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
26
26
|
const _4_gift_js_1 = require("./4_gift.js");
|
|
27
27
|
function constructGiftUpgradedInformation(action, getPeer) {
|
|
28
|
-
const isUpgraded = action.upgrade
|
|
29
|
-
const isTransferred = action.transferred
|
|
30
|
-
const isSaved = action.saved
|
|
31
|
-
const isRefunded = action.refunded
|
|
32
|
-
const isPrepaidUpgrade = action.prepaid_upgrade
|
|
28
|
+
const isUpgraded = !!action.upgrade;
|
|
29
|
+
const isTransferred = !!action.transferred;
|
|
30
|
+
const isSaved = !!action.saved;
|
|
31
|
+
const isRefunded = !!action.refunded;
|
|
32
|
+
const isPrepaidUpgrade = !!action.prepaid_upgrade;
|
|
33
33
|
const gift = (0, _4_gift_js_1.constructGiftUpgraded)(_2_tl_js_1.Api.as("starGiftUnique", action.gift), getPeer);
|
|
34
34
|
const exportableAt = action.can_export_at;
|
|
35
35
|
const transferPrice = action.transfer_stars ? Number(action.transfer_stars) : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"6_poll_media.d.ts","sourceRoot":"","sources":["../../src/types/6_poll_media.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAoB,KAAK,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE7E,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,qBAAqB;IACrB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,mBAAmB;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,eAAe;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,sCAAsC;IACtC,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"6_poll_media.d.ts","sourceRoot":"","sources":["../../src/types/6_poll_media.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAoB,KAAK,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE7E,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,qBAAqB;IACrB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,mBAAmB;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,eAAe;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,sCAAsC;IACtC,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,oBAAoB;IACpB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,qCAAqC;AACrC,MAAM,MAAM,SAAS,GAAG,kBAAkB,GAAG,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,cAAc,GAAG,aAAa,CAAC;AAE1K,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAsElJ"}
|
|
@@ -401,7 +401,7 @@ async function inlineQueryResultToTlObject(result_, parseText, usernameResolver,
|
|
|
401
401
|
const title = "title" in result_ ? result_.title : undefined;
|
|
402
402
|
const description = "description" in result_ ? result_.description : undefined;
|
|
403
403
|
if (document !== null) {
|
|
404
|
-
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb
|
|
404
|
+
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, content: document, send_message: { _: "inputBotInlineMessageMediaAuto", message, entities, reply_markup: replyMarkup } };
|
|
405
405
|
}
|
|
406
406
|
else if (fileId_ !== null) {
|
|
407
407
|
const fileId = (0, _file_id_js_1.deserializeFileId)(fileId_);
|
|
@@ -436,10 +436,10 @@ async function inlineQueryResultToTlObject(result_, parseText, usernameResolver,
|
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
438
|
else if (result_.type === "location") {
|
|
439
|
-
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb
|
|
439
|
+
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, send_message: { _: "inputBotInlineMessageMediaGeo", geo_point: { _: "inputGeoPoint", lat: result_.latitude, long: result_.longitude, accuracy_radius: result_.horizontalAccuracy }, heading: result_.heading, period: result_.livePeriod, proximity_notification_radius: result_.proximityAlertRadius, reply_markup: replyMarkup } };
|
|
440
440
|
}
|
|
441
441
|
else if (result_.type === "game") {
|
|
442
|
-
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb
|
|
442
|
+
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, send_message: { _: "inputBotInlineMessageGame", reply_markup: replyMarkup } };
|
|
443
443
|
}
|
|
444
444
|
else if (result_.type === "article") {
|
|
445
445
|
let sendMessage;
|
|
@@ -483,10 +483,10 @@ async function inlineQueryResultToTlObject(result_, parseText, usernameResolver,
|
|
|
483
483
|
break;
|
|
484
484
|
case "text": {
|
|
485
485
|
const [message, entities] = parseText(result_.messageContent.text, { entities: result_.messageContent.entities, parseMode: result_.messageContent.parseMode });
|
|
486
|
-
const noWebpage = result_.messageContent?.linkPreview && result_.messageContent?.linkPreview.type === "input" && result_.messageContent?.linkPreview.isDisabled
|
|
487
|
-
const invertMedia = result_.messageContent?.linkPreview?.isAboveText
|
|
486
|
+
const noWebpage = result_.messageContent?.linkPreview && result_.messageContent?.linkPreview.type === "input" && result_.messageContent?.linkPreview.isDisabled || undefined;
|
|
487
|
+
const invertMedia = result_.messageContent?.linkPreview?.isAboveText || undefined;
|
|
488
488
|
if (result_.messageContent.linkPreview?.url) {
|
|
489
|
-
sendMessage = { _: "inputBotInlineMessageMediaWebPage", url: result_.messageContent.linkPreview.url, force_large_media: result_.messageContent.linkPreview.mediaSize === "large"
|
|
489
|
+
sendMessage = { _: "inputBotInlineMessageMediaWebPage", url: result_.messageContent.linkPreview.url, force_large_media: result_.messageContent.linkPreview.mediaSize === "large" || undefined, force_small_media: result_.messageContent.linkPreview.mediaSize === "small" || undefined, optional: !message.length || undefined, message, entities, invert_media: invertMedia, reply_markup: replyMarkup };
|
|
490
490
|
}
|
|
491
491
|
else {
|
|
492
492
|
sendMessage = { _: "inputBotInlineMessageText", message, entities, no_webpage: noWebpage, invert_media: invertMedia, reply_markup: replyMarkup };
|
|
@@ -494,13 +494,13 @@ async function inlineQueryResultToTlObject(result_, parseText, usernameResolver,
|
|
|
494
494
|
break;
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb
|
|
497
|
+
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, send_message: sendMessage };
|
|
498
498
|
}
|
|
499
499
|
else if (result_.type === "venue") {
|
|
500
500
|
if (!result_.foursquareId || !result_.foursquareType) {
|
|
501
501
|
(0, _0_deps_js_1.unreachable)();
|
|
502
502
|
}
|
|
503
|
-
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb
|
|
503
|
+
return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, send_message: { _: "inputBotInlineMessageMediaVenue", geo_point: { _: "inputGeoPoint", long: result_.longitude, lat: result_.latitude }, address: result_.address, provider: "foursquare", title: result_.title, venue_id: result_.foursquareId, venue_type: result_.foursquareType, reply_markup: replyMarkup } };
|
|
504
504
|
}
|
|
505
505
|
else {
|
|
506
506
|
(0, _0_deps_js_1.unreachable)();
|
|
@@ -30,7 +30,7 @@ export interface PollOption {
|
|
|
30
30
|
text: string;
|
|
31
31
|
/** The entities of the option's text. */
|
|
32
32
|
entities: MessageEntity[];
|
|
33
|
-
/** Number of users that voted this option. */
|
|
33
|
+
/** Number of users that voted for this option. */
|
|
34
34
|
voterCount: number;
|
|
35
35
|
/** Whether this option has been chosen. */
|
|
36
36
|
isChosen: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"7_poll_option.d.ts","sourceRoot":"","sources":["../../src/types/7_poll_option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEvE,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,
|
|
1
|
+
{"version":3,"file":"7_poll_option.d.ts","sourceRoot":"","sources":["../../src/types/7_poll_option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEvE,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,oDAAoD;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAezL"}
|
|
@@ -24,7 +24,7 @@ const _1_utilities_js_1 = require("../1_utilities.js");
|
|
|
24
24
|
const _7_inline_query_result_js_1 = require("./7_inline_query_result.js");
|
|
25
25
|
function constructInlineQueryAnswer(results) {
|
|
26
26
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
27
|
-
id: results.query_id
|
|
27
|
+
id: String(results.query_id),
|
|
28
28
|
results: results.results.map(_7_inline_query_result_js_1.constructInlineQueryResult),
|
|
29
29
|
nextOffset: results.next_offset,
|
|
30
30
|
});
|
|
@@ -158,7 +158,7 @@ async function constructServiceMessage(message_, chat, getPeer, getMessage, getS
|
|
|
158
158
|
id: message_.id,
|
|
159
159
|
chat,
|
|
160
160
|
date: message_.date,
|
|
161
|
-
isTopicMessage: message_.reply_to && _2_tl_js_1.Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.forum_topic
|
|
161
|
+
isTopicMessage: !!(message_.reply_to && _2_tl_js_1.Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.forum_topic),
|
|
162
162
|
...getSender(message_, getPeer),
|
|
163
163
|
};
|
|
164
164
|
if (_2_tl_js_1.Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.reply_to_msg_id) {
|
|
@@ -351,11 +351,11 @@ async function constructMessage(message_, getPeer, getMessage, getStickerSetName
|
|
|
351
351
|
date: message_.date,
|
|
352
352
|
views: message_.views,
|
|
353
353
|
forwards: message_.forwards,
|
|
354
|
-
isTopicMessage: message_.reply_to && _2_tl_js_1.Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.forum_topic
|
|
354
|
+
isTopicMessage: !!(message_.reply_to && _2_tl_js_1.Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.forum_topic),
|
|
355
355
|
hasProtectedContent: message_.noforwards || false,
|
|
356
356
|
senderBoostCount: message_.from_boosts_applied,
|
|
357
357
|
effectId: message_.effect ? String(message_.effect) : undefined,
|
|
358
|
-
isScheduled: message_.from_scheduled
|
|
358
|
+
isScheduled: message_.from_scheduled || undefined,
|
|
359
359
|
...getSender(message_, getPeer),
|
|
360
360
|
for: message_.guestchat_via_from ? getPeer(message_.guestchat_via_from)?.[0] : undefined,
|
|
361
361
|
};
|