@mtkruto/node 0.1.146 → 0.1.147
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 +1 -1
- package/esm/3_types.js +1 -1
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/3_inline_query_manager.js +1 -1
- package/esm/types/0_mini_app_info.d.ts +6 -0
- package/esm/types/0_mini_app_info.js +3 -0
- package/esm/types/0_network_statistics_entry.d.ts +1 -0
- package/esm/types/0_reaction.d.ts +1 -0
- package/esm/types/1_inline_query_result_button.d.ts +2 -2
- package/esm/types/1_input_message_content.d.ts +1 -0
- package/esm/types/1_keyboard_button.d.ts +5 -4
- package/esm/types/1_keyboard_button.js +3 -3
- package/esm/types/1_network_statistics.d.ts +1 -0
- package/esm/types/2_inline_keyboard_button.d.ts +4 -4
- package/esm/types/2_inline_keyboard_button.js +4 -4
- package/esm/types/2_inline_query.d.ts +1 -0
- package/esm/types/2_message_reaction_count.d.ts +1 -0
- package/esm/types/4_inline_query_result.d.ts +1 -0
- package/esm/types/4_inline_query_result.js +1 -1
- package/esm/types/4_message.d.ts +1 -1
- package/esm/types/4_message.js +2 -2
- package/esm/types/6_update.d.ts +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +1 -1
- package/script/3_types.js +1 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/3_inline_query_manager.js +1 -1
- package/script/types/0_mini_app_info.d.ts +6 -0
- package/script/types/0_mini_app_info.js +7 -0
- package/script/types/0_network_statistics_entry.d.ts +1 -0
- package/script/types/0_reaction.d.ts +1 -0
- package/script/types/1_inline_query_result_button.d.ts +2 -2
- package/script/types/1_input_message_content.d.ts +1 -0
- package/script/types/1_keyboard_button.d.ts +5 -4
- package/script/types/1_keyboard_button.js +3 -3
- package/script/types/1_network_statistics.d.ts +1 -0
- package/script/types/2_inline_keyboard_button.d.ts +4 -4
- package/script/types/2_inline_keyboard_button.js +4 -4
- package/script/types/2_inline_query.d.ts +1 -0
- package/script/types/2_message_reaction_count.d.ts +1 -0
- package/script/types/4_inline_query_result.d.ts +1 -0
- package/script/types/4_inline_query_result.js +1 -1
- package/script/types/4_message.d.ts +1 -1
- package/script/types/4_message.js +2 -2
- package/script/types/6_update.d.ts +1 -1
- package/esm/types/0_web_app_info.d.ts +0 -5
- package/esm/types/0_web_app_info.js +0 -3
- package/script/types/0_web_app_info.d.ts +0 -5
- package/script/types/0_web_app_info.js +0 -7
package/esm/3_types.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./types/0_login_url.js";
|
|
|
18
18
|
export * from "./types/0_mask_position.js";
|
|
19
19
|
export * from "./types/0_message_entity.js";
|
|
20
20
|
export * from "./types/0_message_identifier.js";
|
|
21
|
+
export * from "./types/0_mini_app_info.js";
|
|
21
22
|
export * from "./types/0_network_statistics_entry.js";
|
|
22
23
|
export * from "./types/0_parse_mode.js";
|
|
23
24
|
export * from "./types/0_poll_option.js";
|
|
@@ -26,7 +27,6 @@ export * from "./types/0_restriction_reason.js";
|
|
|
26
27
|
export * from "./types/0_thumbnail.js";
|
|
27
28
|
export * from "./types/0_venue.js";
|
|
28
29
|
export * from "./types/0_voice.js";
|
|
29
|
-
export * from "./types/0_web_app_info.js";
|
|
30
30
|
export * from "./types/1_animation.js";
|
|
31
31
|
export * from "./types/1_audio.js";
|
|
32
32
|
export * from "./types/1_bot_command_scope.js";
|
package/esm/3_types.js
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./types/0_login_url.js";
|
|
|
18
18
|
export * from "./types/0_mask_position.js";
|
|
19
19
|
export * from "./types/0_message_entity.js";
|
|
20
20
|
export * from "./types/0_message_identifier.js";
|
|
21
|
+
export * from "./types/0_mini_app_info.js";
|
|
21
22
|
export * from "./types/0_network_statistics_entry.js";
|
|
22
23
|
export * from "./types/0_parse_mode.js";
|
|
23
24
|
export * from "./types/0_poll_option.js";
|
|
@@ -26,7 +27,6 @@ export * from "./types/0_restriction_reason.js";
|
|
|
26
27
|
export * from "./types/0_thumbnail.js";
|
|
27
28
|
export * from "./types/0_venue.js";
|
|
28
29
|
export * from "./types/0_voice.js";
|
|
29
|
-
export * from "./types/0_web_app_info.js";
|
|
30
30
|
export * from "./types/1_animation.js";
|
|
31
31
|
export * from "./types/1_audio.js";
|
|
32
32
|
export * from "./types/1_bot_command_scope.js";
|
package/esm/4_constants.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type PublicKeys = readonly [bigint, [bigint, bigint]][];
|
|
|
4
4
|
export declare const PUBLIC_KEYS: PublicKeys;
|
|
5
5
|
export declare const INITIAL_DC: DC;
|
|
6
6
|
export declare const LAYER = 172;
|
|
7
|
-
export declare const APP_VERSION = "MTKruto 0.1.
|
|
7
|
+
export declare const APP_VERSION = "MTKruto 0.1.147";
|
|
8
8
|
export declare const DEVICE_MODEL: string;
|
|
9
9
|
export declare const LANG_CODE: string;
|
|
10
10
|
export declare const LANG_PACK = "";
|
package/esm/4_constants.js
CHANGED
|
@@ -53,7 +53,7 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
53
53
|
]);
|
|
54
54
|
export const INITIAL_DC = "2";
|
|
55
55
|
export const LAYER = 172;
|
|
56
|
-
export const APP_VERSION = "MTKruto 0.1.
|
|
56
|
+
export const APP_VERSION = "MTKruto 0.1.147";
|
|
57
57
|
// @ts-ignore: lib
|
|
58
58
|
export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
59
59
|
export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
|
@@ -25,7 +25,7 @@ export class InlineQueryManager {
|
|
|
25
25
|
results: await Promise.all(results.map((v) => inlineQueryResultToTlObject(v, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.parseText.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager), __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.usernameResolver.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager)))),
|
|
26
26
|
cache_time: params?.cacheTime ?? 300,
|
|
27
27
|
private: params?.isPersonal ? true : undefined,
|
|
28
|
-
switch_webview: params?.button && params.button.
|
|
28
|
+
switch_webview: params?.button && params.button.miniApp ? new types.InlineBotWebView({ text: params.button.text, url: params.button.miniApp.url }) : undefined,
|
|
29
29
|
switch_pm: params?.button && params.button.startParameter ? new types.InlineBotSwitchPM({ text: params.button.text, start_param: params.button.startParameter }) : undefined,
|
|
30
30
|
gallery: params?.isGallery ? true : undefined,
|
|
31
31
|
next_offset: params?.nextOffset,
|
|
@@ -9,6 +9,7 @@ export interface ReactionCustomEmoji {
|
|
|
9
9
|
type: "customEmoji";
|
|
10
10
|
id: string;
|
|
11
11
|
}
|
|
12
|
+
/** A reaction type. */
|
|
12
13
|
export type Reaction = ReactionEmoji | ReactionCustomEmoji;
|
|
13
14
|
export declare function constructReaction(reaction: enums.Reaction): Reaction;
|
|
14
15
|
export declare function reactionToTlObject(reaction: Reaction): enums.Reaction;
|
|
@@ -85,4 +85,5 @@ export interface InputMessageContentInvoice {
|
|
|
85
85
|
sendEmailToProvider?: boolean;
|
|
86
86
|
isFlexible?: boolean;
|
|
87
87
|
}
|
|
88
|
+
/** The content of a message to be returned as an inline query result. */
|
|
88
89
|
export type InputMessageContent = InputMessageContentText | InputMessageContentLocation | InputMessageContentVenue | InputMessageContentContact | InputMessageContentInvoice;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { enums } from "../2_tl.js";
|
|
2
2
|
import { ChatAdministratorRights } from "./0_chat_administrator_rights.js";
|
|
3
3
|
import { KeyboardButtonPollType } from "./0_keyboard_button_poll_type.js";
|
|
4
|
-
import {
|
|
4
|
+
import { MiniAppInfo } from "./0_mini_app_info.js";
|
|
5
5
|
/** @unlisted */
|
|
6
6
|
export interface KeyboardButtonText {
|
|
7
7
|
text: string;
|
|
@@ -40,9 +40,10 @@ export interface KeyboardButtonRequestPoll extends KeyboardButtonText {
|
|
|
40
40
|
requestPoll: KeyboardButtonPollType;
|
|
41
41
|
}
|
|
42
42
|
/** @unlisted */
|
|
43
|
-
export interface
|
|
44
|
-
|
|
43
|
+
export interface KeyboardButtonMiniApp extends KeyboardButtonText {
|
|
44
|
+
miniApp: MiniAppInfo;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
/** A button of a custom keyboard. */
|
|
47
|
+
export type KeyboardButton = KeyboardButtonText | KeyboardButtonRequestUser | KeyboardButtonRequestChat | KeyboardButtonRequestContact | KeyboardButtonRequestLocation | KeyboardButtonRequestPoll | KeyboardButtonMiniApp;
|
|
47
48
|
export declare function constructKeyboardButton(button_: enums.KeyboardButton): KeyboardButton;
|
|
48
49
|
export declare function keyboardButtonToTlObject(button: KeyboardButton): import("../tl/2_types.js").KeyboardButton_ | import("../tl/2_types.js").KeyboardButtonRequestPhone_ | import("../tl/2_types.js").KeyboardButtonRequestGeoLocation_ | import("../tl/2_types.js").KeyboardButtonRequestPoll_ | import("../tl/2_types.js").KeyboardButtonWebView_ | import("../tl/2_types.js").KeyboardButtonRequestPeer_;
|
|
@@ -72,7 +72,7 @@ export function constructKeyboardButton(button_) {
|
|
|
72
72
|
return button;
|
|
73
73
|
}
|
|
74
74
|
else if (button_ instanceof types.KeyboardButtonWebView || button_ instanceof types.KeyboardButtonSimpleWebView) {
|
|
75
|
-
return { text: button_.text,
|
|
75
|
+
return { text: button_.text, miniApp: { url: button_.url } };
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
78
78
|
UNREACHABLE();
|
|
@@ -126,8 +126,8 @@ export function keyboardButtonToTlObject(button) {
|
|
|
126
126
|
else if ("requestPoll" in button) {
|
|
127
127
|
return new types.KeyboardButtonRequestPoll({ text: button.text, quiz: button.requestPoll.type == "quiz" });
|
|
128
128
|
}
|
|
129
|
-
else if ("
|
|
130
|
-
return new types.KeyboardButtonWebView({ text: button.text, url: button.
|
|
129
|
+
else if ("miniApp" in button) {
|
|
130
|
+
return new types.KeyboardButtonWebView({ text: button.text, url: button.miniApp.url });
|
|
131
131
|
}
|
|
132
132
|
else {
|
|
133
133
|
return new types.KeyboardButton({ text: button.text });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { enums } from "../2_tl.js";
|
|
2
2
|
import { LoginUrl } from "./0_login_url.js";
|
|
3
|
-
import {
|
|
3
|
+
import { MiniAppInfo } from "./0_mini_app_info.js";
|
|
4
4
|
import { UsernameResolver } from "./1__getters.js";
|
|
5
5
|
/** @unlisted */
|
|
6
6
|
export interface _InlineKeyboardButtonBase {
|
|
@@ -15,8 +15,8 @@ export interface InlineKeyboardButtonCallback extends _InlineKeyboardButtonBase
|
|
|
15
15
|
callbackData: string;
|
|
16
16
|
}
|
|
17
17
|
/** @unlisted */
|
|
18
|
-
export interface
|
|
19
|
-
|
|
18
|
+
export interface InlineKeyboardButtonMiniApp extends _InlineKeyboardButtonBase {
|
|
19
|
+
miniApp: MiniAppInfo;
|
|
20
20
|
}
|
|
21
21
|
/** @unlisted */
|
|
22
22
|
export interface InlineKeyboardButtonLogin extends _InlineKeyboardButtonBase {
|
|
@@ -39,6 +39,6 @@ export interface InlineKeyboardButtonPay extends _InlineKeyboardButtonBase {
|
|
|
39
39
|
pay: boolean;
|
|
40
40
|
}
|
|
41
41
|
/** A button of an inline keyboard. */
|
|
42
|
-
export type InlineKeyboardButton = InlineKeyboardButtonURL | InlineKeyboardButtonCallback |
|
|
42
|
+
export type InlineKeyboardButton = InlineKeyboardButtonURL | InlineKeyboardButtonCallback | InlineKeyboardButtonMiniApp | InlineKeyboardButtonLogin | InlineKeyboardButtonSwitchInline | InlineKeyboardButtonSwitchInlineCurrent | InlineKeyboardButtonGame | InlineKeyboardButtonPay;
|
|
43
43
|
export declare function constructInlineKeyboardButton(button_: enums.KeyboardButton): InlineKeyboardButton;
|
|
44
44
|
export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: UsernameResolver): Promise<import("../tl/2_types.js").KeyboardButtonUrl_ | import("../tl/2_types.js").KeyboardButtonCallback_ | import("../tl/2_types.js").KeyboardButtonSwitchInline_ | import("../tl/2_types.js").KeyboardButtonBuy_ | import("../tl/2_types.js").InputKeyboardButtonUrlAuth_ | import("../tl/2_types.js").KeyboardButtonWebView_>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UNREACHABLE } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
-
import {
|
|
3
|
+
import { constructMiniAppInfo } from "./0_mini_app_info.js";
|
|
4
4
|
export function constructInlineKeyboardButton(button_) {
|
|
5
5
|
if (button_ instanceof types.KeyboardButtonUrl) {
|
|
6
6
|
return { text: button_.text, url: button_.url };
|
|
@@ -9,7 +9,7 @@ export function constructInlineKeyboardButton(button_) {
|
|
|
9
9
|
return { text: button_.text, callbackData: new TextDecoder().decode(button_.data) };
|
|
10
10
|
}
|
|
11
11
|
else if (button_ instanceof types.KeyboardButtonWebView || button_ instanceof types.KeyboardButtonSimpleWebView) {
|
|
12
|
-
return { text: button_.text,
|
|
12
|
+
return { text: button_.text, miniApp: constructMiniAppInfo(button_.url) };
|
|
13
13
|
}
|
|
14
14
|
else if (button_ instanceof types.KeyboardButtonUrlAuth) {
|
|
15
15
|
return { text: button_.text, loginUrl: { url: button_.url, forwardText: button_.fwd_text } };
|
|
@@ -39,8 +39,8 @@ export async function inlineKeyboardButtonToTlObject(button, usernameResolver) {
|
|
|
39
39
|
else if ("callbackData" in button) {
|
|
40
40
|
return new types.KeyboardButtonCallback({ text: button.text, data: new TextEncoder().encode(button.callbackData) });
|
|
41
41
|
}
|
|
42
|
-
else if ("
|
|
43
|
-
return new types.KeyboardButtonWebView({ text: button.text, url: button.
|
|
42
|
+
else if ("miniApp" in button) {
|
|
43
|
+
return new types.KeyboardButtonWebView({ text: button.text, url: button.miniApp.url });
|
|
44
44
|
}
|
|
45
45
|
else if ("loginUrl" in button) {
|
|
46
46
|
return new types.InputKeyboardButtonUrlAuth({
|
|
@@ -2,6 +2,7 @@ import { types } from "../2_tl.js";
|
|
|
2
2
|
import { EntityGetter } from "./1__getters.js";
|
|
3
3
|
import { ChatP } from "./1_chat_p.js";
|
|
4
4
|
import { ReactionCount } from "./1_reaction_count.js";
|
|
5
|
+
/** Information on the reactions made to a channel post. */
|
|
5
6
|
export interface MessageReactionCount {
|
|
6
7
|
chat: ChatP;
|
|
7
8
|
messageId: number;
|
|
@@ -185,6 +185,7 @@ export interface InlineQueryResultVoice extends _InlineQueryResultBase, _InlineQ
|
|
|
185
185
|
voiceUrl: string;
|
|
186
186
|
voiceDuration?: number;
|
|
187
187
|
}
|
|
188
|
+
/** A single inline query result. */
|
|
188
189
|
export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice;
|
|
189
190
|
export declare function inlineQueryResultToTlObject(result_: InlineQueryResult, parseText: (text: string, params?: {
|
|
190
191
|
parseMode?: ParseMode;
|
|
@@ -178,7 +178,7 @@ export async function inlineQueryResultToTlObject(result_, parseText, usernameRe
|
|
|
178
178
|
const fileId = FileID.decode(fileId_);
|
|
179
179
|
return new types.InputBotInlineResultDocument({
|
|
180
180
|
id,
|
|
181
|
-
type,
|
|
181
|
+
type: type == "document" ? "file" : type,
|
|
182
182
|
title,
|
|
183
183
|
description,
|
|
184
184
|
document: new types.InputDocument({
|
package/esm/types/4_message.d.ts
CHANGED
package/esm/types/4_message.js
CHANGED
|
@@ -197,8 +197,8 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
197
197
|
return { ...message, userShared };
|
|
198
198
|
}
|
|
199
199
|
else if (message_.action instanceof types.MessageActionBotAllowed) {
|
|
200
|
-
const
|
|
201
|
-
const writeAccessAllowed = {
|
|
200
|
+
const miniAppName = message_.action.app ? message_.action.app[as](types.BotApp).title : undefined;
|
|
201
|
+
const writeAccessAllowed = { miniAppName };
|
|
202
202
|
return { ...message, writeAccessAllowed };
|
|
203
203
|
}
|
|
204
204
|
else if (message_.action instanceof types.MessageActionTopicCreate) {
|
package/esm/types/6_update.d.ts
CHANGED
|
@@ -192,7 +192,7 @@ export interface UpdateChatMember {
|
|
|
192
192
|
chatMember: ChatMemberUpdated;
|
|
193
193
|
}
|
|
194
194
|
/**
|
|
195
|
-
* The status of
|
|
195
|
+
* The status of the current account was changed in a chat.
|
|
196
196
|
* @unlisted
|
|
197
197
|
*/
|
|
198
198
|
export interface UpdateMyChatMember {
|
package/package.json
CHANGED
package/script/3_types.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./types/0_login_url.js";
|
|
|
18
18
|
export * from "./types/0_mask_position.js";
|
|
19
19
|
export * from "./types/0_message_entity.js";
|
|
20
20
|
export * from "./types/0_message_identifier.js";
|
|
21
|
+
export * from "./types/0_mini_app_info.js";
|
|
21
22
|
export * from "./types/0_network_statistics_entry.js";
|
|
22
23
|
export * from "./types/0_parse_mode.js";
|
|
23
24
|
export * from "./types/0_poll_option.js";
|
|
@@ -26,7 +27,6 @@ export * from "./types/0_restriction_reason.js";
|
|
|
26
27
|
export * from "./types/0_thumbnail.js";
|
|
27
28
|
export * from "./types/0_venue.js";
|
|
28
29
|
export * from "./types/0_voice.js";
|
|
29
|
-
export * from "./types/0_web_app_info.js";
|
|
30
30
|
export * from "./types/1_animation.js";
|
|
31
31
|
export * from "./types/1_audio.js";
|
|
32
32
|
export * from "./types/1_bot_command_scope.js";
|
package/script/3_types.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./types/0_login_url.js"), exports);
|
|
|
34
34
|
__exportStar(require("./types/0_mask_position.js"), exports);
|
|
35
35
|
__exportStar(require("./types/0_message_entity.js"), exports);
|
|
36
36
|
__exportStar(require("./types/0_message_identifier.js"), exports);
|
|
37
|
+
__exportStar(require("./types/0_mini_app_info.js"), exports);
|
|
37
38
|
__exportStar(require("./types/0_network_statistics_entry.js"), exports);
|
|
38
39
|
__exportStar(require("./types/0_parse_mode.js"), exports);
|
|
39
40
|
__exportStar(require("./types/0_poll_option.js"), exports);
|
|
@@ -42,7 +43,6 @@ __exportStar(require("./types/0_restriction_reason.js"), exports);
|
|
|
42
43
|
__exportStar(require("./types/0_thumbnail.js"), exports);
|
|
43
44
|
__exportStar(require("./types/0_venue.js"), exports);
|
|
44
45
|
__exportStar(require("./types/0_voice.js"), exports);
|
|
45
|
-
__exportStar(require("./types/0_web_app_info.js"), exports);
|
|
46
46
|
__exportStar(require("./types/1_animation.js"), exports);
|
|
47
47
|
__exportStar(require("./types/1_audio.js"), exports);
|
|
48
48
|
__exportStar(require("./types/1_bot_command_scope.js"), exports);
|
package/script/4_constants.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type PublicKeys = readonly [bigint, [bigint, bigint]][];
|
|
|
4
4
|
export declare const PUBLIC_KEYS: PublicKeys;
|
|
5
5
|
export declare const INITIAL_DC: DC;
|
|
6
6
|
export declare const LAYER = 172;
|
|
7
|
-
export declare const APP_VERSION = "MTKruto 0.1.
|
|
7
|
+
export declare const APP_VERSION = "MTKruto 0.1.147";
|
|
8
8
|
export declare const DEVICE_MODEL: string;
|
|
9
9
|
export declare const LANG_CODE: string;
|
|
10
10
|
export declare const LANG_PACK = "";
|
package/script/4_constants.js
CHANGED
|
@@ -79,7 +79,7 @@ exports.PUBLIC_KEYS = Object.freeze([
|
|
|
79
79
|
]);
|
|
80
80
|
exports.INITIAL_DC = "2";
|
|
81
81
|
exports.LAYER = 172;
|
|
82
|
-
exports.APP_VERSION = "MTKruto 0.1.
|
|
82
|
+
exports.APP_VERSION = "MTKruto 0.1.147";
|
|
83
83
|
// @ts-ignore: lib
|
|
84
84
|
exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
85
85
|
exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
|
@@ -28,7 +28,7 @@ class InlineQueryManager {
|
|
|
28
28
|
results: await Promise.all(results.map((v) => (0, _3_types_js_1.inlineQueryResultToTlObject)(v, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.parseText.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager), __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.usernameResolver.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager)))),
|
|
29
29
|
cache_time: params?.cacheTime ?? 300,
|
|
30
30
|
private: params?.isPersonal ? true : undefined,
|
|
31
|
-
switch_webview: params?.button && params.button.
|
|
31
|
+
switch_webview: params?.button && params.button.miniApp ? new _2_tl_js_1.types.InlineBotWebView({ text: params.button.text, url: params.button.miniApp.url }) : undefined,
|
|
32
32
|
switch_pm: params?.button && params.button.startParameter ? new _2_tl_js_1.types.InlineBotSwitchPM({ text: params.button.text, start_param: params.button.startParameter }) : undefined,
|
|
33
33
|
gallery: params?.isGallery ? true : undefined,
|
|
34
34
|
next_offset: params?.nextOffset,
|
|
@@ -9,6 +9,7 @@ export interface ReactionCustomEmoji {
|
|
|
9
9
|
type: "customEmoji";
|
|
10
10
|
id: string;
|
|
11
11
|
}
|
|
12
|
+
/** A reaction type. */
|
|
12
13
|
export type Reaction = ReactionEmoji | ReactionCustomEmoji;
|
|
13
14
|
export declare function constructReaction(reaction: enums.Reaction): Reaction;
|
|
14
15
|
export declare function reactionToTlObject(reaction: Reaction): enums.Reaction;
|
|
@@ -85,4 +85,5 @@ export interface InputMessageContentInvoice {
|
|
|
85
85
|
sendEmailToProvider?: boolean;
|
|
86
86
|
isFlexible?: boolean;
|
|
87
87
|
}
|
|
88
|
+
/** The content of a message to be returned as an inline query result. */
|
|
88
89
|
export type InputMessageContent = InputMessageContentText | InputMessageContentLocation | InputMessageContentVenue | InputMessageContentContact | InputMessageContentInvoice;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { enums } from "../2_tl.js";
|
|
2
2
|
import { ChatAdministratorRights } from "./0_chat_administrator_rights.js";
|
|
3
3
|
import { KeyboardButtonPollType } from "./0_keyboard_button_poll_type.js";
|
|
4
|
-
import {
|
|
4
|
+
import { MiniAppInfo } from "./0_mini_app_info.js";
|
|
5
5
|
/** @unlisted */
|
|
6
6
|
export interface KeyboardButtonText {
|
|
7
7
|
text: string;
|
|
@@ -40,9 +40,10 @@ export interface KeyboardButtonRequestPoll extends KeyboardButtonText {
|
|
|
40
40
|
requestPoll: KeyboardButtonPollType;
|
|
41
41
|
}
|
|
42
42
|
/** @unlisted */
|
|
43
|
-
export interface
|
|
44
|
-
|
|
43
|
+
export interface KeyboardButtonMiniApp extends KeyboardButtonText {
|
|
44
|
+
miniApp: MiniAppInfo;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
/** A button of a custom keyboard. */
|
|
47
|
+
export type KeyboardButton = KeyboardButtonText | KeyboardButtonRequestUser | KeyboardButtonRequestChat | KeyboardButtonRequestContact | KeyboardButtonRequestLocation | KeyboardButtonRequestPoll | KeyboardButtonMiniApp;
|
|
47
48
|
export declare function constructKeyboardButton(button_: enums.KeyboardButton): KeyboardButton;
|
|
48
49
|
export declare function keyboardButtonToTlObject(button: KeyboardButton): import("../tl/2_types.js").KeyboardButton_ | import("../tl/2_types.js").KeyboardButtonRequestPhone_ | import("../tl/2_types.js").KeyboardButtonRequestGeoLocation_ | import("../tl/2_types.js").KeyboardButtonRequestPoll_ | import("../tl/2_types.js").KeyboardButtonWebView_ | import("../tl/2_types.js").KeyboardButtonRequestPeer_;
|
|
@@ -75,7 +75,7 @@ function constructKeyboardButton(button_) {
|
|
|
75
75
|
return button;
|
|
76
76
|
}
|
|
77
77
|
else if (button_ instanceof _2_tl_js_1.types.KeyboardButtonWebView || button_ instanceof _2_tl_js_1.types.KeyboardButtonSimpleWebView) {
|
|
78
|
-
return { text: button_.text,
|
|
78
|
+
return { text: button_.text, miniApp: { url: button_.url } };
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
81
|
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
@@ -130,8 +130,8 @@ function keyboardButtonToTlObject(button) {
|
|
|
130
130
|
else if ("requestPoll" in button) {
|
|
131
131
|
return new _2_tl_js_1.types.KeyboardButtonRequestPoll({ text: button.text, quiz: button.requestPoll.type == "quiz" });
|
|
132
132
|
}
|
|
133
|
-
else if ("
|
|
134
|
-
return new _2_tl_js_1.types.KeyboardButtonWebView({ text: button.text, url: button.
|
|
133
|
+
else if ("miniApp" in button) {
|
|
134
|
+
return new _2_tl_js_1.types.KeyboardButtonWebView({ text: button.text, url: button.miniApp.url });
|
|
135
135
|
}
|
|
136
136
|
else {
|
|
137
137
|
return new _2_tl_js_1.types.KeyboardButton({ text: button.text });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { enums } from "../2_tl.js";
|
|
2
2
|
import { LoginUrl } from "./0_login_url.js";
|
|
3
|
-
import {
|
|
3
|
+
import { MiniAppInfo } from "./0_mini_app_info.js";
|
|
4
4
|
import { UsernameResolver } from "./1__getters.js";
|
|
5
5
|
/** @unlisted */
|
|
6
6
|
export interface _InlineKeyboardButtonBase {
|
|
@@ -15,8 +15,8 @@ export interface InlineKeyboardButtonCallback extends _InlineKeyboardButtonBase
|
|
|
15
15
|
callbackData: string;
|
|
16
16
|
}
|
|
17
17
|
/** @unlisted */
|
|
18
|
-
export interface
|
|
19
|
-
|
|
18
|
+
export interface InlineKeyboardButtonMiniApp extends _InlineKeyboardButtonBase {
|
|
19
|
+
miniApp: MiniAppInfo;
|
|
20
20
|
}
|
|
21
21
|
/** @unlisted */
|
|
22
22
|
export interface InlineKeyboardButtonLogin extends _InlineKeyboardButtonBase {
|
|
@@ -39,6 +39,6 @@ export interface InlineKeyboardButtonPay extends _InlineKeyboardButtonBase {
|
|
|
39
39
|
pay: boolean;
|
|
40
40
|
}
|
|
41
41
|
/** A button of an inline keyboard. */
|
|
42
|
-
export type InlineKeyboardButton = InlineKeyboardButtonURL | InlineKeyboardButtonCallback |
|
|
42
|
+
export type InlineKeyboardButton = InlineKeyboardButtonURL | InlineKeyboardButtonCallback | InlineKeyboardButtonMiniApp | InlineKeyboardButtonLogin | InlineKeyboardButtonSwitchInline | InlineKeyboardButtonSwitchInlineCurrent | InlineKeyboardButtonGame | InlineKeyboardButtonPay;
|
|
43
43
|
export declare function constructInlineKeyboardButton(button_: enums.KeyboardButton): InlineKeyboardButton;
|
|
44
44
|
export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: UsernameResolver): Promise<import("../tl/2_types.js").KeyboardButtonUrl_ | import("../tl/2_types.js").KeyboardButtonCallback_ | import("../tl/2_types.js").KeyboardButtonSwitchInline_ | import("../tl/2_types.js").KeyboardButtonBuy_ | import("../tl/2_types.js").InputKeyboardButtonUrlAuth_ | import("../tl/2_types.js").KeyboardButtonWebView_>;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.inlineKeyboardButtonToTlObject = exports.constructInlineKeyboardButton = void 0;
|
|
4
4
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
5
5
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
6
|
-
const
|
|
6
|
+
const _0_mini_app_info_js_1 = require("./0_mini_app_info.js");
|
|
7
7
|
function constructInlineKeyboardButton(button_) {
|
|
8
8
|
if (button_ instanceof _2_tl_js_1.types.KeyboardButtonUrl) {
|
|
9
9
|
return { text: button_.text, url: button_.url };
|
|
@@ -12,7 +12,7 @@ function constructInlineKeyboardButton(button_) {
|
|
|
12
12
|
return { text: button_.text, callbackData: new TextDecoder().decode(button_.data) };
|
|
13
13
|
}
|
|
14
14
|
else if (button_ instanceof _2_tl_js_1.types.KeyboardButtonWebView || button_ instanceof _2_tl_js_1.types.KeyboardButtonSimpleWebView) {
|
|
15
|
-
return { text: button_.text,
|
|
15
|
+
return { text: button_.text, miniApp: (0, _0_mini_app_info_js_1.constructMiniAppInfo)(button_.url) };
|
|
16
16
|
}
|
|
17
17
|
else if (button_ instanceof _2_tl_js_1.types.KeyboardButtonUrlAuth) {
|
|
18
18
|
return { text: button_.text, loginUrl: { url: button_.url, forwardText: button_.fwd_text } };
|
|
@@ -43,8 +43,8 @@ async function inlineKeyboardButtonToTlObject(button, usernameResolver) {
|
|
|
43
43
|
else if ("callbackData" in button) {
|
|
44
44
|
return new _2_tl_js_1.types.KeyboardButtonCallback({ text: button.text, data: new TextEncoder().encode(button.callbackData) });
|
|
45
45
|
}
|
|
46
|
-
else if ("
|
|
47
|
-
return new _2_tl_js_1.types.KeyboardButtonWebView({ text: button.text, url: button.
|
|
46
|
+
else if ("miniApp" in button) {
|
|
47
|
+
return new _2_tl_js_1.types.KeyboardButtonWebView({ text: button.text, url: button.miniApp.url });
|
|
48
48
|
}
|
|
49
49
|
else if ("loginUrl" in button) {
|
|
50
50
|
return new _2_tl_js_1.types.InputKeyboardButtonUrlAuth({
|
|
@@ -2,6 +2,7 @@ import { types } from "../2_tl.js";
|
|
|
2
2
|
import { EntityGetter } from "./1__getters.js";
|
|
3
3
|
import { ChatP } from "./1_chat_p.js";
|
|
4
4
|
import { ReactionCount } from "./1_reaction_count.js";
|
|
5
|
+
/** Information on the reactions made to a channel post. */
|
|
5
6
|
export interface MessageReactionCount {
|
|
6
7
|
chat: ChatP;
|
|
7
8
|
messageId: number;
|
|
@@ -185,6 +185,7 @@ export interface InlineQueryResultVoice extends _InlineQueryResultBase, _InlineQ
|
|
|
185
185
|
voiceUrl: string;
|
|
186
186
|
voiceDuration?: number;
|
|
187
187
|
}
|
|
188
|
+
/** A single inline query result. */
|
|
188
189
|
export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice;
|
|
189
190
|
export declare function inlineQueryResultToTlObject(result_: InlineQueryResult, parseText: (text: string, params?: {
|
|
190
191
|
parseMode?: ParseMode;
|
|
@@ -181,7 +181,7 @@ async function inlineQueryResultToTlObject(result_, parseText, usernameResolver)
|
|
|
181
181
|
const fileId = _0__file_id_js_1.FileID.decode(fileId_);
|
|
182
182
|
return new _2_tl_js_1.types.InputBotInlineResultDocument({
|
|
183
183
|
id,
|
|
184
|
-
type,
|
|
184
|
+
type: type == "document" ? "file" : type,
|
|
185
185
|
title,
|
|
186
186
|
description,
|
|
187
187
|
document: new _2_tl_js_1.types.InputDocument({
|
|
@@ -201,8 +201,8 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
|
|
|
201
201
|
return { ...message, userShared };
|
|
202
202
|
}
|
|
203
203
|
else if (message_.action instanceof _2_tl_js_1.types.MessageActionBotAllowed) {
|
|
204
|
-
const
|
|
205
|
-
const writeAccessAllowed = {
|
|
204
|
+
const miniAppName = message_.action.app ? message_.action.app[_2_tl_js_1.as](_2_tl_js_1.types.BotApp).title : undefined;
|
|
205
|
+
const writeAccessAllowed = { miniAppName };
|
|
206
206
|
return { ...message, writeAccessAllowed };
|
|
207
207
|
}
|
|
208
208
|
else if (message_.action instanceof _2_tl_js_1.types.MessageActionTopicCreate) {
|
|
@@ -192,7 +192,7 @@ export interface UpdateChatMember {
|
|
|
192
192
|
chatMember: ChatMemberUpdated;
|
|
193
193
|
}
|
|
194
194
|
/**
|
|
195
|
-
* The status of
|
|
195
|
+
* The status of the current account was changed in a chat.
|
|
196
196
|
* @unlisted
|
|
197
197
|
*/
|
|
198
198
|
export interface UpdateMyChatMember {
|