@mtkruto/node 0.1.200 → 0.1.289

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 (723) hide show
  1. package/COPYING +674 -0
  2. package/esm/0_deps.d.ts +20 -1
  3. package/esm/0_deps.js +21 -1
  4. package/esm/0_errors.d.ts +19 -0
  5. package/esm/0_errors.js +19 -0
  6. package/esm/1_utilities.d.ts +20 -1
  7. package/esm/1_utilities.js +20 -1
  8. package/esm/2_connection.d.ts +19 -0
  9. package/esm/2_connection.js +19 -0
  10. package/esm/2_tl.d.ts +19 -0
  11. package/esm/2_tl.js +19 -0
  12. package/esm/3_errors.d.ts +19 -0
  13. package/esm/3_errors.js +19 -0
  14. package/esm/3_storage.d.ts +19 -0
  15. package/esm/3_storage.js +19 -0
  16. package/esm/3_transport.d.ts +19 -0
  17. package/esm/3_transport.js +19 -0
  18. package/esm/3_types.d.ts +19 -0
  19. package/esm/3_types.js +19 -0
  20. package/esm/4_constants.js +19 -0
  21. package/esm/4_errors.d.ts +19 -0
  22. package/esm/4_errors.js +22 -3
  23. package/esm/5_client.d.ts +19 -0
  24. package/esm/5_client.js +19 -0
  25. package/esm/client/0_client_abstract.d.ts +19 -0
  26. package/esm/client/0_client_abstract.js +19 -0
  27. package/esm/client/0_filters.d.ts +19 -0
  28. package/esm/client/0_filters.js +19 -0
  29. package/esm/client/0_html.d.ts +19 -0
  30. package/esm/client/0_html.js +19 -0
  31. package/esm/client/0_markdown.js +5 -5
  32. package/esm/client/0_message.d.ts +19 -0
  33. package/esm/client/0_message.js +19 -0
  34. package/esm/client/0_params.d.ts +19 -0
  35. package/esm/client/0_params.js +19 -0
  36. package/esm/client/0_password.js +19 -0
  37. package/esm/client/0_types.d.ts +19 -0
  38. package/esm/client/0_types.js +19 -0
  39. package/esm/client/0_utilities.d.ts +7 -0
  40. package/esm/client/0_utilities.js +66 -4
  41. package/esm/client/1_account_manager.d.ts +19 -0
  42. package/esm/client/1_account_manager.js +23 -4
  43. package/esm/client/1_bot_info_manager.d.ts +19 -0
  44. package/esm/client/1_bot_info_manager.js +19 -0
  45. package/esm/client/1_business_connection_manager.d.ts +19 -0
  46. package/esm/client/1_business_connection_manager.js +19 -0
  47. package/esm/client/1_client_encrypted.d.ts +19 -0
  48. package/esm/client/1_client_encrypted.js +23 -4
  49. package/esm/client/1_client_plain.d.ts +19 -0
  50. package/esm/client/1_client_plain.js +22 -3
  51. package/esm/client/1_composer.d.ts +19 -0
  52. package/esm/client/1_composer.js +19 -0
  53. package/esm/client/1_file_manager.d.ts +19 -0
  54. package/esm/client/1_file_manager.js +25 -5
  55. package/esm/client/1_network_statistics_manager.d.ts +19 -0
  56. package/esm/client/1_network_statistics_manager.js +19 -0
  57. package/esm/client/1_reaction_manager.d.ts +19 -0
  58. package/esm/client/1_reaction_manager.js +21 -2
  59. package/esm/client/1_update_manager.d.ts +19 -0
  60. package/esm/client/1_update_manager.js +28 -8
  61. package/esm/client/2_message_manager.d.ts +19 -0
  62. package/esm/client/2_message_manager.js +66 -24
  63. package/esm/client/3_callback_query_manager.d.ts +19 -0
  64. package/esm/client/3_callback_query_manager.js +21 -0
  65. package/esm/client/3_chat_list_manager.d.ts +19 -0
  66. package/esm/client/3_chat_list_manager.js +32 -12
  67. package/esm/client/3_inline_query_manager.d.ts +19 -0
  68. package/esm/client/3_inline_query_manager.js +23 -2
  69. package/esm/client/3_story_manager.d.ts +19 -0
  70. package/esm/client/3_story_manager.js +26 -5
  71. package/esm/client/4_client.d.ts +24 -8
  72. package/esm/client/4_client.js +40 -29
  73. package/esm/connection/0_connection.d.ts +19 -0
  74. package/esm/connection/0_connection.js +19 -0
  75. package/esm/connection/1_connection_web_socket.js +22 -2
  76. package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.d.ts +0 -1
  77. package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.js +0 -11
  78. package/esm/deps/deno.land/x/tgcrypto@0.4.0/tgcrypto.js +308 -0
  79. package/esm/mod.d.ts +20 -1
  80. package/esm/mod.js +20 -1
  81. package/esm/storage/0_storage.d.ts +19 -0
  82. package/esm/storage/0_storage.js +25 -5
  83. package/esm/storage/1_utilities.d.ts +19 -1
  84. package/esm/storage/1_utilities.js +21 -3
  85. package/esm/storage/2_storage_indexed_db.d.ts +19 -0
  86. package/esm/storage/2_storage_indexed_db.js +19 -0
  87. package/esm/storage/2_storage_local_storage.d.ts +19 -0
  88. package/esm/storage/2_storage_local_storage.js +20 -4
  89. package/esm/storage/2_storage_memory.d.ts +19 -0
  90. package/esm/storage/2_storage_memory.js +19 -0
  91. package/esm/storage/2_storage_session_storage.d.ts +19 -0
  92. package/esm/storage/2_storage_session_storage.js +20 -4
  93. package/esm/tl/0_tl_raw_reader.d.ts +19 -0
  94. package/esm/tl/0_tl_raw_reader.js +19 -0
  95. package/esm/tl/0_tl_raw_writer.d.ts +19 -0
  96. package/esm/tl/0_tl_raw_writer.js +19 -0
  97. package/esm/tl/1_tl_object.d.ts +19 -0
  98. package/esm/tl/1_tl_object.js +19 -0
  99. package/esm/tl/2_types.d.ts +19 -0
  100. package/esm/tl/2_types.js +19 -0
  101. package/esm/tl/3_deserialize.d.ts +19 -0
  102. package/esm/tl/3_deserialize.js +19 -0
  103. package/esm/tl/3_functions.d.ts +19 -0
  104. package/esm/tl/3_functions.js +19 -0
  105. package/esm/tl/3_utilities.d.ts +19 -0
  106. package/esm/tl/3_utilities.js +24 -4
  107. package/esm/tl/4_tl_reader.d.ts +19 -0
  108. package/esm/tl/4_tl_reader.js +19 -0
  109. package/esm/tl/5_tl_writer.d.ts +19 -0
  110. package/esm/tl/5_tl_writer.js +19 -0
  111. package/esm/tl/6_rpc_result.d.ts +19 -0
  112. package/esm/tl/6_rpc_result.js +19 -0
  113. package/esm/tl/7_message.d.ts +19 -0
  114. package/esm/tl/7_message.js +19 -0
  115. package/esm/tl/8_message_container.d.ts +19 -0
  116. package/esm/tl/8_message_container.js +19 -0
  117. package/esm/transport/0_obfuscation.js +19 -0
  118. package/esm/transport/0_transport.d.ts +19 -0
  119. package/esm/transport/0_transport.js +19 -0
  120. package/esm/transport/1_transport_abridged.d.ts +19 -0
  121. package/esm/transport/1_transport_abridged.js +19 -0
  122. package/esm/transport/1_transport_intermediate.d.ts +19 -0
  123. package/esm/transport/1_transport_intermediate.js +19 -0
  124. package/esm/transport/2_transport_provider.d.ts +19 -0
  125. package/esm/transport/2_transport_provider.js +23 -4
  126. package/esm/transport/3_transport_provider_web_socket.d.ts +19 -0
  127. package/esm/transport/3_transport_provider_web_socket.js +19 -0
  128. package/esm/types/0_authorization_state.d.ts +19 -0
  129. package/esm/types/0_authorization_state.js +19 -0
  130. package/esm/types/0_bot_command.d.ts +19 -0
  131. package/esm/types/0_bot_command.js +19 -0
  132. package/esm/types/0_chat_action.d.ts +19 -0
  133. package/esm/types/0_chat_action.js +19 -0
  134. package/esm/types/0_chat_administrator_rights.d.ts +19 -0
  135. package/esm/types/0_chat_administrator_rights.js +19 -0
  136. package/esm/types/0_chat_member_rights.d.ts +19 -0
  137. package/esm/types/0_chat_member_rights.js +19 -0
  138. package/esm/types/0_chat_photo.d.ts +19 -1
  139. package/esm/types/0_chat_photo.js +19 -2
  140. package/esm/types/0_connection_state.d.ts +19 -0
  141. package/esm/types/0_connection_state.js +19 -0
  142. package/esm/types/0_contact.d.ts +19 -0
  143. package/esm/types/0_contact.js +19 -0
  144. package/esm/types/0_dice.d.ts +19 -0
  145. package/esm/types/0_dice.js +19 -0
  146. package/esm/types/0_file_source.d.ts +19 -0
  147. package/esm/types/0_file_source.js +19 -0
  148. package/esm/types/0_giveaway_parameters.d.ts +19 -0
  149. package/esm/types/0_giveaway_parameters.js +19 -0
  150. package/esm/types/0_id.d.ts +19 -0
  151. package/esm/types/0_id.js +19 -0
  152. package/esm/types/0_keyboard_button_poll_type.d.ts +19 -0
  153. package/esm/types/0_keyboard_button_poll_type.js +19 -0
  154. package/esm/types/0_link_preview.d.ts +19 -0
  155. package/esm/types/0_link_preview.js +19 -0
  156. package/esm/types/0_location.d.ts +19 -0
  157. package/esm/types/0_location.js +19 -0
  158. package/esm/types/0_login_url.d.ts +19 -0
  159. package/esm/types/0_login_url.js +19 -0
  160. package/esm/types/0_mask_position.d.ts +19 -0
  161. package/esm/types/0_mask_position.js +19 -0
  162. package/esm/types/0_message_entity.d.ts +19 -0
  163. package/esm/types/0_message_entity.js +22 -3
  164. package/esm/types/0_message_reference.d.ts +19 -0
  165. package/esm/types/0_message_reference.js +19 -0
  166. package/esm/types/0_message_search_filter.d.ts +19 -0
  167. package/esm/types/0_message_search_filter.js +21 -2
  168. package/esm/types/0_mini_app_info.d.ts +19 -0
  169. package/esm/types/0_mini_app_info.js +19 -0
  170. package/esm/types/0_network_statistics_entry.d.ts +19 -0
  171. package/esm/types/0_network_statistics_entry.js +19 -0
  172. package/esm/types/0_parse_mode.d.ts +19 -0
  173. package/esm/types/0_parse_mode.js +19 -0
  174. package/esm/types/0_poll_option.d.ts +19 -0
  175. package/esm/types/0_poll_option.js +19 -0
  176. package/esm/types/0_price_tag.d.ts +19 -0
  177. package/esm/types/0_price_tag.js +19 -0
  178. package/esm/types/0_reaction.d.ts +19 -0
  179. package/esm/types/0_reaction.js +21 -2
  180. package/esm/types/0_restriction_reason.d.ts +19 -0
  181. package/esm/types/0_restriction_reason.js +19 -0
  182. package/esm/types/0_story_reference.d.ts +19 -0
  183. package/esm/types/0_story_reference.js +19 -0
  184. package/esm/types/0_thumbnail.d.ts +19 -0
  185. package/esm/types/0_thumbnail.js +19 -0
  186. package/esm/types/0_voice.d.ts +19 -0
  187. package/esm/types/0_voice.js +19 -0
  188. package/esm/types/1_animation.d.ts +19 -0
  189. package/esm/types/1_animation.js +19 -0
  190. package/esm/types/1_audio.d.ts +19 -0
  191. package/esm/types/1_audio.js +19 -0
  192. package/esm/types/1_bot_command_scope.d.ts +19 -0
  193. package/esm/types/1_bot_command_scope.js +22 -3
  194. package/esm/types/1_chat_p.d.ts +19 -0
  195. package/esm/types/1_chat_p.js +22 -2
  196. package/esm/types/1_document.d.ts +19 -0
  197. package/esm/types/1_document.js +19 -0
  198. package/esm/types/1_giveaway.d.ts +19 -0
  199. package/esm/types/1_giveaway.js +19 -0
  200. package/esm/types/1_inline_query_result_button.d.ts +19 -0
  201. package/esm/types/1_inline_query_result_button.js +19 -0
  202. package/esm/types/1_input_message_content.d.ts +19 -0
  203. package/esm/types/1_input_message_content.js +19 -0
  204. package/esm/types/1_input_story_content.d.ts +19 -0
  205. package/esm/types/1_input_story_content.js +19 -0
  206. package/esm/types/1_keyboard_button.d.ts +19 -0
  207. package/esm/types/1_keyboard_button.js +22 -3
  208. package/esm/types/1_message_reaction.d.ts +19 -0
  209. package/esm/types/1_message_reaction.js +21 -2
  210. package/esm/types/1_network_statistics.d.ts +19 -0
  211. package/esm/types/1_network_statistics.js +19 -0
  212. package/esm/types/1_photo.d.ts +19 -0
  213. package/esm/types/1_photo.js +19 -0
  214. package/esm/types/1_poll.d.ts +19 -0
  215. package/esm/types/1_poll.js +19 -0
  216. package/esm/types/1_reaction_count.d.ts +19 -0
  217. package/esm/types/1_reaction_count.js +19 -0
  218. package/esm/types/1_reply_quote.d.ts +19 -0
  219. package/esm/types/1_reply_quote.js +19 -0
  220. package/esm/types/1_sticker.d.ts +19 -0
  221. package/esm/types/1_sticker.js +19 -0
  222. package/esm/types/1_story_privacy.d.ts +19 -0
  223. package/esm/types/1_story_privacy.js +22 -3
  224. package/esm/types/1_story_reaction.d.ts +19 -0
  225. package/esm/types/1_story_reaction.js +19 -0
  226. package/esm/types/1_user.d.ts +19 -0
  227. package/esm/types/1_user.js +19 -0
  228. package/esm/types/1_venue.d.ts +19 -0
  229. package/esm/types/1_venue.js +19 -0
  230. package/esm/types/1_video.d.ts +19 -0
  231. package/esm/types/1_video.js +19 -0
  232. package/esm/types/1_video_note.d.ts +19 -0
  233. package/esm/types/1_video_note.js +19 -0
  234. package/esm/types/2_business_connection.d.ts +19 -0
  235. package/esm/types/2_business_connection.js +19 -0
  236. package/esm/types/2_chat_member.d.ts +19 -0
  237. package/esm/types/2_chat_member.js +25 -5
  238. package/esm/types/2_chosen_inline_result.d.ts +19 -0
  239. package/esm/types/2_chosen_inline_result.js +22 -2
  240. package/esm/types/2_game.d.ts +19 -0
  241. package/esm/types/2_game.js +19 -0
  242. package/esm/types/2_inactive_chat.d.ts +19 -0
  243. package/esm/types/2_inactive_chat.js +22 -2
  244. package/esm/types/2_inline_keyboard_button.d.ts +19 -0
  245. package/esm/types/2_inline_keyboard_button.js +22 -3
  246. package/esm/types/2_inline_query.d.ts +19 -0
  247. package/esm/types/2_inline_query.js +22 -3
  248. package/esm/types/2_invite_link.d.ts +19 -0
  249. package/esm/types/2_invite_link.js +22 -2
  250. package/esm/types/2_message_interactions.d.ts +19 -0
  251. package/esm/types/2_message_interactions.js +19 -0
  252. package/esm/types/2_message_reaction_count.d.ts +19 -0
  253. package/esm/types/2_message_reaction_count.js +19 -0
  254. package/esm/types/2_message_reactions.d.ts +19 -0
  255. package/esm/types/2_message_reactions.js +19 -0
  256. package/esm/types/2_story_content.d.ts +19 -0
  257. package/esm/types/2_story_content.js +24 -5
  258. package/esm/types/2_story_interactions.d.ts +19 -0
  259. package/esm/types/2_story_interactions.js +19 -0
  260. package/esm/types/2_story_interactive_area.d.ts +19 -0
  261. package/esm/types/2_story_interactive_area.js +24 -5
  262. package/esm/types/3_chat_member_updated.d.ts +19 -0
  263. package/esm/types/3_chat_member_updated.js +23 -3
  264. package/esm/types/3_reply_markup.d.ts +19 -0
  265. package/esm/types/3_reply_markup.js +23 -3
  266. package/esm/types/3_story.d.ts +19 -0
  267. package/esm/types/3_story.js +22 -2
  268. package/esm/types/4_inline_query_result.d.ts +19 -0
  269. package/esm/types/4_inline_query_result.js +24 -5
  270. package/esm/types/4_message.d.ts +19 -0
  271. package/esm/types/4_message.js +36 -16
  272. package/esm/types/5_callback_query.d.ts +19 -0
  273. package/esm/types/5_callback_query.js +23 -3
  274. package/esm/types/5_chat.d.ts +19 -0
  275. package/esm/types/5_chat.js +27 -7
  276. package/esm/types/6_update.d.ts +19 -0
  277. package/esm/types/6_update.js +19 -0
  278. package/esm/types/_file_id.d.ts +19 -0
  279. package/esm/types/_file_id.js +28 -8
  280. package/esm/types/_getters.d.ts +19 -0
  281. package/esm/types/_getters.js +19 -0
  282. package/esm/utilities/0_bigint.d.ts +1 -0
  283. package/esm/utilities/0_bigint.js +44 -0
  284. package/esm/utilities/0_buffer.d.ts +19 -0
  285. package/esm/utilities/0_buffer.js +19 -0
  286. package/esm/utilities/0_cache_map.d.ts +19 -0
  287. package/esm/utilities/0_cache_map.js +19 -0
  288. package/esm/utilities/0_color.d.ts +19 -0
  289. package/esm/utilities/0_color.js +19 -0
  290. package/esm/utilities/0_crypto.d.ts +19 -0
  291. package/esm/utilities/0_crypto.js +19 -0
  292. package/esm/utilities/0_hash.js +19 -0
  293. package/esm/utilities/0_logger.d.ts +27 -0
  294. package/esm/utilities/0_logger.js +28 -5
  295. package/esm/utilities/0_mutex.d.ts +19 -0
  296. package/esm/utilities/0_mutex.js +19 -0
  297. package/esm/utilities/0_object.d.ts +19 -0
  298. package/esm/utilities/0_object.js +19 -0
  299. package/esm/utilities/0_rle.d.ts +19 -0
  300. package/esm/utilities/0_rle.js +19 -0
  301. package/esm/utilities/0_types.d.ts +19 -0
  302. package/esm/utilities/0_types.js +19 -0
  303. package/esm/utilities/1_auth.js +19 -0
  304. package/esm/utilities/1_base64.d.ts +19 -0
  305. package/esm/utilities/1_base64.js +19 -0
  306. package/esm/utilities/1_math.d.ts +20 -0
  307. package/esm/utilities/1_math.js +70 -0
  308. package/esm/utilities/1_misc.d.ts +19 -0
  309. package/esm/utilities/1_misc.js +21 -2
  310. package/esm/utilities/1_queue.d.ts +19 -0
  311. package/esm/utilities/1_queue.js +19 -0
  312. package/package.json +1 -1
  313. package/script/0_deps.d.ts +20 -1
  314. package/script/0_deps.js +22 -3
  315. package/script/0_errors.d.ts +19 -0
  316. package/script/0_errors.js +19 -0
  317. package/script/1_utilities.d.ts +20 -1
  318. package/script/1_utilities.js +20 -1
  319. package/script/2_connection.d.ts +19 -0
  320. package/script/2_connection.js +19 -0
  321. package/script/2_tl.d.ts +19 -0
  322. package/script/2_tl.js +19 -0
  323. package/script/3_errors.d.ts +19 -0
  324. package/script/3_errors.js +19 -0
  325. package/script/3_storage.d.ts +19 -0
  326. package/script/3_storage.js +19 -0
  327. package/script/3_transport.d.ts +19 -0
  328. package/script/3_transport.js +19 -0
  329. package/script/3_types.d.ts +19 -0
  330. package/script/3_types.js +19 -0
  331. package/script/4_constants.js +19 -0
  332. package/script/4_errors.d.ts +19 -0
  333. package/script/4_errors.js +22 -3
  334. package/script/5_client.d.ts +19 -0
  335. package/script/5_client.js +19 -0
  336. package/script/client/0_client_abstract.d.ts +19 -0
  337. package/script/client/0_client_abstract.js +19 -0
  338. package/script/client/0_filters.d.ts +19 -0
  339. package/script/client/0_filters.js +19 -0
  340. package/script/client/0_html.d.ts +19 -0
  341. package/script/client/0_html.js +19 -0
  342. package/script/client/0_markdown.js +5 -5
  343. package/script/client/0_message.d.ts +19 -0
  344. package/script/client/0_message.js +19 -0
  345. package/script/client/0_params.d.ts +19 -0
  346. package/script/client/0_params.js +19 -0
  347. package/script/client/0_password.js +19 -0
  348. package/script/client/0_types.d.ts +19 -0
  349. package/script/client/0_types.js +19 -0
  350. package/script/client/0_utilities.d.ts +7 -0
  351. package/script/client/0_utilities.js +73 -4
  352. package/script/client/1_account_manager.d.ts +19 -0
  353. package/script/client/1_account_manager.js +23 -4
  354. package/script/client/1_bot_info_manager.d.ts +19 -0
  355. package/script/client/1_bot_info_manager.js +19 -0
  356. package/script/client/1_business_connection_manager.d.ts +19 -0
  357. package/script/client/1_business_connection_manager.js +19 -0
  358. package/script/client/1_client_encrypted.d.ts +19 -0
  359. package/script/client/1_client_encrypted.js +21 -2
  360. package/script/client/1_client_plain.d.ts +19 -0
  361. package/script/client/1_client_plain.js +21 -2
  362. package/script/client/1_composer.d.ts +19 -0
  363. package/script/client/1_composer.js +19 -0
  364. package/script/client/1_file_manager.d.ts +19 -0
  365. package/script/client/1_file_manager.js +24 -4
  366. package/script/client/1_network_statistics_manager.d.ts +19 -0
  367. package/script/client/1_network_statistics_manager.js +19 -0
  368. package/script/client/1_reaction_manager.d.ts +19 -0
  369. package/script/client/1_reaction_manager.js +21 -2
  370. package/script/client/1_update_manager.d.ts +19 -0
  371. package/script/client/1_update_manager.js +27 -7
  372. package/script/client/2_message_manager.d.ts +19 -0
  373. package/script/client/2_message_manager.js +70 -28
  374. package/script/client/3_callback_query_manager.d.ts +19 -0
  375. package/script/client/3_callback_query_manager.js +21 -0
  376. package/script/client/3_chat_list_manager.d.ts +19 -0
  377. package/script/client/3_chat_list_manager.js +31 -11
  378. package/script/client/3_inline_query_manager.d.ts +19 -0
  379. package/script/client/3_inline_query_manager.js +23 -2
  380. package/script/client/3_story_manager.d.ts +19 -0
  381. package/script/client/3_story_manager.js +23 -2
  382. package/script/client/4_client.d.ts +24 -8
  383. package/script/client/4_client.js +38 -27
  384. package/script/connection/0_connection.d.ts +19 -0
  385. package/script/connection/0_connection.js +19 -0
  386. package/script/connection/1_connection_web_socket.js +21 -1
  387. package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.d.ts +0 -1
  388. package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.js +1 -13
  389. package/script/deps/deno.land/x/tgcrypto@0.4.0/tgcrypto.js +310 -0
  390. package/script/mod.d.ts +20 -1
  391. package/script/mod.js +21 -1
  392. package/script/storage/0_storage.d.ts +19 -0
  393. package/script/storage/0_storage.js +24 -4
  394. package/script/storage/1_utilities.d.ts +19 -1
  395. package/script/storage/1_utilities.js +22 -4
  396. package/script/storage/2_storage_indexed_db.d.ts +19 -0
  397. package/script/storage/2_storage_indexed_db.js +19 -0
  398. package/script/storage/2_storage_local_storage.d.ts +19 -0
  399. package/script/storage/2_storage_local_storage.js +19 -3
  400. package/script/storage/2_storage_memory.d.ts +19 -0
  401. package/script/storage/2_storage_memory.js +19 -0
  402. package/script/storage/2_storage_session_storage.d.ts +19 -0
  403. package/script/storage/2_storage_session_storage.js +19 -3
  404. package/script/tl/0_tl_raw_reader.d.ts +19 -0
  405. package/script/tl/0_tl_raw_reader.js +19 -0
  406. package/script/tl/0_tl_raw_writer.d.ts +19 -0
  407. package/script/tl/0_tl_raw_writer.js +19 -0
  408. package/script/tl/1_tl_object.d.ts +19 -0
  409. package/script/tl/1_tl_object.js +19 -0
  410. package/script/tl/2_types.d.ts +19 -0
  411. package/script/tl/2_types.js +19 -0
  412. package/script/tl/3_deserialize.d.ts +19 -0
  413. package/script/tl/3_deserialize.js +19 -0
  414. package/script/tl/3_functions.d.ts +19 -0
  415. package/script/tl/3_functions.js +19 -0
  416. package/script/tl/3_utilities.d.ts +19 -0
  417. package/script/tl/3_utilities.js +23 -3
  418. package/script/tl/4_tl_reader.d.ts +19 -0
  419. package/script/tl/4_tl_reader.js +19 -0
  420. package/script/tl/5_tl_writer.d.ts +19 -0
  421. package/script/tl/5_tl_writer.js +19 -0
  422. package/script/tl/6_rpc_result.d.ts +19 -0
  423. package/script/tl/6_rpc_result.js +19 -0
  424. package/script/tl/7_message.d.ts +19 -0
  425. package/script/tl/7_message.js +19 -0
  426. package/script/tl/8_message_container.d.ts +19 -0
  427. package/script/tl/8_message_container.js +19 -0
  428. package/script/transport/0_obfuscation.js +19 -0
  429. package/script/transport/0_transport.d.ts +19 -0
  430. package/script/transport/0_transport.js +19 -0
  431. package/script/transport/1_transport_abridged.d.ts +19 -0
  432. package/script/transport/1_transport_abridged.js +19 -0
  433. package/script/transport/1_transport_intermediate.d.ts +19 -0
  434. package/script/transport/1_transport_intermediate.js +19 -0
  435. package/script/transport/2_transport_provider.d.ts +19 -0
  436. package/script/transport/2_transport_provider.js +23 -4
  437. package/script/transport/3_transport_provider_web_socket.d.ts +19 -0
  438. package/script/transport/3_transport_provider_web_socket.js +19 -0
  439. package/script/types/0_authorization_state.d.ts +19 -0
  440. package/script/types/0_authorization_state.js +19 -0
  441. package/script/types/0_bot_command.d.ts +19 -0
  442. package/script/types/0_bot_command.js +19 -0
  443. package/script/types/0_chat_action.d.ts +19 -0
  444. package/script/types/0_chat_action.js +19 -0
  445. package/script/types/0_chat_administrator_rights.d.ts +19 -0
  446. package/script/types/0_chat_administrator_rights.js +19 -0
  447. package/script/types/0_chat_member_rights.d.ts +19 -0
  448. package/script/types/0_chat_member_rights.js +19 -0
  449. package/script/types/0_chat_photo.d.ts +19 -1
  450. package/script/types/0_chat_photo.js +19 -2
  451. package/script/types/0_connection_state.d.ts +19 -0
  452. package/script/types/0_connection_state.js +19 -0
  453. package/script/types/0_contact.d.ts +19 -0
  454. package/script/types/0_contact.js +19 -0
  455. package/script/types/0_dice.d.ts +19 -0
  456. package/script/types/0_dice.js +19 -0
  457. package/script/types/0_file_source.d.ts +19 -0
  458. package/script/types/0_file_source.js +19 -0
  459. package/script/types/0_giveaway_parameters.d.ts +19 -0
  460. package/script/types/0_giveaway_parameters.js +19 -0
  461. package/script/types/0_id.d.ts +19 -0
  462. package/script/types/0_id.js +19 -0
  463. package/script/types/0_keyboard_button_poll_type.d.ts +19 -0
  464. package/script/types/0_keyboard_button_poll_type.js +19 -0
  465. package/script/types/0_link_preview.d.ts +19 -0
  466. package/script/types/0_link_preview.js +19 -0
  467. package/script/types/0_location.d.ts +19 -0
  468. package/script/types/0_location.js +19 -0
  469. package/script/types/0_login_url.d.ts +19 -0
  470. package/script/types/0_login_url.js +19 -0
  471. package/script/types/0_mask_position.d.ts +19 -0
  472. package/script/types/0_mask_position.js +19 -0
  473. package/script/types/0_message_entity.d.ts +19 -0
  474. package/script/types/0_message_entity.js +22 -3
  475. package/script/types/0_message_reference.d.ts +19 -0
  476. package/script/types/0_message_reference.js +19 -0
  477. package/script/types/0_message_search_filter.d.ts +19 -0
  478. package/script/types/0_message_search_filter.js +21 -2
  479. package/script/types/0_mini_app_info.d.ts +19 -0
  480. package/script/types/0_mini_app_info.js +19 -0
  481. package/script/types/0_network_statistics_entry.d.ts +19 -0
  482. package/script/types/0_network_statistics_entry.js +19 -0
  483. package/script/types/0_parse_mode.d.ts +19 -0
  484. package/script/types/0_parse_mode.js +19 -0
  485. package/script/types/0_poll_option.d.ts +19 -0
  486. package/script/types/0_poll_option.js +19 -0
  487. package/script/types/0_price_tag.d.ts +19 -0
  488. package/script/types/0_price_tag.js +19 -0
  489. package/script/types/0_reaction.d.ts +19 -0
  490. package/script/types/0_reaction.js +21 -2
  491. package/script/types/0_restriction_reason.d.ts +19 -0
  492. package/script/types/0_restriction_reason.js +19 -0
  493. package/script/types/0_story_reference.d.ts +19 -0
  494. package/script/types/0_story_reference.js +19 -0
  495. package/script/types/0_thumbnail.d.ts +19 -0
  496. package/script/types/0_thumbnail.js +19 -0
  497. package/script/types/0_voice.d.ts +19 -0
  498. package/script/types/0_voice.js +19 -0
  499. package/script/types/1_animation.d.ts +19 -0
  500. package/script/types/1_animation.js +19 -0
  501. package/script/types/1_audio.d.ts +19 -0
  502. package/script/types/1_audio.js +19 -0
  503. package/script/types/1_bot_command_scope.d.ts +19 -0
  504. package/script/types/1_bot_command_scope.js +22 -3
  505. package/script/types/1_chat_p.d.ts +19 -0
  506. package/script/types/1_chat_p.js +21 -1
  507. package/script/types/1_document.d.ts +19 -0
  508. package/script/types/1_document.js +19 -0
  509. package/script/types/1_giveaway.d.ts +19 -0
  510. package/script/types/1_giveaway.js +19 -0
  511. package/script/types/1_inline_query_result_button.d.ts +19 -0
  512. package/script/types/1_inline_query_result_button.js +19 -0
  513. package/script/types/1_input_message_content.d.ts +19 -0
  514. package/script/types/1_input_message_content.js +19 -0
  515. package/script/types/1_input_story_content.d.ts +19 -0
  516. package/script/types/1_input_story_content.js +19 -0
  517. package/script/types/1_keyboard_button.d.ts +19 -0
  518. package/script/types/1_keyboard_button.js +22 -3
  519. package/script/types/1_message_reaction.d.ts +19 -0
  520. package/script/types/1_message_reaction.js +21 -2
  521. package/script/types/1_network_statistics.d.ts +19 -0
  522. package/script/types/1_network_statistics.js +19 -0
  523. package/script/types/1_photo.d.ts +19 -0
  524. package/script/types/1_photo.js +19 -0
  525. package/script/types/1_poll.d.ts +19 -0
  526. package/script/types/1_poll.js +19 -0
  527. package/script/types/1_reaction_count.d.ts +19 -0
  528. package/script/types/1_reaction_count.js +19 -0
  529. package/script/types/1_reply_quote.d.ts +19 -0
  530. package/script/types/1_reply_quote.js +19 -0
  531. package/script/types/1_sticker.d.ts +19 -0
  532. package/script/types/1_sticker.js +19 -0
  533. package/script/types/1_story_privacy.d.ts +19 -0
  534. package/script/types/1_story_privacy.js +22 -3
  535. package/script/types/1_story_reaction.d.ts +19 -0
  536. package/script/types/1_story_reaction.js +19 -0
  537. package/script/types/1_user.d.ts +19 -0
  538. package/script/types/1_user.js +19 -0
  539. package/script/types/1_venue.d.ts +19 -0
  540. package/script/types/1_venue.js +19 -0
  541. package/script/types/1_video.d.ts +19 -0
  542. package/script/types/1_video.js +19 -0
  543. package/script/types/1_video_note.d.ts +19 -0
  544. package/script/types/1_video_note.js +19 -0
  545. package/script/types/2_business_connection.d.ts +19 -0
  546. package/script/types/2_business_connection.js +19 -0
  547. package/script/types/2_chat_member.d.ts +19 -0
  548. package/script/types/2_chat_member.js +24 -4
  549. package/script/types/2_chosen_inline_result.d.ts +19 -0
  550. package/script/types/2_chosen_inline_result.js +21 -1
  551. package/script/types/2_game.d.ts +19 -0
  552. package/script/types/2_game.js +19 -0
  553. package/script/types/2_inactive_chat.d.ts +19 -0
  554. package/script/types/2_inactive_chat.js +21 -1
  555. package/script/types/2_inline_keyboard_button.d.ts +19 -0
  556. package/script/types/2_inline_keyboard_button.js +22 -3
  557. package/script/types/2_inline_query.d.ts +19 -0
  558. package/script/types/2_inline_query.js +22 -3
  559. package/script/types/2_invite_link.d.ts +19 -0
  560. package/script/types/2_invite_link.js +21 -1
  561. package/script/types/2_message_interactions.d.ts +19 -0
  562. package/script/types/2_message_interactions.js +19 -0
  563. package/script/types/2_message_reaction_count.d.ts +19 -0
  564. package/script/types/2_message_reaction_count.js +19 -0
  565. package/script/types/2_message_reactions.d.ts +19 -0
  566. package/script/types/2_message_reactions.js +19 -0
  567. package/script/types/2_story_content.d.ts +19 -0
  568. package/script/types/2_story_content.js +24 -5
  569. package/script/types/2_story_interactions.d.ts +19 -0
  570. package/script/types/2_story_interactions.js +19 -0
  571. package/script/types/2_story_interactive_area.d.ts +19 -0
  572. package/script/types/2_story_interactive_area.js +24 -5
  573. package/script/types/3_chat_member_updated.d.ts +19 -0
  574. package/script/types/3_chat_member_updated.js +22 -2
  575. package/script/types/3_reply_markup.d.ts +19 -0
  576. package/script/types/3_reply_markup.js +22 -2
  577. package/script/types/3_story.d.ts +19 -0
  578. package/script/types/3_story.js +21 -1
  579. package/script/types/4_inline_query_result.d.ts +19 -0
  580. package/script/types/4_inline_query_result.js +24 -5
  581. package/script/types/4_message.d.ts +19 -0
  582. package/script/types/4_message.js +35 -15
  583. package/script/types/5_callback_query.d.ts +19 -0
  584. package/script/types/5_callback_query.js +22 -2
  585. package/script/types/5_chat.d.ts +19 -0
  586. package/script/types/5_chat.js +26 -6
  587. package/script/types/6_update.d.ts +19 -0
  588. package/script/types/6_update.js +19 -0
  589. package/script/types/_file_id.d.ts +19 -0
  590. package/script/types/_file_id.js +27 -7
  591. package/script/types/_getters.d.ts +19 -0
  592. package/script/types/_getters.js +19 -0
  593. package/script/utilities/0_bigint.d.ts +1 -0
  594. package/script/utilities/0_bigint.js +46 -1
  595. package/script/utilities/0_buffer.d.ts +19 -0
  596. package/script/utilities/0_buffer.js +19 -0
  597. package/script/utilities/0_cache_map.d.ts +19 -0
  598. package/script/utilities/0_cache_map.js +19 -0
  599. package/script/utilities/0_color.d.ts +19 -0
  600. package/script/utilities/0_color.js +19 -0
  601. package/script/utilities/0_crypto.d.ts +19 -0
  602. package/script/utilities/0_crypto.js +19 -0
  603. package/script/utilities/0_hash.js +19 -0
  604. package/script/utilities/0_logger.d.ts +27 -0
  605. package/script/utilities/0_logger.js +30 -6
  606. package/script/utilities/0_mutex.d.ts +19 -0
  607. package/script/utilities/0_mutex.js +19 -0
  608. package/script/utilities/0_object.d.ts +19 -0
  609. package/script/utilities/0_object.js +19 -0
  610. package/script/utilities/0_rle.d.ts +19 -0
  611. package/script/utilities/0_rle.js +19 -0
  612. package/script/utilities/0_types.d.ts +19 -0
  613. package/script/utilities/0_types.js +19 -0
  614. package/script/utilities/1_auth.js +19 -0
  615. package/script/utilities/1_base64.d.ts +19 -0
  616. package/script/utilities/1_base64.js +19 -0
  617. package/script/utilities/1_math.d.ts +20 -0
  618. package/script/utilities/1_math.js +74 -0
  619. package/script/utilities/1_misc.d.ts +19 -0
  620. package/script/utilities/1_misc.js +21 -2
  621. package/script/utilities/1_queue.d.ts +19 -0
  622. package/script/utilities/1_queue.js +19 -0
  623. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
  624. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -203
  625. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
  626. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -274
  627. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
  628. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -51
  629. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
  630. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -191
  631. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
  632. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -385
  633. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
  634. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -431
  635. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
  636. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1046
  637. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
  638. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -52
  639. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
  640. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -122
  641. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
  642. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -24
  643. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
  644. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -121
  645. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
  646. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -30
  647. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
  648. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2127
  649. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
  650. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -108
  651. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
  652. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -1
  653. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
  654. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -95
  655. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
  656. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -128
  657. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
  658. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -110
  659. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
  660. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -120
  661. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
  662. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -6
  663. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
  664. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -110
  665. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
  666. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -75
  667. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
  668. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -101
  669. package/esm/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +0 -324
  670. package/esm/utilities/0_control.d.ts +0 -1
  671. package/esm/utilities/0_control.js +0 -3
  672. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
  673. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -207
  674. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
  675. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -301
  676. package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
  677. package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -55
  678. package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
  679. package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -222
  680. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
  681. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -404
  682. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
  683. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -438
  684. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
  685. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1052
  686. package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
  687. package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -88
  688. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
  689. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -128
  690. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
  691. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -30
  692. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
  693. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -129
  694. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
  695. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -32
  696. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
  697. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2129
  698. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
  699. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -110
  700. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
  701. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -3
  702. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
  703. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -114
  704. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
  705. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -134
  706. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
  707. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -118
  708. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
  709. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -129
  710. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
  711. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -22
  712. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
  713. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -119
  714. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
  715. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -86
  716. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
  717. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -112
  718. package/script/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +0 -326
  719. package/script/utilities/0_control.d.ts +0 -1
  720. package/script/utilities/0_control.js +0 -7
  721. /package/{LICENSE → COPYING.LESSER} +0 -0
  722. /package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/tgcrypto.d.ts +0 -0
  723. /package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/tgcrypto.d.ts +0 -0
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 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
+ */
1
20
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
21
  if (kind === "m") throw new TypeError("Private method is not writable");
