@mtkruto/node 0.127.0 → 0.129.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.
Files changed (157) hide show
  1. package/esm/0_deps.d.ts +4 -3
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +4 -3
  4. package/esm/3_types.d.ts +7 -0
  5. package/esm/3_types.d.ts.map +1 -1
  6. package/esm/3_types.js +7 -0
  7. package/esm/client/0_params.d.ts +12 -0
  8. package/esm/client/0_params.d.ts.map +1 -1
  9. package/esm/client/1_client_generic.d.ts +96 -19
  10. package/esm/client/1_client_generic.d.ts.map +1 -1
  11. package/esm/client/2_account_manager.d.ts +8 -1
  12. package/esm/client/2_account_manager.d.ts.map +1 -1
  13. package/esm/client/2_account_manager.js +38 -1
  14. package/esm/client/3_message_manager.d.ts +5 -1
  15. package/esm/client/3_message_manager.d.ts.map +1 -1
  16. package/esm/client/3_message_manager.js +21 -1
  17. package/esm/client/4_chat_manager.d.ts +4 -3
  18. package/esm/client/4_chat_manager.d.ts.map +1 -1
  19. package/esm/client/4_chat_manager.js +11 -3
  20. package/esm/client/4_context.d.ts +2 -2
  21. package/esm/client/4_context.d.ts.map +1 -1
  22. package/esm/client/6_client.d.ts +95 -18
  23. package/esm/client/6_client.d.ts.map +1 -1
  24. package/esm/client/6_client.js +121 -20
  25. package/esm/client/6_client_dispatcher.d.ts +96 -19
  26. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  27. package/esm/client/6_client_dispatcher.js +122 -21
  28. package/esm/types/0_calling_code.d.ts +27 -0
  29. package/esm/types/0_calling_code.d.ts.map +1 -0
  30. package/esm/types/0_calling_code.js +26 -0
  31. package/esm/types/0_timezone.d.ts +31 -0
  32. package/esm/types/0_timezone.d.ts.map +1 -0
  33. package/esm/types/0_timezone.js +26 -0
  34. package/esm/types/1_available_reactions.d.ts +54 -0
  35. package/esm/types/1_available_reactions.d.ts.map +1 -0
  36. package/esm/types/1_available_reactions.js +30 -0
  37. package/esm/types/1_chat_p.d.ts +1 -1
  38. package/esm/types/1_chat_p.d.ts.map +1 -1
  39. package/esm/types/1_chat_p.js +1 -1
  40. package/esm/types/1_country.d.ts +30 -0
  41. package/esm/types/1_country.d.ts.map +1 -0
  42. package/esm/types/1_country.js +30 -0
  43. package/esm/types/2_user.d.ts +1 -1
  44. package/esm/types/2_user.d.ts.map +1 -1
  45. package/esm/types/2_user.js +2 -2
  46. package/esm/types/3_app_support.d.ts +27 -0
  47. package/esm/types/3_app_support.d.ts.map +1 -0
  48. package/esm/types/3_app_support.js +24 -0
  49. package/esm/types/3_blocked_user.d.ts +31 -0
  50. package/esm/types/3_blocked_user.d.ts.map +1 -0
  51. package/esm/types/3_blocked_user.js +33 -0
  52. package/esm/types/4_blocked_user_list.d.ts +31 -0
  53. package/esm/types/4_blocked_user_list.d.ts.map +1 -0
  54. package/esm/types/4_blocked_user_list.js +25 -0
  55. package/package.json +1 -1
  56. package/script/0_deps.d.ts +4 -3
  57. package/script/0_deps.d.ts.map +1 -1
  58. package/script/0_deps.js +13 -12
  59. package/script/3_types.d.ts +7 -0
  60. package/script/3_types.d.ts.map +1 -1
  61. package/script/3_types.js +7 -0
  62. package/script/client/0_params.d.ts +12 -0
  63. package/script/client/0_params.d.ts.map +1 -1
  64. package/script/client/1_client_generic.d.ts +96 -19
  65. package/script/client/1_client_generic.d.ts.map +1 -1
  66. package/script/client/2_account_manager.d.ts +8 -1
  67. package/script/client/2_account_manager.d.ts.map +1 -1
  68. package/script/client/2_account_manager.js +37 -0
  69. package/script/client/3_message_manager.d.ts +5 -1
  70. package/script/client/3_message_manager.d.ts.map +1 -1
  71. package/script/client/3_message_manager.js +20 -0
  72. package/script/client/4_chat_manager.d.ts +4 -3
  73. package/script/client/4_chat_manager.d.ts.map +1 -1
  74. package/script/client/4_chat_manager.js +9 -1
  75. package/script/client/4_context.d.ts +2 -2
  76. package/script/client/4_context.d.ts.map +1 -1
  77. package/script/client/6_client.d.ts +95 -18
  78. package/script/client/6_client.d.ts.map +1 -1
  79. package/script/client/6_client.js +121 -20
  80. package/script/client/6_client_dispatcher.d.ts +96 -19
  81. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  82. package/script/client/6_client_dispatcher.js +122 -21
  83. package/script/types/0_calling_code.d.ts +27 -0
  84. package/script/types/0_calling_code.d.ts.map +1 -0
  85. package/script/types/0_calling_code.js +29 -0
  86. package/script/types/0_timezone.d.ts +31 -0
  87. package/script/types/0_timezone.d.ts.map +1 -0
  88. package/script/types/0_timezone.js +29 -0
  89. package/script/types/1_available_reactions.d.ts +54 -0
  90. package/script/types/1_available_reactions.d.ts.map +1 -0
  91. package/script/types/1_available_reactions.js +33 -0
  92. package/script/types/1_chat_p.d.ts +1 -1
  93. package/script/types/1_chat_p.d.ts.map +1 -1
  94. package/script/types/1_chat_p.js +1 -1
  95. package/script/types/1_country.d.ts +30 -0
  96. package/script/types/1_country.d.ts.map +1 -0
  97. package/script/types/1_country.js +33 -0
  98. package/script/types/2_user.d.ts +1 -1
  99. package/script/types/2_user.d.ts.map +1 -1
  100. package/script/types/2_user.js +2 -2
  101. package/script/types/3_app_support.d.ts +27 -0
  102. package/script/types/3_app_support.d.ts.map +1 -0
  103. package/script/types/3_app_support.js +27 -0
  104. package/script/types/3_blocked_user.d.ts +31 -0
  105. package/script/types/3_blocked_user.d.ts.map +1 -0
  106. package/script/types/3_blocked_user.js +36 -0
  107. package/script/types/4_blocked_user_list.d.ts +31 -0
  108. package/script/types/4_blocked_user_list.d.ts.map +1 -0
  109. package/script/types/4_blocked_user_list.js +28 -0
  110. package/esm/deps/jsr.io/@std/async/1.2.0/_util.d.ts +0 -2
  111. package/esm/deps/jsr.io/@std/async/1.2.0/_util.d.ts.map +0 -1
  112. package/esm/deps/jsr.io/@std/async/1.2.0/_util.js +0 -6
  113. package/esm/deps/jsr.io/@std/async/1.2.0/abortable.d.ts +0 -107
  114. package/esm/deps/jsr.io/@std/async/1.2.0/abortable.d.ts.map +0 -1
  115. package/esm/deps/jsr.io/@std/async/1.2.0/abortable.js +0 -46
  116. package/esm/deps/jsr.io/@std/async/1.2.0/deadline.d.ts +0 -37
  117. package/esm/deps/jsr.io/@std/async/1.2.0/deadline.d.ts.map +0 -1
  118. package/esm/deps/jsr.io/@std/async/1.2.0/deadline.js +0 -41
  119. package/esm/deps/jsr.io/@std/async/1.2.0/debounce.d.ts +0 -44
  120. package/esm/deps/jsr.io/@std/async/1.2.0/debounce.d.ts.map +0 -1
  121. package/esm/deps/jsr.io/@std/async/1.2.0/debounce.js +0 -57
  122. package/esm/deps/jsr.io/@std/async/1.2.0/mod.d.ts +0 -22
  123. package/esm/deps/jsr.io/@std/async/1.2.0/mod.d.ts.map +0 -1
  124. package/esm/deps/jsr.io/@std/async/1.2.0/mod.js +0 -23
  125. package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts +0 -111
  126. package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts.map +0 -1
  127. package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +0 -154
  128. package/esm/deps/jsr.io/@std/async/1.2.0/retry.d.ts +0 -155
  129. package/esm/deps/jsr.io/@std/async/1.2.0/retry.d.ts.map +0 -1
  130. package/esm/deps/jsr.io/@std/async/1.2.0/retry.js +0 -147
  131. package/esm/deps/jsr.io/@std/async/1.2.0/tee.d.ts +0 -43
  132. package/esm/deps/jsr.io/@std/async/1.2.0/tee.d.ts.map +0 -1
  133. package/esm/deps/jsr.io/@std/async/1.2.0/tee.js +0 -79
  134. package/script/deps/jsr.io/@std/async/1.2.0/_util.d.ts +0 -2
  135. package/script/deps/jsr.io/@std/async/1.2.0/_util.d.ts.map +0 -1
  136. package/script/deps/jsr.io/@std/async/1.2.0/_util.js +0 -9
  137. package/script/deps/jsr.io/@std/async/1.2.0/abortable.d.ts +0 -107
  138. package/script/deps/jsr.io/@std/async/1.2.0/abortable.d.ts.map +0 -1
  139. package/script/deps/jsr.io/@std/async/1.2.0/abortable.js +0 -49
  140. package/script/deps/jsr.io/@std/async/1.2.0/deadline.d.ts +0 -37
  141. package/script/deps/jsr.io/@std/async/1.2.0/deadline.d.ts.map +0 -1
  142. package/script/deps/jsr.io/@std/async/1.2.0/deadline.js +0 -44
  143. package/script/deps/jsr.io/@std/async/1.2.0/debounce.d.ts +0 -44
  144. package/script/deps/jsr.io/@std/async/1.2.0/debounce.d.ts.map +0 -1
  145. package/script/deps/jsr.io/@std/async/1.2.0/debounce.js +0 -60
  146. package/script/deps/jsr.io/@std/async/1.2.0/mod.d.ts +0 -22
  147. package/script/deps/jsr.io/@std/async/1.2.0/mod.d.ts.map +0 -1
  148. package/script/deps/jsr.io/@std/async/1.2.0/mod.js +0 -39
  149. package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts +0 -111
  150. package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts.map +0 -1
  151. package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +0 -158
  152. package/script/deps/jsr.io/@std/async/1.2.0/retry.d.ts +0 -155
  153. package/script/deps/jsr.io/@std/async/1.2.0/retry.d.ts.map +0 -1
  154. package/script/deps/jsr.io/@std/async/1.2.0/retry.js +0 -152
  155. package/script/deps/jsr.io/@std/async/1.2.0/tee.d.ts +0 -43
  156. package/script/deps/jsr.io/@std/async/1.2.0/tee.d.ts.map +0 -1
  157. package/script/deps/jsr.io/@std/async/1.2.0/tee.js +0 -82
