@mtkruto/node 0.153.0 → 0.160.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 (207) hide show
  1. package/esm/3_types.d.ts +3 -0
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +3 -0
  4. package/esm/4_constants.d.ts +1 -0
  5. package/esm/4_constants.d.ts.map +1 -1
  6. package/esm/4_constants.js +1 -0
  7. package/esm/client/0_markdown.js +4 -4
  8. package/esm/client/0_params.d.ts +11 -1
  9. package/esm/client/0_params.d.ts.map +1 -1
  10. package/esm/client/1_client_generic.d.ts +100 -3
  11. package/esm/client/1_client_generic.d.ts.map +1 -1
  12. package/esm/client/1_client_plain.d.ts +1 -1
  13. package/esm/client/1_client_plain.d.ts.map +1 -1
  14. package/esm/client/1_client_plain.js +25 -13
  15. package/esm/client/2_client_encrypted.d.ts +6 -3
  16. package/esm/client/2_client_encrypted.d.ts.map +1 -1
  17. package/esm/client/2_client_encrypted.js +166 -49
  18. package/esm/client/2_file_manager.js +1 -1
  19. package/esm/client/2_network_statistics_manager.d.ts.map +1 -1
  20. package/esm/client/2_network_statistics_manager.js +3 -2
  21. package/esm/client/2_payment_manager.js +2 -2
  22. package/esm/client/2_takeout_manager.js +2 -2
  23. package/esm/client/2_update_manager.d.ts.map +1 -1
  24. package/esm/client/2_update_manager.js +16 -11
  25. package/esm/client/3_account_manager.js +3 -3
  26. package/esm/client/3_message_manager.d.ts +11 -0
  27. package/esm/client/3_message_manager.d.ts.map +1 -1
  28. package/esm/client/3_message_manager.js +195 -74
  29. package/esm/client/3_sticker_set_manager.js +3 -3
  30. package/esm/client/3_video_chat_manager.js +1 -1
  31. package/esm/client/4_callback_query_manager.js +2 -2
  32. package/esm/client/4_chat_list_manager.js +3 -3
  33. package/esm/client/4_chat_manager.d.ts +3 -2
  34. package/esm/client/4_chat_manager.d.ts.map +1 -1
  35. package/esm/client/4_chat_manager.js +12 -5
  36. package/esm/client/4_contact_manager.js +1 -1
  37. package/esm/client/4_gift_manager.js +11 -11
  38. package/esm/client/4_inline_query_manager.js +1 -1
  39. package/esm/client/4_story_manager.d.ts +3 -1
  40. package/esm/client/4_story_manager.d.ts.map +1 -1
  41. package/esm/client/4_story_manager.js +17 -3
  42. package/esm/client/6_client.d.ts +102 -3
  43. package/esm/client/6_client.d.ts.map +1 -1
  44. package/esm/client/6_client.js +130 -2
  45. package/esm/client/6_client_dispatcher.d.ts +100 -3
  46. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  47. package/esm/client/6_client_dispatcher.js +126 -1
  48. package/esm/connection/0_get_tls_header.d.ts.map +1 -1
  49. package/esm/connection/0_get_tls_header.js +19 -0
  50. package/esm/connection/1_connection_web_socket.js +2 -2
  51. package/esm/session/0_session_state.d.ts +1 -0
  52. package/esm/session/0_session_state.d.ts.map +1 -1
  53. package/esm/session/0_session_state.js +8 -4
  54. package/esm/session/1_session.d.ts +1 -0
  55. package/esm/session/1_session.d.ts.map +1 -1
  56. package/esm/session/1_session.js +3 -0
  57. package/esm/session/2_session_encrypted.d.ts +11 -6
  58. package/esm/session/2_session_encrypted.d.ts.map +1 -1
  59. package/esm/session/2_session_encrypted.js +20 -12
  60. package/esm/storage/1_utilities.js +2 -2
  61. package/esm/transport/2_transport_provider_web_socket.js +1 -1
  62. package/esm/types/0_button_style.js +1 -1
  63. package/esm/types/0_chat_member_rights.js +34 -34
  64. package/esm/types/0_chat_photo.js +2 -2
  65. package/esm/types/0_dice.d.ts +1 -1
  66. package/esm/types/0_dice.d.ts.map +1 -1
  67. package/esm/types/0_giveaway_parameters.js +1 -1
  68. package/esm/types/0_live_stream_channel.d.ts +1 -1
  69. package/esm/types/0_live_stream_channel.d.ts.map +1 -1
  70. package/esm/types/0_report_reason.d.ts +53 -0
  71. package/esm/types/0_report_reason.d.ts.map +1 -0
  72. package/esm/types/0_report_reason.js +45 -0
  73. package/esm/types/0_story_report_option.d.ts +26 -0
  74. package/esm/types/0_story_report_option.d.ts.map +1 -0
  75. package/esm/types/0_story_report_option.js +25 -0
  76. package/esm/types/0_video_chat.js +2 -2
  77. package/esm/types/1_inline_keyboard_button.d.ts +2 -2
  78. package/esm/types/1_message_reaction.js +1 -1
  79. package/esm/types/1_sticker.js +1 -1
  80. package/esm/types/1_story_reaction.js +1 -1
  81. package/esm/types/1_story_report_result.d.ts +37 -0
  82. package/esm/types/1_story_report_result.d.ts.map +1 -0
  83. package/esm/types/1_story_report_result.js +36 -0
  84. package/esm/types/2_chat.js +2 -2
  85. package/esm/types/2_chat_member.js +3 -3
  86. package/esm/types/2_message_entity.js +1 -1
  87. package/esm/types/2_story_interactive_area.js +3 -3
  88. package/esm/types/3_chat_settings.js +1 -1
  89. package/esm/types/3_forward_header.js +3 -3
  90. package/esm/types/3_inline_query.js +1 -1
  91. package/esm/types/3_invite_link.js +2 -2
  92. package/esm/types/3_story.js +3 -3
  93. package/esm/types/4_gift.js +1 -1
  94. package/esm/types/5_gift_non_upgraded_information.js +8 -8
  95. package/esm/types/5_gift_upgraded_information.js +5 -5
  96. package/esm/types/6_poll_media.d.ts +1 -1
  97. package/esm/types/6_poll_media.d.ts.map +1 -1
  98. package/esm/types/7_inline_query_result.js +8 -8
  99. package/esm/types/7_poll_option.d.ts +1 -1
  100. package/esm/types/7_poll_option.d.ts.map +1 -1
  101. package/esm/types/8_inline_query_answer.js +1 -1
  102. package/esm/types/9_message.js +3 -3
  103. package/esm/utilities/0_env.js +1 -1
  104. package/package.json +1 -1
  105. package/script/3_types.d.ts +3 -0
  106. package/script/3_types.d.ts.map +1 -1
  107. package/script/3_types.js +3 -0
  108. package/script/4_constants.d.ts +1 -0
  109. package/script/4_constants.d.ts.map +1 -1
  110. package/script/4_constants.js +2 -1
  111. package/script/client/0_markdown.js +4 -4
  112. package/script/client/0_params.d.ts +11 -1
  113. package/script/client/0_params.d.ts.map +1 -1
  114. package/script/client/1_client_generic.d.ts +100 -3
  115. package/script/client/1_client_generic.d.ts.map +1 -1
  116. package/script/client/1_client_plain.d.ts +1 -1
  117. package/script/client/1_client_plain.d.ts.map +1 -1
  118. package/script/client/1_client_plain.js +24 -12
  119. package/script/client/2_client_encrypted.d.ts +6 -3
  120. package/script/client/2_client_encrypted.d.ts.map +1 -1
  121. package/script/client/2_client_encrypted.js +166 -49
  122. package/script/client/2_file_manager.js +1 -1
  123. package/script/client/2_network_statistics_manager.d.ts.map +1 -1
  124. package/script/client/2_network_statistics_manager.js +3 -2
  125. package/script/client/2_payment_manager.js +2 -2
  126. package/script/client/2_takeout_manager.js +2 -2
  127. package/script/client/2_update_manager.d.ts.map +1 -1
  128. package/script/client/2_update_manager.js +16 -11
  129. package/script/client/3_account_manager.js +3 -3
  130. package/script/client/3_message_manager.d.ts +11 -0
  131. package/script/client/3_message_manager.d.ts.map +1 -1
  132. package/script/client/3_message_manager.js +194 -73
  133. package/script/client/3_sticker_set_manager.js +3 -3
  134. package/script/client/3_video_chat_manager.js +1 -1
  135. package/script/client/4_callback_query_manager.js +2 -2
  136. package/script/client/4_chat_list_manager.js +3 -3
  137. package/script/client/4_chat_manager.d.ts +3 -2
  138. package/script/client/4_chat_manager.d.ts.map +1 -1
  139. package/script/client/4_chat_manager.js +11 -4
  140. package/script/client/4_contact_manager.js +1 -1
  141. package/script/client/4_gift_manager.js +11 -11
  142. package/script/client/4_inline_query_manager.js +1 -1
  143. package/script/client/4_story_manager.d.ts +3 -1
  144. package/script/client/4_story_manager.d.ts.map +1 -1
  145. package/script/client/4_story_manager.js +15 -1
  146. package/script/client/6_client.d.ts +102 -3
  147. package/script/client/6_client.d.ts.map +1 -1
  148. package/script/client/6_client.js +130 -2
  149. package/script/client/6_client_dispatcher.d.ts +100 -3
  150. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  151. package/script/client/6_client_dispatcher.js +126 -1
  152. package/script/connection/0_get_tls_header.d.ts.map +1 -1
  153. package/script/connection/0_get_tls_header.js +19 -0
  154. package/script/connection/1_connection_web_socket.js +2 -2
  155. package/script/session/0_session_state.d.ts +1 -0
  156. package/script/session/0_session_state.d.ts.map +1 -1
  157. package/script/session/0_session_state.js +8 -4
  158. package/script/session/1_session.d.ts +1 -0
  159. package/script/session/1_session.d.ts.map +1 -1
  160. package/script/session/1_session.js +3 -0
  161. package/script/session/2_session_encrypted.d.ts +11 -6
  162. package/script/session/2_session_encrypted.d.ts.map +1 -1
  163. package/script/session/2_session_encrypted.js +20 -12
  164. package/script/storage/1_utilities.js +2 -2
  165. package/script/transport/2_transport_provider_web_socket.js +1 -1
  166. package/script/types/0_button_style.js +1 -1
  167. package/script/types/0_chat_member_rights.js +34 -34
  168. package/script/types/0_chat_photo.js +2 -2
  169. package/script/types/0_dice.d.ts +1 -1
  170. package/script/types/0_dice.d.ts.map +1 -1
  171. package/script/types/0_giveaway_parameters.js +1 -1
  172. package/script/types/0_live_stream_channel.d.ts +1 -1
  173. package/script/types/0_live_stream_channel.d.ts.map +1 -1
  174. package/script/types/0_report_reason.d.ts +53 -0
  175. package/script/types/0_report_reason.d.ts.map +1 -0
  176. package/script/types/0_report_reason.js +48 -0
  177. package/script/types/0_story_report_option.d.ts +26 -0
  178. package/script/types/0_story_report_option.d.ts.map +1 -0
  179. package/script/types/0_story_report_option.js +28 -0
  180. package/script/types/0_video_chat.js +2 -2
  181. package/script/types/1_inline_keyboard_button.d.ts +2 -2
  182. package/script/types/1_message_reaction.js +1 -1
  183. package/script/types/1_sticker.js +1 -1
  184. package/script/types/1_story_reaction.js +1 -1
  185. package/script/types/1_story_report_result.d.ts +37 -0
  186. package/script/types/1_story_report_result.d.ts.map +1 -0
  187. package/script/types/1_story_report_result.js +39 -0
  188. package/script/types/2_chat.js +2 -2
  189. package/script/types/2_chat_member.js +3 -3
  190. package/script/types/2_message_entity.js +1 -1
  191. package/script/types/2_story_interactive_area.js +3 -3
  192. package/script/types/3_chat_settings.js +1 -1
  193. package/script/types/3_forward_header.js +3 -3
  194. package/script/types/3_inline_query.js +1 -1
  195. package/script/types/3_invite_link.js +2 -2
  196. package/script/types/3_story.js +3 -3
  197. package/script/types/4_gift.js +1 -1
  198. package/script/types/5_gift_non_upgraded_information.js +8 -8
  199. package/script/types/5_gift_upgraded_information.js +5 -5
  200. package/script/types/6_poll_media.d.ts +1 -1
  201. package/script/types/6_poll_media.d.ts.map +1 -1
  202. package/script/types/7_inline_query_result.js +8 -8
  203. package/script/types/7_poll_option.d.ts +1 -1
  204. package/script/types/7_poll_option.d.ts.map +1 -1
  205. package/script/types/8_inline_query_answer.js +1 -1
  206. package/script/types/9_message.js +3 -3
  207. package/script/utilities/0_env.js +1 -1