3
22
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -10,15 +29,17 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
29
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
30
  };
12
31
  var _MessageManager_instances, _MessageManager_c, _MessageManager_LresolveFileId, _MessageManager_updatesToMessages, _MessageManager_constructReplyMarkup, _MessageManager_resolveSendAs, _MessageManager_constructReplyTo, _MessageManager_sendDocumentInner, _MessageManager_sendMedia, _MessageManager_sendReaction, _MessageManager_toggleJoinRequests;
13
- import { contentType } from "../0_deps.js";
32
+ import { contentType, unreachable } from "../0_deps.js";
14
33
  import { InputError } from "../0_errors.js";
15
- import { getLogger, getRandomId, toUnixTimestamp, UNREACHABLE } from "../1_utilities.js";
34
+ import { getLogger, getRandomId, toUnixTimestamp } from "../1_utilities.js";
16
35
  import { as, functions, getChannelChatId, peerToChatId, types } from "../2_tl.js";
17
36
  import { constructChatMemberUpdated, constructInviteLink, deserializeFileId } from "../3_types.js";
18
37
  import { assertMessageType, chatMemberRightsToTlObject, constructChatMember, constructMessage as constructMessage_, deserializeInlineMessageId, FileType, messageEntityToTlObject, reactionEqual, reactionToTlObject, replyMarkupToTlObject } from "../3_types.js";