@@ -520,6 +520,90 @@ export class ClientDispatcher extends Composer {
520
520
  async suggestBirthday(userId, birthday) {
521
521
  return await this.#dispatch("suggestBirthday", userId, birthday);
522
522
  }
523
+ /**
524
+ * Block a user. User-only.
525
+ *
526
+ * @method ac
527
+ * @param userId The identifier of the user to block.
528
+ */
529
+ async blockUser(userId) {
530
+ return await this.#dispatch("blockUser", userId);
531
+ }
532
+ /**
533
+ * Unblock a user. User-only.
534
+ *
535
+ * @method ac
536
+ * @param userId The identifier of the user to unblock.
537
+ */
538
+ async unblockUser(userId) {
539
+ return await this.#dispatch("unblockUser", userId);
540
+ }
541
+ /**
542
+ * Get blocked users. User-only.
543
+ *
544
+ * @method ac
545
+ */
546
+ async getBlockedUsers(params) {
547
+ return await this.#dispatch("getBlockedUsers", params);
548
+ }
549
+ /**
550
+ * Add a bot to the attachments menu. User-only.
551
+ *
552
+ * @method ac
553
+ * @param botId The identifier of the bot to add to the attachments menu.
554
+ */
555
+ async addBotToAttachmentsMenu(botId, params) {
556
+ return await this.#dispatch("addBotToAttachmentsMenu", botId, params);
557
+ }
558
+ /**
559
+ * Remove a bot from the attachments menu. User-only.
560
+ *
561
+ * @method ac
562
+ * @param botId The identifier of the bot to remove from the attachments menu.
563
+ */
564
+ async removeBotFromAttachmentsMenu(botId) {
565
+ return await this.#dispatch("removeBotFromAttachmentsMenu", botId);
566
+ }
567
+ /**
568
+ * Get app support. User-only.
569
+ *
570
+ * @method ac
571
+ */
572
+ async getAppSupport() {
573
+ return await this.#dispatch("getAppSupport");
574
+ }
575
+ /**
576
+ * Get app support name. User-only.
577
+ *
578
+ * @method ac
579
+ */
580
+ async getAppSupportName() {
581
+ return await this.#dispatch("getAppSupportName");
582
+ }
583
+ /**
584
+ * Get owned bots. User-only.
585
+ *
586
+ * @method ac
587
+ */
588
+ async getOwnedBots() {
589
+ return await this.#dispatch("getOwnedBots");
590
+ }
591
+ /**
592
+ * Get timezones. User-only.
593
+ *
594
+ * @method ac
595
+ */
596
+ async getTimezones() {
597
+ return await this.#dispatch("getTimezones");
598
+ }
599
+ /**
600
+ * Get countries. User-only.
601
+ *
602
+ * @method ac
603
+ */
604
+ async getCountries(languageCode) {
605
+ return await this.#dispatch("getCountries", languageCode);
606
+ }
523
607
  //
524
608
  // ========================= MESSAGES ========================= //
525
609
  //
@@ -1126,13 +1210,30 @@ export class ClientDispatcher extends Composer {
1126
1210
  /**
1127
1211
  * Get a list of reactions made to a message. User-only.
1128
1212
  *
1213
+ * @method ms
1129
1214
  * @param chatId The identifier of a chat.
1130
1215
  * @param messageId The identifier of the message.
1131
- * @method ms
1132
1216
  */
1133
1217
  async getMessageReactions(chatId, messageId, params) {
1134
1218
  return await this.#dispatch("getMessageReactions", chatId, messageId, params);
1135
1219
  }
1220
+ /**
1221
+ * Set a reaction as default. User-only.
1222
+ *
1223
+ * @mehod ms
1224
+ * @param reaction The reaction to set as default.
1225
+ */
1226
+ async setDefaultReaction(reaction) {
1227
+ return await this.#dispatch("setDefaultReaction", reaction);
1228
+ }
1229
+ /**
1230
+ * Clear all message drafts. User-only.
1231
+ *
1232
+ * @mehod ms
1233
+ */
1234
+ async clearDrafts() {
1235
+ return await this.#dispatch("clearAllDrafts");
1236
+ }
1136
1237
  //
1137
1238
  // ========================= POLLS ========================= //
1138
1239
  //
@@ -2035,6 +2136,16 @@ export class ClientDispatcher extends Composer {
2035
2136
  async disableChatHistoryForNewMembers(chatId) {
2036
2137
  return await this.#dispatch("disableChatHistoryForNewMembers", chatId);
2037
2138
  }
2139
+ /**
2140
+ * Set the default send as chat of a chat. User-only.
2141
+ *
2142
+ * @method ch
2143
+ * @param chatId The identifier of a chat.
2144
+ * @param sendAs The new default send as chat.
2145
+ */
2146
+ async setDefaultSendAs(chatId, sendAs) {
2147
+ return await this.#dispatch("setDefaultSendAs", chatId, sendAs);
2148
+ }
2038
2149
  //
2039
2150
  // ========================= CALLBACK QUERIES ========================= //
2040
2151
  //
@@ -2193,6 +2304,14 @@ export class ClientDispatcher extends Composer {
2193
2304
  async removeReaction(chatId, messageId, reaction) {
2194
2305
  return await this.#dispatch("removeReaction", chatId, messageId, reaction);
2195
2306
  }
2307
+ /**
2308
+ * Clear recent reactions. User-only.
2309
+ *
2310
+ * @method re
2311
+ */
2312
+ async clearRecentReactions() {
2313
+ return await this.#dispatch("clearRecentReactions");
2314
+ }
2196
2315
  //
2197
2316
  // ========================= STORIES ========================= //
2198
2317
  //
@@ -2388,34 +2507,16 @@ export class ClientDispatcher extends Composer {
2388
2507
  return await this.#dispatch("getStoriesInAlbum", chatId, albumId);
2389
2508
  }
2390
2509
  //
2391
- // ========================= MISC ========================= //
2510
+ // ========================= NETWORK STATISTICS ========================= //
2392
2511
  //
2393
2512
  /**
2394
2513
  * Get network statistics. This might not always be available.
2395
2514
  *
2396
- * @method mc
2515
+ * @method ns
2397
2516
  */
2398
2517
  async getNetworkStatistics() {
2399
2518
  return await this.#dispatch("getNetworkStatistics");
2400
2519
  }
2401
- /**
2402
- * Block a user. User-only.
2403
- *
2404
- * @method mc
2405
- * @param userId The identifier of the user to block.
2406
- */
2407
- async blockUser(userId) {
2408
- return await this.#dispatch("blockUser", userId);
2409
- }
2410
- /**
2411
- * Unblock a user. User-only.
2412
- *
2413
- * @method mc
2414
- * @param userId The identifier of the user to unblock.
2415
- */
2416
- async unblockUser(userId) {
2417
- return await this.#dispatch("unblockUser", userId);
2418
- }
2419
2520
  //
2420
2521
  // ========================= VIDEO CHATS ========================= //
2421
2522
  //
@@ -0,0 +1,27 @@
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 CallingCode {
22
+ countryCode: string;
23
+ prefixes: string[];
24
+ patterns: string[];
25
+ }
26
+ export declare function constructCallingCode(countryCode: Api.help_CountryCode): CallingCode;
27
+ //# sourceMappingURL=0_calling_code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_calling_code.d.ts","sourceRoot":"","sources":["../../src/types/0_calling_code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,gBAAgB,GAAG,WAAW,CAMnF"}
@@ -0,0 +1,26 @@
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 constructCallingCode(countryCode) {
21
+ return {
22
+ countryCode: countryCode.country_code,
23
+ prefixes: countryCode.prefixes ?? [],
24
+ patterns: countryCode.patterns ?? [],
25
+ };
26
+ }
@@ -0,0 +1,31 @@
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
+ /** A timezone. */
22
+ export interface Timezone {
23
+ /** The identifier of the timezone. */
24
+ id: string;
25
+ /** The name of the timezone. */
26
+ name: string;
27
+ /** The UTC offset of the timezone. */
28
+ utcOffset: number;
29
+ }
30
+ export declare function constructTimezone(timezone: Api.Timezone): Timezone;
31
+ //# sourceMappingURL=0_timezone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_timezone.d.ts","sourceRoot":"","sources":["../../src/types/0_timezone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,kBAAkB;AAClB,MAAM,WAAW,QAAQ;IACvB,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAMlE"}
@@ -0,0 +1,26 @@
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 constructTimezone(timezone) {
21
+ return {
22
+ id: timezone.id,
23
+ name: timezone.name,
24
+ utcOffset: timezone.utc_offset,
25
+ };
26
+ }
@@ -0,0 +1,54 @@
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
+ import { type Reaction } from "./0_reaction.js";
22
+ /**
23
+ * An available reactions value allowing no type of reactions.
24
+ * @unlisted
25
+ */
26
+ export interface AvailableReactionsNone {
27
+ /** @discriminator */
28
+ type: "none";
29
+ }
30
+ /**
31
+ * An available reactions value allowing a specific set of reactions.
32
+ * @unlisted
33
+ */
34
+ export interface AvailableReactionsSome {
35
+ /** @discriminator */
36
+ type: "some";
37
+ /** The allowed reactions. */
38
+ reactions: Reaction[];
39
+ /** The maximum number of allowed reactions on a single message. */
40
+ maxReactionCount: number;
41
+ }
42
+ /**
43
+ * An available reactions value allowing all types of reactions.
44
+ * @unlisted
45
+ */
46
+ export interface AvailableReactionsAll {
47
+ /** @discriminator */
48
+ type: "all";
49
+ /** The maximum number of allowed reactions on a single message. */
50
+ maxReactionCount: number;
51
+ }
52
+ export type AvailableReactions = AvailableReactionsNone | AvailableReactionsSome | AvailableReactionsAll;
53
+ export declare function availableReactionsToTlObject(chatAvailableReactions: AvailableReactions): Api.ChatReactions;
54
+ //# sourceMappingURL=1_available_reactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1_available_reactions.d.ts","sourceRoot":"","sources":["../../src/types/1_available_reactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAsB,MAAM,iBAAiB,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,qBAAqB;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC;AAEzG,wBAAgB,4BAA4B,CAAC,sBAAsB,EAAE,kBAAkB,GAAG,GAAG,CAAC,aAAa,CAS1G"}
@@ -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 { reactionToTlObject } from "./0_reaction.js";
21
+ export function availableReactionsToTlObject(chatAvailableReactions) {
22
+ switch (chatAvailableReactions.type) {
23
+ case "none":
24
+ return { _: "chatReactionsNone" };
25
+ case "some":
26
+ return { _: "chatReactionsSome", reactions: chatAvailableReactions.reactions.map(reactionToTlObject) };
27
+ case "all":
28
+ return { _: "chatReactionsAll" };
29
+ }
30
+ }
@@ -82,7 +82,7 @@ export interface ChatPPrivate extends _ChatPBase {
82
82
  /** The reason why the user has been restricted. */
83
83
  restrictionReason?: RestrictionReason[];
84
84
  /** Whether the user is a bot that has been added to the attachment menu by the current user. */
85
- isAddedToAttachmentMenu?: boolean;
85
+ isAddedToAttachmentsMenu?: boolean;
86
86
  /** Whether the user is a bot that has been added to the attachment menu by the current user. */
87
87
  hasMainMiniApp?: boolean;
88
88
  }
@@ -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,EAAwB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAuB,KAAK,UA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AK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC/E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE/D"}
@@ -55,7 +55,7 @@ export function constructChatP(chat) {
55
55
  isSupport: chat.support || false,
56
56
  isRestricted: chat.restricted || false,
57
57
  restrictionReason: chat.restriction_reason?.map((v) => constructRestrictionReason(v)),
58
- isAddedToAttachmentMenu: chat.bot ? chat.attach_menu_enabled || false : undefined,
58
+ isAddedToAttachmentsMenu: chat.bot ? chat.attach_menu_enabled || false : undefined,
59
59
  hasMainMiniApp: chat.bot ? chat.attach_menu_enabled || false : undefined,
60
60
  };
61
61
  if (Api.is("userProfilePhoto", chat.photo)) {
@@ -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 { Api } from "../2_tl.js";
21
+ import { type CallingCode } from "./0_calling_code.js";
22
+ export interface Country {
23
+ defaultName: string;
24
+ name?: string;
25
+ code: string;
26
+ callingCodes: CallingCode[];
27
+ isHidden: boolean;
28
+ }
29
+ export declare function constructCountry(country: Api.help_Country): Country;
30
+ //# sourceMappingURL=1_country.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1_country.d.ts","sourceRoot":"","sources":["../../src/types/1_country.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,YAAY,GAAG,OAAO,CAQnE"}
@@ -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 { cleanObject } from "../1_utilities.js";
21
+ import { constructCallingCode } from "./0_calling_code.js";
22
+ export function constructCountry(country) {
23
+ return cleanObject({
24
+ defaultName: country.default_name,
25
+ name: country.name,
26
+ code: country.iso2,
27
+ callingCodes: country.country_codes.map(constructCallingCode),
28
+ isHidden: country.hidden ?? false,
29
+ });
30
+ }
@@ -74,7 +74,7 @@ export interface User {
74
74
  /** The reason why the user has been restricted. */
75
75
  restrictionReason?: RestrictionReason[];
76
76
  /** Whether the user is a bot that has been added to the attachment menu by the current user. */
77
- isAddedToAttachmentMenu?: boolean;
77
+ isAddedToAttachmentsMenu?: boolean;
78
78
  /** Whether the user is a bot that has a main mini app. */
79
79
  hasMainMiniApp?: boolean;
80
80
  }
@@ -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,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;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,yBAAyB;IACzB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,gCAAgC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,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AAgG;IAChG,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAoCnD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CA8BxD"}
@@ -51,7 +51,7 @@ export function constructUser(user_) {
51
51
  isSupport: user_.support || false,
52
52
  isRestricted: user_.restricted || false,
53
53
  restrictionReason: user_.restriction_reason?.map((v) => constructRestrictionReason(v)),
54
- isAddedToAttachmentMenu: user_.bot ? user_.attach_menu_enabled || false : undefined,
54
+ isAddedToAttachmentsMenu: user_.bot ? user_.attach_menu_enabled || false : undefined,
55
55
  hasMainMiniApp: user_.bot ? user_.bot_has_main_app || false : undefined,
56
56
  };
57
57
  if (Api.is("userProfilePhoto", user_.photo)) {
@@ -85,7 +85,7 @@ export function constructUser2(chatP) {
85
85
  isSupport: chatP.isSupport,
86
86
  isRestricted: chatP.isRestricted,
87
87
  restrictionReason: chatP.restrictionReason,
88
- isAddedToAttachmentMenu: chatP.isAddedToAttachmentMenu,
88
+ isAddedToAttachmentsMenu: chatP.isAddedToAttachmentsMenu,
89
89
  hasMainMiniApp: chatP.hasMainMiniApp,
90
90
  };
91
91
  return cleanObject(user);
@@ -0,0 +1,27 @@
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 { Api } from "../2_tl.js";
21
+ import { type User } from "./2_user.js";
22
+ export interface AppSupport {
23
+ phoneNumber: string;
24
+ user: User;
25
+ }
26
+ export declare function constructAppSupport(result: Api.help_Support): AppSupport;
27
+ //# sourceMappingURL=3_app_support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_app_support.d.ts","sourceRoot":"","sources":["../../src/types/3_app_support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAiB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,YAAY,GAAG,UAAU,CAExE"}
@@ -0,0 +1,24 @@
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 { Api } from "../2_tl.js";
21
+ import { constructUser } from "./2_user.js";
22
+ export function constructAppSupport(result) {
23
+ return { phoneNumber: result.phone_number, user: constructUser(Api.as("user", result.user)) };
24
+ }
@@ -0,0 +1,31 @@
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
+ import type { PeerGetter } from "./1_chat_p.js";
22
+ import { type User } from "./2_user.js";
23
+ /** A blocked user. */
24
+ export interface BlockedUser {
25
+ /** The blocked user. */
26
+ user: User;
27
+ /** The point in time in which the user was blocked. */
28
+ blockedAt: number;
29
+ }
30
+ export declare function constructBlockedUser(peerBlocked: Api.PeerBlocked, getPeer: PeerGetter): BlockedUser;
31
+ //# sourceMappingURL=3_blocked_user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_blocked_user.d.ts","sourceRoot":"","sources":["../../src/types/3_blocked_user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD,sBAAsB;AACtB,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,WAAW,CAanG"}