@@ -36,6 +36,6 @@ export function constructMessageReaction(reaction_, recentReactions) {
36
36
  .map((v) => Api.peerToChatId(v.peer_id));
37
37
  const reaction = constructReaction(reaction_.reaction);
38
38
  const count = reaction_.count;
39
- const chosen = reaction_.chosen_order !== undefined ? true : false;
39
+ const chosen = reaction_.chosen_order !== undefined;
40
40
  return { reaction, count, choosers, isChosen: chosen };
41
41
  }
@@ -45,7 +45,7 @@ export function constructSticker2(document, fileId, fileUniqueId, setName, custo
45
45
  premiumAnimation: undefined, // TODO
46
46
  maskPosition: stickerAttribute ? stickerAttribute.mask_coords ? constructMaskPosition(stickerAttribute.mask_coords) : undefined : undefined,
47
47
  customEmojiId: customEmojiAttribute ? customEmojiId : undefined,
48
- needsRepainting: customEmojiAttribute ? Boolean(customEmojiAttribute.text_color) : undefined,
48
+ needsRepainting: customEmojiAttribute ? !!customEmojiAttribute.text_color : undefined,
49
49
  fileSize: Number(document.size),
50
50
  });
51
51
  }
@@ -21,6 +21,6 @@ import { constructReaction } from "./0_reaction.js";
21
21
  export function constructStoryReaction(reaction_) {
22
22
  const reaction = constructReaction(reaction_.reaction);
23
23
  const count = reaction_.count;
24
- const chosen = reaction_.chosen_order !== undefined ? true : false;
24
+ const chosen = reaction_.chosen_order !== undefined;
25
25
  return { reaction, count, isChosen: chosen };
26
26
  }