19
38
  import { messageSearchFilterToTlObject } from "../types/0_message_search_filter.js";
20
39
  import { parseHtml } from "./0_html.js";
21
40
  import { parseMarkdown } from "./0_markdown.js";
41
+ import { checkMessageId } from "./0_utilities.js";
42
+ import { checkArray } from "./0_utilities.js";
22
43
  import { getFileContents, isHttpUrl } from "./0_utilities.js";
23
44
  const FALLBACK_MIME_TYPE = "application/octet-stream";
24
45
  const STICKER_MIME_TYPES = ["image/webp", "video/webm", "application/x-tgsticker"];
@@ -41,6 +62,7 @@ export class MessageManager {
41
62
  __classPrivateFieldSet(this, _MessageManager_LresolveFileId, L.branch("resolveFileId"), "f");
42
63
  }
43
64
  async getMessages(chatId, messageIds) {
65
+ checkArray(messageIds, checkMessageId);
44
66
  const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
45
67
  let messages_ = new Array();
46
68
  const chatId_ = peerToChatId(peer);
@@ -111,7 +133,7 @@ export class MessageManager {
111
133
  break;
112
134
  }
113
135
  default:
114
- UNREACHABLE();
136
+ unreachable();
115
137
  }
116
138
  text = text.trimEnd();
