@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
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
interface User extends Base {
|
|
16
|
-
/** Differentiates between user profile photos. */
|
|
17
|
-
personal: true;
|
|
18
|
-
}
|
|
19
|
-
type Chat = Base;
|
|
2
|
+
/** @unlisted */
|
|
3
|
+
export interface ChatPhotoBase {
|
|
4
|
+
/** A file identifier that can be used to download or reuse the small version of the chat photo (160x160). */
|
|
5
|
+
smallFileId: string;
|
|
6
|
+
/** A file identifier that can be used to identify the small version of the chat photo (160x160). */
|
|
7
|
+
smallFileUniqueId: string;
|
|
8
|
+
/** A file identifier that can be used to download or reuse the big version of the chat photo (640x640). */
|
|
9
|
+
bigFileId: string;
|
|
10
|
+
/** A file identifier that can be used to identify the big version of the chat photo (640x640). */
|
|
11
|
+
bigFileUniqueId: string;
|
|
12
|
+
/** Whether the chat photo is animated. */
|
|
13
|
+
hasVideo: boolean;
|
|
20
14
|
}
|
|
15
|
+
/** @unlisted */
|
|
16
|
+
export interface ChatPhotoUser extends ChatPhotoBase {
|
|
17
|
+
/** Differentiates between user profile photos. */
|
|
18
|
+
personal: true;
|
|
19
|
+
}
|
|
20
|
+
/** @unlisted */
|
|
21
|
+
export type ChatPhotoChat = ChatPhotoBase;
|
|
21
22
|
/** This object represents a chat photo. */
|
|
22
|
-
export type ChatPhoto =
|
|
23
|
-
export declare function constructChatPhoto(photo: types.ChatPhoto, chatId: number, chatAccessHash: bigint):
|
|
24
|
-
export declare function constructChatPhoto(photo: types.UserProfilePhoto, chatId: number, chatAccessHash: bigint):
|
|
23
|
+
export type ChatPhoto = ChatPhotoUser | ChatPhotoChat;
|
|
24
|
+
export declare function constructChatPhoto(photo: types.ChatPhoto, chatId: number, chatAccessHash: bigint): ChatPhotoChat;
|
|
25
|
+
export declare function constructChatPhoto(photo: types.UserProfilePhoto, chatId: number, chatAccessHash: bigint): ChatPhotoUser;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client is not connected.
|
|
3
|
+
* @unlisted
|
|
4
|
+
*/
|
|
5
|
+
export type ConnectionStateNotConnected = "notConnected";
|
|
6
|
+
/**
|
|
7
|
+
* The client is connected but recovering from an update gap.
|
|
8
|
+
* @unlisted
|
|
9
|
+
*/
|
|
10
|
+
export type ConnectionStateUpdating = "updating";
|
|
11
|
+
/**
|
|
12
|
+
* The client is connected and not recovering from an update gap.
|
|
13
|
+
* @unlisted
|
|
14
|
+
*/
|
|
15
|
+
export type ConnectionStateReady = "ready";
|
|
16
|
+
/** A client's connection state. */
|
|
17
|
+
export type ConnectionState = ConnectionStateNotConnected | ConnectionStateUpdating | ConnectionStateReady;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
|
+
export interface GiveawayParameters {
|
|
3
|
+
boostedChatId: number;
|
|
4
|
+
additionalChatIds: number[];
|
|
5
|
+
winnerSelectionDate: Date;
|
|
6
|
+
onlyNewMembers: boolean;
|
|
7
|
+
countries: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function constructGiveawayParameters(g: types.MessageMediaGiveaway): GiveawayParameters;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.constructGiveawayParameters = void 0;
|
|
4
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
5
|
+
function constructGiveawayParameters(g) {
|
|
6
|
+
const countries = g.countries_iso2 ?? [];
|
|
7
|
+
const boostedChatId = (0, _2_tl_js_1.peerToChatId)(new _2_tl_js_1.types.PeerChannel({ channel_id: g.channels[0] }));
|
|
8
|
+
const additionalChatIds = g.channels.slice(1).map((v) => (0, _2_tl_js_1.peerToChatId)(new _2_tl_js_1.types.PeerChannel({ channel_id: v })));
|
|
9
|
+
const onlyNewMembers = g.only_new_subscribers ? true : false;
|
|
10
|
+
const winnerSelectionDate = new Date(g.until_date * 1000);
|
|
11
|
+
return { boostedChatId, additionalChatIds, winnerSelectionDate, onlyNewMembers, countries };
|
|
12
|
+
}
|
|
13
|
+
exports.constructGiveawayParameters = constructGiveawayParameters;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
export interface LoginUrl {
|
|
2
|
-
/** An HTTPS URL to be opened with the authorization data appended to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. */
|
|
3
2
|
url: string;
|
|
4
|
-
/** A different text to use for the button when the message is forwarded. */
|
|
5
3
|
forwardText?: string;
|
|
6
|
-
/** Username of a bot, which will be used for user authorization. See [Learn more.](https://core.telegram.org/widgets/login#setting-up-a-bot) If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. [Learn more.](https://core.telegram.org/widgets/login#linking-your-domain-to-the-bot) */
|
|
7
4
|
botUsername?: string;
|
|
8
|
-
/** Whether to ask the user to allow messages to be received from the specified bot. */
|
|
9
5
|
requestWriteAccess?: boolean;
|
|
10
6
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { enums } from "../2_tl.js";
|
|
2
2
|
export interface MaskPosition {
|
|
3
|
-
/** The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin". */
|
|
4
3
|
point: "forehead" | "eyes" | "mouth" | "chin";
|
|
5
|
-
/** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */
|
|
6
4
|
xShift: number;
|
|
7
|
-
/** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */
|
|
8
5
|
yShift: number;
|
|
9
|
-
/** Mask scaling coefficient. For example, 2.0 means double size. */
|
|
10
6
|
scale: number;
|
|
11
7
|
}
|
|
12
8
|
export declare function constructMaskPosition({ n, x, y, zoom }: enums.MaskCoords): MaskPosition;
|
|
@@ -1,80 +1,97 @@
|
|
|
1
1
|
import { enums } from "../2_tl.js";
|
|
2
|
+
/** @unlisted */
|
|
2
3
|
export type MessageEntityType = "mention" | "hashtag" | "botCommand" | "url" | "email" | "bold" | "italic" | "code" | "pre" | "textLink" | "textMention" | "cashtag" | "phoneNumber" | "underline" | "strikethrough" | "blockquote" | "bankCard" | "spoiler" | "customEmoji";
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
4
|
+
/** @unlisted */
|
|
5
|
+
export interface MessageEntityBase {
|
|
6
|
+
type: MessageEntityType;
|
|
7
|
+
offset: number;
|
|
8
|
+
length: number;
|
|
9
|
+
}
|
|
10
|
+
/** @unlisted */
|
|
11
|
+
export interface MessageEntityMention extends MessageEntityBase {
|
|
12
|
+
type: "mention";
|
|
13
|
+
}
|
|
14
|
+
/** @unlisted */
|
|
15
|
+
export interface MessageEntityHashtag extends MessageEntityBase {
|
|
16
|
+
type: "hashtag";
|
|
17
|
+
}
|
|
18
|
+
/** @unlisted */
|
|
19
|
+
export interface MessageEntityBotCommand extends MessageEntityBase {
|
|
20
|
+
type: "botCommand";
|
|
21
|
+
}
|
|
22
|
+
/** @unlisted */
|
|
23
|
+
export interface MessageEntityURL extends MessageEntityBase {
|
|
24
|
+
type: "url";
|
|
25
|
+
}
|
|
26
|
+
/** @unlisted */
|
|
27
|
+
export interface MessageEntityEmailAddress extends MessageEntityBase {
|
|
28
|
+
type: "email";
|
|
29
|
+
}
|
|
30
|
+
/** @unlisted */
|
|
31
|
+
export interface MessageEntityBold extends MessageEntityBase {
|
|
32
|
+
type: "bold";
|
|
33
|
+
}
|
|
34
|
+
/** @unlisted */
|
|
35
|
+
export interface MessageEntityItalic extends MessageEntityBase {
|
|
36
|
+
type: "italic";
|
|
37
|
+
}
|
|
38
|
+
/** @unlisted */
|
|
39
|
+
export interface MessageEntityPre extends MessageEntityBase {
|
|
40
|
+
type: "pre";
|
|
41
|
+
/** The language identifier of the code. */
|
|
42
|
+
language: string;
|
|
43
|
+
}
|
|
44
|
+
/** @unlisted */
|
|
45
|
+
export interface MessageEntityCode extends MessageEntityBase {
|
|
46
|
+
type: "code";
|
|
47
|
+
}
|
|
48
|
+
/** @unlisted */
|
|
49
|
+
export interface MessageEntityTextLink extends MessageEntityBase {
|
|
50
|
+
type: "textLink";
|
|
51
|
+
/** A URL that will be opened after the text is tapped. */
|
|
52
|
+
url: string;
|
|
53
|
+
}
|
|
54
|
+
/** @unlisted */
|
|
55
|
+
export interface MessageEntityTextMention extends MessageEntityBase {
|
|
56
|
+
type: "textMention";
|
|
57
|
+
/** The identifier of the user to mention. */
|
|
58
|
+
userId: number;
|
|
59
|
+
}
|
|
60
|
+
/** @unlisted */
|
|
61
|
+
export interface MessageEntityCashtag extends MessageEntityBase {
|
|
62
|
+
type: "cashtag";
|
|
63
|
+
}
|
|
64
|
+
/** @unlisted */
|
|
65
|
+
export interface MessageEntityPhoneNumber extends MessageEntityBase {
|
|
66
|
+
type: "phoneNumber";
|
|
67
|
+
}
|
|
68
|
+
/** @unlisted */
|
|
69
|
+
export interface MessageEntityUnderline extends MessageEntityBase {
|
|
70
|
+
type: "underline";
|
|
71
|
+
}
|
|
72
|
+
/** @unlisted */
|
|
73
|
+
export interface MessageEntityStrikethrough extends MessageEntityBase {
|
|
74
|
+
type: "strikethrough";
|
|
75
|
+
}
|
|
76
|
+
/** @unlisted */
|
|
77
|
+
export interface MessageEntityBlockquote extends MessageEntityBase {
|
|
78
|
+
type: "blockquote";
|
|
79
|
+
}
|
|
80
|
+
/** @unlisted */
|
|
81
|
+
export interface MessageEntityBankCard extends MessageEntityBase {
|
|
82
|
+
type: "bankCard";
|
|
83
|
+
}
|
|
84
|
+
/** @unlisted */
|
|
85
|
+
export interface MessageEntitySpoiler extends MessageEntityBase {
|
|
86
|
+
type: "spoiler";
|
|
87
|
+
}
|
|
88
|
+
/** @unlisted */
|
|
89
|
+
export interface MessageEntityCustomEmoji extends MessageEntityBase {
|
|
90
|
+
type: "customEmoji";
|
|
91
|
+
/** The identifier of the custom emoji. */
|
|
92
|
+
customEmojiId: string;
|
|
76
93
|
}
|
|
77
94
|
/** A single entity of a message's text or caption. */
|
|
78
|
-
export type MessageEntity =
|
|
95
|
+
export type MessageEntity = MessageEntityMention | MessageEntityHashtag | MessageEntityBotCommand | MessageEntityURL | MessageEntityEmailAddress | MessageEntityBold | MessageEntityItalic | MessageEntityCode | MessageEntityPre | MessageEntityTextLink | MessageEntityTextMention | MessageEntityCashtag | MessageEntityPhoneNumber | MessageEntityUnderline | MessageEntityStrikethrough | MessageEntityBlockquote | MessageEntityBankCard | MessageEntitySpoiler | MessageEntityCustomEmoji;
|
|
79
96
|
export declare function constructMessageEntity(obj: enums.MessageEntity): MessageEntity | null;
|
|
80
97
|
export declare function messageEntityToTlObject(entity: MessageEntity): import("../tl/2_types.js").MessageEntityMention_ | import("../tl/2_types.js").MessageEntityHashtag_ | import("../tl/2_types.js").MessageEntityBotCommand_ | import("../tl/2_types.js").MessageEntityUrl_ | import("../tl/2_types.js").MessageEntityEmail_ | import("../tl/2_types.js").MessageEntityBold_ | import("../tl/2_types.js").MessageEntityItalic_ | import("../tl/2_types.js").MessageEntityCode_ | import("../tl/2_types.js").MessageEntityPre_ | import("../tl/2_types.js").MessageEntityTextUrl_ | import("../tl/2_types.js").MessageEntityMentionName_ | import("../tl/2_types.js").MessageEntityPhone_ | import("../tl/2_types.js").MessageEntityCashtag_ | import("../tl/2_types.js").MessageEntityUnderline_ | import("../tl/2_types.js").MessageEntityStrike_ | import("../tl/2_types.js").MessageEntityBankCard_ | import("../tl/2_types.js").MessageEntitySpoiler_ | import("../tl/2_types.js").MessageEntityCustomEmoji_ | import("../tl/2_types.js").MessageEntityBlockquote_;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
interface CustomEmoji {
|
|
7
|
-
type: "customEmoji";
|
|
8
|
-
id: string;
|
|
9
|
-
}
|
|
1
|
+
import { enums } from "../2_tl.js";
|
|
2
|
+
/** @unlisted */
|
|
3
|
+
export interface ReactionEmoji {
|
|
4
|
+
type: "emoji";
|
|
5
|
+
emoji: string;
|
|
10
6
|
}
|
|
11
|
-
|
|
7
|
+
/** @unlisted */
|
|
8
|
+
export interface ReactionCustomEmoji {
|
|
9
|
+
type: "customEmoji";
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
export type Reaction = ReactionEmoji | ReactionCustomEmoji;
|
|
13
|
+
export declare function constructReaction(reaction: enums.Reaction): Reaction;
|
|
14
|
+
export declare function reactionToTlObject(reaction: Reaction): enums.Reaction;
|
|
15
|
+
export declare function reactionEqual(left: Reaction, right: Reaction): boolean;
|
|
@@ -1,2 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reactionEqual = exports.reactionToTlObject = exports.constructReaction = void 0;
|
|
4
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
5
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
6
|
+
function constructReaction(reaction) {
|
|
7
|
+
if (reaction instanceof _2_tl_js_1.types.ReactionEmoji) {
|
|
8
|
+
return { type: "emoji", emoji: reaction.emoticon };
|
|
9
|
+
}
|
|
10
|
+
else if (reaction instanceof _2_tl_js_1.types.ReactionCustomEmoji) {
|
|
11
|
+
return { type: "customEmoji", id: String(reaction.document_id) };
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
(0, _1_utilities_js_1.UNREACHABLE)();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.constructReaction = constructReaction;
|
|
18
|
+
function reactionToTlObject(reaction) {
|
|
19
|
+
return reaction.type == "emoji" ? new _2_tl_js_1.types.ReactionEmoji({ emoticon: reaction.emoji }) : new _2_tl_js_1.types.ReactionCustomEmoji({ document_id: BigInt(reaction.id) });
|
|
20
|
+
}
|
|
21
|
+
exports.reactionToTlObject = reactionToTlObject;
|
|
22
|
+
function reactionEqual(left, right) {
|
|
23
|
+
if (left.type == "emoji") {
|
|
24
|
+
if (right.type == "emoji" && left.emoji == right.emoji) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else if (left.type == "customEmoji") {
|
|
29
|
+
if (right.type == "customEmoji" && left.id == right.id) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
exports.reactionEqual = reactionEqual;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
3
|
import { ChatID } from "./0_chat_id.js";
|
|
4
|
+
/** @unlisted */
|
|
4
5
|
export interface EntityGetter {
|
|
5
6
|
(peer: types.PeerUser): MaybePromise<types.User | null>;
|
|
6
7
|
(peer: types.PeerChat): MaybePromise<types.Chat | types.ChatForbidden | null>;
|
|
7
8
|
(peer: types.PeerChannel): MaybePromise<types.Channel | types.ChannelForbidden | null>;
|
|
8
9
|
(peer: types.PeerUser | types.PeerChat | types.PeerChannel): MaybePromise<types.User | types.Chat | types.ChatForbidden | types.Channel | types.ChannelForbidden | null>;
|
|
9
10
|
}
|
|
11
|
+
/** @unlisted */
|
|
10
12
|
export interface InputPeerGetter {
|
|
11
13
|
(id: ChatID): Promise<types.InputPeerUser | types.InputPeerChannel | types.InputPeerChat>;
|
|
12
14
|
}
|
|
15
|
+
/** @unlisted */
|
|
13
16
|
export interface UsernameResolver {
|
|
14
17
|
(username: string): MaybePromise<types.InputUser>;
|
|
15
18
|
}
|
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import { ChatID } from "./0_chat_id.js";
|
|
2
2
|
import { InputPeerGetter } from "./1__getters.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
interface AllPrivateChats {
|
|
8
|
-
type: "allPrivateChats";
|
|
9
|
-
}
|
|
10
|
-
interface AllGroupChats {
|
|
11
|
-
type: "allGroupChats";
|
|
12
|
-
}
|
|
13
|
-
interface AllChatAdministrators {
|
|
14
|
-
type: "allChatAdministrators";
|
|
15
|
-
}
|
|
16
|
-
interface Chat {
|
|
17
|
-
type: "chat";
|
|
18
|
-
chatId: ChatID;
|
|
19
|
-
}
|
|
20
|
-
interface ChatAdministrators {
|
|
21
|
-
type: "chatAdministrators";
|
|
22
|
-
chatId: ChatID;
|
|
23
|
-
}
|
|
24
|
-
interface ChatMember {
|
|
25
|
-
type: "chatMember";
|
|
26
|
-
chatId: ChatID;
|
|
27
|
-
userId: number;
|
|
28
|
-
}
|
|
3
|
+
/** @unlisted */
|
|
4
|
+
export interface BotCommandScopeDefault {
|
|
5
|
+
type: "default";
|
|
29
6
|
}
|
|
30
|
-
|
|
7
|
+
/** @unlisted */
|
|
8
|
+
export interface BotCommandScopeAllPrivateChats {
|
|
9
|
+
type: "allPrivateChats";
|
|
10
|
+
}
|
|
11
|
+
/** @unlisted */
|
|
12
|
+
export interface BotCommandScopeAllGroupChats {
|
|
13
|
+
type: "allGroupChats";
|
|
14
|
+
}
|
|
15
|
+
/** @unlisted */
|
|
16
|
+
export interface BotCommandScopeAllChatAdministrators {
|
|
17
|
+
type: "allChatAdministrators";
|
|
18
|
+
}
|
|
19
|
+
/** @unlisted */
|
|
20
|
+
export interface BotCommandScopeChat {
|
|
21
|
+
type: "chat";
|
|
22
|
+
chatId: ChatID;
|
|
23
|
+
}
|
|
24
|
+
/** @unlisted */
|
|
25
|
+
export interface BotCommandScopeChatAdministrators {
|
|
26
|
+
type: "chatAdministrators";
|
|
27
|
+
chatId: ChatID;
|
|
28
|
+
}
|
|
29
|
+
/** @unlisted */
|
|
30
|
+
export interface BotCommandScopeChatMember {
|
|
31
|
+
type: "chatMember";
|
|
32
|
+
chatId: ChatID;
|
|
33
|
+
userId: number;
|
|
34
|
+
}
|
|
35
|
+
export type BotCommandScope = BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember;
|
|
31
36
|
export declare function botCommandScopeToTlObject(scope: BotCommandScope, getInputPeer: InputPeerGetter): Promise<import("../tl/2_types.js").BotCommandScopeDefault_ | import("../tl/2_types.js").BotCommandScopeUsers_ | import("../tl/2_types.js").BotCommandScopeChats_ | import("../tl/2_types.js").BotCommandScopeChatAdmins_ | import("../tl/2_types.js").BotCommandScopePeer_ | import("../tl/2_types.js").BotCommandScopePeerAdmins_ | import("../tl/2_types.js").BotCommandScopePeerUser_>;
|
|
@@ -1,72 +1,81 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
2
|
import { RestrictionReason } from "./0_restriction_reason.js";
|
|
3
|
+
/** @unlisted */
|
|
3
4
|
export type ChatType = "private" | "group" | "supergroup" | "channel";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
interface Private extends Base {
|
|
14
|
-
type: "private";
|
|
15
|
-
/** Whether this is a bot's chat. */
|
|
16
|
-
isBot?: boolean;
|
|
17
|
-
/** The first name of the user. */
|
|
18
|
-
firstName: string;
|
|
19
|
-
/** The last name of the user. */
|
|
20
|
-
lastName?: string;
|
|
21
|
-
/** The user's main username. */
|
|
22
|
-
username?: string;
|
|
23
|
-
/** Whether the user has been identified as scam. */
|
|
24
|
-
isScam: boolean;
|
|
25
|
-
/** Whether the user has been identified as an impersonator. */
|
|
26
|
-
isFake: boolean;
|
|
27
|
-
/** Whether the user is official support. */
|
|
28
|
-
isSupport: boolean;
|
|
29
|
-
/** Whether the user has been verified. */
|
|
30
|
-
isVerified: boolean;
|
|
31
|
-
/** Whether the user has been restricted. */
|
|
32
|
-
isRestricted?: boolean;
|
|
33
|
-
/** The reason why the user has been restricted. */
|
|
34
|
-
restrictionReason?: RestrictionReason[];
|
|
35
|
-
}
|
|
36
|
-
interface Group extends Base {
|
|
37
|
-
type: "group";
|
|
38
|
-
/** The title of the chat. */
|
|
39
|
-
title: string;
|
|
40
|
-
/** Whether the current user is the owner of the chat. */
|
|
41
|
-
isCreator: boolean;
|
|
42
|
-
}
|
|
43
|
-
interface ChannelBase extends Base {
|
|
44
|
-
/** The title of the chat or channel. */
|
|
45
|
-
title: string;
|
|
46
|
-
/** The main username of the chat or channel. */
|
|
47
|
-
username?: string;
|
|
48
|
-
/** Whether the chat or channel has been identified as scam. */
|
|
49
|
-
isScam: boolean;
|
|
50
|
-
/** Whether the chat or channel has been identified as an impersonator. */
|
|
51
|
-
isFake: boolean;
|
|
52
|
-
/** Whether the chat or channel has been verified. */
|
|
53
|
-
isVerified: boolean;
|
|
54
|
-
/** Whether the chat or channel has been restricted. */
|
|
55
|
-
isRestricted: boolean;
|
|
56
|
-
/** The reason why the chat or channel has been restricted. */
|
|
57
|
-
restrictionReason?: RestrictionReason[];
|
|
58
|
-
}
|
|
59
|
-
interface Channel extends ChannelBase {
|
|
60
|
-
type: "channel";
|
|
61
|
-
}
|
|
62
|
-
interface Supergroup extends ChannelBase {
|
|
63
|
-
type: "supergroup";
|
|
64
|
-
/** Whether the chat is a forum. */
|
|
65
|
-
isForum: boolean;
|
|
66
|
-
}
|
|
5
|
+
/** @unlisted */
|
|
6
|
+
export interface ChatPBase {
|
|
7
|
+
/** The identifier of the chat. */
|
|
8
|
+
id: number;
|
|
9
|
+
/** The type of the chat. */
|
|
10
|
+
type: ChatType;
|
|
11
|
+
/** Identifier of a color that can be displayed instead of the chat's photo. */
|
|
12
|
+
color: number;
|
|
67
13
|
}
|
|
68
|
-
/**
|
|
69
|
-
export
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
14
|
+
/** @unlisted */
|
|
15
|
+
export interface ChatPPrivate extends ChatPBase {
|
|
16
|
+
type: "private";
|
|
17
|
+
/** Whether this is a bot's chat. */
|
|
18
|
+
isBot?: boolean;
|
|
19
|
+
/** The first name of the user. */
|
|
20
|
+
firstName: string;
|
|
21
|
+
/** The last name of the user. */
|
|
22
|
+
lastName?: string;
|
|
23
|
+
/** The user's main username. */
|
|
24
|
+
username?: string;
|
|
25
|
+
/** Whether the user has been identified as scam. */
|
|
26
|
+
isScam: boolean;
|
|
27
|
+
/** Whether the user has been identified as an impersonator. */
|
|
28
|
+
isFake: boolean;
|
|
29
|
+
/** Whether the user is official support. */
|
|
30
|
+
isSupport: boolean;
|
|
31
|
+
/** Whether the user has been verified. */
|
|
32
|
+
isVerified: boolean;
|
|
33
|
+
/** Whether the user has been restricted. */
|
|
34
|
+
isRestricted?: boolean;
|
|
35
|
+
/** The reason why the user has been restricted. */
|
|
36
|
+
restrictionReason?: RestrictionReason[];
|
|
37
|
+
}
|
|
38
|
+
/** @unlisted */
|
|
39
|
+
export interface ChatPGroup extends ChatPBase {
|
|
40
|
+
type: "group";
|
|
41
|
+
/** The title of the chat. */
|
|
42
|
+
title: string;
|
|
43
|
+
/** Whether the current user is the owner of the chat. */
|
|
44
|
+
isCreator: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** @unlisted */
|
|
47
|
+
export interface ChatPChannelBase extends ChatPBase {
|
|
48
|
+
/** The title of the chat or channel. */
|
|
49
|
+
title: string;
|
|
50
|
+
/** The main username of the chat or channel. */
|
|
51
|
+
username?: string;
|
|
52
|
+
/** Whether the chat or channel has been identified as scam. */
|
|
53
|
+
isScam: boolean;
|
|
54
|
+
/** Whether the chat or channel has been identified as an impersonator. */
|
|
55
|
+
isFake: boolean;
|
|
56
|
+
/** Whether the chat or channel has been verified. */
|
|
57
|
+
isVerified: boolean;
|
|
58
|
+
/** Whether the chat or channel has been restricted. */
|
|
59
|
+
isRestricted: boolean;
|
|
60
|
+
/** The reason why the chat or channel has been restricted. */
|
|
61
|
+
restrictionReason?: RestrictionReason[];
|
|
62
|
+
}
|
|
63
|
+
/** @unlisted */
|
|
64
|
+
export interface ChatPChannel extends ChatPChannelBase {
|
|
65
|
+
type: "channel";
|
|
66
|
+
}
|
|
67
|
+
/** @unlisted */
|
|
68
|
+
export interface ChatPSupergroup extends ChatPChannelBase {
|
|
69
|
+
type: "supergroup";
|
|
70
|
+
/** Whether the chat is a forum. */
|
|
71
|
+
isForum: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* This object represents a chat.
|
|
75
|
+
* @unlisted
|
|
76
|
+
*/
|
|
77
|
+
export type ChatP = ChatPPrivate | ChatPGroup | ChatPSupergroup | ChatPChannel;
|
|
78
|
+
export declare function constructChatP(chat: types.User): ChatPPrivate;
|
|
79
|
+
export declare function constructChatP(chat: types.Chat | types.ChatForbidden): ChatPGroup;
|
|
80
|
+
export declare function constructChatP(chat: types.Channel | types.ChannelForbidden): ChatPSupergroup | ChatPChannel;
|
|
81
|
+
export declare function constructChatP(chat: types.User | types.Chat | types.ChatForbidden | types.Channel | types.ChannelForbidden): ChatP;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { types } from "../2_tl.js";
|
|
2
|
+
import { GiveawayParameters } from "./0_giveaway_parameters.js";
|
|
3
|
+
export interface Giveaway {
|
|
4
|
+
parameters: GiveawayParameters;
|
|
5
|
+
winnerCount: number;
|
|
6
|
+
monthCount: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function constructGiveaway(g: types.MessageMediaGiveaway): Giveaway;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.constructGiveaway = void 0;
|
|
4
|
+
const _0_giveaway_parameters_js_1 = require("./0_giveaway_parameters.js");
|
|
5
|
+
function constructGiveaway(g) {
|
|
6
|
+
const winnerCount = g.quantity;
|
|
7
|
+
const monthCount = g.months;
|
|
8
|
+
const parameters = (0, _0_giveaway_parameters_js_1.constructGiveawayParameters)(g);
|
|
9
|
+
return { parameters, winnerCount, monthCount };
|
|
10
|
+
}
|
|
11
|
+
exports.constructGiveaway = constructGiveaway;
|