@@ -0,0 +1,37 @@
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 StoryReportOption } from "./0_story_report_option.js";
22
+ export interface StoryReportResultOptionRequired {
23
+ type: "optionRequired";
24
+ title: string;
25
+ options: StoryReportOption[];
26
+ }
27
+ export interface StoryReportResultTextRequired {
28
+ type: "textRequired";
29
+ option: string;
30
+ isOptional: boolean;
31
+ }
32
+ export interface StoryReportResultReported {
33
+ type: "reported";
34
+ }
35
+ export type StoryReportResult = StoryReportResultOptionRequired | StoryReportResultTextRequired | StoryReportResultReported;
36
+ export declare function constructStoryReportResult(rr: Api.ReportResult): StoryReportResult;
37
+ //# sourceMappingURL=1_story_report_result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1_story_report_result.d.ts","sourceRoot":"","sources":["../../src/types/1_story_report_result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEhG,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,MAAM,iBAAiB,GAAG,+BAA+B,GAAG,6BAA6B,GAAG,yBAAyB,CAAC;AAE5H,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,GAAG,CAAC,YAAY,GAAG,iBAAiB,CAclF"}
@@ -0,0 +1,36 @@
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
+ import { base64EncodeUrlSafe } from "../1_utilities.js";
22
+ import { constructStoryReportOption } from "./0_story_report_option.js";
23
+ export function constructStoryReportResult(rr) {
24
+ switch (rr._) {
25
+ case "reportResultChooseOption": {
26
+ const title = rr.title;
27
+ const options = rr.options.map(constructStoryReportOption);
28
+ return { type: "optionRequired", title, options };
29
+ }
30
+ case "reportResultAddComment":
31
+ return { type: "textRequired", option: base64EncodeUrlSafe(rr.option), isOptional: !!rr.optional };
32
+ case "reportResultReported":
33
+ return { type: "reported" };
34
+ }
35
+ unreachable();
36
+ }
@@ -40,7 +40,7 @@ export function constructChat(fullChat, getPeer) {
40
40
  }
