@mtkruto/node 0.0.998 → 0.0.999
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 +39 -3
- package/esm/3_types.js +39 -3
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/3_types.d.ts +1 -5
- package/esm/client/4_client.d.ts +18 -2
- package/esm/client/4_client.js +37 -21
- package/esm/connection/1_connection_web_socket.js +2 -1
- package/esm/types/0_bot_command.d.ts +4 -0
- package/esm/types/0_chat_id.d.ts +4 -0
- package/esm/types/0_chat_id.js +1 -0
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_input_contact_message_content.d.ts +6 -0
- package/esm/types/0_input_contact_message_content.js +1 -0
- package/esm/types/0_input_location_message_content.d.ts +8 -0
- package/esm/types/0_input_location_message_content.js +1 -0
- package/esm/types/0_input_venue_message_content.d.ts +10 -0
- package/esm/types/0_input_venue_message_content.js +1 -0
- package/esm/types/0_labeled_price.d.ts +4 -0
- package/esm/types/0_labeled_price.js +1 -0
- package/esm/types/0_parse_mode.d.ts +1 -0
- package/esm/types/0_parse_mode.js +1 -0
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
- package/esm/types/1__getters.js +1 -0
- package/esm/types/1_bot_command_scope.d.ts +32 -0
- package/esm/types/1_bot_command_scope.js +27 -0
- package/esm/types/1_inline_query_result_button.d.ts +6 -0
- package/esm/types/1_inline_query_result_button.js +1 -0
- package/esm/types/1_input_invoice_message_content.d.ts +23 -0
- package/esm/types/1_input_invoice_message_content.js +1 -0
- package/esm/types/1_input_text_message_content.d.ts +8 -0
- package/esm/types/1_input_text_message_content.js +1 -0
- package/esm/types/1_photo.js +1 -1
- package/esm/types/2_game.js +1 -1
- package/{script/types/1_inline_keyboard_button.d.ts → esm/types/2_inline_keyboard_button.d.ts} +2 -2
- package/esm/types/2_inline_query.d.ts +1 -1
- package/esm/types/2_input_message_content.d.ts +6 -0
- package/esm/types/2_input_message_content.js +1 -0
- package/esm/types/{2_inline_keyboard_markup.d.ts → 3_inline_keyboard_markup.d.ts} +3 -2
- package/esm/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +1 -1
- package/esm/types/3_message.d.ts +2 -2
- package/esm/types/3_message.js +2 -2
- package/esm/types/4_callback_query.d.ts +1 -1
- package/esm/types/4_inline_query_result_article.d.ts +15 -0
- package/esm/types/4_inline_query_result_article.js +1 -0
- package/esm/types/4_inline_query_result_audio.d.ts +17 -0
- package/esm/types/4_inline_query_result_audio.js +1 -0
- package/esm/types/4_inline_query_result_cached_audio.d.ts +14 -0
- package/esm/types/4_inline_query_result_cached_audio.js +1 -0
- package/esm/types/4_inline_query_result_cached_document.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_document.js +1 -0
- package/esm/types/4_inline_query_result_cached_gif.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_gif.js +1 -0
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_mpeg4_gif.js +1 -0
- package/esm/types/4_inline_query_result_cached_photo.d.ts +16 -0
- package/esm/types/4_inline_query_result_cached_photo.js +1 -0
- package/esm/types/4_inline_query_result_cached_sticker.d.ts +9 -0
- package/esm/types/4_inline_query_result_cached_sticker.js +1 -0
- package/esm/types/4_inline_query_result_cached_video.d.ts +16 -0
- package/esm/types/4_inline_query_result_cached_video.js +1 -0
- package/esm/types/4_inline_query_result_cached_voice.d.ts +15 -0
- package/esm/types/4_inline_query_result_cached_voice.js +1 -0
- package/esm/types/4_inline_query_result_contact.d.ts +15 -0
- package/esm/types/4_inline_query_result_contact.js +1 -0
- package/esm/types/4_inline_query_result_document.d.ts +18 -0
- package/esm/types/4_inline_query_result_document.js +1 -0
- package/esm/types/4_inline_query_result_game.d.ts +7 -0
- package/esm/types/4_inline_query_result_game.js +1 -0
- package/esm/types/4_inline_query_result_gif.d.ts +20 -0
- package/esm/types/4_inline_query_result_gif.js +1 -0
- package/esm/types/4_inline_query_result_location.d.ts +18 -0
- package/esm/types/4_inline_query_result_location.js +1 -0
- package/esm/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
- package/esm/types/4_inline_query_result_mpeg4_gif.js +1 -0
- package/esm/types/4_inline_query_result_photo.d.ts +19 -0
- package/esm/types/4_inline_query_result_photo.js +1 -0
- package/esm/types/4_inline_query_result_venue.d.ts +19 -0
- package/esm/types/4_inline_query_result_venue.js +1 -0
- package/esm/types/4_inline_query_result_video.d.ts +21 -0
- package/esm/types/4_inline_query_result_video.js +1 -0
- package/esm/types/4_inline_query_result_voice.d.ts +16 -0
- package/esm/types/4_inline_query_result_voice.js +1 -0
- package/esm/types/4_reply_markup.d.ts +7 -0
- package/esm/types/4_reply_markup.js +22 -0
- package/esm/types/5_inline_query_result.d.ts +29 -0
- package/esm/types/5_inline_query_result.js +256 -0
- package/package.json +1 -1
- package/script/3_types.d.ts +39 -3
- package/script/3_types.js +39 -3
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/3_types.d.ts +1 -5
- package/script/client/4_client.d.ts +18 -2
- package/script/client/4_client.js +36 -20
- package/script/connection/1_connection_web_socket.js +2 -1
- package/script/types/0_bot_command.d.ts +4 -0
- package/script/types/0_chat_id.d.ts +4 -0
- package/script/types/0_chat_id.js +2 -0
- package/script/types/0_chat_photo.js +7 -7
- package/script/types/0_input_contact_message_content.d.ts +6 -0
- package/script/types/0_input_contact_message_content.js +2 -0
- package/script/types/0_input_location_message_content.d.ts +8 -0
- package/script/types/0_input_location_message_content.js +2 -0
- package/script/types/0_input_venue_message_content.d.ts +10 -0
- package/script/types/0_input_venue_message_content.js +2 -0
- package/script/types/0_labeled_price.d.ts +4 -0
- package/script/types/0_labeled_price.js +2 -0
- package/script/types/0_parse_mode.d.ts +1 -0
- package/script/types/0_parse_mode.js +2 -0
- package/script/types/0_thumbnail.js +5 -5
- package/script/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
- package/script/types/1__getters.js +2 -0
- package/script/types/1_bot_command_scope.d.ts +32 -0
- package/script/types/1_bot_command_scope.js +31 -0
- package/script/types/1_inline_query_result_button.d.ts +6 -0
- package/script/types/1_inline_query_result_button.js +2 -0
- package/script/types/1_input_invoice_message_content.d.ts +23 -0
- package/script/types/1_input_invoice_message_content.js +2 -0
- package/script/types/1_input_text_message_content.d.ts +8 -0
- package/script/types/1_input_text_message_content.js +2 -0
- package/script/types/1_photo.js +5 -5
- package/script/types/2_game.js +3 -3
- package/{esm/types/1_inline_keyboard_button.d.ts → script/types/2_inline_keyboard_button.d.ts} +2 -2
- package/script/types/2_inline_query.d.ts +1 -1
- package/script/types/2_input_message_content.d.ts +6 -0
- package/script/types/2_input_message_content.js +2 -0
- package/script/types/{2_inline_keyboard_markup.d.ts → 3_inline_keyboard_markup.d.ts} +3 -2
- package/script/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +3 -3
- package/script/types/3_message.d.ts +2 -2
- package/script/types/3_message.js +12 -12
- package/script/types/4_callback_query.d.ts +1 -1
- package/script/types/4_inline_query_result_article.d.ts +15 -0
- package/script/types/4_inline_query_result_article.js +2 -0
- package/script/types/4_inline_query_result_audio.d.ts +17 -0
- package/script/types/4_inline_query_result_audio.js +2 -0
- package/script/types/4_inline_query_result_cached_audio.d.ts +14 -0
- package/script/types/4_inline_query_result_cached_audio.js +2 -0
- package/script/types/4_inline_query_result_cached_document.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_document.js +2 -0
- package/script/types/4_inline_query_result_cached_gif.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_gif.js +2 -0
- package/script/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_mpeg4_gif.js +2 -0
- package/script/types/4_inline_query_result_cached_photo.d.ts +16 -0
- package/script/types/4_inline_query_result_cached_photo.js +2 -0
- package/script/types/4_inline_query_result_cached_sticker.d.ts +9 -0
- package/script/types/4_inline_query_result_cached_sticker.js +2 -0
- package/script/types/4_inline_query_result_cached_video.d.ts +16 -0
- package/script/types/4_inline_query_result_cached_video.js +2 -0
- package/script/types/4_inline_query_result_cached_voice.d.ts +15 -0
- package/script/types/4_inline_query_result_cached_voice.js +2 -0
- package/script/types/4_inline_query_result_contact.d.ts +15 -0
- package/script/types/4_inline_query_result_contact.js +2 -0
- package/script/types/4_inline_query_result_document.d.ts +18 -0
- package/script/types/4_inline_query_result_document.js +2 -0
- package/script/types/4_inline_query_result_game.d.ts +7 -0
- package/script/types/4_inline_query_result_game.js +2 -0
- package/script/types/4_inline_query_result_gif.d.ts +20 -0
- package/script/types/4_inline_query_result_gif.js +2 -0
- package/script/types/4_inline_query_result_location.d.ts +18 -0
- package/script/types/4_inline_query_result_location.js +2 -0
- package/script/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
- package/script/types/4_inline_query_result_mpeg4_gif.js +2 -0
- package/script/types/4_inline_query_result_photo.d.ts +19 -0
- package/script/types/4_inline_query_result_photo.js +2 -0
- package/script/types/4_inline_query_result_venue.d.ts +19 -0
- package/script/types/4_inline_query_result_venue.js +2 -0
- package/script/types/4_inline_query_result_video.d.ts +21 -0
- package/script/types/4_inline_query_result_video.js +2 -0
- package/script/types/4_inline_query_result_voice.d.ts +16 -0
- package/script/types/4_inline_query_result_voice.js +2 -0
- package/script/types/4_reply_markup.d.ts +7 -0
- package/script/types/4_reply_markup.js +26 -0
- package/script/types/5_inline_query_result.d.ts +29 -0
- package/script/types/5_inline_query_result.js +260 -0
- /package/esm/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
- /package/esm/types/{!0_file_id.js → 0__file_id.js} +0 -0
- /package/esm/types/{!0_misc.js → 0_bot_command.js} +0 -0
- /package/esm/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
- /package/script/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
- /package/script/types/{!0_file_id.js → 0__file_id.js} +0 -0
- /package/script/types/{!0_misc.js → 0_bot_command.js} +0 -0
- /package/script/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ParseMode = "HTML" | null;
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.constructThumbnail = void 0;
|
|
4
4
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
5
|
-
const
|
|
5
|
+
const _0__file_id_js_1 = require("./0__file_id.js");
|
|
6
6
|
function constructThumbnail(size, file) {
|
|
7
|
-
const fileType = file instanceof _2_tl_js_1.types.Photo ?
|
|
8
|
-
const fileId = new
|
|
7
|
+
const fileType = file instanceof _2_tl_js_1.types.Photo ? _0__file_id_js_1.FileType.Photo : _0__file_id_js_1.FileType.Document;
|
|
8
|
+
const fileId = new _0__file_id_js_1.FileID(null, null, fileType, file.dcId, {
|
|
9
9
|
mediaId: file.id,
|
|
10
10
|
accessHash: file.accessHash,
|
|
11
11
|
fileReference: file.fileReference,
|
|
12
12
|
thumbnailFileType: fileType,
|
|
13
|
-
thumbnailSource:
|
|
13
|
+
thumbnailSource: _0__file_id_js_1.ThumbnailSource.Thumbnail,
|
|
14
14
|
thumbnailSize: size.type,
|
|
15
15
|
volumeId: 0n,
|
|
16
16
|
localId: 0,
|
|
17
17
|
}).encode();
|
|
18
|
-
const fileUniqueId = new
|
|
18
|
+
const fileUniqueId = new _0__file_id_js_1.FileUniqueID(_0__file_id_js_1.FileUniqueType.Document, { mediaId: file.id }).encode();
|
|
19
19
|
return {
|
|
20
20
|
fileId,
|
|
21
21
|
fileUniqueId,
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
+
import { ChatID } from "./0_chat_id.js";
|
|
3
4
|
export interface EntityGetter {
|
|
4
5
|
(peer: types.PeerUser): MaybePromise<types.User | null>;
|
|
5
6
|
(peer: types.PeerChat): MaybePromise<types.Chat | null>;
|
|
6
7
|
(peer: types.PeerChannel): MaybePromise<types.Channel | null>;
|
|
7
8
|
}
|
|
9
|
+
export interface InputPeerGetter {
|
|
10
|
+
(id: ChatID): Promise<types.InputPeerUser | types.InputPeerChannel | types.InputPeerChat>;
|
|
11
|
+
}
|
|
12
|
+
export interface UsernameResolver {
|
|
13
|
+
(username: string): MaybePromise<types.InputUser>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ChatID } from "./0_chat_id.js";
|
|
2
|
+
import { types } from "../2_tl.js";
|
|
3
|
+
import { InputPeerGetter } from "./1__getters.js";
|
|
4
|
+
export declare namespace BotCommandScope {
|
|
5
|
+
interface Default {
|
|
6
|
+
type: "default";
|
|
7
|
+
}
|
|
8
|
+
interface AllPrivateChats {
|
|
9
|
+
type: "allPrivateChats";
|
|
10
|
+
}
|
|
11
|
+
interface AllGroupChats {
|
|
12
|
+
type: "allGroupChats";
|
|
13
|
+
}
|
|
14
|
+
interface AllChatAdministrators {
|
|
15
|
+
type: "allChatAdministrators";
|
|
16
|
+
}
|
|
17
|
+
interface Chat {
|
|
18
|
+
type: "chat";
|
|
19
|
+
chatId: ChatID;
|
|
20
|
+
}
|
|
21
|
+
interface ChatAdministrators {
|
|
22
|
+
type: "chatAdministrators";
|
|
23
|
+
chatId: ChatID;
|
|
24
|
+
}
|
|
25
|
+
interface ChatMember {
|
|
26
|
+
type: "chatMember";
|
|
27
|
+
chatId: ChatID;
|
|
28
|
+
userId: number;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export type BotCommandScope = BotCommandScope.Default | BotCommandScope.AllPrivateChats | BotCommandScope.AllGroupChats | BotCommandScope.AllChatAdministrators | BotCommandScope.Chat | BotCommandScope.ChatAdministrators | BotCommandScope.ChatMember;
|
|
32
|
+
export declare function botCommandScopeToTlObject(scope: BotCommandScope, getInputPeer: InputPeerGetter): Promise<types.BotCommandScopeDefault | types.BotCommandScopeUsers | types.BotCommandScopeChats | types.BotCommandScopeChatAdmins | types.BotCommandScopePeer | types.BotCommandScopePeerAdmins | types.BotCommandScopePeerUser>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.botCommandScopeToTlObject = void 0;
|
|
4
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
5
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
6
|
+
async function botCommandScopeToTlObject(scope, getInputPeer) {
|
|
7
|
+
switch (scope.type) {
|
|
8
|
+
case "default":
|
|
9
|
+
return new _2_tl_js_1.types.BotCommandScopeDefault();
|
|
10
|
+
case "allPrivateChats":
|
|
11
|
+
return new _2_tl_js_1.types.BotCommandScopeUsers();
|
|
12
|
+
case "allGroupChats":
|
|
13
|
+
return new _2_tl_js_1.types.BotCommandScopeChats();
|
|
14
|
+
case "allChatAdministrators":
|
|
15
|
+
return new _2_tl_js_1.types.BotCommandScopeChatAdmins();
|
|
16
|
+
case "chat":
|
|
17
|
+
return new _2_tl_js_1.types.BotCommandScopePeer({ peer: await getInputPeer(scope.chatId) });
|
|
18
|
+
case "chatAdministrators":
|
|
19
|
+
return new _2_tl_js_1.types.BotCommandScopePeerAdmins({ peer: await getInputPeer(scope.chatId) });
|
|
20
|
+
case "chatMember": {
|
|
21
|
+
const user = await getInputPeer(scope.userId);
|
|
22
|
+
if (!(user instanceof _2_tl_js_1.types.InputPeerUser)) {
|
|
23
|
+
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
24
|
+
}
|
|
25
|
+
return new _2_tl_js_1.types.BotCommandScopePeerUser({ peer: await getInputPeer(scope.chatId), userId: new _2_tl_js_1.types.InputUser({ userId: user.userId, accessHash: user.accessHash }) });
|
|
26
|
+
}
|
|
27
|
+
default:
|
|
28
|
+
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.botCommandScopeToTlObject = botCommandScopeToTlObject;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LabeledPrice } from "../tl/2_types.js";
|
|
2
|
+
export interface InputInvoiceMessageContent {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
payload: string;
|
|
6
|
+
providerToken: string;
|
|
7
|
+
currency: string;
|
|
8
|
+
prices: LabeledPrice[];
|
|
9
|
+
maxTipAmount?: number;
|
|
10
|
+
suggestedTipAmounts?: number[];
|
|
11
|
+
providerData?: string;
|
|
12
|
+
photoUrl?: string;
|
|
13
|
+
photoSize?: number;
|
|
14
|
+
photoWidth?: number;
|
|
15
|
+
photoHeight?: number;
|
|
16
|
+
needName?: boolean;
|
|
17
|
+
needPhoneNumber?: boolean;
|
|
18
|
+
needEmail?: boolean;
|
|
19
|
+
needShippingAAddress?: boolean;
|
|
20
|
+
sendPhoneNumberToPorvider?: boolean;
|
|
21
|
+
sendEmailToProvider?: boolean;
|
|
22
|
+
isFlexible?: boolean;
|
|
23
|
+
}
|
package/script/types/1_photo.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.constructPhoto = void 0;
|
|
4
4
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
5
|
-
const
|
|
5
|
+
const _0__file_id_js_1 = require("./0__file_id.js");
|
|
6
6
|
const _0_thumbnail_js_1 = require("./0_thumbnail.js");
|
|
7
7
|
function constructPhoto(photo) {
|
|
8
8
|
const sizes = photo.sizes
|
|
@@ -18,14 +18,14 @@ function constructPhoto(photo) {
|
|
|
18
18
|
.sort((a, b) => a.size - b.size);
|
|
19
19
|
const largest = sizes.slice(-1)[0];
|
|
20
20
|
const { dcId, id: mediaId, accessHash, fileReference } = photo;
|
|
21
|
-
const fileUniqueId = new
|
|
21
|
+
const fileUniqueId = new _0__file_id_js_1.FileUniqueID(_0__file_id_js_1.FileUniqueType.Document, { mediaId: photo.id }).encode();
|
|
22
22
|
return {
|
|
23
|
-
fileId: new
|
|
23
|
+
fileId: new _0__file_id_js_1.FileID(null, null, _0__file_id_js_1.FileType.Photo, dcId, {
|
|
24
24
|
mediaId,
|
|
25
25
|
accessHash,
|
|
26
26
|
fileReference,
|
|
27
|
-
thumbnailSource:
|
|
28
|
-
thumbnailFileType:
|
|
27
|
+
thumbnailSource: _0__file_id_js_1.ThumbnailSource.Thumbnail,
|
|
28
|
+
thumbnailFileType: _0__file_id_js_1.FileType.Photo,
|
|
29
29
|
thumbnailSize: largest.type,
|
|
30
30
|
volumeId: 0n,
|
|
31
31
|
localId: 0,
|
package/script/types/2_game.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.constructGame = 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__file_id_js_1 = require("./0__file_id.js");
|
|
7
7
|
const _1_animation_js_1 = require("./1_animation.js");
|
|
8
8
|
const _1_photo_js_1 = require("./1_photo.js");
|
|
9
9
|
function constructGame(media_) {
|
|
@@ -14,11 +14,11 @@ function constructGame(media_) {
|
|
|
14
14
|
description: media_.game.description,
|
|
15
15
|
photo: (0, _1_photo_js_1.constructPhoto)(game_.photo[_2_tl_js_1.as](_2_tl_js_1.types.Photo)),
|
|
16
16
|
animation: document_
|
|
17
|
-
? (0, _1_animation_js_1.constructAnimation)(document_, document_.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeVideo), document_.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeFilename), new
|
|
17
|
+
? (0, _1_animation_js_1.constructAnimation)(document_, document_.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeVideo), document_.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeFilename), new _0__file_id_js_1.FileID(null, null, _0__file_id_js_1.FileType.Animation, document_.dcId, {
|
|
18
18
|
mediaId: document_.id,
|
|
19
19
|
accessHash: document_.accessHash,
|
|
20
20
|
fileReference: document_.fileReference,
|
|
21
|
-
}).encode(), new
|
|
21
|
+
}).encode(), new _0__file_id_js_1.FileUniqueID(_0__file_id_js_1.FileUniqueType.Document, { mediaId: document_.id }).encode())
|
|
22
22
|
: undefined,
|
|
23
23
|
});
|
|
24
24
|
}
|
package/{esm/types/1_inline_keyboard_button.d.ts → script/types/2_inline_keyboard_button.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MaybePromise } from "../1_utilities.js";
|
|
2
1
|
import { types } from "../2_tl.js";
|
|
3
2
|
import { WebAppInfo } from "./0_web_app_info.js";
|
|
4
3
|
import { LoginUrl } from "./0_login_url.js";
|
|
4
|
+
import { UsernameResolver } from "./1__getters.js";
|
|
5
5
|
export declare namespace InlineKeyboardButton {
|
|
6
6
|
interface Base {
|
|
7
7
|
/** Label text on the button */
|
|
@@ -42,4 +42,4 @@ export declare namespace InlineKeyboardButton {
|
|
|
42
42
|
/** This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. */
|
|
43
43
|
export type InlineKeyboardButton = InlineKeyboardButton.URL | InlineKeyboardButton.Callback | InlineKeyboardButton.WebApp | InlineKeyboardButton.Login | InlineKeyboardButton.SwitchInline | InlineKeyboardButton.SwitchInlineCurrent | InlineKeyboardButton.Game | InlineKeyboardButton.Pay;
|
|
44
44
|
export declare function constructInlineKeyboardButton(button_: types.TypeKeyboardButton): InlineKeyboardButton;
|
|
45
|
-
export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver:
|
|
45
|
+
export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: UsernameResolver): Promise<types.KeyboardButtonURL | types.KeyboardButtonCallback | types.KeyboardButtonSwitchInline | types.KeyboardButtonBuy | types.InputKeyboardButtonURLAuth | types.KeyboardButtonWebView>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { EntityGetter } from "./!0_misc.js";
|
|
3
2
|
import { Location } from "./0_location.js";
|
|
3
|
+
import { EntityGetter } from "./1__getters.js";
|
|
4
4
|
import { User } from "./1_user.js";
|
|
5
5
|
export interface InlineQuery {
|
|
6
6
|
/** Unique identifier for this query */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InputContactMessageContent } from "./0_input_contact_message_content.js";
|
|
2
|
+
import { InputLocationMessageContent } from "./0_input_location_message_content.js";
|
|
3
|
+
import { InputVenuMessageContent } from "./0_input_venue_message_content.js";
|
|
4
|
+
import { InputInvoiceMessageContent } from "./1_input_invoice_message_content.js";
|
|
5
|
+
import { InputTextMessageContent } from "./1_input_text_message_content.js";
|
|
6
|
+
export type InputMessageContent = InputTextMessageContent | InputLocationMessageContent | InputVenuMessageContent | InputContactMessageContent | InputInvoiceMessageContent;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import {
|
|
2
|
+
import { UsernameResolver } from "./1__getters.js";
|
|
3
|
+
import { InlineKeyboardButton } from "./2_inline_keyboard_button.js";
|
|
3
4
|
/** This object represents an inline keyboard that appears right next to the message it belongs to. */
|
|
4
5
|
export interface InlineKeyboardMarkup {
|
|
5
6
|
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
|
|
6
7
|
inlineKeyboard: InlineKeyboardButton[][];
|
|
7
8
|
}
|
|
8
9
|
export declare function constructInlineKeyboardMarkup(keyboard_: types.ReplyInlineMarkup): InlineKeyboardMarkup;
|
|
9
|
-
export declare function inlineKeyboardMarkupToTlObject(keyboard: InlineKeyboardMarkup, usernameResolver:
|
|
10
|
+
export declare function inlineKeyboardMarkupToTlObject(keyboard: InlineKeyboardMarkup, usernameResolver: UsernameResolver): Promise<types.ReplyInlineMarkup>;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.inlineKeyboardMarkupToTlObject = exports.constructInlineKeyboardMarkup = void 0;
|
|
4
4
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
5
|
-
const
|
|
5
|
+
const _2_inline_keyboard_button_js_1 = require("./2_inline_keyboard_button.js");
|
|
6
6
|
function constructInlineKeyboardMarkup(keyboard_) {
|
|
7
7
|
const rows = new Array();
|
|
8
8
|
for (const row_ of keyboard_.rows) {
|
|
9
9
|
const row = new Array();
|
|
10
10
|
for (const button_ of row_.buttons) {
|
|
11
|
-
row.push((0,
|
|
11
|
+
row.push((0, _2_inline_keyboard_button_js_1.constructInlineKeyboardButton)(button_));
|
|
12
12
|
}
|
|
13
13
|
rows.push(row);
|
|
14
14
|
}
|
|
@@ -20,7 +20,7 @@ async function inlineKeyboardMarkupToTlObject(keyboard, usernameResolver) {
|
|
|
20
20
|
for (const row of keyboard.inlineKeyboard) {
|
|
21
21
|
const row_ = new Array();
|
|
22
22
|
for (const button of row) {
|
|
23
|
-
row_.push(await (0,
|
|
23
|
+
row_.push(await (0, _2_inline_keyboard_button_js_1.inlineKeyboardButtonToTlObject)(button, usernameResolver));
|
|
24
24
|
}
|
|
25
25
|
rows_.push(new _2_tl_js_1.types.KeyboardButtonRow({ buttons: row_ }));
|
|
26
26
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
-
import { EntityGetter } from "./!0_misc.js";
|
|
4
3
|
import { ForceReply } from "./0_force_reply.js";
|
|
5
4
|
import { MessageEntity } from "./0_message_entity.js";
|
|
6
5
|
import { Audio } from "./0_audio.js";
|
|
@@ -10,6 +9,7 @@ import { Venue } from "./0_venue.js";
|
|
|
10
9
|
import { Location } from "./0_location.js";
|
|
11
10
|
import { Dice } from "./0_dice.js";
|
|
12
11
|
import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
|
|
12
|
+
import { EntityGetter } from "./1__getters.js";
|
|
13
13
|
import { Chat } from "./1_chat.js";
|
|
14
14
|
import { Photo } from "./1_photo.js";
|
|
15
15
|
import { Document } from "./1_document.js";
|
|
@@ -19,7 +19,7 @@ import { Animation } from "./1_animation.js";
|
|
|
19
19
|
import { User } from "./1_user.js";
|
|
20
20
|
import { Poll } from "./1_poll.js";
|
|
21
21
|
import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
|
|
22
|
-
import { InlineKeyboardMarkup } from "./
|
|
22
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
23
23
|
import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
24
24
|
import { Game } from "./2_game.js";
|
|
25
25
|
/** This object represents a message. */
|
|
@@ -5,7 +5,7 @@ const _0_deps_js_1 = require("../0_deps.js");
|
|
|
5
5
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
6
6
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
7
7
|
const _4_constants_js_1 = require("../4_constants.js");
|
|
8
|
-
const
|
|
8
|
+
const _0__file_id_js_1 = require("./0__file_id.js");
|
|
9
9
|
const _0_force_reply_js_1 = require("./0_force_reply.js");
|
|
10
10
|
const _0_message_entity_js_1 = require("./0_message_entity.js");
|
|
11
11
|
const _0_audio_js_1 = require("./0_audio.js");
|
|
@@ -24,7 +24,7 @@ const _1_animation_js_1 = require("./1_animation.js");
|
|
|
24
24
|
const _1_user_js_1 = require("./1_user.js");
|
|
25
25
|
const _1_poll_js_1 = require("./1_poll.js");
|
|
26
26
|
const _1_sticker_js_1 = require("./1_sticker.js");
|
|
27
|
-
const
|
|
27
|
+
const _3_inline_keyboard_markup_js_1 = require("./3_inline_keyboard_markup.js");
|
|
28
28
|
const _2_reply_keyboard_markup_js_1 = require("./2_reply_keyboard_markup.js");
|
|
29
29
|
const _2_game_js_1 = require("./2_game.js");
|
|
30
30
|
const d = (0, _0_deps_js_1.debug)("types/Message");
|
|
@@ -264,7 +264,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
264
264
|
message.replyMarkup = (0, _2_reply_keyboard_markup_js_1.constructReplyKeyboardMarkup)(message_.replyMarkup);
|
|
265
265
|
}
|
|
266
266
|
else if (message_.replyMarkup instanceof _2_tl_js_1.types.ReplyInlineMarkup) {
|
|
267
|
-
message.replyMarkup = (0,
|
|
267
|
+
message.replyMarkup = (0, _3_inline_keyboard_markup_js_1.constructInlineKeyboardMarkup)(message_.replyMarkup);
|
|
268
268
|
}
|
|
269
269
|
else if (message_.replyMarkup instanceof _2_tl_js_1.types.ReplyKeyboardHide) {
|
|
270
270
|
message.replyMarkup = (0, _0_reply_keyboard_remove_js_1.constructReplyKeyboardRemove)(message_.replyMarkup);
|
|
@@ -334,41 +334,41 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
334
334
|
else if (message_.media instanceof _2_tl_js_1.types.MessageMediaDocument) {
|
|
335
335
|
const { document } = message_.media;
|
|
336
336
|
if (document instanceof _2_tl_js_1.types.Document) {
|
|
337
|
-
const getFileId = (type) => new
|
|
337
|
+
const getFileId = (type) => new _0__file_id_js_1.FileID(null, null, type, document.dcId, {
|
|
338
338
|
mediaId: document.id,
|
|
339
339
|
accessHash: document.accessHash,
|
|
340
340
|
fileReference: document.fileReference,
|
|
341
341
|
}).encode();
|
|
342
|
-
const fileUniqueId = new
|
|
342
|
+
const fileUniqueId = new _0__file_id_js_1.FileUniqueID(_0__file_id_js_1.FileUniqueType.Document, { mediaId: document.id }).encode();
|
|
343
343
|
const animated = document.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeAnimated);
|
|
344
344
|
const audio = document.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeAudio);
|
|
345
345
|
const fileName = document.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeFilename);
|
|
346
346
|
const sticker = document.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeSticker);
|
|
347
347
|
const video = document.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeVideo);
|
|
348
348
|
if (animated) {
|
|
349
|
-
message.animation = (0, _1_animation_js_1.constructAnimation)(document, video, fileName, getFileId(
|
|
349
|
+
message.animation = (0, _1_animation_js_1.constructAnimation)(document, video, fileName, getFileId(_0__file_id_js_1.FileType.Animation), fileUniqueId);
|
|
350
350
|
}
|
|
351
351
|
else if (video) {
|
|
352
352
|
if (video.roundMessage) {
|
|
353
|
-
message.videoNote = (0, _1_video_note_js_1.constructVideoNote)(document, video, getFileId(
|
|
353
|
+
message.videoNote = (0, _1_video_note_js_1.constructVideoNote)(document, video, getFileId(_0__file_id_js_1.FileType.VideoNote), fileUniqueId);
|
|
354
354
|
}
|
|
355
355
|
else {
|
|
356
|
-
message.video = (0, _1_video_js_1.constructVideo)(document, video, fileName?.fileName, getFileId(
|
|
356
|
+
message.video = (0, _1_video_js_1.constructVideo)(document, video, fileName?.fileName, getFileId(_0__file_id_js_1.FileType.Video), fileUniqueId);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
else if (audio) {
|
|
360
360
|
if (audio.voice) {
|
|
361
|
-
message.voice = (0, _0_voice_js_1.constructVoice)(document, audio, getFileId(
|
|
361
|
+
message.voice = (0, _0_voice_js_1.constructVoice)(document, audio, getFileId(_0__file_id_js_1.FileType.Voice), fileUniqueId);
|
|
362
362
|
}
|
|
363
363
|
else {
|
|
364
|
-
message.audio = (0, _0_audio_js_1.constructAudio)(document, audio, getFileId(
|
|
364
|
+
message.audio = (0, _0_audio_js_1.constructAudio)(document, audio, getFileId(_0__file_id_js_1.FileType.Audio), fileUniqueId);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
else if (sticker) {
|
|
368
|
-
message.sticker = await (0, _1_sticker_js_1.constructSticker)(document, getFileId(
|
|
368
|
+
message.sticker = await (0, _1_sticker_js_1.constructSticker)(document, getFileId(_0__file_id_js_1.FileType.Sticker), fileUniqueId, getStickerSetName);
|
|
369
369
|
}
|
|
370
370
|
else if (fileName) {
|
|
371
|
-
message.document = (0, _1_document_js_1.constructDocument)(document, fileName, getFileId(
|
|
371
|
+
message.document = (0, _1_document_js_1.constructDocument)(document, fileName, getFileId(_0__file_id_js_1.FileType.Document), fileUniqueId);
|
|
372
372
|
}
|
|
373
373
|
else {
|
|
374
374
|
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
2
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
3
|
+
export interface InlineQueryResultArticle {
|
|
4
|
+
type: "article";
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
inputMessageContent: InputMessageContent;
|
|
8
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
9
|
+
url?: string;
|
|
10
|
+
hideUrl?: boolean;
|
|
11
|
+
description?: string;
|
|
12
|
+
thumbnailUrl?: string;
|
|
13
|
+
thumbnailWidth?: string;
|
|
14
|
+
thumbnailHeight?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultAudio {
|
|
6
|
+
type: "audio";
|
|
7
|
+
id: string;
|
|
8
|
+
audioUrl: string;
|
|
9
|
+
title: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
parseMode?: ParseMode;
|
|
12
|
+
captionEntities?: MessageEntity[];
|
|
13
|
+
performer?: string;
|
|
14
|
+
audioDuration?: number;
|
|
15
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
16
|
+
inputMessageContent?: InputMessageContent;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultCachedAudio {
|
|
6
|
+
type: "audio";
|
|
7
|
+
id: string;
|
|
8
|
+
audioFileId: string;
|
|
9
|
+
caption?: string;
|
|
10
|
+
parseMode?: ParseMode;
|
|
11
|
+
captionEntities?: MessageEntity[];
|
|
12
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
13
|
+
inputMessageContent?: InputMessageContent;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultCachedDocument {
|
|
6
|
+
type: "document";
|
|
7
|
+
id: string;
|
|
8
|
+
documentFileId: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
parseMode?: ParseMode;
|
|
12
|
+
captionEntities?: MessageEntity[];
|
|
13
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
14
|
+
inputMessageContent?: InputMessageContent;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultCachedGif {
|
|
6
|
+
type: "gif";
|
|
7
|
+
id: string;
|
|
8
|
+
gifFileId: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
parseMode?: ParseMode;
|
|
12
|
+
captionEntities?: MessageEntity[];
|
|
13
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
14
|
+
inputMessageContent?: InputMessageContent;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultCachedMpeg4Gif {
|
|
6
|
+
type: "mpeg4_gif";
|
|
7
|
+
id: string;
|
|
8
|
+
mpeg4FileId: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
parseMode?: ParseMode;
|
|
12
|
+
captionEntities?: MessageEntity[];
|
|
13
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
14
|
+
inputMessageContent?: InputMessageContent;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
2
|
+
import { ParseMode } from "./0_parse_mode.js";
|
|
3
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
4
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
5
|
+
export interface InlineQueryResultCachedPhoto {
|
|
6
|
+
type: "photo";
|
|
7
|
+
id: string;
|
|
8
|
+
photoFileId: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
caption?: string;
|
|
12
|
+
parseMode?: ParseMode;
|
|
13
|
+
captionEntities?: MessageEntity[];
|
|
14
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
15
|
+
inputMessageContent?: InputMessageContent;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InputMessageContent } from "./2_input_message_content.js";
|
|
2
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
3
|
+
export interface InlineQueryResultCachedSticker {
|
|
4
|
+
type: "sticker";
|
|
5
|
+
id: string;
|
|
6
|
+
stickerFileId: string;
|
|
7
|
+
replyMarkup?: InlineKeyboardMarkup;
|
|
8
|
+
inputMessageContent?: InputMessageContent;
|
|
9
|
+
}
|