117
139
  for (const entity of entities) {
@@ -119,6 +141,9 @@ export class MessageManager {
119
141
  --entity.length;
120
142
  }
121
143
  }
144
+ if (!text.length) {
145
+ throw new InputError("Text must not be empty.");
146
+ }
122
147
  return [text, entities];
123
148
  }
124
149
  async parseText(text_, params) {
@@ -130,6 +155,7 @@ export class MessageManager {
130
155
  return await constructMessage_(message_, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity, this.getMessage.bind(this), __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.getStickerSetName.bind(__classPrivateFieldGet(this, _MessageManager_c, "f").fileManager), r, business);
131
156
  }
132
157
  async forwardMessages(from, to, messageIds, params) {
158
+ checkArray(messageIds, checkMessageId);
133
159
  const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.forwardMessages({
134
160
  from_peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(from),
135
161
  to_peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(to),
@@ -173,7 +199,7 @@ export class MessageManager {
173
199
  hash: 0n,
174
200
  });
175
201
  if (!("messages" in result)) {
176
- UNREACHABLE();
202
+ unreachable();
177
203
  }
178
204
  for (const message_ of result.messages) {
179
205
  const message = await this.constructMessage(message_, false);
@@ -445,10 +471,10 @@ export class MessageManager {
445
471
  }
446
472
  if (fileId != null) {
447
473
  if (!expectedFileType.includes(fileId.type)) {
448
- UNREACHABLE();
474
+ unreachable();
449
475
  }
450
476
  return {
451
- id: "id" in fileId.location ? fileId.location.id : UNREACHABLE(),
477
+ id: "id" in fileId.location ? fileId.location.id : unreachable(),
452
478
  access_hash: fileId.location.accessHash,
453
479
  file_reference: fileId.fileReference ?? new Uint8Array(),
454
480
  };
@@ -456,6 +482,13 @@ export class MessageManager {
456
482
  return null;
457
483
  }
458
484
  async sendPoll(chatId, question, options, params) {
485
+ question = question?.trim();
486
+ if (!question) {
487
+ throw new Error("Question must not be empty.");
488
+ }
489
+ if (!Array.isArray(options) || options.length < 2) {
490
+ throw new Error("There must be at least two options.");
491
+ }
459
492
  const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
460
493
  const randomId = getRandomId();
461
494
  const silent = params?.disableNotification ? true : undefined;
@@ -500,7 +533,7 @@ export class MessageManager {
500
533
  }
501
534
  async editMessageReplyMarkup(chatId, messageId, params) {
502
535
  const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.editMessage({
503
- id: messageId,
536
+ id: checkMessageId(messageId),
504
537
  peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
505
538
  reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
506
539
  });
@@ -528,7 +561,7 @@ export class MessageManager {
528
561
  });
529
562
  }
530
563
  const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.editMessage({
531
- id: messageId,
564
+ id: checkMessageId(messageId),
532
565
  peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
533
566
  entities,
534
567
  message,
@@ -565,6 +598,7 @@ export class MessageManager {
565
598
  });
566
599
  }
567
600
  async deleteMessages(chatId, messageIds, params) {
601
+ checkArray(messageIds, checkMessageId);
568
602
  const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
569
603
  if (peer instanceof types.InputPeerChannel) {
570
604
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.deleteMessages({ channel: new types.InputChannel(peer), id: messageIds });
@@ -581,7 +615,7 @@ export class MessageManager {
581
615
  async pinMessage(chatId, messageId, params) {
582
616
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.updatePinnedMessage({
583
617
  peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
584
- id: messageId,
618
+ id: checkMessageId(messageId),
585
619
  silent: params?.disableNotification ? true : undefined,
586
620
  pm_oneside: params?.bothSides ? undefined : true,
587
621
  });
@@ -589,7 +623,7 @@ export class MessageManager {
589
623
  async unpinMessage(chatId, messageId) {
590
624
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.updatePinnedMessage({
591
625
  peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
592
- id: messageId,
626
+ id: checkMessageId(messageId),
593
627
  unpin: true,
594
628
  });
595
629
  }
@@ -600,14 +634,18 @@ export class MessageManager {
600
634
  // TODO: sync with storage
601
635
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.setChatAvailableReactions({
602
636
  peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
603
- available_reactions: availableReactions == "none" ? new types.ChatReactionsNone() : availableReactions == "all" ? new types.ChatReactionsAll() : Array.isArray(availableReactions) ? new types.ChatReactionsSome({ reactions: availableReactions.map((v) => v.type == "emoji" ? new types.ReactionEmoji({ emoticon: v.emoji }) : new types.ReactionCustomEmoji({ document_id: BigInt(v.id) })) }) : UNREACHABLE(),
637
+ available_reactions: availableReactions == "none" ? new types.ChatReactionsNone() : availableReactions == "all" ? new types.ChatReactionsAll() : Array.isArray(availableReactions) ? new types.ChatReactionsSome({ reactions: availableReactions.map((v) => v.type == "emoji" ? new types.ReactionEmoji({ emoticon: v.emoji }) : new types.ReactionCustomEmoji({ document_id: BigInt(v.id) })) }) : unreachable(),
604
638
  });
605
639
  }
606
640
  async setReactions(chatId, messageId, reactions, params) {
607
641
  await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_sendReaction).call(this, chatId, messageId, reactions, params);
608
642
  }
609
643
  async addReaction(chatId, messageId, reaction, params) {
610
- const chosenReactions = await this.getMessage(chatId, messageId).then((v) => v?.reactions ?? []).then((v) => v.filter((v) => v.chosen));
644
+ const message = await this.getMessage(chatId, messageId);
645
+ if (!message) {
646
+ throw new InputError("Message not found.");
647
+ }
648
+ const chosenReactions = (message.reactions ?? []).filter((v) => v.chosen);
611
649
  for (const r of chosenReactions) {
612
650
  if (reactionEqual(r.reaction, reaction)) {
613
651
  return;
@@ -617,7 +655,11 @@ export class MessageManager {
617
655
  await this.setReactions(chatId, messageId, reactions, params);
618
656
  }
619
657
  async removeReaction(chatId, messageId, reaction) {
620
- const chosenReactions = await this.getMessage(chatId, messageId).then((v) => v?.reactions ?? []).then((v) => v.filter((v) => v.chosen));
658
+ const message = await this.getMessage(chatId, messageId);
659
+ if (!message) {
660
+ throw new InputError("Message not found.");
661
+ }
662
+ const chosenReactions = (message.reactions ?? []).filter((v) => v.chosen);
621
663
  for (const r of chosenReactions) {
622
664
  if (reactionEqual(r.reaction, reaction)) {
623
665
  const reactions = chosenReactions.filter((v) => v != r).map((v) => v.reaction);
@@ -754,7 +796,7 @@ export class MessageManager {
754
796
  async deleteChatPhoto(chatId) {
755
797
  const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
756
798
  if (!(peer instanceof types.InputPeerChannel) && !(peer instanceof types.InputPeerChat)) {
757
- UNREACHABLE();
799
+ unreachable();
758
800
  }
759
801
  if (peer instanceof types.InputPeerChannel) {
760
802
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.editPhoto({ channel: new types.InputChannel(peer), photo: new types.InputChatPhotoEmpty() });
@@ -766,7 +808,7 @@ export class MessageManager {
766
808
  async setChatPhoto(chatId, photo, params) {
767
809
  const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
768
810
  if (!(peer instanceof types.InputPeerChannel) && !(peer instanceof types.InputPeerChat)) {
769
- UNREACHABLE();
811
+ unreachable();
770
812
  }
771
813
  const [contents, fileName] = await getFileContents(photo);
772
814
  const file = await __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.upload(contents, { fileName: params?.fileName ?? fileName, chunkSize: params?.chunkSize, signal: params?.signal });
@@ -850,7 +892,7 @@ export class MessageManager {
850
892
  hash: 0n,
851
893
  });
852
894
  if (participants instanceof types.channels.ChannelParticipantsNotModified) {
853
- UNREACHABLE();
895
+ unreachable();
854
896
  }
855
897
  const chatMembers = new Array();
856
898
  for (const p of participants.participants) {
@@ -861,7 +903,7 @@ export class MessageManager {
861
903
  else if (peer instanceof types.InputPeerChat) {
862
904
  const fullChat = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.getFullChat(peer); // TODO: full chat cache
863
905
  if (!(fullChat.full_chat instanceof types.ChatFull) || !(fullChat.full_chat.participants instanceof types.ChatParticipants)) {
864
- UNREACHABLE();
906
+ unreachable();
865
907
  }
866
908
  const chatMembers = new Array();
867
909
  for (const p of fullChat.full_chat.participants.participants) {
@@ -870,7 +912,7 @@ export class MessageManager {
870
912
  return chatMembers;
871
913
  }
872
914
  else {
873
- UNREACHABLE();
915
+ unreachable();
874
916
  }
875
917
  }
876
918
  async enableJoinRequests(chatId) {
@@ -897,7 +939,7 @@ export class MessageManager {
897
939
  from_id: params?.from ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.from) : undefined,
898
940
  });
899
941
  if (!("messages" in result)) {
900
- UNREACHABLE();
942
+ unreachable();
901
943
  }
902
944
  const messages = new Array();
903
945
  for (const message_ of result.messages) {
@@ -948,7 +990,7 @@ export class MessageManager {
948
990
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.addChatUser({ chat_id: peer.chat_id, user_id: new types.InputUserSelf(), fwd_limit: 0 }); // TODO: use potential high-level method for adding participants to chats
949
991
  }
950
992
  else {
951
- UNREACHABLE();
993
+ unreachable();
952
994
  }
953
995
  }
954
996
  async leaveChat(chatId) {
@@ -963,7 +1005,7 @@ export class MessageManager {
963
1005
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.deleteChatUser({ chat_id: peer.chat_id, user_id: new types.InputUserSelf() }); // TODO: use potential high-level method for adding participants to chats
964
1006
  }
965
1007
  else {
966
- UNREACHABLE();
1008
+ unreachable();
967
1009
  }
968
1010
  }
969
1011
  async blockUser(userId) {
@@ -1056,7 +1098,7 @@ export class MessageManager {
1056
1098
  const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
1057
1099
  return assertMessageType(message, "location");
1058
1100
  }
1059
- UNREACHABLE();
1101
+ unreachable();
1060
1102
  }
1061
1103
  async editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params) {
1062
1104
  await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertBot("editInlineMessageLiveLocation");
@@ -1144,7 +1186,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
1144
1186
  let fileName = params?.fileName ?? fileName_;
1145
1187
  const mimeType = params?.mimeType ?? contentType(fileName.split(".").slice(-1)[0]) ?? FALLBACK_MIME_TYPE;
1146
1188
  if (expectedMimeTypes && !expectedMimeTypes.includes(mimeType)) {
1147
- UNREACHABLE();
1189
+ unreachable();
1148
1190
  }
1149
1191
  if (fileName.endsWith(".tgs") && fileType == FileType.Document) {
1150
1192
  fileName += "-";
@@ -1194,7 +1236,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
1194
1236
  }, _MessageManager_sendReaction = async function _MessageManager_sendReaction(chatId, messageId, reactions, params) {
1195
1237
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendReaction({
1196
1238
  peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
1197
- msg_id: messageId,
1239
+ msg_id: checkMessageId(messageId),
1198
1240
  reaction: reactions.map((v) => reactionToTlObject(v)),
1199
1241
  big: params?.big ? true : undefined,
1200
1242
  add_to_recent: params?.addToRecents ? true : undefined,
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 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
+ */
1
20
  import { enums, types } from "../2_tl.js";
2
21
  import { Update } from "../3_types.js";
3
22
  import { AnswerCallbackQueryParams } from "./0_params.js";
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 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
+ */
1
20
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
21
  if (kind === "m") throw new TypeError("Private method is not writable");
3
22
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -12,6 +31,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
12
31
  var _CallbackQueryManager_c;
13
32
  import { types } from "../2_tl.js";
14
33
  import { constructCallbackQuery } from "../3_types.js";
34
+ import { checkCallbackQueryId } from "./0_utilities.js";
15
35
  export class CallbackQueryManager {
16
36
  constructor(c) {
17
37
  _CallbackQueryManager_c.set(this, void 0);
@@ -19,6 +39,7 @@ export class CallbackQueryManager {
19
39
  }
20
40
  async answerCallbackQuery(id, params) {
21
41
  await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").storage.assertBot("answerCallbackQuery");
42
+ checkCallbackQueryId(id);
22
43
  await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").api.messages.setBotCallbackAnswer({
23
44
  query_id: BigInt(id),
24
45
  cache_time: params?.cacheTime ?? 0,
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 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
+ */
1
20
  import { enums, types } from "../2_tl.js";
2
21
  import { Chat, ID } from "../3_types.js";
3
22
  import { C as C_ } from "./0_types.js";
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 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
+ */
1
20
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
21
  if (kind === "m") throw new TypeError("Private method is not writable");
3
22
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -10,8 +29,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
29
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
30
  };
12
31
  var _ChatListManager_instances, _ChatListManager_c, _ChatListManager_LgetChats, _ChatListManager_sendChatUpdate, _ChatListManager_chats, _ChatListManager_archivedChats, _ChatListManager_chatsLoadedFromStorage, _ChatListManager_tryGetChatId, _ChatListManager_getChatAnywhere, _ChatListManager_getChatList, _ChatListManager_loadChatsFromStorage, _ChatListManager_getLoadedChats, _ChatListManager_pinnedChats, _ChatListManager_pinnedArchiveChats, _ChatListManager_storageHadPinnedChats, _ChatListManager_pinnedChatsLoaded, _ChatListManager_loadPinnedChats, _ChatListManager_fetchPinnedChats, _ChatListManager_getPinnedChats, _ChatListManager_updateOrAddChat, _ChatListManager_removeChat, _ChatListManager_handleUpdateFolderPeers, _ChatListManager_handleUpdatePinnedDialogs, _ChatListManager_handleUpdateChannel, _ChatListManager_handleUpdateChat, _ChatListManager_handleUpdateUser, _ChatListManager_fetchChats;
32
+ import { unreachable } from "../0_deps.js";
13
33
  import { InputError } from "../0_errors.js";
14
- import { getLogger, toUnixTimestamp, UNREACHABLE } from "../1_utilities.js";
34
+ import { getLogger, toUnixTimestamp } from "../1_utilities.js";
15
35
  import { as, peerToChatId, types } from "../2_tl.js";
16
36
  import { constructChat, constructChat2, constructChat3, constructChat4, getChatOrder } from "../3_types.js";
17
37
  import { getChatListId, getUsername } from "./0_utilities.js";
@@ -54,7 +74,7 @@ export class ChatListManager {
54
74
  const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
55
75
  const chat = await constructChat3(chatId, pinnedChats.indexOf(chatId), message, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
56
76
  if (chat == null) {
57
- UNREACHABLE();
77
+ unreachable();
58
78
  }
59
79
  __classPrivateFieldGet(this, _ChatListManager_chats, "f").set(chatId, chat);
60
80
  await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setChat(listId, chatId, chat.pinned, chat.lastMessage?.id ?? 0, chat.lastMessage?.date ?? new Date(0));
@@ -75,7 +95,7 @@ export class ChatListManager {
75
95
  const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
76
96
  const chat = await constructChat3(chatId, pinnedChats.indexOf(chatId), message, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
77
97
  if (chat == null) {
78
- UNREACHABLE();
98
+ unreachable();
79
99
  }
80
100
  __classPrivateFieldGet(this, _ChatListManager_chats, "f").set(chatId, chat);
81
101
  }
@@ -146,7 +166,7 @@ export class ChatListManager {
146
166
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateUser).call(this, update);
147
167
  }
148
168
  else {
149
- UNREACHABLE();
169
+ unreachable();
150
170
  }
151
171
  }
152
172
  async getChat(chatId) {
@@ -159,7 +179,7 @@ export class ChatListManager {
159
179
  maybeChatId = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_tryGetChatId).call(this, getUsername(chatId));
160
180
  }
161
181
  else {
162
- UNREACHABLE();
182
+ unreachable();
163
183
  }
164
184
  if (maybeChatId != null) {
165
185
  const [chat] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, maybeChatId);
@@ -190,7 +210,7 @@ export class ChatListManager {
190
210
  const chats = await __classPrivateFieldGet(this, _ChatListManager_c, "f").api.messages.getChats({ id: [inputPeer.chat_id] }).then((v) => v[as](types.messages.Chats));
191
211
  const chat = chats.chats[0];
192
212
  if (chat instanceof types.ChatEmpty) {
193
- UNREACHABLE();
213
+ unreachable();
194
214
  }
195
215
  return constructChat2(chat, -1, undefined);
196
216
  }
@@ -198,7 +218,7 @@ export class ChatListManager {
198
218
  const channels = await __classPrivateFieldGet(this, _ChatListManager_c, "f").api.channels.getChannels({ id: [new types.InputChannel(inputPeer)] });
199
219
  const channel = channels.chats[0];
200
220
  if (channel instanceof types.ChatEmpty) {
201
- UNREACHABLE();
221
+ unreachable();
202
222
  }
203
223
  return constructChat2(channel, -1, undefined);
204
224
  }
@@ -206,12 +226,12 @@ export class ChatListManager {
206
226
  const users = await __classPrivateFieldGet(this, _ChatListManager_c, "f").api.users.getUsers({ id: [new types.InputUser(inputPeer)] });
207
227
  const user = users[0];
208
228
  if (user instanceof types.UserEmpty) {
209
- UNREACHABLE();
229
+ unreachable();
210
230
  }
211
231
  return constructChat2(user, -1, undefined);
212
232
  }
213
233
  else {
214
- UNREACHABLE();
234
+ unreachable();
215
235
  }
216
236
  }
217
237
  }
@@ -316,7 +336,7 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
316
336
  await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(1, __classPrivateFieldGet(this, _ChatListManager_pinnedArchiveChats, "f"));
317
337
  }
318
338
  if (listId != null && listId != 0 && listId != 1) {
319
- UNREACHABLE();
339
+ unreachable();
320
340
  }
321
341
  }, _ChatListManager_getPinnedChats = async function _ChatListManager_getPinnedChats(listId) {
322
342
  if (!__classPrivateFieldGet(this, _ChatListManager_pinnedChatsLoaded, "f")) {
@@ -331,7 +351,7 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
331
351
  case 1:
332
352
  return __classPrivateFieldGet(this, _ChatListManager_pinnedArchiveChats, "f");
333
353
  default:
334
- UNREACHABLE();
354
+ unreachable();
335
355
  }
336
356
  }, _ChatListManager_updateOrAddChat = async function _ChatListManager_updateOrAddChat(chatId) {
337
357
  const [chat, listId] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
@@ -428,7 +448,7 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
428
448
  });
429
449
  const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
430
450
  if (!(dialogs instanceof types.messages.Dialogs) && !(dialogs instanceof types.messages.DialogsSlice)) {
431
- UNREACHABLE();
451
+ unreachable();
432
452
  }
433
453
  if (dialogs.dialogs.length < limit) {
434
454
  await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setHasAllChats(listId, true);
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 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
+ */
1
20
  import { enums, types } from "../2_tl.js";
2
21
  import { InlineQueryResult, Update } from "../3_types.js";
3
22
  import { AnswerInlineQueryParams } from "./0_params.js";
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 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
+ */
1
20
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
21
  if (kind === "m") throw new TypeError("Private method is not writable");
3
22
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -10,9 +29,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
29
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
30
  };
12
31
  var _InlineQueryManager_c;
13
- import { UNREACHABLE } from "../1_utilities.js";
32
+ import { unreachable } from "../0_deps.js";
14
33
  import { types } from "../2_tl.js";
15
34
  import { constructChosenInlineResult, constructInlineQuery, inlineQueryResultToTlObject } from "../3_types.js";
35
+ import { checkInlineQueryId } from "./0_utilities.js";
16
36
  export class InlineQueryManager {
17
37
  constructor(c) {
18
38
  _InlineQueryManager_c.set(this, void 0);
@@ -20,6 +40,7 @@ export class InlineQueryManager {
20
40
  }
21
41
  async answerInlineQuery(id, results, params) {
22
42
  await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").storage.assertBot("answerInlineQuery");
43
+ checkInlineQueryId(id);
23
44
  await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").api.messages.setInlineBotResults({
24
45
  query_id: BigInt(id),
25
46
  results: await Promise.all(results.map((v) => inlineQueryResultToTlObject(v, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.parseText.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager), __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager.usernameResolver.bind(__classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageManager)))),
@@ -42,7 +63,7 @@ export class InlineQueryManager {
42
63
  return { chosenInlineResult: await constructChosenInlineResult(update, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").getEntity) };
43
64
  }
44
65
  else {
45
- UNREACHABLE();
66
+ unreachable();
46
67
  }
47
68
  }
48
69
  }
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 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
+ */
1
20
  import { enums, types } from "../2_tl.js";
2
21
  import { ID, Story, Update } from "../3_types.js";
3
22
  import { InputStoryContent } from "../types/1_input_story_content.js";