41
41
  else if (Api.is("chatFull", fullChat)) {
42
42
  const peer = getPeer({ _: "peerChat", chat_id: fullChat.id });
43
- if (peer === null)
43
+ if (!peer)
44
44
  unreachable();
45
45
  return cleanObject({
46
46
  ...peer[0],
@@ -50,7 +50,7 @@ export function constructChat(fullChat, getPeer) {
50
50
  }
51
51
  else if (Api.is("channelFull", fullChat)) {
52
52
  const peer = getPeer({ _: "peerChannel", channel_id: fullChat.id });
53
- if (peer === null)
53
+ if (!peer)
54
54
  unreachable();
55
55
  return cleanObject({
56
56
  ...peer[0],
@@ -24,7 +24,7 @@ import { constructChatAdministratorRights } from "./0_chat_administrator_rights.
24
24
  import { constructChatMemberRights } from "./0_chat_member_rights.js";
25
25
  export function constructChatMember(member, participant, getPeer) {
26
26
  const peer = "user_id" in participant ? getPeer({ ...participant, _: "peerUser" }) : "peer" in participant ? Array.isArray(participant.peer) ? participant.peer : Api.is("peerUser", participant.peer) ? getPeer(participant.peer) : unreachable() : unreachable(); // TODO: support other peer types
27
- if (peer === null || peer[0].type !== "private")
27
+ if (!peer || peer[0].type !== "private")
28
28
  unreachable();
29
29
  if (Api.is("channelParticipant", participant) || Api.is("chatParticipant", participant)) {
30
30
  return {
@@ -36,7 +36,7 @@ export function constructChatMember(member, participant, getPeer) {
36
36
  return cleanObject({
37
37
  status: "creator",
38
38
  member,
39
- isAnonymous: participant.admin_rights.anonymous ? true : false,
39
+ isAnonymous: !!participant.admin_rights.anonymous,
40
40
  title: participant.rank,
41
41
  });
42
42
  }
@@ -58,7 +58,7 @@ export function constructChatMember(member, participant, getPeer) {
58
58
  until,
59
59
  });
60
60
  }
61
- const isMember = participant.left ? true : false;
61
+ const isMember = !!participant.left;
62
62
  const rights = constructChatMemberRights(participant.banned_rights);
63
63
  const tag = participant.rank;
64
64
  return cleanObject({
@@ -116,7 +116,7 @@ export function constructMessageEntity(obj) {
116
116
  return { type: "strikethrough", offset: obj.offset, length: obj.length };
117
117
  }
118
118
  else if (Api.is("messageEntityBlockquote", obj)) {
119
- return cleanObject({ type: "blockquote", offset: obj.offset, length: obj.length, collapsible: obj.collapsed ? true : undefined });
119
+ return cleanObject({ type: "blockquote", offset: obj.offset, length: obj.length, collapsible: obj.collapsed || undefined });
120
120
  }
121
121
  else if (Api.is("messageEntityBankCard", obj)) {
122
122
  return { type: "bankCard", offset: obj.offset, length: obj.length };
@@ -51,8 +51,8 @@ export function constructStoryInteractiveArea(area) {
51
51
  position,
52
52
  reaction,
53
53
  count: 0, // TODO: count
54
- isFlipped: area.flipped ? true : false,
55
- isDark: area.dark ? true : false,
54
+ isFlipped: !!area.flipped,
55
+ isDark: !!area.dark,
56
56
  };
57
57
  }
58
58
  else if (Api.is("mediaAreaChannelPost", area)) {
@@ -117,7 +117,7 @@ export function storyInteractiveAreaToTlObject(area, getPeer) {
117
117
  }
118
118
  case "reaction": {
119
119
  const reaction = reactionToTlObject(area.reaction);
120
- return { _: "mediaAreaSuggestedReaction", coordinates, reaction, dark: area.isDark ? true : undefined, flipped: area.isFlipped ? true : undefined };
120
+ return { _: "mediaAreaSuggestedReaction", coordinates, reaction, dark: area.isDark || undefined, flipped: area.isFlipped || undefined };
121
121
  }
122
122
  case "messageReference": {
123
123
  const peer = getPeer(Api.chatIdToPeer(area.messageReference.chatId));
@@ -35,7 +35,7 @@ export function constructChatSettings(settings_) {
35
35
  businessBotCanReply: settings_.settings.business_bot_can_reply || false,
36
36
  distance: settings_.settings.geo_distance,
37
37
  joinRequestChatTitle: settings_.settings.request_chat_title,
38
- joinRequestDate: settings_.settings.request_chat_date ? settings_.settings.request_chat_date : undefined,
38
+ joinRequestDate: settings_.settings.request_chat_date || undefined,
39
39
  businessBotUrl: settings_.settings.business_bot_manage_url,
40
40
  messagePrice: settings_.settings.charge_paid_message_stars ? Number(settings_.settings.charge_paid_message_stars) : undefined,
41
41
  registrationMonth: settings_.settings.registration_month,
@@ -23,7 +23,7 @@ import { constructUser2 } from "./2_user.js";
23
23
  export function constructForwardHeader(fwdHeader, getPeer) {
24
24
  if (fwdHeader.channel_post && fwdHeader.from_id?._ === "peerChannel") {
25
25
  const peer = getPeer(fwdHeader.from_id);
26
- if (peer === null) {
26
+ if (!peer) {
27
27
  unreachable();
28
28
  }
29
29
  return cleanObject({
@@ -36,7 +36,7 @@ export function constructForwardHeader(fwdHeader, getPeer) {
36
36
  }
37
37
  else if (fwdHeader.from_id?._ === "peerChannel") {
38
38
  const peer = getPeer(fwdHeader.from_id);
39
- if (peer === null) {
39
+ if (!peer) {
40
40
  unreachable();
41
41
  }
42
42
  return cleanObject({
@@ -48,7 +48,7 @@ export function constructForwardHeader(fwdHeader, getPeer) {
48
48
  }
49
49
  else if (fwdHeader.from_id?._ === "peerUser") {
50
50
  const peer = getPeer(fwdHeader.from_id);
51
- if (peer === null || peer[0].type !== "private") {
51
+ if (!peer || peer[0].type !== "private") {
52
52
  unreachable();
53
53
  }
54
54
  return {
@@ -24,7 +24,7 @@ import { constructLocation } from "./0_location.js";
24
24
  import { constructUser2 } from "./2_user.js";
25
25
  export function constructInlineQuery(query_, getPeer) {
26
26
  const peer = getPeer({ _: "peerUser", user_id: query_.user_id });
27
- if (peer === null) {
27
+ if (!peer) {
28
28
  unreachable();
29
29
  }
30
30
  const user = constructUser2(peer[0]);
@@ -27,8 +27,8 @@ export function constructInviteLink(inviteLink_, getPeer) {
27
27
  }
28
28
  const inviteLink = inviteLink_.link;
29
29
  const creator = constructUser2(peer[0]);
30
- const requiresApproval = inviteLink_.request_needed ? true : false;
31
- const isRevoked = inviteLink_.revoked ? true : false;
30
+ const requiresApproval = !!inviteLink_.request_needed;
31
+ const isRevoked = !!inviteLink_.revoked;
32
32
  const title = inviteLink_.title;
33
33
  const expiresAt = inviteLink_.expire_date;
34
34
  const limit = inviteLink_.usage_limit;
@@ -33,19 +33,19 @@ export function constructStory(story, peer, getPeer) {
33
33
  const chat = peer_[0];
34
34
  const date = story.date;
35
35
  const interactiveAreas = (story.media_areas ?? []).map(constructStoryInteractiveArea);
36
- const isHighlighted = story.pinned ? true : false;
36
+ const isHighlighted = !!story.pinned;
37
37
  const content = constructStoryContent(story.media);
38
38
  const caption = story.caption;
39
39
  const captionEntities = story.entities?.map(constructMessageEntity).filter((v) => !!v);
40
40
  const privacy = story.privacy ? constructStoryPrivacy(story.privacy) : undefined;
41
41
  const interactions = story.views ? constructStoryInteractions(story.views) : undefined;
42
42
  return cleanObject({
43
- isOutgoing: story.out ? true : false,
43
+ isOutgoing: !!story.out,
44
44
  id,
45
45
  chat,
46
46
  date,
47
47
  content,
48
- isEdited: story.edited ? true : false,
48
+ isEdited: !!story.edited,
49
49
  interactiveAreas,
50
50
  isHighlighted,
51
51
  interactions,
@@ -91,7 +91,7 @@ export function constructGiftNonUpgraded(gift) {
91
91
  const isSoldOut = isLimited ? !!gift.sold_out : undefined;
92
92
  const isBirthday = !!gift.birthday;
93
93
  const conversionPrice = Number(gift.convert_stars);
94
- const firstSaleDate = isLimited ? gift.first_sale_date ? gift.first_sale_date : undefined : undefined;
94
+ const firstSaleDate = isLimited ? gift.first_sale_date || undefined : undefined;
95
95
  const lastSaleDate = isLimited ? gift.last_sale_date ? gift.last_sale_date : undefined : undefined;
96
96
  const upgradePrice = gift.upgrade_stars ? Number(gift.upgrade_stars) : undefined;
97
97
  return cleanObject({
@@ -23,14 +23,14 @@ import { Api } from "../2_tl.js";
23
23
  import { constructMessageEntity } from "./2_message_entity.js";
24
24
  import { constructGiftNonUpgraded } from "./4_gift.js";
25
25
  export function constructGiftNonUpgradedInformation(action, getPeer) {
26
- const isNameHidden = action.name_hidden ? true : false;
27
- const isSaved = action.saved ? true : false;
28
- const isConverted = action.converted ? true : false;
29
- const isUpgraded = action.upgraded ? true : false;
30
- const isRefunded = action.refunded ? true : false;
31
- const isUpgradable = action.can_upgrade ? true : false;
32
- const isPrepaidUpgrade = action.prepaid_upgrade ? true : false;
33
- const isUpgradedSeparately = action.upgrade_separate ? true : false;
26
+ const isNameHidden = !!action.name_hidden;
27
+ const isSaved = !!action.saved;
28
+ const isConverted = !!action.converted;
29
+ const isUpgraded = !!action.upgraded;
30
+ const isRefunded = !!action.refunded;
31
+ const isUpgradable = !!action.can_upgrade;
32
+ const isPrepaidUpgrade = !!action.prepaid_upgrade;
33
+ const isUpgradedSeparately = !!action.upgrade_separate;
34
34
  const gift = constructGiftNonUpgraded(Api.as("starGift", action.gift));
35
35
  const message = action.message?.text;
36
36
  const messageEntities = action.message?.entities.map((v) => constructMessageEntity(v)).filter((v) => v !== null);
@@ -22,11 +22,11 @@ import { cleanObject } from "../1_utilities.js";
22
22
  import { Api } from "../2_tl.js";
23
23
  import { constructGiftUpgraded } from "./4_gift.js";
24
24
  export function constructGiftUpgradedInformation(action, getPeer) {
25
- const isUpgraded = action.upgrade ? true : false;
26
- const isTransferred = action.transferred ? true : false;
27
- const isSaved = action.saved ? true : false;
28
- const isRefunded = action.refunded ? true : false;
29
- const isPrepaidUpgrade = action.prepaid_upgrade ? true : false;
25
+ const isUpgraded = !!action.upgrade;
26
+ const isTransferred = !!action.transferred;
27
+ const isSaved = !!action.saved;
28
+ const isRefunded = !!action.refunded;
29
+ const isPrepaidUpgrade = !!action.prepaid_upgrade;
30
30
  const gift = constructGiftUpgraded(Api.as("starGiftUnique", action.gift), getPeer);
31
31
  const exportableAt = action.can_export_at;
32
32
  const transferPrice = action.transfer_stars ? Number(action.transfer_stars) : undefined;
@@ -75,7 +75,7 @@ export interface PollMediaLivePhoto {
75
75
  /** @unlisted */
76
76
  export interface PollMediaLocation {
77
77
  type: "location";
78
- /** The the location. */
78
+ /** The location. */
79
79
  location: Location;
80
80
  }
81
81
  /** Any type of poll option media. */
@@ -1 +1 @@
1
- {"version":3,"file":"6_poll_media.d.ts","sourceRoot":"","sources":["../../src/types/6_poll_media.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,iBA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,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAsElJ"}
@@ -397,7 +397,7 @@ export async function inlineQueryResultToTlObject(result_, parseText, usernameRe
397
397
  const title = "title" in result_ ? result_.title : undefined;
398
398
  const description = "description" in result_ ? result_.description : undefined;
399
399
  if (document !== null) {
400
- return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb === null ? undefined : thumb, content: document, send_message: { _: "inputBotInlineMessageMediaAuto", message, entities, reply_markup: replyMarkup } };
400
+ return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, content: document, send_message: { _: "inputBotInlineMessageMediaAuto", message, entities, reply_markup: replyMarkup } };
401
401
  }
402
402
  else if (fileId_ !== null) {
403
403
  const fileId = deserializeFileId(fileId_);
@@ -432,10 +432,10 @@ export async function inlineQueryResultToTlObject(result_, parseText, usernameRe
432
432
  };
433
433
  }
434
434
  else if (result_.type === "location") {
435
- return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb === null ? undefined : thumb, send_message: { _: "inputBotInlineMessageMediaGeo", geo_point: { _: "inputGeoPoint", lat: result_.latitude, long: result_.longitude, accuracy_radius: result_.horizontalAccuracy }, heading: result_.heading, period: result_.livePeriod, proximity_notification_radius: result_.proximityAlertRadius, reply_markup: replyMarkup } };
435
+ return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, send_message: { _: "inputBotInlineMessageMediaGeo", geo_point: { _: "inputGeoPoint", lat: result_.latitude, long: result_.longitude, accuracy_radius: result_.horizontalAccuracy }, heading: result_.heading, period: result_.livePeriod, proximity_notification_radius: result_.proximityAlertRadius, reply_markup: replyMarkup } };
436
436
  }
437
437
  else if (result_.type === "game") {
438
- return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb === null ? undefined : thumb, send_message: { _: "inputBotInlineMessageGame", reply_markup: replyMarkup } };
438
+ return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, send_message: { _: "inputBotInlineMessageGame", reply_markup: replyMarkup } };
439
439
  }
440
440
  else if (result_.type === "article") {
441
441
  let sendMessage;
@@ -479,10 +479,10 @@ export async function inlineQueryResultToTlObject(result_, parseText, usernameRe
479
479
  break;
480
480
  case "text": {
481
481
  const [message, entities] = parseText(result_.messageContent.text, { entities: result_.messageContent.entities, parseMode: result_.messageContent.parseMode });
482
- const noWebpage = result_.messageContent?.linkPreview && result_.messageContent?.linkPreview.type === "input" && result_.messageContent?.linkPreview.isDisabled ? true : undefined;
483
- const invertMedia = result_.messageContent?.linkPreview?.isAboveText ? true : undefined;
482
+ const noWebpage = result_.messageContent?.linkPreview && result_.messageContent?.linkPreview.type === "input" && result_.messageContent?.linkPreview.isDisabled || undefined;
483
+ const invertMedia = result_.messageContent?.linkPreview?.isAboveText || undefined;
484
484
  if (result_.messageContent.linkPreview?.url) {
485
- sendMessage = { _: "inputBotInlineMessageMediaWebPage", url: result_.messageContent.linkPreview.url, force_large_media: result_.messageContent.linkPreview.mediaSize === "large" ? true : undefined, force_small_media: result_.messageContent.linkPreview.mediaSize === "small" ? true : undefined, optional: message.length ? undefined : true, message, entities, invert_media: invertMedia, reply_markup: replyMarkup };
485
+ sendMessage = { _: "inputBotInlineMessageMediaWebPage", url: result_.messageContent.linkPreview.url, force_large_media: result_.messageContent.linkPreview.mediaSize === "large" || undefined, force_small_media: result_.messageContent.linkPreview.mediaSize === "small" || undefined, optional: !message.length || undefined, message, entities, invert_media: invertMedia, reply_markup: replyMarkup };
486
486
  }
487
487
  else {
488
488
  sendMessage = { _: "inputBotInlineMessageText", message, entities, no_webpage: noWebpage, invert_media: invertMedia, reply_markup: replyMarkup };
@@ -490,13 +490,13 @@ export async function inlineQueryResultToTlObject(result_, parseText, usernameRe
490
490
  break;
491
491
  }
492
492
  }
493
- return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb === null ? undefined : thumb, send_message: sendMessage };
493
+ return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, send_message: sendMessage };
494
494
  }
495
495
  else if (result_.type === "venue") {
496
496
  if (!result_.foursquareId || !result_.foursquareType) {
497
497
  unreachable();
498
498
  }
499
- return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb === null ? undefined : thumb, send_message: { _: "inputBotInlineMessageMediaVenue", geo_point: { _: "inputGeoPoint", long: result_.longitude, lat: result_.latitude }, address: result_.address, provider: "foursquare", title: result_.title, venue_id: result_.foursquareId, venue_type: result_.foursquareType, reply_markup: replyMarkup } };
499
+ return { _: "inputBotInlineResult", id, type, title, description, thumb: thumb ?? undefined, send_message: { _: "inputBotInlineMessageMediaVenue", geo_point: { _: "inputGeoPoint", long: result_.longitude, lat: result_.latitude }, address: result_.address, provider: "foursquare", title: result_.title, venue_id: result_.foursquareId, venue_type: result_.foursquareType, reply_markup: replyMarkup } };
500
500
  }
501
501
  else {
502
502
  unreachable();
@@ -30,7 +30,7 @@ export interface PollOption {
30
30
  text: string;
31
31
  /** The entities of the option's text. */
32
32
  entities: MessageEntity[];
33
- /** Number of users that voted this option. */
33
+ /** Number of users that voted for this option. */
34
34
  voterCount: number;
35
35
  /** Whether this option has been chosen. */
36
36
  isChosen: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"7_poll_option.d.ts","sourceRoot":"","sources":["../../src/types/7_poll_option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEvE,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,IAAI,EAAE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EAAE,SAAS,CAAC;IAClB,oDAAoD;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAezL"}
@@ -21,7 +21,7 @@ import { cleanObject } from "../1_utilities.js";
21
21
  import { constructInlineQueryResult } from "./7_inline_query_result.js";
22
22
  export function constructInlineQueryAnswer(results) {
23
23
  return cleanObject({
24
- id: results.query_id + "",
24
+ id: String(results.query_id),
25
25
  results: results.results.map(constructInlineQueryResult),
26
26
  nextOffset: results.next_offset,
27
27
  });
@@ -153,7 +153,7 @@ async function constructServiceMessage(message_, chat, getPeer, getMessage, getS
153
153
  id: message_.id,
154
154
  chat,
155
155
  date: message_.date,
156
- isTopicMessage: message_.reply_to && Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.forum_topic ? true : false,
156
+ isTopicMessage: !!(message_.reply_to && Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.forum_topic),
157
157
  ...getSender(message_, getPeer),
158
158
  };
159
159
  if (Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.reply_to_msg_id) {
@@ -346,11 +346,11 @@ export async function constructMessage(message_, getPeer, getMessage, getSticker
346
346
  date: message_.date,
347
347
  views: message_.views,
348
348
  forwards: message_.forwards,
349
- isTopicMessage: message_.reply_to && Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.forum_topic ? true : false,
349
+ isTopicMessage: !!(message_.reply_to && Api.is("messageReplyHeader", message_.reply_to) && message_.reply_to.forum_topic),
350
350
  hasProtectedContent: message_.noforwards || false,
351
351
  senderBoostCount: message_.from_boosts_applied,
352
352
  effectId: message_.effect ? String(message_.effect) : undefined,
353
- isScheduled: message_.from_scheduled ? true : undefined,
353
+ isScheduled: message_.from_scheduled || undefined,
354
354
  ...getSender(message_, getPeer),
355
355
  for: message_.guestchat_via_from ? getPeer(message_.guestchat_via_from)?.[0] : undefined,
356
356
  };
@@ -26,7 +26,7 @@ export function getString(name) {
26
26
  if (globalName in global_) {
27
27
  const value = global_[globalName];
28
28
  if (value) {
29
- const string = value + "";
29
+ const string = String(value);
30
30
  if (string) {
31
31
  return string;
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtkruto/node",
3
- "version": "0.153.0",
3
+ "version": "0.160.0",
4
4
  "description": "MTKruto for Node.js",
5
5
  "author": "Roj <rojvv@icloud.com>",
6
6
  "repository": {
@@ -64,12 +64,14 @@ export * from "./types/0_premium_subscription_duration.js";
64
64
  export * from "./types/0_price_tag.js";
65
65
  export * from "./types/0_reaction.js";
66
66
  export * from "./types/0_refunded_payment.js";
67
+ export * from "./types/0_report_reason.js";
67
68
  export * from "./types/0_restriction_reason.js";
68
69
  export * from "./types/0_self_destruct_option.js";
69
70
  export * from "./types/0_shipping_address.js";
70
71
  export * from "./types/0_slow_mode_duration.js";
71
72
  export * from "./types/0_star_amount.js";
72
73
  export * from "./types/0_story_reference.js";
74
+ export * from "./types/0_story_report_option.js";
73
75
  export * from "./types/0_switch_inline_query_chosen_chats.js";
74
76
  export * from "./types/0_thumbnail.js";
75
77
  export * from "./types/0_timezone.js";
@@ -104,6 +106,7 @@ export * from "./types/1_photo.js";
104
106
  export * from "./types/1_reaction_count.js";
105
107
  export * from "./types/1_sticker.js";
106
108
  export * from "./types/1_story_reaction.js";
109
+ export * from "./types/1_story_report_result.js";
107
110
  export * from "./types/1_venue.js";
108
111
  export * from "./types/1_video_note.js";
109
112
  export * from "./types/1_video.js";
@@ -1 +1 @@
1
- {"version":3,"file":"3_types.d.ts","sourceRoot":"","sources":["../src/3_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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AAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
package/script/3_types.js CHANGED
@@ -80,12 +80,14 @@ __exportStar(require("./types/0_premium_subscription_duration.js"), exports);
80
80
  __exportStar(require("./types/0_price_tag.js"), exports);
81
81
  __exportStar(require("./types/0_reaction.js"), exports);
82
82
  __exportStar(require("./types/0_refunded_payment.js"), exports);
83
+ __exportStar(require("./types/0_report_reason.js"), exports);
83
84
  __exportStar(require("./types/0_restriction_reason.js"), exports);
84
85
  __exportStar(require("./types/0_self_destruct_option.js"), exports);
85
86
  __exportStar(require("./types/0_shipping_address.js"), exports);
86
87
  __exportStar(require("./types/0_slow_mode_duration.js"), exports);
87
88
  __exportStar(require("./types/0_star_amount.js"), exports);
88
89
  __exportStar(require("./types/0_story_reference.js"), exports);
90
+ __exportStar(require("./types/0_story_report_option.js"), exports);
89
91
  __exportStar(require("./types/0_switch_inline_query_chosen_chats.js"), exports);
90
92
  __exportStar(require("./types/0_thumbnail.js"), exports);
91
93
  __exportStar(require("./types/0_timezone.js"), exports);
@@ -120,6 +122,7 @@ __exportStar(require("./types/1_photo.js"), exports);
120
122
  __exportStar(require("./types/1_reaction_count.js"), exports);
121
123
  __exportStar(require("./types/1_sticker.js"), exports);
122
124
  __exportStar(require("./types/1_story_reaction.js"), exports);
125
+ __exportStar(require("./types/1_story_report_result.js"), exports);
123
126
  __exportStar(require("./types/1_venue.js"), exports);
124
127
  __exportStar(require("./types/1_video_note.js"), exports);
125
128
  __exportStar(require("./types/1_video.js"), exports);
@@ -16,4 +16,5 @@ export declare const MAX_CHANNEL_ID = 997852516352;
16
16
  export declare const CHANNEL_DIFFERENCE_LIMIT_USER = 100;
17
17
  export declare const CHANNEL_DIFFERENCE_LIMIT_BOT = 100000;
18
18
  export declare const DOWNLOAD_MAX_CHUNK_SIZE: number;
19
+ export declare const TEMPORARY_AUTH_KEY_TTL = 86400;
19
20
  //# sourceMappingURL=4_constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"4_constants.d.ts","sourceRoot":"","sources":["../src/4_constants.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;AAE/D,eAAO,MAAM,WAAW,EAAE,UAkDxB,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,EAAQ,CAAC;AAElC,eAAO,MAAM,WAAW,YAAY,CAAC;AAGrC,eAAO,MAAM,YAAY,EAAE,MAA+Q,CAAC;AAE3S,eAAO,MAAM,SAAS,EAAE,MAA6H,CAAC;AAEtJ,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,gBAAgB,QAAY,CAAC;AAG1C,eAAO,MAAM,cAAc,QAA2I,CAAC;AAEv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 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.DOWNLOAD_MAX_CHUNK_SIZE = exports.CHANNEL_DIFFERENCE_LIMIT_BOT = exports.CHANNEL_DIFFERENCE_LIMIT_USER = exports.MAX_CHANNEL_ID = exports.MAX_CHAT_ID = exports.STICKER_SET_NAME_TTL = exports.PHONE_NUMBER_TTL = exports.USERNAME_TTL = exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LANG_PACK = exports.LANG_CODE = exports.DEVICE_MODEL = exports.APP_VERSION = exports.INITIAL_DC = exports.PUBLIC_KEYS = void 0;
36
+ exports.TEMPORARY_AUTH_KEY_TTL = exports.DOWNLOAD_MAX_CHUNK_SIZE = exports.CHANNEL_DIFFERENCE_LIMIT_BOT = exports.CHANNEL_DIFFERENCE_LIMIT_USER = exports.MAX_CHANNEL_ID = exports.MAX_CHAT_ID = exports.STICKER_SET_NAME_TTL = exports.PHONE_NUMBER_TTL = exports.USERNAME_TTL = exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LANG_PACK = exports.LANG_CODE = exports.DEVICE_MODEL = exports.APP_VERSION = exports.INITIAL_DC = exports.PUBLIC_KEYS = void 0;
37
37
  /**
38
38
  * MTKruto - Cross-runtime JavaScript library for building Telegram clients
39
39
  * Copyright (C) 2023-2026 Roj <https://roj.im/>
@@ -123,3 +123,4 @@ exports.MAX_CHANNEL_ID = 997852516352;
123
123
  exports.CHANNEL_DIFFERENCE_LIMIT_USER = 100;
124
124
  exports.CHANNEL_DIFFERENCE_LIMIT_BOT = 100_000;
125
125
  exports.DOWNLOAD_MAX_CHUNK_SIZE = 1 * _1_utilities_js_1.megabyte;
126
+ exports.TEMPORARY_AUTH_KEY_TTL = 86_400;
@@ -122,7 +122,7 @@ function parseMarkdown(text_) {
122
122
  let entities = [];
123
123
  let utf16Offset = 0;
124
124
  const nestedEntities = [];
125
- for (let i = 0; i < text.length; i++) {
125
+ for (let i = 0; i < text.byteLength; i++) {
126
126
  const c = text[i];
127
127
  if (c === exports.CODEPOINTS["\\"] && text[i + 1] !== undefined && text[i + 1] > 0 && text[i + 1] <= 126) {
128
128
  i++;
@@ -215,7 +215,7 @@ function parseMarkdown(text_) {
215
215
  while (text[languageEnd] !== null && !isWhitespace(text[languageEnd]) && text[languageEnd] !== exports.CODEPOINTS["`"]) {
216
216
  languageEnd++;
217
217
  }
218
- if (i !== languageEnd && languageEnd < text.length && text[languageEnd] !== exports.CODEPOINTS["`"]) {
218
+ if (i !== languageEnd && languageEnd < text.byteLength && text[languageEnd] !== exports.CODEPOINTS["`"]) {
219
219
  type = "pre";
220
220
  argument = text.slice(i, languageEnd);
221
221
  i = languageEnd;
@@ -277,7 +277,7 @@ function parseMarkdown(text_) {
277
277
  i += 2;
278
278
  const urlBeginPos = i;
279
279
  const url_ = [];
280
- while (i < text.length && text[i] !== exports.CODEPOINTS[")"]) {
280
+ while (i < text.byteLength && text[i] !== exports.CODEPOINTS[")"]) {
281
281
  if (text[i] === exports.CODEPOINTS["\\"] && text[i + 1] > 0 && text[i + 1] <= 126) {
282
282
  url_.push(text[i + 1]);
283
283
  i += 2;
@@ -309,7 +309,7 @@ function parseMarkdown(text_) {
309
309
  i += 2;
310
310
  const url_ = [];
311
311
  const urlBeginPos = i;
312
- while (i < text.length && text[i] !== exports.CODEPOINTS[")"]) {
312
+ while (i < text.byteLength && text[i] !== exports.CODEPOINTS[")"]) {
313
313
  if (text[i] === exports.CODEPOINTS["\\"] && text[i + 1] > 0 && text[i + 1] <= 126) {
314
314
  url_.push(text[i + 1]);
315
315
  i += 2;