@mtkruto/node 0.1.132 → 0.1.134
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_errors.d.ts +519 -510
- package/esm/3_errors.js +521 -509
- package/esm/3_types.d.ts +19 -7
- package/esm/3_types.js +19 -7
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +2 -2
- package/esm/4_errors.d.ts +7 -12
- package/esm/4_errors.js +6 -7
- package/esm/5_client.d.ts +3 -3
- package/esm/5_client.js +3 -3
- package/esm/client/0_utilities.d.ts +30 -2
- package/esm/client/0_utilities.js +13 -5
- package/esm/client/1_composer.d.ts +30 -0
- package/esm/client/{4_composer.js → 1_composer.js} +15 -2
- package/esm/client/2_client_plain.d.ts +1 -1
- package/esm/client/2_client_plain.js +1 -1
- package/esm/client/{3_types.d.ts → 3_params.d.ts} +68 -172
- package/esm/client/3_params.js +1 -0
- package/esm/client/{5_client.d.ts → 4_client.d.ts} +89 -57
- package/esm/client/{5_client.js → 4_client.js} +499 -308
- package/esm/client/5_composer.d.ts +4 -0
- package/esm/client/5_composer.js +3 -0
- package/esm/storage/0_storage.d.ts +4 -1
- package/esm/storage/0_storage.js +36 -7
- package/esm/storage/1_storage_indexed_db.d.ts +6 -2
- package/esm/storage/1_storage_indexed_db.js +7 -5
- package/esm/storage/1_storage_local_storage.d.ts +1 -1
- package/esm/storage/1_storage_local_storage.js +1 -1
- package/esm/storage/1_storage_memory.d.ts +1 -1
- package/esm/storage/1_storage_memory.js +1 -1
- package/esm/storage/1_storage_session_storage.d.ts +1 -1
- package/esm/storage/1_storage_session_storage.js +1 -1
- package/esm/tl/2_types.d.ts +313 -24
- package/esm/tl/2_types.js +982 -46
- package/esm/tl/3_functions.d.ts +95 -32
- package/esm/tl/3_functions.js +227 -66
- package/esm/tl/3_utilities.d.ts +1 -0
- package/esm/tl/3_utilities.js +14 -0
- package/esm/tl/6_message.js +1 -1
- package/esm/types/0_authorization_state.d.ts +5 -0
- package/esm/types/0_authorization_state.js +1 -0
- package/esm/types/0_chat_photo.d.ts +22 -21
- package/esm/types/0_connection_state.d.ts +17 -0
- package/esm/types/0_connection_state.js +1 -0
- package/esm/types/0_giveaway_parameters.d.ts +9 -0
- package/esm/types/0_giveaway_parameters.js +9 -0
- package/esm/types/0_login_url.d.ts +0 -4
- package/esm/types/0_mask_position.d.ts +0 -4
- package/esm/types/0_message_entity.d.ts +91 -74
- package/esm/types/0_message_identifier.d.ts +4 -0
- package/esm/types/0_message_identifier.js +1 -0
- package/esm/types/0_network_statistics_entry.d.ts +4 -0
- package/esm/types/0_network_statistics_entry.js +1 -0
- package/esm/types/0_reaction.d.ts +14 -10
- package/esm/types/0_reaction.js +29 -1
- package/esm/types/1__getters.d.ts +3 -0
- package/esm/types/1_bot_command_scope.d.ts +32 -27
- package/esm/types/1_chat_p.d.ts +77 -68
- package/esm/types/1_giveaway.d.ts +8 -0
- package/esm/types/1_giveaway.js +7 -0
- package/esm/types/1_keyboard_button.d.ts +41 -57
- package/esm/types/1_keyboard_button.js +3 -0
- package/esm/types/1_message_reaction.d.ts +14 -0
- package/esm/types/1_message_reaction.js +22 -0
- package/esm/types/1_network_statistics.d.ts +5 -0
- package/esm/types/1_network_statistics.js +1 -0
- package/esm/types/1_poll.d.ts +0 -13
- package/esm/types/1_reaction_count.d.ts +7 -0
- package/esm/types/1_reaction_count.js +6 -0
- package/esm/types/1_user.d.ts +2 -2
- package/esm/types/2_game.d.ts +0 -7
- package/esm/types/2_inline_keyboard_button.d.ts +36 -37
- package/esm/types/2_inline_query.d.ts +0 -6
- package/esm/types/2_message_interactions.d.ts +8 -0
- package/esm/types/2_message_interactions.js +1 -0
- package/esm/types/2_message_reaction_count.d.ts +8 -0
- package/esm/types/2_message_reaction_count.js +1 -0
- package/esm/types/2_reply_keyboard_markup.d.ts +0 -7
- package/esm/types/3_inline_keyboard_markup.d.ts +0 -2
- package/esm/types/4_message.d.ts +457 -0
- package/esm/types/{3_message.js → 4_message.js} +216 -129
- package/{script/types/4_callback_query.d.ts → esm/types/5_callback_query.d.ts} +1 -1
- package/esm/types/5_chat.d.ts +37 -0
- package/esm/types/{4_chat.js → 5_chat.js} +2 -2
- package/esm/types/6_update.d.ts +134 -0
- package/esm/types/6_update.js +1 -0
- package/package.json +1 -1
- package/script/3_errors.d.ts +519 -510
- package/script/3_errors.js +533 -520
- package/script/3_types.d.ts +19 -7
- package/script/3_types.js +19 -7
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +2 -2
- package/script/4_errors.d.ts +7 -12
- package/script/4_errors.js +5 -6
- package/script/5_client.d.ts +3 -3
- package/script/5_client.js +3 -3
- package/script/client/0_utilities.d.ts +30 -2
- package/script/client/0_utilities.js +15 -6
- package/script/client/1_composer.d.ts +30 -0
- package/script/client/{4_composer.js → 1_composer.js} +17 -4
- package/script/client/2_client_plain.d.ts +1 -1
- package/script/client/2_client_plain.js +2 -2
- package/script/client/{3_types.d.ts → 3_params.d.ts} +68 -172
- package/script/client/3_params.js +2 -0
- package/script/client/{5_client.d.ts → 4_client.d.ts} +89 -57
- package/script/client/{5_client.js → 4_client.js} +505 -314
- package/script/client/5_composer.d.ts +4 -0
- package/script/client/{6_composer.js → 5_composer.js} +2 -2
- package/script/storage/0_storage.d.ts +4 -1
- package/script/storage/0_storage.js +36 -7
- package/script/storage/1_storage_indexed_db.d.ts +6 -2
- package/script/storage/1_storage_indexed_db.js +7 -5
- package/script/storage/1_storage_local_storage.d.ts +1 -1
- package/script/storage/1_storage_local_storage.js +1 -1
- package/script/storage/1_storage_memory.d.ts +1 -1
- package/script/storage/1_storage_memory.js +1 -1
- package/script/storage/1_storage_session_storage.d.ts +1 -1
- package/script/storage/1_storage_session_storage.js +1 -1
- package/script/tl/2_types.d.ts +313 -24
- package/script/tl/2_types.js +1169 -217
- package/script/tl/3_functions.d.ts +95 -32
- package/script/tl/3_functions.js +241 -77
- package/script/tl/3_utilities.d.ts +1 -0
- package/script/tl/3_utilities.js +16 -1
- package/script/tl/6_message.js +1 -1
- package/script/types/0_authorization_state.d.ts +5 -0
- package/script/types/0_authorization_state.js +2 -0
- package/script/types/0_chat_photo.d.ts +22 -21
- package/script/types/0_connection_state.d.ts +17 -0
- package/script/types/0_connection_state.js +2 -0
- package/script/types/0_giveaway_parameters.d.ts +9 -0
- package/script/types/0_giveaway_parameters.js +13 -0
- package/script/types/0_login_url.d.ts +0 -4
- package/script/types/0_mask_position.d.ts +0 -4
- package/script/types/0_message_entity.d.ts +91 -74
- package/script/types/0_message_identifier.d.ts +4 -0
- package/script/types/0_message_identifier.js +2 -0
- package/script/types/0_network_statistics_entry.d.ts +4 -0
- package/script/types/0_network_statistics_entry.js +2 -0
- package/script/types/0_reaction.d.ts +14 -10
- package/script/types/0_reaction.js +33 -0
- package/script/types/1__getters.d.ts +3 -0
- package/script/types/1_bot_command_scope.d.ts +32 -27
- package/script/types/1_chat_p.d.ts +77 -68
- package/script/types/1_giveaway.d.ts +8 -0
- package/script/types/1_giveaway.js +11 -0
- package/script/types/1_keyboard_button.d.ts +41 -57
- package/script/types/1_keyboard_button.js +3 -0
- package/script/types/1_message_reaction.d.ts +14 -0
- package/script/types/1_message_reaction.js +26 -0
- package/script/types/1_network_statistics.d.ts +5 -0
- package/script/types/1_network_statistics.js +2 -0
- package/script/types/1_poll.d.ts +0 -13
- package/script/types/1_reaction_count.d.ts +7 -0
- package/script/types/1_reaction_count.js +10 -0
- package/script/types/1_user.d.ts +2 -2
- package/script/types/2_game.d.ts +0 -7
- package/script/types/2_inline_keyboard_button.d.ts +36 -37
- package/script/types/2_inline_query.d.ts +0 -6
- package/script/types/2_message_interactions.d.ts +8 -0
- package/script/types/2_message_interactions.js +2 -0
- package/script/types/2_message_reaction_count.d.ts +8 -0
- package/script/types/2_message_reaction_count.js +2 -0
- package/script/types/2_reply_keyboard_markup.d.ts +0 -7
- package/script/types/3_inline_keyboard_markup.d.ts +0 -2
- package/script/types/4_message.d.ts +457 -0
- package/script/types/{3_message.js → 4_message.js} +218 -130
- package/{esm/types/4_callback_query.d.ts → script/types/5_callback_query.d.ts} +1 -1
- package/script/types/5_chat.d.ts +37 -0
- package/script/types/{4_chat.js → 5_chat.js} +3 -3
- package/script/types/6_update.d.ts +134 -0
- package/script/types/6_update.js +2 -0
- package/esm/client/3_types.js +0 -11
- package/esm/client/4_composer.d.ts +0 -31
- package/esm/client/6_composer.d.ts +0 -4
- package/esm/client/6_composer.js +0 -3
- package/esm/types/3_message.d.ts +0 -182
- package/esm/types/4_chat.d.ts +0 -34
- package/script/client/3_types.js +0 -15
- package/script/client/4_composer.d.ts +0 -31
- package/script/client/6_composer.d.ts +0 -4
- package/script/types/3_message.d.ts +0 -182
- package/script/types/4_chat.d.ts +0 -34
- /package/esm/client/{1_client_abstract.d.ts → 0_client_abstract.d.ts} +0 -0
- /package/esm/client/{1_client_abstract.js → 0_client_abstract.js} +0 -0
- /package/esm/types/{0_audio.d.ts → 1_audio.d.ts} +0 -0
- /package/esm/types/{0_audio.js → 1_audio.js} +0 -0
- /package/esm/types/{4_callback_query.js → 5_callback_query.js} +0 -0
- /package/script/client/{1_client_abstract.d.ts → 0_client_abstract.d.ts} +0 -0
- /package/script/client/{1_client_abstract.js → 0_client_abstract.js} +0 -0
- /package/script/types/{0_audio.d.ts → 1_audio.d.ts} +0 -0
- /package/script/types/{0_audio.js → 1_audio.js} +0 -0
- /package/script/types/{4_callback_query.js → 5_callback_query.js} +0 -0
|
@@ -2,63 +2,47 @@ 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
4
|
import { WebAppInfo } from "./0_web_app_info.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
text: string;
|
|
9
|
-
}
|
|
10
|
-
/** This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. */
|
|
11
|
-
interface RequestUser extends Text {
|
|
12
|
-
/** If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a "user_shared" service message. Available in private chats only. */
|
|
13
|
-
requestUser: {
|
|
14
|
-
/** Signed 32-bit identifier of the request */
|
|
15
|
-
requestId: number;
|
|
16
|
-
/** Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. */
|
|
17
|
-
userIsBot?: boolean;
|
|
18
|
-
/** Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied. */
|
|
19
|
-
userIsPremium?: boolean;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
/** This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. */
|
|
23
|
-
interface RequestChat extends Text {
|
|
24
|
-
/** If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a "chat_shared" service message. Available in private chats only. */
|
|
25
|
-
requestChat: {
|
|
26
|
-
/** Signed 32-bit identifier of the request */
|
|
27
|
-
requestId: number;
|
|
28
|
-
/** Pass True to request a channel chat, pass False to request a group or a supergroup chat. */
|
|
29
|
-
chatIsChannel: boolean;
|
|
30
|
-
/** Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied. */
|
|
31
|
-
chatIsForum?: boolean;
|
|
32
|
-
/** Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied. */
|
|
33
|
-
chatHasUsername?: boolean;
|
|
34
|
-
/** Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. */
|
|
35
|
-
chatIsCreated?: boolean;
|
|
36
|
-
/** A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of _bot_administrator_rights_. If not specified, no additional restrictions are applied. */
|
|
37
|
-
userAdministratorRights?: ChatAdministratorRights;
|
|
38
|
-
/** A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of _user_administrator_rights_. If not specified, no additional restrictions are applied. */
|
|
39
|
-
botAdministratorRights?: ChatAdministratorRights;
|
|
40
|
-
/** Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
|
|
41
|
-
botIsMember?: boolean;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
interface RequestContact extends Text {
|
|
45
|
-
/** If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. */
|
|
46
|
-
requestContact: true;
|
|
47
|
-
}
|
|
48
|
-
interface RequestLocation extends Text {
|
|
49
|
-
/** If True, the user's current location will be sent when the button is pressed. Available in private chats only. */
|
|
50
|
-
requestLocation: true;
|
|
51
|
-
}
|
|
52
|
-
interface RequestPoll extends Text {
|
|
53
|
-
/** If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. */
|
|
54
|
-
requestPoll: KeyboardButtonPollType;
|
|
55
|
-
}
|
|
56
|
-
interface WebApp extends Text {
|
|
57
|
-
/** If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a "web_app_data" service message. Available in private chats only. */
|
|
58
|
-
webApp: WebAppInfo;
|
|
59
|
-
}
|
|
5
|
+
/** @unlisted */
|
|
6
|
+
export interface KeyboardButtonText {
|
|
7
|
+
text: string;
|
|
60
8
|
}
|
|
61
|
-
/**
|
|
62
|
-
export
|
|
9
|
+
/** @unlisted */
|
|
10
|
+
export interface KeyboardButtonRequestUser extends KeyboardButtonText {
|
|
11
|
+
requestUser: {
|
|
12
|
+
requestId: number;
|
|
13
|
+
userIsBot?: boolean;
|
|
14
|
+
userIsPremium?: boolean;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** @unlisted */
|
|
18
|
+
export interface KeyboardButtonRequestChat extends KeyboardButtonText {
|
|
19
|
+
requestChat: {
|
|
20
|
+
requestId: number;
|
|
21
|
+
chatIsChannel: boolean;
|
|
22
|
+
chatIsForum?: boolean;
|
|
23
|
+
chatHasUsername?: boolean;
|
|
24
|
+
chatIsCreated?: boolean;
|
|
25
|
+
userAdministratorRights?: ChatAdministratorRights;
|
|
26
|
+
botAdministratorRights?: ChatAdministratorRights;
|
|
27
|
+
botIsMember?: boolean;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** @unlisted */
|
|
31
|
+
export interface KeyboardButtonRequestContact extends KeyboardButtonText {
|
|
32
|
+
requestContact: true;
|
|
33
|
+
}
|
|
34
|
+
/** @unlisted */
|
|
35
|
+
export interface KeyboardButtonRequestLocation extends KeyboardButtonText {
|
|
36
|
+
requestLocation: true;
|
|
37
|
+
}
|
|
38
|
+
/** @unlisted */
|
|
39
|
+
export interface KeyboardButtonRequestPoll extends KeyboardButtonText {
|
|
40
|
+
requestPoll: KeyboardButtonPollType;
|
|
41
|
+
}
|
|
42
|
+
/** @unlisted */
|
|
43
|
+
export interface KeyboardButtonWebApp extends KeyboardButtonText {
|
|
44
|
+
webApp: WebAppInfo;
|
|
45
|
+
}
|
|
46
|
+
export type KeyboardButton = KeyboardButtonText | KeyboardButtonRequestUser | KeyboardButtonRequestChat | KeyboardButtonRequestContact | KeyboardButtonRequestLocation | KeyboardButtonRequestPoll | KeyboardButtonWebApp;
|
|
63
47
|
export declare function constructKeyboardButton(button_: enums.KeyboardButton): KeyboardButton;
|
|
64
48
|
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_;
|
|
@@ -88,6 +88,7 @@ function keyboardButtonToTlObject(button) {
|
|
|
88
88
|
text: button.text,
|
|
89
89
|
button_id: button.requestUser.requestId,
|
|
90
90
|
peer_type: new _2_tl_js_1.types.RequestPeerTypeUser({ bot: button.requestUser.userIsBot, premium: button.requestUser.userIsPremium }),
|
|
91
|
+
max_quantity: 1,
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
94
|
else if ("requestChat" in button) {
|
|
@@ -103,6 +104,7 @@ function keyboardButtonToTlObject(button) {
|
|
|
103
104
|
bot_admin_rights: button.requestChat.botAdministratorRights ? (0, _0_chat_administrator_rights_js_1.chatAdministratorRightsToTlObject)(button.requestChat.botAdministratorRights) : undefined,
|
|
104
105
|
user_admin_rights: button.requestChat.userAdministratorRights ? (0, _0_chat_administrator_rights_js_1.chatAdministratorRightsToTlObject)(button.requestChat.userAdministratorRights) : undefined,
|
|
105
106
|
}),
|
|
107
|
+
max_quantity: 1,
|
|
106
108
|
});
|
|
107
109
|
}
|
|
108
110
|
else {
|
|
@@ -115,6 +117,7 @@ function keyboardButtonToTlObject(button) {
|
|
|
115
117
|
bot_admin_rights: button.requestChat.botAdministratorRights ? (0, _0_chat_administrator_rights_js_1.chatAdministratorRightsToTlObject)(button.requestChat.botAdministratorRights) : undefined,
|
|
116
118
|
user_admin_rights: button.requestChat.userAdministratorRights ? (0, _0_chat_administrator_rights_js_1.chatAdministratorRightsToTlObject)(button.requestChat.userAdministratorRights) : undefined,
|
|
117
119
|
}),
|
|
120
|
+
max_quantity: 1,
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
123
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
|
+
import { Reaction } from "./0_reaction.js";
|
|
3
|
+
/** Represents a type of reaction made to a message. */
|
|
4
|
+
export interface MessageReaction {
|
|
5
|
+
/** The type of the reaction. */
|
|
6
|
+
reaction: Reaction;
|
|
7
|
+
/** The number of those who made this reaction. */
|
|
8
|
+
count: number;
|
|
9
|
+
/** A list of identifiers of users who recently made this reaction. */
|
|
10
|
+
choosers: number[];
|
|
11
|
+
/** Whether the current user made this reaction. */
|
|
12
|
+
chosen: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function constructMessageReaction(reaction_: types.ReactionCount, recentReactions: types.MessagePeerReaction[]): MessageReaction;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.constructMessageReaction = void 0;
|
|
4
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
5
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
6
|
+
const _0_reaction_js_1 = require("./0_reaction.js");
|
|
7
|
+
function constructMessageReaction(reaction_, recentReactions) {
|
|
8
|
+
const choosers = recentReactions
|
|
9
|
+
.filter((v) => {
|
|
10
|
+
if (reaction_.reaction instanceof _2_tl_js_1.types.ReactionEmoji) {
|
|
11
|
+
return v.reaction instanceof _2_tl_js_1.types.ReactionEmoji && v.reaction.emoticon == reaction_.reaction.emoticon;
|
|
12
|
+
}
|
|
13
|
+
else if (reaction_.reaction instanceof _2_tl_js_1.types.ReactionCustomEmoji) {
|
|
14
|
+
return v.reaction instanceof _2_tl_js_1.types.ReactionCustomEmoji && v.reaction.document_id == reaction_.reaction.document_id;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
.map((v) => (0, _2_tl_js_1.peerToChatId)(v.peer_id));
|
|
21
|
+
const reaction = (0, _0_reaction_js_1.constructReaction)(reaction_.reaction);
|
|
22
|
+
const count = reaction_.count;
|
|
23
|
+
const chosen = reaction_.chosen_order !== undefined ? true : false;
|
|
24
|
+
return { reaction, count, choosers, chosen };
|
|
25
|
+
}
|
|
26
|
+
exports.constructMessageReaction = constructMessageReaction;
|
package/script/types/1_poll.d.ts
CHANGED
|
@@ -2,31 +2,18 @@ import { types } from "../2_tl.js";
|
|
|
2
2
|
import { MessageEntity } from "./0_message_entity.js";
|
|
3
3
|
import { PollOption } from "./0_poll_option.js";
|
|
4
4
|
export interface Poll {
|
|
5
|
-
/** Unique poll identifier */
|
|
6
5
|
id: string;
|
|
7
|
-
/** Poll question, 1-300 characters */
|
|
8
6
|
question: string;
|
|
9
|
-
/** List of poll options */
|
|
10
7
|
options: PollOption[];
|
|
11
|
-
/** Total number of users that voted in the poll */
|
|
12
8
|
totalVoterCount: number;
|
|
13
|
-
/** True, if the poll is closed */
|
|
14
9
|
isClosed: boolean;
|
|
15
|
-
/** True, if the poll is anonymous */
|
|
16
10
|
isAnonymous: boolean;
|
|
17
|
-
/** Poll type, currently can be "regular" or "quiz" */
|
|
18
11
|
type: "regular" | "quiz";
|
|
19
|
-
/** True, if the poll allows multiple answers */
|
|
20
12
|
allowMultipleAnswers?: boolean;
|
|
21
|
-
/** Index of the correct answer in `options`. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */
|
|
22
13
|
correctOptionIndex?: number;
|
|
23
|
-
/** Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */
|
|
24
14
|
explanation?: string;
|
|
25
|
-
/** Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */
|
|
26
15
|
explanationEntities?: MessageEntity[];
|
|
27
|
-
/** Amount of time in seconds the poll will be active after creation */
|
|
28
16
|
openPeriod?: number;
|
|
29
|
-
/** Point in time (Unix timestamp) when the poll will be automatically closed */
|
|
30
17
|
closeDate?: Date;
|
|
31
18
|
}
|
|
32
19
|
export declare function constructPoll(media_: types.MessageMediaPoll): Poll;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.constructReactionCount = void 0;
|
|
4
|
+
const _0_reaction_js_1 = require("./0_reaction.js");
|
|
5
|
+
function constructReactionCount(reaction_) {
|
|
6
|
+
const reaction = (0, _0_reaction_js_1.constructReaction)(reaction_.reaction);
|
|
7
|
+
const count = reaction_.count;
|
|
8
|
+
return { reaction, count };
|
|
9
|
+
}
|
|
10
|
+
exports.constructReactionCount = constructReactionCount;
|
package/script/types/1_user.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ChatPhotoUser } from "./0_chat_photo.js";
|
|
3
3
|
/** This object represents a Telegram user or bot. */
|
|
4
4
|
export interface User {
|
|
5
5
|
/** Unique identifier for this user or bot */
|
|
@@ -17,7 +17,7 @@ export interface User {
|
|
|
17
17
|
/** Additional usernames */
|
|
18
18
|
also?: string[];
|
|
19
19
|
/** The user's photo. */
|
|
20
|
-
photo?:
|
|
20
|
+
photo?: ChatPhotoUser;
|
|
21
21
|
/** [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the user's language */
|
|
22
22
|
languageCode?: string;
|
|
23
23
|
/** True, if the user is a scam user */
|
package/script/types/2_game.d.ts
CHANGED
|
@@ -2,19 +2,12 @@ import { types } from "../2_tl.js";
|
|
|
2
2
|
import { MessageEntity } from "./0_message_entity.js";
|
|
3
3
|
import { Animation } from "./1_animation.js";
|
|
4
4
|
import { Photo } from "./1_photo.js";
|
|
5
|
-
/** This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. */
|
|
6
5
|
export interface Game {
|
|
7
|
-
/** Title of the game */
|
|
8
6
|
title: string;
|
|
9
|
-
/** Description of the game */
|
|
10
7
|
description: string;
|
|
11
|
-
/** Photo that will be displayed in the game message in chats. */
|
|
12
8
|
photo: Photo;
|
|
13
|
-
/** Brief description of the game or high scores included in the game message */
|
|
14
9
|
text?: string;
|
|
15
|
-
/** Special entities that appear in text, such as usernames, URLs, bot commands, etc. */
|
|
16
10
|
textEntities?: MessageEntity[];
|
|
17
|
-
/** Animation that will be displayed in the game message in chats */
|
|
18
11
|
animation?: Animation;
|
|
19
12
|
}
|
|
20
13
|
export declare function constructGame(media_: types.MessageMediaGame): Game;
|
|
@@ -2,44 +2,43 @@ import { enums } from "../2_tl.js";
|
|
|
2
2
|
import { LoginUrl } from "./0_login_url.js";
|
|
3
3
|
import { WebAppInfo } from "./0_web_app_info.js";
|
|
4
4
|
import { UsernameResolver } from "./1__getters.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
5
|
+
/** @unlisted */
|
|
6
|
+
export interface InlineKeyboardButtonBase {
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
/** @unlisted */
|
|
10
|
+
export interface InlineKeyboardButtonURL extends InlineKeyboardButtonBase {
|
|
11
|
+
url: string;
|
|
12
|
+
}
|
|
13
|
+
/** @unlisted */
|
|
14
|
+
export interface InlineKeyboardButtonCallback extends InlineKeyboardButtonBase {
|
|
15
|
+
callbackData: string;
|
|
16
|
+
}
|
|
17
|
+
/** @unlisted */
|
|
18
|
+
export interface InlineKeyboardButtonWebApp extends InlineKeyboardButtonBase {
|
|
19
|
+
webApp: WebAppInfo;
|
|
20
|
+
}
|
|
21
|
+
/** @unlisted */
|
|
22
|
+
export interface InlineKeyboardButtonLogin extends InlineKeyboardButtonBase {
|
|
23
|
+
loginUrl: LoginUrl;
|
|
24
|
+
}
|
|
25
|
+
/** @unlisted */
|
|
26
|
+
export interface InlineKeyboardButtonSwitchInline extends InlineKeyboardButtonBase {
|
|
27
|
+
switchInlineQuery: string;
|
|
28
|
+
}
|
|
29
|
+
/** @unlisted */
|
|
30
|
+
export interface InlineKeyboardButtonSwitchInlineCurrent extends InlineKeyboardButtonBase {
|
|
31
|
+
switchInlineQueryCurrentChat: string;
|
|
32
|
+
}
|
|
33
|
+
/** @unlisted */
|
|
34
|
+
export interface InlineKeyboardButtonGame extends InlineKeyboardButtonBase {
|
|
35
|
+
callbackGame: Record<never, never>;
|
|
36
|
+
}
|
|
37
|
+
/** @unlisted */
|
|
38
|
+
export interface InlineKeyboardButtonPay extends InlineKeyboardButtonBase {
|
|
39
|
+
pay: boolean;
|
|
41
40
|
}
|
|
42
41
|
/** This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. */
|
|
43
|
-
export type InlineKeyboardButton =
|
|
42
|
+
export type InlineKeyboardButton = InlineKeyboardButtonURL | InlineKeyboardButtonCallback | InlineKeyboardButtonWebApp | InlineKeyboardButtonLogin | InlineKeyboardButtonSwitchInline | InlineKeyboardButtonSwitchInlineCurrent | InlineKeyboardButtonGame | InlineKeyboardButtonPay;
|
|
44
43
|
export declare function constructInlineKeyboardButton(button_: enums.KeyboardButton): InlineKeyboardButton;
|
|
45
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,17 +3,11 @@ import { Location } from "./0_location.js";
|
|
|
3
3
|
import { EntityGetter } from "./1__getters.js";
|
|
4
4
|
import { User } from "./1_user.js";
|
|
5
5
|
export interface InlineQuery {
|
|
6
|
-
/** Unique identifier for this query */
|
|
7
6
|
id: string;
|
|
8
|
-
/** The user who made this query */
|
|
9
7
|
from: User;
|
|
10
|
-
/** The text of the query */
|
|
11
8
|
query: string;
|
|
12
|
-
/** Result offset */
|
|
13
9
|
offset: string;
|
|
14
|
-
/** Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat */
|
|
15
10
|
chatType?: "sender" | "private" | "group" | "supergroup" | "channel";
|
|
16
|
-
/** The location of the user who made this query */
|
|
17
11
|
location?: Location;
|
|
18
12
|
}
|
|
19
13
|
export declare function constructInlineQuery(query_: types.UpdateBotInlineQuery, getEntity: EntityGetter): Promise<InlineQuery>;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
2
|
import { KeyboardButton } from "./1_keyboard_button.js";
|
|
3
|
-
/** This object represents a custom keyboard with reply options. */
|
|
4
3
|
export interface ReplyKeyboardMarkup {
|
|
5
|
-
/** Array of button rows, each represented by an Array of `KeyboardButton` objects */
|
|
6
4
|
keyboard: KeyboardButton[][];
|
|
7
|
-
/** Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. */
|
|
8
5
|
isPersistent?: boolean;
|
|
9
|
-
/** Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. */
|
|
10
6
|
resizeKeyboard?: boolean;
|
|
11
|
-
/** Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false. */
|
|
12
7
|
oneTimeKeyboard?: boolean;
|
|
13
|
-
/** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
|
|
14
8
|
inputFieldPlaceholder?: string;
|
|
15
|
-
/** Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the `Message` object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. */
|
|
16
9
|
selective?: boolean;
|
|
17
10
|
}
|
|
18
11
|
export declare function constructReplyKeyboardMarkup(keyboard_: types.ReplyKeyboardMarkup): ReplyKeyboardMarkup;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
2
|
import { UsernameResolver } from "./1__getters.js";
|
|
3
3
|
import { InlineKeyboardButton } from "./2_inline_keyboard_button.js";
|
|
4
|
-
/** This object represents an inline keyboard that appears right next to the message it belongs to. */
|
|
5
4
|
export interface InlineKeyboardMarkup {
|
|
6
|
-
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
|
|
7
5
|
inlineKeyboard: InlineKeyboardButton[][];
|
|
8
6
|
}
|
|
9
7
|
export declare function constructInlineKeyboardMarkup(keyboard_: types.ReplyInlineMarkup): InlineKeyboardMarkup;
|