@mtkruto/node 0.114.0 → 0.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/3_types.d.ts +7 -1
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +7 -1
- package/esm/client/0_params.d.ts +4 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +51 -30
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/2_account_manager.d.ts +13 -4
- package/esm/client/2_account_manager.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +44 -7
- package/esm/client/2_bot_info_manager.d.ts +9 -2
- package/esm/client/2_bot_info_manager.d.ts.map +1 -1
- package/esm/client/2_bot_info_manager.js +14 -0
- package/esm/client/2_context.d.ts +332 -280
- package/esm/client/2_context.d.ts.map +1 -1
- package/esm/client/2_context.js +608 -517
- package/esm/client/3_filters.d.ts +1 -1
- package/esm/client/3_filters.d.ts.map +1 -1
- package/esm/client/3_message_manager.d.ts +2 -8
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +6 -44
- package/esm/client/4_checklist_manager.d.ts +38 -0
- package/esm/client/4_checklist_manager.d.ts.map +1 -0
- package/esm/client/4_checklist_manager.js +68 -0
- package/esm/client/4_gift_manager.d.ts +1 -0
- package/esm/client/4_gift_manager.d.ts.map +1 -1
- package/esm/client/4_gift_manager.js +6 -0
- package/esm/client/5_client.d.ts +51 -30
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +84 -44
- package/esm/client/5_client_dispatcher.d.ts +51 -30
- package/esm/client/5_client_dispatcher.d.ts.map +1 -1
- package/esm/client/5_client_dispatcher.js +68 -38
- package/esm/types/0_emoji_status.d.ts +45 -0
- package/esm/types/0_emoji_status.d.ts.map +1 -0
- package/esm/types/0_emoji_status.js +33 -0
- package/esm/types/0_input_emoji_status.d.ts +33 -0
- package/esm/types/0_input_emoji_status.d.ts.map +1 -0
- package/esm/types/0_user_status.d.ts +64 -0
- package/esm/types/0_user_status.d.ts.map +1 -0
- package/esm/types/0_user_status.js +35 -0
- package/esm/types/{0_working_hour_interval.d.ts → 0_working_hours_interval.d.ts} +2 -2
- package/esm/types/0_working_hours_interval.d.ts.map +1 -0
- package/esm/types/0_working_hours_interval.js +20 -0
- package/esm/types/1_bot_commands.d.ts +30 -0
- package/esm/types/1_bot_commands.d.ts.map +1 -0
- package/esm/types/1_bot_commands.js +20 -0
- package/esm/types/1_chat_p.d.ts +6 -0
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +4 -0
- package/esm/types/1_working_hours.d.ts +2 -2
- package/esm/types/1_working_hours.d.ts.map +1 -1
- package/esm/types/2_user.d.ts +6 -0
- package/esm/types/2_user.d.ts.map +1 -1
- package/esm/types/2_user.js +5 -0
- package/esm/types/3_reply_quote.d.ts +1 -1
- package/esm/types/3_reply_quote.d.ts.map +1 -1
- package/esm/types/4_gift.d.ts +1 -1
- package/esm/types/4_gift.d.ts.map +1 -1
- package/esm/types/5_claimed_gift.d.ts +1 -1
- package/esm/types/5_claimed_gift.js +1 -1
- package/esm/types/5_gift_non_upgraded_information.d.ts +47 -0
- package/esm/types/5_gift_non_upgraded_information.d.ts.map +1 -0
- package/esm/types/5_gift_non_upgraded_information.js +69 -0
- package/esm/types/5_gift_upgraded_information.d.ts +41 -0
- package/esm/types/5_gift_upgraded_information.d.ts.map +1 -0
- package/esm/types/5_gift_upgraded_information.js +58 -0
- package/esm/types/6_message.d.ts +21 -1
- package/esm/types/6_message.d.ts.map +1 -1
- package/esm/types/6_message.js +12 -0
- package/esm/types/8_update.d.ts +60 -2
- package/esm/types/8_update.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +7 -1
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +7 -1
- package/script/client/0_params.d.ts +4 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +51 -30
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/2_account_manager.d.ts +13 -4
- package/script/client/2_account_manager.d.ts.map +1 -1
- package/script/client/2_account_manager.js +43 -6
- package/script/client/2_bot_info_manager.d.ts +9 -2
- package/script/client/2_bot_info_manager.d.ts.map +1 -1
- package/script/client/2_bot_info_manager.js +14 -0
- package/script/client/2_context.d.ts +332 -280
- package/script/client/2_context.d.ts.map +1 -1
- package/script/client/2_context.js +608 -517
- package/script/client/3_filters.d.ts +1 -1
- package/script/client/3_filters.d.ts.map +1 -1
- package/script/client/3_message_manager.d.ts +2 -8
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +6 -44
- package/script/client/4_checklist_manager.d.ts +38 -0
- package/script/client/4_checklist_manager.d.ts.map +1 -0
- package/script/client/4_checklist_manager.js +72 -0
- package/script/client/4_gift_manager.d.ts +1 -0
- package/script/client/4_gift_manager.d.ts.map +1 -1
- package/script/client/4_gift_manager.js +6 -0
- package/script/client/5_client.d.ts +51 -30
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +84 -44
- package/script/client/5_client_dispatcher.d.ts +51 -30
- package/script/client/5_client_dispatcher.d.ts.map +1 -1
- package/script/client/5_client_dispatcher.js +68 -38
- package/script/types/0_emoji_status.d.ts +45 -0
- package/script/types/0_emoji_status.d.ts.map +1 -0
- package/script/types/0_emoji_status.js +36 -0
- package/script/types/0_input_emoji_status.d.ts +33 -0
- package/script/types/0_input_emoji_status.d.ts.map +1 -0
- package/script/types/0_user_status.d.ts +64 -0
- package/script/types/0_user_status.d.ts.map +1 -0
- package/script/types/0_user_status.js +38 -0
- package/script/types/{0_working_hour_interval.d.ts → 0_working_hours_interval.d.ts} +2 -2
- package/script/types/0_working_hours_interval.d.ts.map +1 -0
- package/script/types/0_working_hours_interval.js +21 -0
- package/script/types/1_bot_commands.d.ts +30 -0
- package/script/types/1_bot_commands.d.ts.map +1 -0
- package/script/types/1_bot_commands.js +21 -0
- package/script/types/1_chat_p.d.ts +6 -0
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +4 -0
- package/script/types/1_working_hours.d.ts +2 -2
- package/script/types/1_working_hours.d.ts.map +1 -1
- package/script/types/2_user.d.ts +6 -0
- package/script/types/2_user.d.ts.map +1 -1
- package/script/types/2_user.js +5 -0
- package/script/types/3_reply_quote.d.ts +1 -1
- package/script/types/3_reply_quote.d.ts.map +1 -1
- package/script/types/4_gift.d.ts +1 -1
- package/script/types/4_gift.d.ts.map +1 -1
- package/script/types/5_claimed_gift.d.ts +1 -1
- package/script/types/5_claimed_gift.js +1 -1
- package/script/types/5_gift_non_upgraded_information.d.ts +47 -0
- package/script/types/5_gift_non_upgraded_information.d.ts.map +1 -0
- package/script/types/5_gift_non_upgraded_information.js +72 -0
- package/script/types/5_gift_upgraded_information.d.ts +41 -0
- package/script/types/5_gift_upgraded_information.d.ts.map +1 -0
- package/script/types/5_gift_upgraded_information.js +61 -0
- package/script/types/6_message.d.ts +21 -1
- package/script/types/6_message.d.ts.map +1 -1
- package/script/types/6_message.js +12 -0
- package/script/types/8_update.d.ts +60 -2
- package/script/types/8_update.d.ts.map +1 -1
- package/esm/types/0_working_hour_interval.d.ts.map +0 -1
- package/script/types/0_working_hour_interval.d.ts.map +0 -1
- /package/esm/types/{0_working_hour_interval.js → 0_input_emoji_status.js} +0 -0
- /package/script/types/{0_working_hour_interval.js → 0_input_emoji_status.js} +0 -0
|
@@ -340,20 +340,37 @@ export class ClientDispatcher extends Composer {
|
|
|
340
340
|
* Set the current account's emoji status. User-only.
|
|
341
341
|
*
|
|
342
342
|
* @method ac
|
|
343
|
-
* @param
|
|
343
|
+
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
344
344
|
*/
|
|
345
|
-
async setEmojiStatus(
|
|
346
|
-
return await this.#dispatch(
|
|
345
|
+
async setEmojiStatus(emojiStatus, params) {
|
|
346
|
+
return await this.#dispatch("setEmojiStatus", emojiStatus, params);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Remove the current account's emoji status. User-only.
|
|
350
|
+
*
|
|
351
|
+
* @method ac
|
|
352
|
+
*/
|
|
353
|
+
async removeEmojiStatus() {
|
|
354
|
+
return await this.#dispatch("removeEmojiStatus");
|
|
347
355
|
}
|
|
348
356
|
/**
|
|
349
357
|
* Set the emoji status of a bot's user. Bot-only.
|
|
350
358
|
*
|
|
351
359
|
* @method ac
|
|
352
360
|
* @param userId The identifier of a user of the bot.
|
|
353
|
-
* @param
|
|
361
|
+
* @param emojiStatus The emoji or gift to set as the new emoji status.
|
|
362
|
+
*/
|
|
363
|
+
async setUserEmojiStatus(userId, emojiStatus, params) {
|
|
364
|
+
return await this.#dispatch("setUserEmojiStatus", userId, emojiStatus, params);
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Remove the emoji status of a bot's user. Bot-only.
|
|
368
|
+
*
|
|
369
|
+
* @method ac
|
|
370
|
+
* @param userId The identifier of a user of the bot.
|
|
354
371
|
*/
|
|
355
|
-
async
|
|
356
|
-
return await this.#dispatch("
|
|
372
|
+
async removeUserEmojiStatus(userId) {
|
|
373
|
+
return await this.#dispatch("removeUserEmojiStatus", userId);
|
|
357
374
|
}
|
|
358
375
|
/**
|
|
359
376
|
* Update the profile of the current user. At least one parameter must be specified. User-only.
|
|
@@ -905,8 +922,8 @@ export class ClientDispatcher extends Composer {
|
|
|
905
922
|
* @method ms
|
|
906
923
|
* @param chatId The identifier of a chat.
|
|
907
924
|
*/
|
|
908
|
-
async unpinMessages(chatId) {
|
|
909
|
-
return await this.#dispatch("unpinMessages", chatId);
|
|
925
|
+
async unpinMessages(chatId, params) {
|
|
926
|
+
return await this.#dispatch("unpinMessages", chatId, params);
|
|
910
927
|
}
|
|
911
928
|
/**
|
|
912
929
|
* Forward multiple messages.
|
|
@@ -1058,13 +1075,40 @@ export class ClientDispatcher extends Composer {
|
|
|
1058
1075
|
async getMessageReactions(chatId, messageId, params) {
|
|
1059
1076
|
return await this.#dispatch("getMessageReactions", chatId, messageId, params);
|
|
1060
1077
|
}
|
|
1078
|
+
//
|
|
1079
|
+
// ========================= POLLS ========================= //
|
|
1080
|
+
//
|
|
1081
|
+
/**
|
|
1082
|
+
* Cast a vote. User-only.
|
|
1083
|
+
*
|
|
1084
|
+
* @method pl
|
|
1085
|
+
* @param chatId The identifier of the chat that includes the poll.
|
|
1086
|
+
* @param messageId The identifier of the message that includes the poll.
|
|
1087
|
+
* @param optionIndexes The indexes of the options to cast for.
|
|
1088
|
+
*/
|
|
1089
|
+
async vote(chatId, messageId, optionIndexes) {
|
|
1090
|
+
return await this.#dispatch("vote", chatId, messageId, optionIndexes);
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Retract a vote. User-only.
|
|
1094
|
+
*
|
|
1095
|
+
* @method pl
|
|
1096
|
+
* @param chatId The identifier of the chat that includes the poll.
|
|
1097
|
+
* @param messageId The identifier of the message that includes the poll.
|
|
1098
|
+
*/
|
|
1099
|
+
async retractVote(chatId, messageId) {
|
|
1100
|
+
return await this.#dispatch("retractVote", chatId, messageId);
|
|
1101
|
+
}
|
|
1102
|
+
//
|
|
1103
|
+
// ========================= CHECKLISTS ========================= //
|
|
1104
|
+
//
|
|
1061
1105
|
/**
|
|
1062
1106
|
* Add items to a checklist. User-only.
|
|
1063
1107
|
*
|
|
1064
1108
|
* @param chatId The identifier of a chat.
|
|
1065
1109
|
* @param messageId The identifier of the checklist message.
|
|
1066
1110
|
* @param items The items to add.
|
|
1067
|
-
* @method
|
|
1111
|
+
* @method cl
|
|
1068
1112
|
*/
|
|
1069
1113
|
async addToChecklist(chatId, messageId, items) {
|
|
1070
1114
|
return await this.#dispatch("addToChecklist", chatId, messageId, items);
|
|
@@ -1074,7 +1118,7 @@ export class ClientDispatcher extends Composer {
|
|
|
1074
1118
|
*
|
|
1075
1119
|
* @param chatId The identifier of a chat.
|
|
1076
1120
|
* @param messageId The identifier of the checklist message.
|
|
1077
|
-
* @method
|
|
1121
|
+
* @method cl
|
|
1078
1122
|
*/
|
|
1079
1123
|
async updateChecklist(chatId, messageId, params) {
|
|
1080
1124
|
return await this.#dispatch("updateChecklist", chatId, messageId, params);
|
|
@@ -1085,7 +1129,7 @@ export class ClientDispatcher extends Composer {
|
|
|
1085
1129
|
* @param chatId The identifier of a chat.
|
|
1086
1130
|
* @param messageId The identifier of the checklist message.
|
|
1087
1131
|
* @param items The identifiers of the items to check.
|
|
1088
|
-
* @method
|
|
1132
|
+
* @method cl
|
|
1089
1133
|
*/
|
|
1090
1134
|
async checkChecklistItems(chatId, messageId, items) {
|
|
1091
1135
|
return await this.#dispatch("checkChecklistItems", chatId, messageId, items);
|
|
@@ -1096,7 +1140,7 @@ export class ClientDispatcher extends Composer {
|
|
|
1096
1140
|
* @param chatId The identifier of a chat.
|
|
1097
1141
|
* @param messageId The identifier of the checklist message.
|
|
1098
1142
|
* @param items The identifiers of the items to uncheck.
|
|
1099
|
-
* @method
|
|
1143
|
+
* @method cl
|
|
1100
1144
|
*/
|
|
1101
1145
|
async uncheckChecklistItems(chatId, messageId, items) {
|
|
1102
1146
|
return await this.#dispatch("uncheckChecklistItems", chatId, messageId, items);
|
|
@@ -1107,7 +1151,7 @@ export class ClientDispatcher extends Composer {
|
|
|
1107
1151
|
* @param chatId The identifier of a chat.
|
|
1108
1152
|
* @param messageId The identifier of the checklist message.
|
|
1109
1153
|
* @param item The identifier of the item to check.
|
|
1110
|
-
* @method
|
|
1154
|
+
* @method cl
|
|
1111
1155
|
*/
|
|
1112
1156
|
async checkChecklistItem(chatId, messageId, item) {
|
|
1113
1157
|
return await this.#dispatch("checkChecklistItem", chatId, messageId, item);
|
|
@@ -1118,36 +1162,12 @@ export class ClientDispatcher extends Composer {
|
|
|
1118
1162
|
* @param chatId The identifier of a chat.
|
|
1119
1163
|
* @param messageId The identifier of the checklist message.
|
|
1120
1164
|
* @param item The identifier of the item to uncheck.
|
|
1121
|
-
* @method
|
|
1165
|
+
* @method cl
|
|
1122
1166
|
*/
|
|
1123
1167
|
async uncheckChecklistItem(chatId, messageId, item) {
|
|
1124
1168
|
return await this.#dispatch("uncheckChecklistItem", chatId, messageId, item);
|
|
1125
1169
|
}
|
|
1126
1170
|
//
|
|
1127
|
-
// ========================= POLLS ========================= //
|
|
1128
|
-
//
|
|
1129
|
-
/**
|
|
1130
|
-
* Cast a vote. User-only.
|
|
1131
|
-
*
|
|
1132
|
-
* @method pl
|
|
1133
|
-
* @param chatId The identifier of the chat that includes the poll.
|
|
1134
|
-
* @param messageId The identifier of the message that includes the poll.
|
|
1135
|
-
* @param optionIndexes The indexes of the options to cast for.
|
|
1136
|
-
*/
|
|
1137
|
-
async vote(chatId, messageId, optionIndexes) {
|
|
1138
|
-
return await this.#dispatch("vote", chatId, messageId, optionIndexes);
|
|
1139
|
-
}
|
|
1140
|
-
/**
|
|
1141
|
-
* Retract a vote. User-only.
|
|
1142
|
-
*
|
|
1143
|
-
* @method pl
|
|
1144
|
-
* @param chatId The identifier of the chat that includes the poll.
|
|
1145
|
-
* @param messageId The identifier of the message that includes the poll.
|
|
1146
|
-
*/
|
|
1147
|
-
async retractVote(chatId, messageId) {
|
|
1148
|
-
return await this.#dispatch("retractVote", chatId, messageId);
|
|
1149
|
-
}
|
|
1150
|
-
//
|
|
1151
1171
|
// ========================= FILES ========================= //
|
|
1152
1172
|
//
|
|
1153
1173
|
/**
|
|
@@ -2425,4 +2445,14 @@ export class ClientDispatcher extends Composer {
|
|
|
2425
2445
|
async getGift(slug) {
|
|
2426
2446
|
return await this.#dispatch("getGift", slug);
|
|
2427
2447
|
}
|
|
2448
|
+
/**
|
|
2449
|
+
* Transfer a gift. User-only.
|
|
2450
|
+
*
|
|
2451
|
+
* @method gf
|
|
2452
|
+
* @param chatId The identifier of a chat to transfer the gift to.
|
|
2453
|
+
* @param gift The gift to transfer.
|
|
2454
|
+
*/
|
|
2455
|
+
async transferGift(chatId, gift) {
|
|
2456
|
+
return await this.#dispatch("transferGift", chatId, gift);
|
|
2457
|
+
}
|
|
2428
2458
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import type { Api } from "../2_tl.js";
|
|
21
|
+
export interface _EmojiStatusBase {
|
|
22
|
+
until?: number;
|
|
23
|
+
}
|
|
24
|
+
/** @unlisted */
|
|
25
|
+
export interface EmojiStatusCustomEmoji extends _EmojiStatusBase {
|
|
26
|
+
type: "customEmoji";
|
|
27
|
+
customEmojiId: string;
|
|
28
|
+
}
|
|
29
|
+
/** @unlisted */
|
|
30
|
+
export interface EmojiStatusGift extends _EmojiStatusBase {
|
|
31
|
+
/** @discriminator */
|
|
32
|
+
type: "gift";
|
|
33
|
+
giftId: string;
|
|
34
|
+
customEmojiId: string;
|
|
35
|
+
title: string;
|
|
36
|
+
slug: string;
|
|
37
|
+
patternId: string;
|
|
38
|
+
centerColor: number;
|
|
39
|
+
edgeColor: number;
|
|
40
|
+
patternColor: number;
|
|
41
|
+
textColor: number;
|
|
42
|
+
}
|
|
43
|
+
export type EmojiStatus = EmojiStatusCustomEmoji | EmojiStatusGift;
|
|
44
|
+
export declare function constructEmojiStatus(emojiStatus: Api.EmojiStatus): EmojiStatus;
|
|
45
|
+
//# sourceMappingURL=0_emoji_status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_emoji_status.d.ts","sourceRoot":"","sources":["../../src/types/0_emoji_status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,gBAAgB;AAChB,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,WAAW,GAAG,sBAAsB,GAAG,eAAe,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,WAAW,GAAG,WAAW,CAY9E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { unreachable } from "../0_deps.js";
|
|
21
|
+
export function constructEmojiStatus(emojiStatus) {
|
|
22
|
+
switch (emojiStatus._) {
|
|
23
|
+
case "emojiStatusEmpty":
|
|
24
|
+
unreachable();
|
|
25
|
+
break;
|
|
26
|
+
case "emojiStatus":
|
|
27
|
+
return { type: "customEmoji", customEmojiId: String(emojiStatus.document_id), until: emojiStatus.until };
|
|
28
|
+
case "emojiStatusCollectible":
|
|
29
|
+
return { type: "gift", giftId: String(emojiStatus.collectible_id), customEmojiId: String(emojiStatus.document_id), title: emojiStatus.title, slug: emojiStatus.slug, patternId: String(emojiStatus.pattern_document_id), centerColor: emojiStatus.center_color, edgeColor: emojiStatus.edge_color, patternColor: emojiStatus.pattern_color, textColor: emojiStatus.text_color, until: emojiStatus.until };
|
|
30
|
+
case "inputEmojiStatusCollectible":
|
|
31
|
+
unreachable();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
/** @unlisted */
|
|
21
|
+
export interface InputEmojiStatusCustomEmoji {
|
|
22
|
+
/** @discriminator */
|
|
23
|
+
type: "customEmoji";
|
|
24
|
+
customEmojiId: string;
|
|
25
|
+
}
|
|
26
|
+
/** @unlisted */
|
|
27
|
+
export interface InputEmojiStatusGift {
|
|
28
|
+
/** @discriminator */
|
|
29
|
+
type: "gift";
|
|
30
|
+
giftId: number;
|
|
31
|
+
}
|
|
32
|
+
export type InputEmojiStatus = InputEmojiStatusCustomEmoji | InputEmojiStatusGift;
|
|
33
|
+
//# sourceMappingURL=0_input_emoji_status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_input_emoji_status.d.ts","sourceRoot":"","sources":["../../src/types/0_input_emoji_status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,gBAAgB;AAChB,MAAM,WAAW,2BAA2B;IAC1C,qBAAqB;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,gBAAgB;AAChB,MAAM,WAAW,oBAAoB;IACnC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,gBAAgB,GAAG,2BAA2B,GAAG,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import type { Api } from "../2_tl.js";
|
|
21
|
+
/**
|
|
22
|
+
* A user status indicating that the user is currently online.
|
|
23
|
+
* @unlisted
|
|
24
|
+
*/
|
|
25
|
+
export interface UserStatusOnline {
|
|
26
|
+
type: "online";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A user status indicating that the user is currently offline.
|
|
30
|
+
* @unlisted
|
|
31
|
+
*/
|
|
32
|
+
export interface UserStatusOffline {
|
|
33
|
+
/** @discriminator */
|
|
34
|
+
type: "offline";
|
|
35
|
+
/** A point in time in which the user was last seen online. */
|
|
36
|
+
lastSeenAt: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A user status indictating that the user was last seen online recently.
|
|
40
|
+
* @unlisted
|
|
41
|
+
*/
|
|
42
|
+
export interface UserStatusLastSeenRecently {
|
|
43
|
+
/** @discriminator */
|
|
44
|
+
type: "lastSeenRecently";
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A user status indictating that the user was last seen online around a week ago.
|
|
48
|
+
* @unlisted
|
|
49
|
+
*/
|
|
50
|
+
export interface UserStatusLastSeenLastWeek {
|
|
51
|
+
/** @discriminator */
|
|
52
|
+
type: "lastSeenLastWeek";
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A user status indictating that the user was last seen online around a month ago.
|
|
56
|
+
* @unlisted
|
|
57
|
+
*/
|
|
58
|
+
export interface UserStatusLastSeenLastMonth {
|
|
59
|
+
/** @discriminator */
|
|
60
|
+
type: "lastSeenLastMonth";
|
|
61
|
+
}
|
|
62
|
+
export type UserStatus = UserStatusOnline | UserStatusOffline | UserStatusLastSeenRecently | UserStatusLastSeenLastWeek | UserStatusLastSeenLastMonth;
|
|
63
|
+
export declare function constructUserStatus(userStatus: Api.UserStatus): UserStatus;
|
|
64
|
+
//# sourceMappingURL=0_user_status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_user_status.d.ts","sourceRoot":"","sources":["../../src/types/0_user_status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qBAAqB;IACrB,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,0BAA0B,GAAG,0BAA0B,GAAG,2BAA2B,CAAC;AAEtJ,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,UAAU,CAe1E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export function constructUserStatus(userStatus) {
|
|
21
|
+
switch (userStatus._) {
|
|
22
|
+
case "userStatusEmpty":
|
|
23
|
+
return { type: "lastSeenRecently" };
|
|
24
|
+
case "userStatusOnline":
|
|
25
|
+
return { type: "online" };
|
|
26
|
+
case "userStatusOffline":
|
|
27
|
+
return { type: "offline", lastSeenAt: userStatus.was_online };
|
|
28
|
+
case "userStatusRecently":
|
|
29
|
+
return { type: "lastSeenRecently" };
|
|
30
|
+
case "userStatusLastWeek":
|
|
31
|
+
return { type: "lastSeenLastWeek" };
|
|
32
|
+
case "userStatusLastMonth":
|
|
33
|
+
return { type: "lastSeenLastMonth" };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
/** A business working hour interval. */
|
|
21
|
-
export interface
|
|
21
|
+
export interface WorkingHoursInterval {
|
|
22
22
|
/** A point in time in which the working hour starts. */
|
|
23
23
|
startsAt: number;
|
|
24
24
|
/** A point in time in which the working hour ends. */
|
|
25
25
|
endsAt: number;
|
|
26
26
|
}
|
|
27
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=0_working_hours_interval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_working_hours_interval.d.ts","sourceRoot":"","sources":["../../src/types/0_working_hours_interval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wCAAwC;AACxC,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import type { BotCommand } from "./0_bot_command.js";
|
|
21
|
+
/** A bot's list of commands. */
|
|
22
|
+
export interface BotCommands {
|
|
23
|
+
/** The identifier of the bot. */
|
|
24
|
+
botId: number;
|
|
25
|
+
/** The identifier of the chat in which the command list is valid. */
|
|
26
|
+
chatId: number;
|
|
27
|
+
/** The list of commands. */
|
|
28
|
+
commands: BotCommand[];
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=1_bot_commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1_bot_commands.d.ts","sourceRoot":"","sources":["../../src/types/1_bot_commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC1B,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
package/esm/types/1_chat_p.d.ts
CHANGED
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { type ChatPhoto } from "./0_chat_photo.js";
|
|
22
|
+
import { type EmojiStatus } from "./0_emoji_status.js";
|
|
22
23
|
import { type RestrictionReason } from "./0_restriction_reason.js";
|
|
24
|
+
import { type UserStatus } from "./0_user_status.js";
|
|
23
25
|
/** @unlisted */
|
|
24
26
|
export type ChatType = "private" | "group" | "supergroup" | "channel";
|
|
25
27
|
/** @unlisted */
|
|
@@ -47,6 +49,10 @@ export interface ChatPPrivate extends _ChatPBase {
|
|
|
47
49
|
username?: string;
|
|
48
50
|
/** The user's additional usernames. */
|
|
49
51
|
also?: string[];
|
|
52
|
+
/** The user's status. */
|
|
53
|
+
status?: UserStatus;
|
|
54
|
+
/** The user's emoji status. */
|
|
55
|
+
emojiStatus?: EmojiStatus;
|
|
50
56
|
/** The user's [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag). */
|
|
51
57
|
languageCode?: string;
|
|
52
58
|
/** Whether the user has been identified as scam. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_chat_p.d.ts","sourceRoot":"","sources":["../../src/types/1_chat_p.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"1_chat_p.d.ts","sourceRoot":"","sources":["../../src/types/1_chat_p.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE1E,gBAAgB;AAChB,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,OAAO,GACP,YAAY,GACZ,SAAS,CAAC;AAEd,gBAAgB;AAChB,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,EAAE,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AAG,KAAK,CAAC;AAiHjE,gBAAgB;AAChB,MAAM,WAAW,UAAU;IACzB,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACpD,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAClD,CAAC,IAAI,EAAE,GAAG,CAAC,WAAW,GAAG,CAAC,YAAY,GAAG,eAAe,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACzE,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC/E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE/D"}
|
package/esm/types/1_chat_p.js
CHANGED
|
@@ -22,7 +22,9 @@ import { cleanObject, getColorFromPeerId, ZERO_CHANNEL_ID } from "../1_utilities
|
|
|
22
22
|
import { Api } from "../2_tl.js";
|
|
23
23
|
import { peerToChatId } from "../tl/2_telegram.js";
|
|
24
24
|
import { constructChatPhoto } from "./0_chat_photo.js";
|
|
25
|
+
import { constructEmojiStatus } from "./0_emoji_status.js";
|
|
25
26
|
import { constructRestrictionReason } from "./0_restriction_reason.js";
|
|
27
|
+
import { constructUserStatus } from "./0_user_status.js";
|
|
26
28
|
export function constructChatP(chat) {
|
|
27
29
|
if (Api.is("user", chat)) {
|
|
28
30
|
const id = Number(chat.id);
|
|
@@ -38,6 +40,8 @@ export function constructChatP(chat) {
|
|
|
38
40
|
username,
|
|
39
41
|
languageCode: chat.lang_code,
|
|
40
42
|
also: usernames?.filter((v) => v !== username),
|
|
43
|
+
status: chat.status ? constructUserStatus(chat.status) : undefined,
|
|
44
|
+
emojiStatus: chat.emoji_status ? constructEmojiStatus(chat.emoji_status) : undefined,
|
|
41
45
|
isScam: chat.scam || false,
|
|
42
46
|
isFake: chat.fake || false,
|
|
43
47
|
isPremium: chat.premium || false,
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import type { Api } from "../2_tl.js";
|
|
21
|
-
import type {
|
|
21
|
+
import type { WorkingHoursInterval } from "./0_working_hours_interval.js";
|
|
22
22
|
/** The working hours of a business. */
|
|
23
23
|
export interface WorkingHours {
|
|
24
24
|
/** The timezone of the working hours. */
|
|
25
25
|
timezone: string;
|
|
26
26
|
/** The working hours. */
|
|
27
|
-
intervals:
|
|
27
|
+
intervals: WorkingHoursInterval[];
|
|
28
28
|
}
|
|
29
29
|
export declare function constructWorkingHours(hours: Api.businessWorkHours): WorkingHours;
|
|
30
30
|
export declare function workingHoursToTlObject(workingHours: WorkingHours): Api.businessWorkHours;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_working_hours.d.ts","sourceRoot":"","sources":["../../src/types/1_working_hours.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"1_working_hours.d.ts","sourceRoot":"","sources":["../../src/types/1_working_hours.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,SAAS,EAAE,oBAAoB,EAAE,CAAC;CACnC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,iBAAiB,GAAG,YAAY,CAKhF;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,GAAG,CAAC,iBAAiB,CAMxF"}
|
package/esm/types/2_user.d.ts
CHANGED
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { type ChatPhoto } from "./0_chat_photo.js";
|
|
22
|
+
import { type EmojiStatus } from "./0_emoji_status.js";
|
|
22
23
|
import type { RestrictionReason } from "./0_restriction_reason.js";
|
|
24
|
+
import { type UserStatus } from "./0_user_status.js";
|
|
23
25
|
import type { ChatPPrivate } from "./1_chat_p.js";
|
|
24
26
|
/** A user. */
|
|
25
27
|
export interface User {
|
|
@@ -37,6 +39,10 @@ export interface User {
|
|
|
37
39
|
username?: string;
|
|
38
40
|
/** The user's additional usernames. */
|
|
39
41
|
also?: string[];
|
|
42
|
+
/** The user's status. */
|
|
43
|
+
status?: UserStatus;
|
|
44
|
+
/** The user's emoji status. */
|
|
45
|
+
emojiStatus?: EmojiStatus;
|
|
40
46
|
/** The user's profile photo. */
|
|
41
47
|
photo?: ChatPhoto;
|
|
42
48
|
/** The user's [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_user.d.ts","sourceRoot":"","sources":["../../src/types/2_user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,6EA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Ac,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAsBxD"}
|
package/esm/types/2_user.js
CHANGED
|
@@ -20,10 +20,13 @@
|
|
|
20
20
|
import { cleanObject, getColorFromPeerId } from "../1_utilities.js";
|
|
21
21
|
import { Api } from "../2_tl.js";
|
|
22
22
|
import { constructChatPhoto } from "./0_chat_photo.js";
|
|
23
|
+
import { constructEmojiStatus } from "./0_emoji_status.js";
|
|
24
|
+
import { constructUserStatus } from "./0_user_status.js";
|
|
23
25
|
export function constructUser(user_) {
|
|
24
26
|
const id = Number(user_.id);
|
|
25
27
|
const usernames = user_.usernames?.map((v) => v.username);
|
|
26
28
|
const username = user_.username ?? usernames?.shift();
|
|
29
|
+
user_.emoji_status;
|
|
27
30
|
const user = {
|
|
28
31
|
id,
|
|
29
32
|
color: Api.is("peerColor", user_.color) && user_.color.color !== undefined ? user_.color.color : getColorFromPeerId(id),
|
|
@@ -32,6 +35,8 @@ export function constructUser(user_) {
|
|
|
32
35
|
lastName: user_.last_name,
|
|
33
36
|
username: username,
|
|
34
37
|
also: usernames?.filter((v) => v !== username),
|
|
38
|
+
status: user_.status ? constructUserStatus(user_.status) : undefined,
|
|
39
|
+
emojiStatus: user_.emoji_status ? constructEmojiStatus(user_.emoji_status) : undefined,
|
|
35
40
|
languageCode: user_.lang_code,
|
|
36
41
|
isScam: user_.scam || false,
|
|
37
42
|
isFake: user_.fake || false,
|
|
@@ -21,7 +21,7 @@ import type { Api } from "../2_tl.js";
|
|
|
21
21
|
import { type MessageEntity } from "./2_message_entity.js";
|
|
22
22
|
/** A reference to a specific part of a message that is being replied to. */
|
|
23
23
|
export interface ReplyQuote {
|
|
24
|
-
/** The
|
|
24
|
+
/** The offset of the quoted text. */
|
|
25
25
|
offset: number;
|
|
26
26
|
/** The quoted text. */
|
|
27
27
|
text: string;
|