@mtkruto/node 0.1.800 → 0.2.1

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 (664) hide show
  1. package/esm/0_deps.d.ts +2 -0
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +2 -1
  4. package/esm/2_tl.d.ts +7 -8
  5. package/esm/2_tl.d.ts.map +1 -1
  6. package/esm/2_tl.js +7 -8
  7. package/esm/3_errors.d.ts +519 -515
  8. package/esm/3_errors.d.ts.map +1 -1
  9. package/esm/3_errors.js +527 -512
  10. package/esm/3_transport.d.ts +1 -0
  11. package/esm/3_transport.d.ts.map +1 -1
  12. package/esm/3_transport.js +1 -0
  13. package/esm/4_errors.d.ts +7 -7
  14. package/esm/4_errors.d.ts.map +1 -1
  15. package/esm/4_errors.js +5 -5
  16. package/esm/client/0_client_abstract.d.ts +1 -21
  17. package/esm/client/0_client_abstract.d.ts.map +1 -1
  18. package/esm/client/0_client_abstract.js +17 -15
  19. package/esm/client/0_message.d.ts +3 -3
  20. package/esm/client/0_message.d.ts.map +1 -1
  21. package/esm/client/0_message.js +4 -20
  22. package/esm/client/0_params.d.ts +1 -1
  23. package/esm/client/0_params.d.ts.map +1 -1
  24. package/esm/client/0_password.d.ts +2 -2
  25. package/esm/client/0_password.d.ts.map +1 -1
  26. package/esm/client/0_password.js +3 -8
  27. package/esm/client/0_storage_operations.d.ts +23 -23
  28. package/esm/client/0_storage_operations.d.ts.map +1 -1
  29. package/esm/client/0_storage_operations.js +13 -12
  30. package/esm/client/0_utilities.d.ts.map +1 -1
  31. package/esm/client/0_utilities.js +13 -10
  32. package/esm/client/1_client_encrypted.d.ts +3 -5
  33. package/esm/client/1_client_encrypted.d.ts.map +1 -1
  34. package/esm/client/1_client_encrypted.js +44 -28
  35. package/esm/client/1_client_plain.d.ts +2 -2
  36. package/esm/client/1_client_plain.d.ts.map +1 -1
  37. package/esm/client/1_client_plain.js +27 -19
  38. package/esm/client/1_types.d.ts +9 -22
  39. package/esm/client/1_types.d.ts.map +1 -1
  40. package/esm/client/2_account_manager.d.ts +2 -2
  41. package/esm/client/2_account_manager.js +16 -16
  42. package/esm/client/2_bot_info_manager.d.ts.map +1 -1
  43. package/esm/client/2_bot_info_manager.js +7 -6
  44. package/esm/client/2_business_connection_manager.d.ts +3 -3
  45. package/esm/client/2_business_connection_manager.d.ts.map +1 -1
  46. package/esm/client/2_business_connection_manager.js +6 -5
  47. package/esm/client/2_file_manager.d.ts +4 -4
  48. package/esm/client/2_file_manager.d.ts.map +1 -1
  49. package/esm/client/2_file_manager.js +26 -23
  50. package/esm/client/2_reaction_manager.d.ts +3 -3
  51. package/esm/client/2_reaction_manager.d.ts.map +1 -1
  52. package/esm/client/2_reaction_manager.js +16 -10
  53. package/esm/client/2_update_manager.d.ts +11 -11
  54. package/esm/client/2_update_manager.d.ts.map +1 -1
  55. package/esm/client/2_update_manager.js +185 -164
  56. package/esm/client/3_message_manager.d.ts +8 -9
  57. package/esm/client/3_message_manager.d.ts.map +1 -1
  58. package/esm/client/3_message_manager.js +205 -474
  59. package/esm/client/3_video_chat_manager.d.ts +3 -3
  60. package/esm/client/3_video_chat_manager.d.ts.map +1 -1
  61. package/esm/client/3_video_chat_manager.js +26 -36
  62. package/esm/client/4_callback_query_manager.d.ts +3 -3
  63. package/esm/client/4_callback_query_manager.d.ts.map +1 -1
  64. package/esm/client/4_callback_query_manager.js +5 -16
  65. package/esm/client/4_chat_list_manager.d.ts +5 -4
  66. package/esm/client/4_chat_list_manager.d.ts.map +1 -1
  67. package/esm/client/4_chat_list_manager.js +56 -34
  68. package/esm/client/4_inline_query_manager.d.ts +3 -3
  69. package/esm/client/4_inline_query_manager.d.ts.map +1 -1
  70. package/esm/client/4_inline_query_manager.js +6 -15
  71. package/esm/client/4_story_manager.d.ts +3 -3
  72. package/esm/client/4_story_manager.d.ts.map +1 -1
  73. package/esm/client/4_story_manager.js +15 -32
  74. package/esm/client/5_client.d.ts +10 -12
  75. package/esm/client/5_client.d.ts.map +1 -1
  76. package/esm/client/5_client.js +60 -114
  77. package/esm/{tl/7_message.d.ts → connection/1_connection_tcp.d.ts} +14 -12
  78. package/esm/connection/1_connection_tcp.d.ts.map +1 -0
  79. package/esm/connection/1_connection_tcp.js +169 -0
  80. package/esm/deps/deno.land/std@0.224.0/io/_constants.d.ts +3 -0
  81. package/esm/deps/deno.land/std@0.224.0/io/_constants.d.ts.map +1 -0
  82. package/esm/deps/deno.land/std@0.224.0/io/_constants.js +4 -0
  83. package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts +70 -0
  84. package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts.map +1 -0
  85. package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.js +86 -0
  86. package/esm/deps/deno.land/std@0.224.0/io/types.d.ts +95 -0
  87. package/esm/deps/deno.land/std@0.224.0/io/types.d.ts.map +1 -0
  88. package/esm/deps/deno.land/std@0.224.0/io/types.js +3 -0
  89. package/esm/deps/deno.land/std@0.224.0/io/write_all.d.ts +39 -0
  90. package/esm/deps/deno.land/std@0.224.0/io/write_all.d.ts.map +1 -0
  91. package/esm/deps/deno.land/std@0.224.0/io/write_all.js +49 -0
  92. package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts +45 -0
  93. package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts.map +1 -0
  94. package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.js +253 -0
  95. package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts +3 -0
  96. package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts.map +1 -0
  97. package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.js +1 -0
  98. package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts +3 -0
  99. package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts.map +1 -0
  100. package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.js +13 -0
  101. package/esm/mod.d.ts +0 -1
  102. package/esm/mod.d.ts.map +1 -1
  103. package/esm/mod.js +0 -1
  104. package/esm/tl/0_api.d.ts +14813 -0
  105. package/esm/tl/0_api.d.ts.map +1 -0
  106. package/esm/tl/0_api.js +23222 -0
  107. package/esm/tl/1_utilities.d.ts +32 -0
  108. package/esm/tl/1_utilities.d.ts.map +1 -0
  109. package/esm/tl/1_utilities.js +65 -0
  110. package/esm/tl/1_utilities_test.d.ts.map +1 -0
  111. package/esm/tl/2_deserialize.d.ts +23 -0
  112. package/esm/tl/2_deserialize.d.ts.map +1 -0
  113. package/esm/tl/{3_deserialize.js → 2_deserialize.js} +16 -17
  114. package/esm/tl/2_serialize.d.ts +22 -0
  115. package/esm/tl/2_serialize.d.ts.map +1 -0
  116. package/esm/tl/2_serialize.js +160 -0
  117. package/esm/tl/2_serialize_test.d.ts.map +1 -0
  118. package/esm/tl/{4_tl_reader.d.ts → 3_tl_reader.d.ts} +3 -3
  119. package/esm/tl/3_tl_reader.d.ts.map +1 -0
  120. package/esm/tl/{4_tl_reader.js → 3_tl_reader.js} +5 -5
  121. package/esm/tl/3_utilities.d.ts +5 -5
  122. package/esm/tl/3_utilities.d.ts.map +1 -1
  123. package/esm/tl/3_utilities.js +9 -10
  124. package/esm/tl/4_rpc_result.d.ts +27 -0
  125. package/esm/tl/4_rpc_result.d.ts.map +1 -0
  126. package/esm/tl/4_rpc_result.js +28 -0
  127. package/{script/tl/5_tl_writer.d.ts → esm/tl/4_tl_writer.d.ts} +2 -2
  128. package/esm/tl/4_tl_writer.d.ts.map +1 -0
  129. package/esm/tl/{5_tl_writer.js → 4_tl_writer.js} +4 -4
  130. package/esm/tl/5_message.d.ts +39 -0
  131. package/esm/tl/5_message.d.ts.map +1 -0
  132. package/esm/tl/5_message.js +98 -0
  133. package/esm/tl/5_message_test.d.ts.map +1 -0
  134. package/esm/transport/3_transport_provider_tcp.d.ts +14 -0
  135. package/esm/transport/3_transport_provider_tcp.d.ts.map +1 -0
  136. package/esm/transport/3_transport_provider_tcp.js +15 -0
  137. package/esm/types/0_birthday.d.ts +2 -2
  138. package/esm/types/0_birthday.d.ts.map +1 -1
  139. package/esm/types/0_callback_query_answer.d.ts +2 -2
  140. package/esm/types/0_callback_query_answer.d.ts.map +1 -1
  141. package/esm/types/0_chat_administrator_rights.d.ts +3 -3
  142. package/esm/types/0_chat_administrator_rights.d.ts.map +1 -1
  143. package/esm/types/0_chat_administrator_rights.js +1 -11
  144. package/esm/types/0_chat_member_rights.d.ts +3 -3
  145. package/esm/types/0_chat_member_rights.d.ts.map +1 -1
  146. package/esm/types/0_chat_member_rights.js +3 -3
  147. package/esm/types/0_chat_photo.d.ts +2 -2
  148. package/esm/types/0_chat_photo.d.ts.map +1 -1
  149. package/esm/types/0_chat_photo.js +2 -2
  150. package/esm/types/0_contact.d.ts +2 -2
  151. package/esm/types/0_contact.d.ts.map +1 -1
  152. package/esm/types/0_dice.d.ts +2 -2
  153. package/esm/types/0_dice.d.ts.map +1 -1
  154. package/esm/types/0_giveaway_parameters.d.ts +2 -2
  155. package/esm/types/0_giveaway_parameters.d.ts.map +1 -1
  156. package/esm/types/0_giveaway_parameters.js +3 -3
  157. package/esm/types/0_link_preview.d.ts +2 -2
  158. package/esm/types/0_link_preview.d.ts.map +1 -1
  159. package/esm/types/0_live_stream_channel.d.ts +2 -2
  160. package/esm/types/0_live_stream_channel.d.ts.map +1 -1
  161. package/esm/types/0_location.d.ts +2 -2
  162. package/esm/types/0_location.d.ts.map +1 -1
  163. package/esm/types/0_location.js +5 -5
  164. package/esm/types/0_mask_position.d.ts +2 -2
  165. package/esm/types/0_mask_position.d.ts.map +1 -1
  166. package/esm/types/0_message_entity.d.ts +3 -3
  167. package/esm/types/0_message_entity.d.ts.map +1 -1
  168. package/esm/types/0_message_entity.js +42 -42
  169. package/esm/types/0_message_search_filter.d.ts +2 -2
  170. package/esm/types/0_message_search_filter.d.ts.map +1 -1
  171. package/esm/types/0_message_search_filter.js +14 -15
  172. package/esm/types/0_opening_hours.d.ts +2 -2
  173. package/esm/types/0_opening_hours.d.ts.map +1 -1
  174. package/esm/types/0_poll_option.d.ts +2 -2
  175. package/esm/types/0_poll_option.d.ts.map +1 -1
  176. package/esm/types/0_reaction.d.ts +3 -3
  177. package/esm/types/0_reaction.d.ts.map +1 -1
  178. package/esm/types/0_reaction.js +4 -4
  179. package/esm/types/0_restriction_reason.d.ts +2 -2
  180. package/esm/types/0_restriction_reason.d.ts.map +1 -1
  181. package/esm/types/0_thumbnail.d.ts +2 -2
  182. package/esm/types/0_thumbnail.d.ts.map +1 -1
  183. package/esm/types/0_thumbnail.js +3 -3
  184. package/esm/types/0_video_chat.d.ts +2 -2
  185. package/esm/types/0_video_chat.d.ts.map +1 -1
  186. package/esm/types/0_video_chat.js +2 -2
  187. package/esm/types/0_voice.d.ts +2 -2
  188. package/esm/types/0_voice.d.ts.map +1 -1
  189. package/esm/types/1_animation.d.ts +2 -2
  190. package/esm/types/1_animation.d.ts.map +1 -1
  191. package/esm/types/1_animation.js +2 -2
  192. package/esm/types/1_audio.d.ts +2 -2
  193. package/esm/types/1_audio.d.ts.map +1 -1
  194. package/esm/types/1_audio.js +2 -2
  195. package/esm/types/1_bot_command_scope.d.ts +9 -2
  196. package/esm/types/1_bot_command_scope.d.ts.map +1 -1
  197. package/esm/types/1_bot_command_scope.js +9 -9
  198. package/esm/types/1_chat_p.d.ts +5 -5
  199. package/esm/types/1_chat_p.d.ts.map +1 -1
  200. package/esm/types/1_chat_p.js +6 -6
  201. package/esm/types/1_document.d.ts +2 -2
  202. package/esm/types/1_document.d.ts.map +1 -1
  203. package/esm/types/1_document.js +2 -2
  204. package/esm/types/1_giveaway.d.ts +2 -2
  205. package/esm/types/1_giveaway.d.ts.map +1 -1
  206. package/esm/types/1_keyboard_button.d.ts +3 -3
  207. package/esm/types/1_keyboard_button.d.ts.map +1 -1
  208. package/esm/types/1_keyboard_button.js +18 -45
  209. package/esm/types/1_message_reaction.d.ts +2 -2
  210. package/esm/types/1_message_reaction.d.ts.map +1 -1
  211. package/esm/types/1_message_reaction.js +5 -5
  212. package/esm/types/1_photo.d.ts +5 -5
  213. package/esm/types/1_photo.d.ts.map +1 -1
  214. package/esm/types/1_photo.js +4 -4
  215. package/esm/types/1_poll.d.ts +2 -2
  216. package/esm/types/1_poll.d.ts.map +1 -1
  217. package/esm/types/1_reaction_count.d.ts +2 -2
  218. package/esm/types/1_reaction_count.d.ts.map +1 -1
  219. package/esm/types/1_reply_quote.d.ts +2 -2
  220. package/esm/types/1_reply_quote.d.ts.map +1 -1
  221. package/esm/types/1_sticker.d.ts +3 -3
  222. package/esm/types/1_sticker.d.ts.map +1 -1
  223. package/esm/types/1_sticker.js +9 -9
  224. package/esm/types/1_story_privacy.d.ts +3 -3
  225. package/esm/types/1_story_privacy.d.ts.map +1 -1
  226. package/esm/types/1_story_privacy.js +14 -14
  227. package/esm/types/1_story_reaction.d.ts +2 -2
  228. package/esm/types/1_story_reaction.d.ts.map +1 -1
  229. package/esm/types/1_user.d.ts +2 -2
  230. package/esm/types/1_user.d.ts.map +1 -1
  231. package/esm/types/1_user.js +2 -2
  232. package/esm/types/1_venue.d.ts +2 -2
  233. package/esm/types/1_venue.d.ts.map +1 -1
  234. package/esm/types/1_venue.js +2 -2
  235. package/esm/types/1_video.d.ts +2 -2
  236. package/esm/types/1_video.d.ts.map +1 -1
  237. package/esm/types/1_video.js +2 -2
  238. package/esm/types/1_video_note.d.ts +2 -2
  239. package/esm/types/1_video_note.d.ts.map +1 -1
  240. package/esm/types/1_video_note.js +2 -2
  241. package/esm/types/2_business_connection.d.ts +2 -2
  242. package/esm/types/2_business_connection.d.ts.map +1 -1
  243. package/esm/types/2_business_connection.js +1 -2
  244. package/esm/types/2_chat.d.ts +2 -2
  245. package/esm/types/2_chat.d.ts.map +1 -1
  246. package/esm/types/2_chat.js +11 -11
  247. package/esm/types/2_chat_member.d.ts +2 -2
  248. package/esm/types/2_chat_member.d.ts.map +1 -1
  249. package/esm/types/2_chat_member.js +10 -10
  250. package/esm/types/2_chosen_inline_result.d.ts +2 -2
  251. package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
  252. package/esm/types/2_chosen_inline_result.js +5 -5
  253. package/esm/types/2_game.d.ts +2 -2
  254. package/esm/types/2_game.d.ts.map +1 -1
  255. package/esm/types/2_game.js +4 -4
  256. package/esm/types/2_inactive_chat.d.ts +2 -2
  257. package/esm/types/2_inactive_chat.d.ts.map +1 -1
  258. package/esm/types/2_inactive_chat.js +2 -2
  259. package/esm/types/2_inline_keyboard_button.d.ts +3 -3
  260. package/esm/types/2_inline_keyboard_button.d.ts.map +1 -1
  261. package/esm/types/2_inline_keyboard_button.js +15 -21
  262. package/esm/types/2_inline_query.d.ts +2 -2
  263. package/esm/types/2_inline_query.d.ts.map +1 -1
  264. package/esm/types/2_inline_query.js +8 -8
  265. package/esm/types/2_invite_link.d.ts +2 -2
  266. package/esm/types/2_invite_link.d.ts.map +1 -1
  267. package/esm/types/2_invite_link.js +1 -2
  268. package/esm/types/2_message_reaction_count.d.ts +2 -2
  269. package/esm/types/2_message_reaction_count.d.ts.map +1 -1
  270. package/esm/types/2_message_reactions.d.ts +2 -2
  271. package/esm/types/2_message_reactions.d.ts.map +1 -1
  272. package/esm/types/2_message_reactions.js +2 -2
  273. package/esm/types/2_story_content.d.ts +2 -2
  274. package/esm/types/2_story_content.d.ts.map +1 -1
  275. package/esm/types/2_story_content.js +6 -6
  276. package/esm/types/2_story_interactions.d.ts +2 -2
  277. package/esm/types/2_story_interactions.d.ts.map +1 -1
  278. package/esm/types/2_story_interactive_area.d.ts +3 -3
  279. package/esm/types/2_story_interactive_area.d.ts.map +1 -1
  280. package/esm/types/2_story_interactive_area.js +19 -29
  281. package/esm/types/3_chat_member_updated.d.ts +2 -2
  282. package/esm/types/3_chat_member_updated.d.ts.map +1 -1
  283. package/esm/types/3_chat_member_updated.js +7 -7
  284. package/esm/types/3_reply_markup.d.ts +3 -3
  285. package/esm/types/3_reply_markup.d.ts.map +1 -1
  286. package/esm/types/3_reply_markup.js +12 -22
  287. package/esm/types/3_story.d.ts +2 -2
  288. package/esm/types/3_story.d.ts.map +1 -1
  289. package/esm/types/4_inline_query_result.d.ts +3 -3
  290. package/esm/types/4_inline_query_result.d.ts.map +1 -1
  291. package/esm/types/4_inline_query_result.js +53 -161
  292. package/esm/types/4_message.d.ts +3 -3
  293. package/esm/types/4_message.d.ts.map +1 -1
  294. package/esm/types/4_message.js +68 -59
  295. package/esm/types/5_callback_query.d.ts +3 -3
  296. package/esm/types/5_callback_query.d.ts.map +1 -1
  297. package/esm/types/5_callback_query.js +5 -5
  298. package/esm/types/5_chat_list_item.d.ts +3 -3
  299. package/esm/types/5_chat_list_item.d.ts.map +1 -1
  300. package/esm/types/5_chat_list_item.js +2 -2
  301. package/esm/types/5_inline_query_answer.d.ts +2 -2
  302. package/esm/types/5_inline_query_answer.d.ts.map +1 -1
  303. package/esm/types/_file_id.d.ts +2 -2
  304. package/esm/types/_file_id.d.ts.map +1 -1
  305. package/esm/types/_file_id.js +4 -4
  306. package/esm/types/_getters.d.ts +7 -7
  307. package/esm/types/_getters.d.ts.map +1 -1
  308. package/package.json +1 -1
  309. package/script/0_deps.d.ts +2 -0
  310. package/script/0_deps.d.ts.map +1 -1
  311. package/script/0_deps.js +5 -2
  312. package/script/2_tl.d.ts +7 -8
  313. package/script/2_tl.d.ts.map +1 -1
  314. package/script/2_tl.js +20 -11
  315. package/script/3_errors.d.ts +519 -515
  316. package/script/3_errors.d.ts.map +1 -1
  317. package/script/3_errors.js +543 -514
  318. package/script/3_transport.d.ts +1 -0
  319. package/script/3_transport.d.ts.map +1 -1
  320. package/script/3_transport.js +1 -0
  321. package/script/4_errors.d.ts +7 -7
  322. package/script/4_errors.d.ts.map +1 -1
  323. package/script/4_errors.js +6 -6
  324. package/script/client/0_client_abstract.d.ts +1 -21
  325. package/script/client/0_client_abstract.d.ts.map +1 -1
  326. package/script/client/0_client_abstract.js +41 -16
  327. package/script/client/0_message.d.ts +3 -3
  328. package/script/client/0_message.d.ts.map +1 -1
  329. package/script/client/0_message.js +3 -19
  330. package/script/client/0_params.d.ts +1 -1
  331. package/script/client/0_params.d.ts.map +1 -1
  332. package/script/client/0_password.d.ts +2 -2
  333. package/script/client/0_password.d.ts.map +1 -1
  334. package/script/client/0_password.js +2 -7
  335. package/script/client/0_storage_operations.d.ts +23 -23
  336. package/script/client/0_storage_operations.d.ts.map +1 -1
  337. package/script/client/0_storage_operations.js +12 -11
  338. package/script/client/0_utilities.d.ts.map +1 -1
  339. package/script/client/0_utilities.js +12 -9
  340. package/script/client/1_client_encrypted.d.ts +3 -5
  341. package/script/client/1_client_encrypted.d.ts.map +1 -1
  342. package/script/client/1_client_encrypted.js +42 -26
  343. package/script/client/1_client_plain.d.ts +2 -2
  344. package/script/client/1_client_plain.d.ts.map +1 -1
  345. package/script/client/1_client_plain.js +25 -17
  346. package/script/client/1_types.d.ts +9 -22
  347. package/script/client/1_types.d.ts.map +1 -1
  348. package/script/client/2_account_manager.d.ts +2 -2
  349. package/script/client/2_account_manager.js +15 -15
  350. package/script/client/2_bot_info_manager.d.ts.map +1 -1
  351. package/script/client/2_bot_info_manager.js +7 -6
  352. package/script/client/2_business_connection_manager.d.ts +3 -3
  353. package/script/client/2_business_connection_manager.d.ts.map +1 -1
  354. package/script/client/2_business_connection_manager.js +5 -4
  355. package/script/client/2_file_manager.d.ts +4 -4
  356. package/script/client/2_file_manager.d.ts.map +1 -1
  357. package/script/client/2_file_manager.js +25 -22
  358. package/script/client/2_reaction_manager.d.ts +3 -3
  359. package/script/client/2_reaction_manager.d.ts.map +1 -1
  360. package/script/client/2_reaction_manager.js +15 -9
  361. package/script/client/2_update_manager.d.ts +11 -11
  362. package/script/client/2_update_manager.d.ts.map +1 -1
  363. package/script/client/2_update_manager.js +183 -162
  364. package/script/client/3_message_manager.d.ts +8 -9
  365. package/script/client/3_message_manager.d.ts.map +1 -1
  366. package/script/client/3_message_manager.js +204 -473
  367. package/script/client/3_video_chat_manager.d.ts +3 -3
  368. package/script/client/3_video_chat_manager.d.ts.map +1 -1
  369. package/script/client/3_video_chat_manager.js +25 -35
  370. package/script/client/4_callback_query_manager.d.ts +3 -3
  371. package/script/client/4_callback_query_manager.d.ts.map +1 -1
  372. package/script/client/4_callback_query_manager.js +4 -15
  373. package/script/client/4_chat_list_manager.d.ts +5 -4
  374. package/script/client/4_chat_list_manager.d.ts.map +1 -1
  375. package/script/client/4_chat_list_manager.js +54 -32
  376. package/script/client/4_inline_query_manager.d.ts +3 -3
  377. package/script/client/4_inline_query_manager.d.ts.map +1 -1
  378. package/script/client/4_inline_query_manager.js +5 -14
  379. package/script/client/4_story_manager.d.ts +3 -3
  380. package/script/client/4_story_manager.d.ts.map +1 -1
  381. package/script/client/4_story_manager.js +14 -31
  382. package/script/client/5_client.d.ts +10 -12
  383. package/script/client/5_client.d.ts.map +1 -1
  384. package/script/client/5_client.js +59 -113
  385. package/{esm/tl/6_rpc_result.d.ts → script/connection/1_connection_tcp.d.ts} +14 -10
  386. package/script/connection/1_connection_tcp.d.ts.map +1 -0
  387. package/script/connection/1_connection_tcp.js +196 -0
  388. package/script/deps/deno.land/std@0.224.0/io/_constants.d.ts +3 -0
  389. package/script/deps/deno.land/std@0.224.0/io/_constants.d.ts.map +1 -0
  390. package/script/deps/deno.land/std@0.224.0/io/_constants.js +7 -0
  391. package/script/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts +70 -0
  392. package/script/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts.map +1 -0
  393. package/script/deps/deno.land/std@0.224.0/io/iterate_reader.js +91 -0
  394. package/script/deps/deno.land/std@0.224.0/io/types.d.ts +95 -0
  395. package/script/deps/deno.land/std@0.224.0/io/types.d.ts.map +1 -0
  396. package/script/deps/deno.land/std@0.224.0/io/types.js +4 -0
  397. package/script/deps/deno.land/std@0.224.0/io/write_all.d.ts +39 -0
  398. package/script/deps/deno.land/std@0.224.0/io/write_all.d.ts.map +1 -0
  399. package/script/deps/deno.land/std@0.224.0/io/write_all.js +54 -0
  400. package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts +45 -0
  401. package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts.map +1 -0
  402. package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.js +280 -0
  403. package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts +3 -0
  404. package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts.map +1 -0
  405. package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.js +5 -0
  406. package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts +3 -0
  407. package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts.map +1 -0
  408. package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.js +40 -0
  409. package/script/mod.d.ts +0 -1
  410. package/script/mod.d.ts.map +1 -1
  411. package/script/mod.js +0 -1
  412. package/script/tl/0_api.d.ts +14813 -0
  413. package/script/tl/0_api.d.ts.map +1 -0
  414. package/script/tl/0_api.js +23248 -0
  415. package/script/tl/1_utilities.d.ts +32 -0
  416. package/script/tl/1_utilities.d.ts.map +1 -0
  417. package/script/tl/1_utilities.js +76 -0
  418. package/script/tl/1_utilities_test.d.ts.map +1 -0
  419. package/script/tl/2_deserialize.d.ts +23 -0
  420. package/script/tl/2_deserialize.d.ts.map +1 -0
  421. package/script/tl/{3_deserialize.js → 2_deserialize.js} +19 -20
  422. package/script/tl/2_serialize.d.ts +22 -0
  423. package/script/tl/2_serialize.d.ts.map +1 -0
  424. package/script/tl/2_serialize.js +164 -0
  425. package/script/tl/2_serialize_test.d.ts.map +1 -0
  426. package/script/tl/{4_tl_reader.d.ts → 3_tl_reader.d.ts} +3 -3
  427. package/script/tl/3_tl_reader.d.ts.map +1 -0
  428. package/script/tl/{4_tl_reader.js → 3_tl_reader.js} +5 -5
  429. package/script/tl/3_utilities.d.ts +5 -5
  430. package/script/tl/3_utilities.d.ts.map +1 -1
  431. package/script/tl/3_utilities.js +9 -10
  432. package/script/tl/4_rpc_result.d.ts +27 -0
  433. package/script/tl/4_rpc_result.d.ts.map +1 -0
  434. package/{esm/tl/8_message_container.d.ts → script/tl/4_rpc_result.js} +12 -12
  435. package/{esm/tl/5_tl_writer.d.ts → script/tl/4_tl_writer.d.ts} +2 -2
  436. package/script/tl/4_tl_writer.d.ts.map +1 -0
  437. package/script/tl/{5_tl_writer.js → 4_tl_writer.js} +4 -4
  438. package/script/tl/5_message.d.ts +39 -0
  439. package/script/tl/5_message.d.ts.map +1 -0
  440. package/script/tl/5_message.js +106 -0
  441. package/script/tl/5_message_test.d.ts.map +1 -0
  442. package/script/transport/3_transport_provider_tcp.d.ts +14 -0
  443. package/script/transport/3_transport_provider_tcp.d.ts.map +1 -0
  444. package/script/transport/3_transport_provider_tcp.js +19 -0
  445. package/script/types/0_birthday.d.ts +2 -2
  446. package/script/types/0_birthday.d.ts.map +1 -1
  447. package/script/types/0_callback_query_answer.d.ts +2 -2
  448. package/script/types/0_callback_query_answer.d.ts.map +1 -1
  449. package/script/types/0_chat_administrator_rights.d.ts +3 -3
  450. package/script/types/0_chat_administrator_rights.d.ts.map +1 -1
  451. package/script/types/0_chat_administrator_rights.js +1 -11
  452. package/script/types/0_chat_member_rights.d.ts +3 -3
  453. package/script/types/0_chat_member_rights.d.ts.map +1 -1
  454. package/script/types/0_chat_member_rights.js +3 -3
  455. package/script/types/0_chat_photo.d.ts +2 -2
  456. package/script/types/0_chat_photo.d.ts.map +1 -1
  457. package/script/types/0_chat_photo.js +1 -1
  458. package/script/types/0_contact.d.ts +2 -2
  459. package/script/types/0_contact.d.ts.map +1 -1
  460. package/script/types/0_dice.d.ts +2 -2
  461. package/script/types/0_dice.d.ts.map +1 -1
  462. package/script/types/0_giveaway_parameters.d.ts +2 -2
  463. package/script/types/0_giveaway_parameters.d.ts.map +1 -1
  464. package/script/types/0_giveaway_parameters.js +2 -2
  465. package/script/types/0_link_preview.d.ts +2 -2
  466. package/script/types/0_link_preview.d.ts.map +1 -1
  467. package/script/types/0_live_stream_channel.d.ts +2 -2
  468. package/script/types/0_live_stream_channel.d.ts.map +1 -1
  469. package/script/types/0_location.d.ts +2 -2
  470. package/script/types/0_location.d.ts.map +1 -1
  471. package/script/types/0_location.js +4 -4
  472. package/script/types/0_mask_position.d.ts +2 -2
  473. package/script/types/0_mask_position.d.ts.map +1 -1
  474. package/script/types/0_message_entity.d.ts +3 -3
  475. package/script/types/0_message_entity.d.ts.map +1 -1
  476. package/script/types/0_message_entity.js +41 -41
  477. package/script/types/0_message_search_filter.d.ts +2 -2
  478. package/script/types/0_message_search_filter.d.ts.map +1 -1
  479. package/script/types/0_message_search_filter.js +14 -15
  480. package/script/types/0_opening_hours.d.ts +2 -2
  481. package/script/types/0_opening_hours.d.ts.map +1 -1
  482. package/script/types/0_poll_option.d.ts +2 -2
  483. package/script/types/0_poll_option.d.ts.map +1 -1
  484. package/script/types/0_reaction.d.ts +3 -3
  485. package/script/types/0_reaction.d.ts.map +1 -1
  486. package/script/types/0_reaction.js +3 -3
  487. package/script/types/0_restriction_reason.d.ts +2 -2
  488. package/script/types/0_restriction_reason.d.ts.map +1 -1
  489. package/script/types/0_thumbnail.d.ts +2 -2
  490. package/script/types/0_thumbnail.d.ts.map +1 -1
  491. package/script/types/0_thumbnail.js +2 -2
  492. package/script/types/0_video_chat.d.ts +2 -2
  493. package/script/types/0_video_chat.d.ts.map +1 -1
  494. package/script/types/0_video_chat.js +1 -1
  495. package/script/types/0_voice.d.ts +2 -2
  496. package/script/types/0_voice.d.ts.map +1 -1
  497. package/script/types/1_animation.d.ts +2 -2
  498. package/script/types/1_animation.d.ts.map +1 -1
  499. package/script/types/1_animation.js +1 -1
  500. package/script/types/1_audio.d.ts +2 -2
  501. package/script/types/1_audio.d.ts.map +1 -1
  502. package/script/types/1_audio.js +1 -1
  503. package/script/types/1_bot_command_scope.d.ts +9 -2
  504. package/script/types/1_bot_command_scope.d.ts.map +1 -1
  505. package/script/types/1_bot_command_scope.js +8 -8
  506. package/script/types/1_chat_p.d.ts +5 -5
  507. package/script/types/1_chat_p.d.ts.map +1 -1
  508. package/script/types/1_chat_p.js +5 -5
  509. package/script/types/1_document.d.ts +2 -2
  510. package/script/types/1_document.d.ts.map +1 -1
  511. package/script/types/1_document.js +1 -1
  512. package/script/types/1_giveaway.d.ts +2 -2
  513. package/script/types/1_giveaway.d.ts.map +1 -1
  514. package/script/types/1_keyboard_button.d.ts +3 -3
  515. package/script/types/1_keyboard_button.d.ts.map +1 -1
  516. package/script/types/1_keyboard_button.js +17 -44
  517. package/script/types/1_message_reaction.d.ts +2 -2
  518. package/script/types/1_message_reaction.d.ts.map +1 -1
  519. package/script/types/1_message_reaction.js +4 -4
  520. package/script/types/1_photo.d.ts +5 -5
  521. package/script/types/1_photo.d.ts.map +1 -1
  522. package/script/types/1_photo.js +3 -3
  523. package/script/types/1_poll.d.ts +2 -2
  524. package/script/types/1_poll.d.ts.map +1 -1
  525. package/script/types/1_reaction_count.d.ts +2 -2
  526. package/script/types/1_reaction_count.d.ts.map +1 -1
  527. package/script/types/1_reply_quote.d.ts +2 -2
  528. package/script/types/1_reply_quote.d.ts.map +1 -1
  529. package/script/types/1_sticker.d.ts +3 -3
  530. package/script/types/1_sticker.d.ts.map +1 -1
  531. package/script/types/1_sticker.js +8 -8
  532. package/script/types/1_story_privacy.d.ts +3 -3
  533. package/script/types/1_story_privacy.d.ts.map +1 -1
  534. package/script/types/1_story_privacy.js +13 -13
  535. package/script/types/1_story_reaction.d.ts +2 -2
  536. package/script/types/1_story_reaction.d.ts.map +1 -1
  537. package/script/types/1_user.d.ts +2 -2
  538. package/script/types/1_user.d.ts.map +1 -1
  539. package/script/types/1_user.js +1 -1
  540. package/script/types/1_venue.d.ts +2 -2
  541. package/script/types/1_venue.d.ts.map +1 -1
  542. package/script/types/1_venue.js +1 -1
  543. package/script/types/1_video.d.ts +2 -2
  544. package/script/types/1_video.d.ts.map +1 -1
  545. package/script/types/1_video.js +1 -1
  546. package/script/types/1_video_note.d.ts +2 -2
  547. package/script/types/1_video_note.d.ts.map +1 -1
  548. package/script/types/1_video_note.js +1 -1
  549. package/script/types/2_business_connection.d.ts +2 -2
  550. package/script/types/2_business_connection.d.ts.map +1 -1
  551. package/script/types/2_business_connection.js +1 -2
  552. package/script/types/2_chat.d.ts +2 -2
  553. package/script/types/2_chat.d.ts.map +1 -1
  554. package/script/types/2_chat.js +10 -10
  555. package/script/types/2_chat_member.d.ts +2 -2
  556. package/script/types/2_chat_member.d.ts.map +1 -1
  557. package/script/types/2_chat_member.js +9 -9
  558. package/script/types/2_chosen_inline_result.d.ts +2 -2
  559. package/script/types/2_chosen_inline_result.d.ts.map +1 -1
  560. package/script/types/2_chosen_inline_result.js +4 -4
  561. package/script/types/2_game.d.ts +2 -2
  562. package/script/types/2_game.d.ts.map +1 -1
  563. package/script/types/2_game.js +3 -3
  564. package/script/types/2_inactive_chat.d.ts +2 -2
  565. package/script/types/2_inactive_chat.d.ts.map +1 -1
  566. package/script/types/2_inactive_chat.js +1 -1
  567. package/script/types/2_inline_keyboard_button.d.ts +3 -3
  568. package/script/types/2_inline_keyboard_button.d.ts.map +1 -1
  569. package/script/types/2_inline_keyboard_button.js +14 -20
  570. package/script/types/2_inline_query.d.ts +2 -2
  571. package/script/types/2_inline_query.d.ts.map +1 -1
  572. package/script/types/2_inline_query.js +7 -7
  573. package/script/types/2_invite_link.d.ts +2 -2
  574. package/script/types/2_invite_link.d.ts.map +1 -1
  575. package/script/types/2_invite_link.js +1 -2
  576. package/script/types/2_message_reaction_count.d.ts +2 -2
  577. package/script/types/2_message_reaction_count.d.ts.map +1 -1
  578. package/script/types/2_message_reactions.d.ts +2 -2
  579. package/script/types/2_message_reactions.d.ts.map +1 -1
  580. package/script/types/2_message_reactions.js +1 -1
  581. package/script/types/2_story_content.d.ts +2 -2
  582. package/script/types/2_story_content.d.ts.map +1 -1
  583. package/script/types/2_story_content.js +5 -5
  584. package/script/types/2_story_interactions.d.ts +2 -2
  585. package/script/types/2_story_interactions.d.ts.map +1 -1
  586. package/script/types/2_story_interactive_area.d.ts +3 -3
  587. package/script/types/2_story_interactive_area.d.ts.map +1 -1
  588. package/script/types/2_story_interactive_area.js +18 -28
  589. package/script/types/3_chat_member_updated.d.ts +2 -2
  590. package/script/types/3_chat_member_updated.d.ts.map +1 -1
  591. package/script/types/3_chat_member_updated.js +6 -6
  592. package/script/types/3_reply_markup.d.ts +3 -3
  593. package/script/types/3_reply_markup.d.ts.map +1 -1
  594. package/script/types/3_reply_markup.js +11 -21
  595. package/script/types/3_story.d.ts +2 -2
  596. package/script/types/3_story.d.ts.map +1 -1
  597. package/script/types/4_inline_query_result.d.ts +3 -3
  598. package/script/types/4_inline_query_result.d.ts.map +1 -1
  599. package/script/types/4_inline_query_result.js +52 -160
  600. package/script/types/4_message.d.ts +3 -3
  601. package/script/types/4_message.d.ts.map +1 -1
  602. package/script/types/4_message.js +67 -58
  603. package/script/types/5_callback_query.d.ts +3 -3
  604. package/script/types/5_callback_query.d.ts.map +1 -1
  605. package/script/types/5_callback_query.js +4 -4
  606. package/script/types/5_chat_list_item.d.ts +3 -3
  607. package/script/types/5_chat_list_item.d.ts.map +1 -1
  608. package/script/types/5_chat_list_item.js +1 -1
  609. package/script/types/5_inline_query_answer.d.ts +2 -2
  610. package/script/types/5_inline_query_answer.d.ts.map +1 -1
  611. package/script/types/_file_id.d.ts +2 -2
  612. package/script/types/_file_id.d.ts.map +1 -1
  613. package/script/types/_file_id.js +3 -3
  614. package/script/types/_getters.d.ts +7 -7
  615. package/script/types/_getters.d.ts.map +1 -1
  616. package/esm/tl/1_tl_object.d.ts +0 -64
  617. package/esm/tl/1_tl_object.d.ts.map +0 -1
  618. package/esm/tl/1_tl_object.js +0 -221
  619. package/esm/tl/1_tl_object_test.d.ts.map +0 -1
  620. package/esm/tl/2_types.d.ts +0 -28060
  621. package/esm/tl/2_types.d.ts.map +0 -1
  622. package/esm/tl/2_types.js +0 -68685
  623. package/esm/tl/2_types_test.d.ts.map +0 -1
  624. package/esm/tl/3_deserialize.d.ts +0 -23
  625. package/esm/tl/3_deserialize.d.ts.map +0 -1
  626. package/esm/tl/3_functions.d.ts +0 -14094
  627. package/esm/tl/3_functions.d.ts.map +0 -1
  628. package/esm/tl/3_functions.js +0 -28475
  629. package/esm/tl/3_functions_test.d.ts.map +0 -1
  630. package/esm/tl/4_tl_reader.d.ts.map +0 -1
  631. package/esm/tl/5_tl_writer.d.ts.map +0 -1
  632. package/esm/tl/6_rpc_result.d.ts.map +0 -1
  633. package/esm/tl/6_rpc_result.js +0 -49
  634. package/esm/tl/7_message.d.ts.map +0 -1
  635. package/esm/tl/7_message.js +0 -90
  636. package/esm/tl/7_message_test.d.ts.map +0 -1
  637. package/esm/tl/8_message_container.d.ts.map +0 -1
  638. package/esm/tl/8_message_container.js +0 -72
  639. package/script/tl/1_tl_object.d.ts +0 -64
  640. package/script/tl/1_tl_object.d.ts.map +0 -1
  641. package/script/tl/1_tl_object.js +0 -228
  642. package/script/tl/1_tl_object_test.d.ts.map +0 -1
  643. package/script/tl/2_types.d.ts +0 -28060
  644. package/script/tl/2_types.d.ts.map +0 -1
  645. package/script/tl/2_types.js +0 -70558
  646. package/script/tl/2_types_test.d.ts.map +0 -1
  647. package/script/tl/3_deserialize.d.ts +0 -23
  648. package/script/tl/3_deserialize.d.ts.map +0 -1
  649. package/script/tl/3_functions.d.ts +0 -14094
  650. package/script/tl/3_functions.d.ts.map +0 -1
  651. package/script/tl/3_functions.js +0 -29121
  652. package/script/tl/3_functions_test.d.ts.map +0 -1
  653. package/script/tl/4_tl_reader.d.ts.map +0 -1
  654. package/script/tl/5_tl_writer.d.ts.map +0 -1
  655. package/script/tl/6_rpc_result.d.ts +0 -30
  656. package/script/tl/6_rpc_result.d.ts.map +0 -1
  657. package/script/tl/6_rpc_result.js +0 -53
  658. package/script/tl/7_message.d.ts +0 -32
  659. package/script/tl/7_message.d.ts.map +0 -1
  660. package/script/tl/7_message.js +0 -95
  661. package/script/tl/7_message_test.d.ts.map +0 -1
  662. package/script/tl/8_message_container.d.ts +0 -32
  663. package/script/tl/8_message_container.d.ts.map +0 -1
  664. package/script/tl/8_message_container.js +0 -76
@@ -17,7 +17,7 @@
17
17
  * You should have received a copy of the GNU Lesser General Public License
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
- import { enums, types } from "../2_tl.js";
20
+ import { Api } from "../2_tl.js";
21
21
  import { ID, Update, VideoChatActive, VideoChatScheduled } from "../3_types.js";
22
22
  import { DownloadLiveStreamChunkParams, JoinVideoChatParams, StartVideoChatParams } from "./0_params.js";
23
23
  import { C as C_ } from "./1_types.js";
@@ -25,7 +25,7 @@ import { FileManager } from "./2_file_manager.js";
25
25
  interface C extends C_ {
26
26
  fileManager: FileManager;
27
27
  }
28
- type VideoChatManagerUpdate = types.UpdateGroupCall;
28
+ type VideoChatManagerUpdate = Api.updateGroupCall;
29
29
  export declare class VideoChatManager {
30
30
  #private;
31
31
  constructor(c: C);
@@ -35,7 +35,7 @@ export declare class VideoChatManager {
35
35
  leaveVideoChat(id: string): Promise<void>;
36
36
  joinLiveStream(id: string): Promise<void>;
37
37
  getVideoChat(id: string): Promise<import("../3_types.js").VideoChat>;
38
- static canHandleUpdate(update: enums.Update): update is VideoChatManagerUpdate;
38
+ static canHandleUpdate(update: Api.Update): update is VideoChatManagerUpdate;
39
39
  handleUpdate(update: VideoChatManagerUpdate): Promise<Update>;
40
40
  getLiveStreamChannels(id: string): Promise<import("../3_types.js").LiveStreamChannel[]>;
41
41
  downloadLiveStreamChunk(id: string, channel: number, scale: number, timestamp: number, params?: DownloadLiveStreamChunkParams): AsyncGenerator<Uint8Array, void, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"3_video_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_video_chat_manager.ts"],"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;IAgB/B,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,6BAA6B;CAmBrI"}
@@ -54,31 +54,26 @@ class VideoChatManager {
54
54
  async joinVideoChat(id, params, params_) {
55
55
  await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("joinVideoChat");
56
56
  const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id);
57
- const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").api.phone.joinGroupCall({
58
- call,
59
- join_as: params_?.joinAs ? await __classPrivateFieldGet(this, _VideoChatManager_c, "f").getInputPeer(params_.joinAs) : new _2_tl_js_1.types.InputPeerSelf(),
60
- params: new _2_tl_js_1.types.DataJSON({ data: params }),
61
- invite_hash: params_?.inviteHash,
62
- muted: params_?.audio ? undefined : true,
63
- video_stopped: params_?.video ? undefined : true,
64
- }).then((v) => v[_2_tl_js_1.as](_2_tl_js_1.types.Updates));
57
+ const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.joinGroupCall", call, join_as: params_?.joinAs ? await __classPrivateFieldGet(this, _VideoChatManager_c, "f").getInputPeer(params_.joinAs) : { _: "inputPeerSelf" }, params: ({ _: "dataJSON", data: params }), invite_hash: params_?.inviteHash, muted: params_?.audio ? undefined : true, video_stopped: params_?.video ? undefined : true }).then((v) => (0, _2_tl_js_1.as)("updates", v));
65
58
  const updateGroupCall = updates
66
- .find((v) => v instanceof _2_tl_js_1.types.UpdateGroupCallConnection);
59
+ .find((v) => (0, _2_tl_js_1.is)("updateGroupCallConnection", v));
67
60
  if (!updateGroupCall)
68
61
  (0, _0_deps_js_1.unreachable)();
69
62
  return updateGroupCall.params.data;
70
63
  }
71
64
  async leaveVideoChat(id) {
72
65
  await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("leaveVideoChat");
73
- await __classPrivateFieldGet(this, _VideoChatManager_c, "f").api.phone.leaveGroupCall({ call: await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id), source: 0 });
66
+ await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.leaveGroupCall", call: await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id), source: 0 });
74
67
  }
75
68
  async joinLiveStream(id) {
76
69
  await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("joinLiveStream");
77
70
  const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id);
78
- const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").api.phone.joinGroupCall({
71
+ const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({
72
+ _: "phone.joinGroupCall",
79
73
  call,
80
- join_as: new _2_tl_js_1.types.InputPeerSelf(),
81
- params: new _2_tl_js_1.types.DataJSON({
74
+ join_as: { _: "inputPeerSelf" },
75
+ params: ({
76
+ _: "dataJSON",
82
77
  data: JSON.stringify({
83
78
  fingerprints: [],
84
79
  pwd: "",
@@ -87,9 +82,9 @@ class VideoChatManager {
87
82
  ufrag: "",
88
83
  }),
89
84
  }),
90
- }).then((v) => v[_2_tl_js_1.as](_2_tl_js_1.types.Updates));
85
+ }).then((v) => (0, _2_tl_js_1.as)("updates", v));
91
86
  const updateGroupCall = updates
92
- .find((v) => v instanceof _2_tl_js_1.types.UpdateGroupCallConnection);
87
+ .find((v) => (0, _2_tl_js_1.is)("updateGroupCallConnection", v));
93
88
  if (!updateGroupCall)
94
89
  (0, _0_deps_js_1.unreachable)();
95
90
  }
@@ -98,13 +93,13 @@ class VideoChatManager {
98
93
  return (0, _3_types_js_1.constructVideoChat)(await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getCall).call(this, id));
99
94
  }
100
95
  static canHandleUpdate(update) {
101
- return update instanceof _2_tl_js_1.types.UpdateGroupCall;
96
+ return (0, _2_tl_js_1.is)("updateGroupCall", update);
102
97
  }
103
98
  async handleUpdate(update) {
104
99
  let chatId = Number(-update.chat_id);
105
100
  const fullChat = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getFullChat(chatId).then((v) => v == null ? __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getFullChat(chatId = _1_utilities_js_1.ZERO_CHANNEL_ID - Number(update.chat_id)) : v);
106
101
  let updateFullChat = false;
107
- if (update.call instanceof _2_tl_js_1.types.GroupCallDiscarded) {
102
+ if ((0, _2_tl_js_1.is)("groupCallDiscarded", update.call)) {
108
103
  await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.setGroupCall(update.call.id, null);
109
104
  await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.setGroupCallAccessHash(update.call.id, null);
110
105
  if (fullChat != null) {
@@ -117,7 +112,7 @@ class VideoChatManager {
117
112
  await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.setGroupCallAccessHash(update.call.id, update.call.access_hash);
118
113
  if (fullChat != null) {
119
114
  if (!("call" in fullChat) || !fullChat.call || fullChat.call.id != update.call.id) {
120
- fullChat.call = new _2_tl_js_1.types.InputGroupCall(update.call);
115
+ fullChat.call = { ...update.call, _: "inputGroupCall" };
121
116
  updateFullChat = true;
122
117
  }
123
118
  }
@@ -130,13 +125,13 @@ class VideoChatManager {
130
125
  async getLiveStreamChannels(id) {
131
126
  await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("getLiveStreamChannels");
132
127
  const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getCall).call(this, id);
133
- if (!(call instanceof _2_tl_js_1.types.GroupCall) || !call.rtmp_stream) {
128
+ if (!((0, _2_tl_js_1.is)("groupCall", call)) || !call.rtmp_stream) {
134
129
  throw new _0_errors_js_1.InputError("Not a live stream.");
135
130
  }
136
131
  const client = __classPrivateFieldGet(this, _VideoChatManager_c, "f").getCdnConnection(call.stream_dc_id);
137
132
  await client.connect();
138
133
  try {
139
- const streams = await client.api.phone.getGroupCallStreamChannels({ call: await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id) });
134
+ const streams = await client.invoke({ _: "phone.getGroupCallStreamChannels", call: await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id) });
140
135
  return streams.channels.map(_3_types_js_1.constructLiveStreamChannel);
141
136
  }
142
137
  finally {
@@ -146,37 +141,32 @@ class VideoChatManager {
146
141
  async *downloadLiveStreamChunk(id, channel, scale, timestamp, params) {
147
142
  await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.assertUser("downloadLiveStreamChunk");
148
143
  const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getCall).call(this, id);
149
- if (!(call instanceof _2_tl_js_1.types.GroupCall) || !call.rtmp_stream) {
144
+ if (!((0, _2_tl_js_1.is)("groupCall", call)) || !call.rtmp_stream) {
150
145
  throw new _0_errors_js_1.InputError("Not a live stream.");
151
146
  }
152
147
  const quality = params?.quality ?? "low";
153
- const location = new _2_tl_js_1.types.InputGroupCallStream({
154
- call: new _2_tl_js_1.types.InputGroupCall(call),
148
+ const location = {
149
+ _: "inputGroupCallStream",
150
+ call: { ...call, _: "inputGroupCall" },
155
151
  scale,
156
152
  time_ms: BigInt(timestamp),
157
153
  video_channel: channel,
158
154
  video_quality: quality == "low" ? 0 : quality == "medium" ? 1 : quality == "high" ? 2 : (() => {
159
155
  throw new _0_errors_js_1.InputError("Got invalid quality.");
160
156
  })(),
161
- });
157
+ };
162
158
  yield* __classPrivateFieldGet(this, _VideoChatManager_c, "f").fileManager.downloadInner(location, call.stream_dc_id ?? (0, _0_deps_js_1.unreachable)());
163
159
  }
164
160
  }
165
161
  exports.VideoChatManager = VideoChatManager;
166
162
  _VideoChatManager_c = new WeakMap(), _VideoChatManager_instances = new WeakSet(), _VideoChatManager_createGroupCall = async function _VideoChatManager_createGroupCall(chatId, title, liveStream, scheduleDate) {
167
163
  const peer = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").getInputPeer(chatId);
168
- if (peer instanceof _2_tl_js_1.types.InputPeerUser) {
164
+ if ((0, _2_tl_js_1.is)("inputPeerUser", peer)) {
169
165
  throw new _0_errors_js_1.InputError("Video chats are only available for groups and channels.");
170
166
  }
171
- const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").api.phone.createGroupCall({
172
- peer,
173
- random_id: (0, _1_utilities_js_1.getRandomId)(true),
174
- title,
175
- rtmp_stream: liveStream,
176
- schedule_date: scheduleDate ? (0, _1_utilities_js_1.toUnixTimestamp)(scheduleDate) : undefined,
177
- }).then((v) => v[_2_tl_js_1.as](_2_tl_js_1.types.Updates));
167
+ const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.createGroupCall", peer, random_id: (0, _1_utilities_js_1.getRandomId)(true), title, rtmp_stream: liveStream, schedule_date: scheduleDate ? (0, _1_utilities_js_1.toUnixTimestamp)(scheduleDate) : undefined }).then((v) => (0, _2_tl_js_1.as)("updates", v));
178
168
  const updateGroupCall = updates
179
- .find((v) => v instanceof _2_tl_js_1.types.UpdateGroupCall);
169
+ .find((v) => (0, _2_tl_js_1.is)("updateGroupCall", v));
180
170
  if (!updateGroupCall) {
181
171
  (0, _0_deps_js_1.unreachable)();
182
172
  }
@@ -187,12 +177,12 @@ _VideoChatManager_c = new WeakMap(), _VideoChatManager_instances = new WeakSet()
187
177
  if (accessHash == null) {
188
178
  throw new _0_errors_js_1.InputError("Video chat not found.");
189
179
  }
190
- return new _2_tl_js_1.types.InputGroupCall({ id, access_hash: accessHash });
180
+ return { _: "inputGroupCall", id, access_hash: accessHash };
191
181
  }, _VideoChatManager_getCall = async function _VideoChatManager_getCall(id) {
192
182
  let groupCall = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getGroupCall(BigInt(id));
193
183
  if (groupCall == null) {
194
184
  const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id);
195
- groupCall = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").api.phone.getGroupCall({ call, limit: 1 }).then((v) => v.call);
185
+ groupCall = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.getGroupCall", call, limit: 1 }).then((v) => v.call);
196
186
  }
197
187
  return groupCall;
198
188
  };
@@ -17,7 +17,7 @@
17
17
  * You should have received a copy of the GNU Lesser General Public License
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
- import { enums, types } from "../2_tl.js";
20
+ import { Api } from "../2_tl.js";
21
21
  import { CallbackQueryQuestion, ID, Update } from "../3_types.js";
22
22
  import { AnswerCallbackQueryParams } from "./0_params.js";
23
23
  import { C as C_ } from "./1_types.js";
@@ -25,13 +25,13 @@ import { MessageManager } from "./3_message_manager.js";
25
25
  type C = C_ & {
26
26
  messageManager: MessageManager;
27
27
  };
28
- type CallbackQueryManagerUpdate = types.UpdateBotCallbackQuery | types.UpdateInlineBotCallbackQuery;
28
+ type CallbackQueryManagerUpdate = Api.updateBotCallbackQuery | Api.updateInlineBotCallbackQuery;
29
29
  export declare class CallbackQueryManager {
30
30
  #private;
31
31
  constructor(c: C);
32
32
  answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
33
33
  sendCallbackQuery(chatId: ID, messageId: number, question: CallbackQueryQuestion): Promise<import("../3_types.js").CallbackQueryAnswer>;
34
- static canHandleUpdate(update: enums.Update): update is CallbackQueryManagerUpdate;
34
+ static canHandleUpdate(update: Api.Update): update is CallbackQueryManagerUpdate;
35
35
  handleUpdate(update: CallbackQueryManagerUpdate): Promise<Update>;
36
36
  }
37
37
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"4_callback_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_callback_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAwD,EAAE,EAAE,MAAM,EAAiC,MAAM,eAAe,CAAC;AACvJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAEjD,KAAK,0BAA0B,GAAG,KAAK,CAAC,sBAAsB,GAAG,KAAK,CAAC,4BAA4B,CAAC;AAEpG,qBAAa,oBAAoB;;gBAGnB,CAAC,EAAE,CAAC;IAIV,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB;IAYlE,iBAAiB,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB;IA+BtF,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,0BAA0B;IAI5E,YAAY,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC;CAGxE"}
1
+ {"version":3,"file":"4_callback_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_callback_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAyB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAwD,EAAE,EAAE,MAAM,EAAiC,MAAM,eAAe,CAAC;AACvJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAEjD,KAAK,0BAA0B,GAAG,GAAG,CAAC,sBAAsB,GAAG,GAAG,CAAC,4BAA4B,CAAC;AAEhG,qBAAa,oBAAoB;;gBAGnB,CAAC,EAAE,CAAC;IAIV,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB;IAOlE,iBAAiB,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB;IAyBtF,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,0BAA0B;IAI1E,YAAY,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC;CAGxE"}
@@ -45,12 +45,7 @@ class CallbackQueryManager {
45
45
  async answerCallbackQuery(id, params) {
46
46
  await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").storage.assertBot("answerCallbackQuery");
47
47
  (0, _0_utilities_js_1.checkCallbackQueryId)(id);
48
- await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").api.messages.setBotCallbackAnswer({
49
- query_id: BigInt(id),
50
- cache_time: params?.cacheTime ?? 0,
51
- message: params?.text,
52
- alert: params?.alert ? true : undefined,
53
- });
48
+ await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").invoke({ _: "messages.setBotCallbackAnswer", query_id: BigInt(id), cache_time: params?.cacheTime ?? 0, message: params?.text, alert: params?.alert ? true : undefined });
54
49
  }
55
50
  async sendCallbackQuery(chatId, messageId, question) {
56
51
  await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").storage.assertUser("sendCallbackQuery");
@@ -61,20 +56,14 @@ class CallbackQueryManager {
61
56
  if (maybeAnswer != null && !__classPrivateFieldGet(_a, _a, "m", _CallbackQueryManager_isExpired).call(_a, maybeAnswer[1], maybeAnswer[0].cache_time)) {
62
57
  return (0, _3_types_js_1.constructCallbackQueryAnswer)(maybeAnswer[0]);
63
58
  }
64
- const answer = await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").api.messages.getBotCallbackAnswer({
65
- peer,
66
- msg_id: messageId,
67
- data: "data" in question ? __classPrivateFieldGet(_a, _a, "f", _CallbackQueryManager_enc).encode(question.data) : undefined,
68
- game: question.type == "game" ? true : undefined,
69
- password: question.type == "password" ? await __classPrivateFieldGet(this, _CallbackQueryManager_instances, "m", _CallbackQueryManager_getPasswordCheck).call(this, question.password) : undefined,
70
- });
59
+ const answer = await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").invoke({ _: "messages.getBotCallbackAnswer", peer, msg_id: messageId, data: "data" in question ? __classPrivateFieldGet(_a, _a, "f", _CallbackQueryManager_enc).encode(question.data) : undefined, game: question.type == "game" ? true : undefined, password: question.type == "password" ? await __classPrivateFieldGet(this, _CallbackQueryManager_instances, "m", _CallbackQueryManager_getPasswordCheck).call(this, question.password) : undefined });
71
60
  if (answer.cache_time >= 0) {
72
61
  await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").messageStorage.setCallbackQueryAnswer(peerId, messageId, questionKey, answer);
73
62
  }
74
63
  return (0, _3_types_js_1.constructCallbackQueryAnswer)(answer);
75
64
  }
76
65
  static canHandleUpdate(update) {
77
- return update instanceof _2_tl_js_1.types.UpdateBotCallbackQuery || update instanceof _2_tl_js_1.types.UpdateInlineBotCallbackQuery;
66
+ return (0, _2_tl_js_1.isOneOf)(["updateBotCallbackQuery", "updateInlineBotCallbackQuery"], update);
78
67
  }
79
68
  async handleUpdate(update) {
80
69
  return { callbackQuery: await (0, _3_types_js_1.constructCallbackQuery)(update, __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").getEntity, __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").messageManager.getMessageWithReply.bind(__classPrivateFieldGet(this, _CallbackQueryManager_c, "f").messageManager)) };
@@ -84,7 +73,7 @@ exports.CallbackQueryManager = CallbackQueryManager;
84
73
  _a = CallbackQueryManager, _CallbackQueryManager_c = new WeakMap(), _CallbackQueryManager_instances = new WeakSet(), _CallbackQueryManager_isExpired = function _CallbackQueryManager_isExpired(date, cacheTime) {
85
74
  return (Date.now() - date.getTime()) / 1000 > cacheTime;
86
75
  }, _CallbackQueryManager_getPasswordCheck = async function _CallbackQueryManager_getPasswordCheck(password) {
87
- const ap = await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").api.account.getPassword();
76
+ const ap = await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").invoke({ _: "account.getPassword" });
88
77
  return await (0, _0_password_js_1.checkPassword)(password, ap);
89
78
  };
90
79
  _CallbackQueryManager_enc = { value: new TextEncoder() };
@@ -17,8 +17,8 @@
17
17
  * You should have received a copy of the GNU Lesser General Public License
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
- import { enums, types } from "../2_tl.js";
21
- import { ChatListItem, ID } from "../3_types.js";
20
+ import { Api } from "../2_tl.js";
21
+ import { ChatListItem, ChatMember, ID } from "../3_types.js";
22
22
  import { C as C_ } from "./1_types.js";
23
23
  import { FileManager } from "./2_file_manager.js";
24
24
  import { MessageManager } from "./3_message_manager.js";
@@ -26,15 +26,16 @@ type C = C_ & {
26
26
  fileManager: FileManager;
27
27
  messageManager: MessageManager;
28
28
  };
29
- type ChatListManagerUpdate = types.UpdateNewMessage | types.UpdateNewChannelMessage | types.UpdatePinnedDialogs | types.UpdateFolderPeers | types.UpdateChannel | types.UpdateChat | types.UpdateUser | types.UpdateUserName;
29
+ type ChatListManagerUpdate = Api.updateNewMessage | Api.updateNewChannelMessage | Api.updatePinnedDialogs | Api.updateFolderPeers | Api.updateChannel | Api.updateChat | Api.updateUser | Api.updateUserName;
30
30
  export declare class ChatListManager {
31
31
  #private;
32
32
  constructor(c: C);
33
33
  reassignChatLastMessage(chatId: number, add?: boolean, sendUpdate?: boolean): Promise<() => Promise<void>>;
34
34
  getChats(from?: "archived" | "main", after?: ChatListItem, limit?: number): Promise<ChatListItem[]>;
35
- static canHandleUpdate(update: enums.Update): update is ChatListManagerUpdate;
35
+ static canHandleUpdate(update: Api.Update): update is ChatListManagerUpdate;
36
36
  handleUpdate(update: ChatListManagerUpdate): Promise<void>;
37
37
  getChat(chatId: ID): Promise<import("../3_types.js").Chat>;
38
+ getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
38
39
  }
39
40
  export {};
40
41
  //# sourceMappingURL=4_chat_list_manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"4_chat_list_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_chat_list_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,YAAY,EAA8G,EAAE,EAAE,MAAM,eAAe,CAAC;AAC7J,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAE3E,KAAK,qBAAqB,GACtB,KAAK,CAAC,gBAAgB,GACtB,KAAK,CAAC,uBAAuB,GAC7B,KAAK,CAAC,mBAAmB,GACzB,KAAK,CAAC,iBAAiB,GACvB,KAAK,CAAC,aAAa,GACnB,KAAK,CAAC,UAAU,GAChB,KAAK,CAAC,UAAU,GAChB,KAAK,CAAC,cAAc,CAAC;AAEzB,qBAAa,eAAe;;gBAKd,CAAC,EAAE,CAAC;I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UAAQ,EAAE,UAAU,UAAO;IAwTtE,QAAQ,CAAC,IAAI,GAAE,UAAU,GAAG,MAAe,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,KAAK,SAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IA4B9G,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,qBAAqB;IAIrE,YAAY,CAAC,MAAM,EAAE,qBAAqB;IA0C1C,OAAO,CAAC,MAAM,EAAE,EAAE;IAQlB,qBAAqB,CAAC,MAAM,EAAE,EAAE;CA2BvC"}
@@ -144,28 +144,28 @@ class ChatListManager {
144
144
  return chats;
145
145
  }
146
146
  static canHandleUpdate(update) {
147
- return update instanceof _2_tl_js_1.types.UpdateNewMessage || update instanceof _2_tl_js_1.types.UpdateNewChannelMessage || update instanceof _2_tl_js_1.types.UpdatePinnedDialogs || update instanceof _2_tl_js_1.types.UpdateFolderPeers || update instanceof _2_tl_js_1.types.UpdateChannel || update instanceof _2_tl_js_1.types.UpdateChat || update instanceof _2_tl_js_1.types.UpdateUser || update instanceof _2_tl_js_1.types.UpdateUserName;
147
+ return (0, _2_tl_js_1.is)("updateNewMessage", update) || (0, _2_tl_js_1.is)("updateNewChannelMessage", update) || (0, _2_tl_js_1.is)("updatePinnedDialogs", update) || (0, _2_tl_js_1.is)("updateFolderPeers", update) || (0, _2_tl_js_1.is)("updateChannel", update) || (0, _2_tl_js_1.is)("updateChat", update) || (0, _2_tl_js_1.is)("updateUser", update) || (0, _2_tl_js_1.is)("updateUserName", update);
148
148
  }
149
149
  async handleUpdate(update) {
150
- if (update instanceof _2_tl_js_1.types.UpdateNewMessage || update instanceof _2_tl_js_1.types.UpdateNewChannelMessage || update instanceof _2_tl_js_1.types.UpdateEditMessage || update instanceof _2_tl_js_1.types.UpdateEditChannelMessage) {
151
- if (update.message instanceof _2_tl_js_1.types.Message || update.message instanceof _2_tl_js_1.types.MessageService) {
150
+ if ((0, _2_tl_js_1.is)("updateNewMessage", update) || (0, _2_tl_js_1.is)("updateNewChannelMessage", update) || (0, _2_tl_js_1.is)("updateEditMessage", update) || (0, _2_tl_js_1.is)("updateEditChannelMessage", update)) {
151
+ if ((0, _2_tl_js_1.is)("message", update.message) || (0, _2_tl_js_1.is)("messageService", update.message)) {
152
152
  const chatId = (0, _2_tl_js_1.peerToChatId)(update.message.peer_id);
153
153
  await this.reassignChatLastMessage(chatId);
154
154
  }
155
155
  }
156
- else if (update instanceof _2_tl_js_1.types.UpdatePinnedDialogs) {
156
+ else if ((0, _2_tl_js_1.is)("updatePinnedDialogs", update)) {
157
157
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdatePinnedDialogs).call(this, update);
158
158
  }
159
- else if (update instanceof _2_tl_js_1.types.UpdateFolderPeers) {
159
+ else if ((0, _2_tl_js_1.is)("updateFolderPeers", update)) {
160
160
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateFolderPeers).call(this, update);
161
161
  }
162
- else if (update instanceof _2_tl_js_1.types.UpdateChannel) {
162
+ else if ((0, _2_tl_js_1.is)("updateChannel", update)) {
163
163
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateChannel).call(this, update);
164
164
  }
165
- else if (update instanceof _2_tl_js_1.types.UpdateChat) {
165
+ else if ((0, _2_tl_js_1.is)("updateChat", update)) {
166
166
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateChat).call(this, update);
167
167
  }
168
- else if (update instanceof _2_tl_js_1.types.UpdateUser || update instanceof _2_tl_js_1.types.UpdateUserName) {
168
+ else if ((0, _2_tl_js_1.is)("updateUser", update) || (0, _2_tl_js_1.is)("updateUserName", update)) {
169
169
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateUser).call(this, update);
170
170
  }
171
171
  else {
@@ -179,6 +179,35 @@ class ChatListManager {
179
179
  }
180
180
  return await (0, _3_types_js_1.constructChat)(fullChat, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
181
181
  }
182
+ async getChatAdministrators(chatId) {
183
+ const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
184
+ if ((0, _2_tl_js_1.is)("inputPeerChannel", peer)) {
185
+ const channel = { ...peer, _: "inputChannel" };
186
+ const participants = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsAdmins" }, offset: 0, limit: 100, hash: 0n });
187
+ if ((0, _2_tl_js_1.is)("channels.channelParticipantsNotModified", participants)) {
188
+ (0, _0_deps_js_1.unreachable)();
189
+ }
190
+ const chatMembers = new Array();
191
+ for (const p of participants.participants) {
192
+ chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity));
193
+ }
194
+ return chatMembers;
195
+ }
196
+ else if ((0, _2_tl_js_1.is)("inputPeerChat", peer)) {
197
+ const fullChat = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getFullChat).call(this, chatId);
198
+ if (!fullChat || !("participants" in fullChat) || !(0, _2_tl_js_1.is)("chatParticipants", fullChat.participants)) {
199
+ (0, _0_deps_js_1.unreachable)();
200
+ }
201
+ const chatMembers = new Array();
202
+ for (const p of fullChat.participants.participants) {
203
+ chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity));
204
+ }
205
+ return chatMembers;
206
+ }
207
+ else {
208
+ (0, _0_deps_js_1.unreachable)();
209
+ }
210
+ }
182
211
  }
183
212
  exports.ChatListManager = ChatListManager;
184
213
  _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(), _ChatListManager_chats = new WeakMap(), _ChatListManager_archivedChats = new WeakMap(), _ChatListManager_chatsLoadedFromStorage = new WeakMap(), _ChatListManager_pinnedChats = new WeakMap(), _ChatListManager_pinnedArchiveChats = new WeakMap(), _ChatListManager_storageHadPinnedChats = new WeakMap(), _ChatListManager_pinnedChatsLoaded = new WeakMap(), _ChatListManager_instances = new WeakSet(), _ChatListManager_sendChatUpdate = async function _ChatListManager_sendChatUpdate(chatId, added) {
@@ -272,7 +301,7 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
272
301
  __classPrivateFieldSet(this, _ChatListManager_pinnedChatsLoaded, true, "f");
273
302
  }, _ChatListManager_fetchPinnedChats = async function _ChatListManager_fetchPinnedChats(listId = null) {
274
303
  if (listId == null || listId == 0) {
275
- const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").api.messages.getPinnedDialogs({ folder_id: 0 });
304
+ const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getPinnedDialogs", folder_id: 0 });
276
305
  const pinnedChats = new Array();
277
306
  for (const dialog of dialogs.dialogs) {
278
307
  pinnedChats.push((0, _2_tl_js_1.peerToChatId)(dialog.peer));
@@ -281,7 +310,7 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
281
310
  await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(0, __classPrivateFieldGet(this, _ChatListManager_pinnedChats, "f"));
282
311
  }
283
312
  if (listId == null || listId == 1) {
284
- const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").api.messages.getPinnedDialogs({ folder_id: 1 });
313
+ const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getPinnedDialogs", folder_id: 1 });
285
314
  const pinnedArchiveChats = new Array();
286
315
  for (const dialog of dialogs.dialogs) {
287
316
  pinnedArchiveChats.push((0, _2_tl_js_1.peerToChatId)(dialog.peer));
@@ -362,35 +391,35 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
362
391
  }
363
392
  await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(listId, await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId));
364
393
  }, _ChatListManager_handleUpdateChannel = async function _ChatListManager_handleUpdateChannel(update) {
365
- const peer = new _2_tl_js_1.types.PeerChannel(update);
394
+ const peer = { ...update, _: "peerChannel" };
366
395
  const channel = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
367
396
  const chatId = (0, _2_tl_js_1.peerToChatId)(peer);
368
397
  await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
369
398
  if (channel != null && "left" in channel && channel.left) {
370
399
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
371
400
  }
372
- else if (channel instanceof _2_tl_js_1.types.ChannelForbidden) {
401
+ else if ((0, _2_tl_js_1.is)("channelForbidden", channel)) {
373
402
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
374
403
  }
375
- else if (channel instanceof _2_tl_js_1.types.Channel) {
404
+ else if ((0, _2_tl_js_1.is)("channel", channel)) {
376
405
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
377
406
  }
378
407
  }, _ChatListManager_handleUpdateChat = async function _ChatListManager_handleUpdateChat(update) {
379
- const peer = new _2_tl_js_1.types.PeerChat(update);
408
+ const peer = { ...update, _: "peerChat" };
380
409
  const chat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
381
410
  const chatId = (0, _2_tl_js_1.peerToChatId)(peer);
382
411
  await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
383
412
  if (chat != null && "left" in chat && chat.left) {
384
413
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
385
414
  }
386
- else if (chat instanceof _2_tl_js_1.types.ChatForbidden) {
415
+ else if ((0, _2_tl_js_1.is)("chatForbidden", chat)) {
387
416
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
388
417
  }
389
- else if (chat instanceof _2_tl_js_1.types.Chat) {
418
+ else if ((0, _2_tl_js_1.is)("chat", chat)) {
390
419
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
391
420
  }
392
421
  }, _ChatListManager_handleUpdateUser = async function _ChatListManager_handleUpdateUser(update) {
393
- const peer = new _2_tl_js_1.types.PeerUser(update);
422
+ const peer = { ...update, _: "peerUser" };
394
423
  const chat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
395
424
  const chatId = (0, _2_tl_js_1.peerToChatId)(peer);
396
425
  await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
@@ -398,16 +427,9 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
398
427
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
399
428
  }
400
429
  }, _ChatListManager_fetchChats = async function _ChatListManager_fetchChats(listId, limit, after) {
401
- const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").api.messages.getDialogs({
402
- limit,
403
- offset_id: after?.lastMessage?.id ?? 0,
404
- offset_date: after?.lastMessage?.date ? (0, _1_utilities_js_1.toUnixTimestamp)(after.lastMessage.date) : 0,
405
- offset_peer: after ? await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(after.chat.id) : new _2_tl_js_1.types.InputPeerEmpty(),
406
- hash: 0n,
407
- folder_id: listId,
408
- });
430
+ const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getDialogs", limit, offset_id: after?.lastMessage?.id ?? 0, offset_date: after?.lastMessage?.date ? (0, _1_utilities_js_1.toUnixTimestamp)(after.lastMessage.date) : 0, offset_peer: after ? await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(after.chat.id) : { _: "inputPeerEmpty" }, hash: 0n, folder_id: listId });
409
431
  const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
410
- if (!(dialogs instanceof _2_tl_js_1.types.messages.Dialogs) && !(dialogs instanceof _2_tl_js_1.types.messages.DialogsSlice)) {
432
+ if (!((0, _2_tl_js_1.is)("messages.dialogs", dialogs)) && !((0, _2_tl_js_1.is)("messages.dialogsSlice", dialogs))) {
411
433
  (0, _0_deps_js_1.unreachable)();
412
434
  }
413
435
  if (dialogs.dialogs.length < limit) {
@@ -426,14 +448,14 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
426
448
  if (fullChat != null) {
427
449
  return fullChat;
428
450
  }
429
- if (inputPeer instanceof _2_tl_js_1.types.InputPeerUser) {
430
- fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").api.users.getFullUser({ id: new _2_tl_js_1.types.InputUser(inputPeer) }).then((v) => v.full_user);
451
+ if ((0, _2_tl_js_1.is)("inputPeerUser", inputPeer)) {
452
+ fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "users.getFullUser", id: { ...inputPeer, _: "inputUser" } }).then((v) => v.full_user);
431
453
  }
432
- else if (inputPeer instanceof _2_tl_js_1.types.InputPeerChat) {
433
- fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").api.messages.getFullChat(inputPeer).then((v) => v.full_chat);
454
+ else if ((0, _2_tl_js_1.is)("inputPeerChat", inputPeer)) {
455
+ fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ ...inputPeer, _: "messages.getFullChat" }).then((v) => v.full_chat);
434
456
  }
435
- else if (inputPeer instanceof _2_tl_js_1.types.InputPeerChannel) {
436
- fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").api.channels.getFullChannel({ channel: new _2_tl_js_1.types.InputChannel(inputPeer) }).then((v) => v.full_chat);
457
+ else if ((0, _2_tl_js_1.is)("inputPeerChannel", inputPeer)) {
458
+ fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getFullChannel", channel: { ...inputPeer, _: "inputChannel" } }).then((v) => v.full_chat);
437
459
  }
438
460
  await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId_, fullChat);
439
461
  if (fullChat != null && "call" in fullChat && fullChat.call) {
@@ -17,7 +17,7 @@
17
17
  * You should have received a copy of the GNU Lesser General Public License
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
- import { enums, types } from "../2_tl.js";
20
+ import { Api } from "../2_tl.js";
21
21
  import { ID, InlineQueryResult, Update } from "../3_types.js";
22
22
  import { AnswerInlineQueryParams, SendInlineQueryParams } from "./0_params.js";
23
23
  import { C as C_ } from "./1_types.js";
@@ -25,12 +25,12 @@ import { MessageManager } from "./3_message_manager.js";
25
25
  type C = C_ & {
26
26
  messageManager: MessageManager;
27
27
  };
28
- type InlineQueryManagerUpdate = types.UpdateBotInlineQuery | types.UpdateBotInlineSend;
28
+ type InlineQueryManagerUpdate = Api.updateBotInlineQuery | Api.updateBotInlineSend;
29
29
  export declare class InlineQueryManager {
30
30
  #private;
31
31
  constructor(c: C);
32
32
  answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
33
- static canHandleUpdate(update: enums.Update): update is InlineQueryManagerUpdate;
33
+ static canHandleUpdate(update: Api.Update): update is InlineQueryManagerUpdate;
34
34
  handleUpdate(update: InlineQueryManagerUpdate): Promise<Update>;
35
35
  sendInlineQuery(userId: ID, chatId: ID, params?: SendInlineQueryParams): Promise<import("../3_types.js").InlineQueryAnswer>;
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"4_inline_query_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_inline_query_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,KAAK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cAAc,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAEjD,KAAK,wBAAwB,GAAG,GAAG,CAAC,oBAAoB,GAAG,GAAG,CAAC,mBAAmB,CAAC;AAEnF,qBAAa,kBAAkB;;gBAGjB,CAAC,EAAE,CAAC;IAIV,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,MAAM,CAAC,EAAE,uBAAuB;IAMlG,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,wBAAwB;IAIxE,YAAY,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAU/D,eAAe,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,qBAAqB;CAsB7E"}
@@ -44,25 +44,16 @@ class InlineQueryManager {
44
44
  async answerInlineQuery(id, results, params) {
45
45
  await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").storage.assertBot("answerInlineQuery");
46
46
  (0, _0_utilities_js_1.checkInlineQueryId)(id);
47
- await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").api.messages.setInlineBotResults({
48
- query_id: BigInt(id),
49
- results: await Promise.all(results.map((v) => (0, _3_types_js_1.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)))),
50
- cache_time: params?.cacheTime ?? 300,
51
- private: params?.isPersonal ? true : undefined,
52
- switch_webview: params?.button && params.button.miniApp ? new _2_tl_js_1.types.InlineBotWebView({ text: params.button.text, url: params.button.miniApp.url }) : undefined,
53
- switch_pm: params?.button && params.button.startParameter ? new _2_tl_js_1.types.InlineBotSwitchPM({ text: params.button.text, start_param: params.button.startParameter }) : undefined,
54
- gallery: params?.isGallery ? true : undefined,
55
- next_offset: params?.nextOffset,
56
- });
47
+ await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").invoke({ _: "messages.setInlineBotResults", query_id: BigInt(id), results: await Promise.all(results.map((v) => (0, _3_types_js_1.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)))), cache_time: params?.cacheTime ?? 300, private: params?.isPersonal ? true : undefined, switch_webview: params?.button && params.button.miniApp ? ({ _: "inlineBotWebView", text: params.button.text, url: params.button.miniApp.url }) : undefined, switch_pm: params?.button && params.button.startParameter ? ({ _: "inlineBotSwitchPM", text: params.button.text, start_param: params.button.startParameter }) : undefined, gallery: params?.isGallery ? true : undefined, next_offset: params?.nextOffset });
57
48
  }
58
49
  static canHandleUpdate(update) {
59
- return update instanceof _2_tl_js_1.types.UpdateBotInlineQuery || update instanceof _2_tl_js_1.types.UpdateBotInlineSend;
50
+ return (0, _2_tl_js_1.is)("updateBotInlineQuery", update) || (0, _2_tl_js_1.is)("updateBotInlineSend", update);
60
51
  }
61
52
  async handleUpdate(update) {
62
- if (update instanceof _2_tl_js_1.types.UpdateBotInlineQuery) {
53
+ if ((0, _2_tl_js_1.is)("updateBotInlineQuery", update)) {
63
54
  return { inlineQuery: await (0, _3_types_js_1.constructInlineQuery)(update, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").getEntity) };
64
55
  }
65
- else if (update instanceof _2_tl_js_1.types.UpdateBotInlineSend) {
56
+ else if ((0, _2_tl_js_1.is)("updateBotInlineSend", update)) {
66
57
  return { chosenInlineResult: await (0, _3_types_js_1.constructChosenInlineResult)(update, __classPrivateFieldGet(this, _InlineQueryManager_c, "f").getEntity) };
67
58
  }
68
59
  else {
@@ -78,7 +69,7 @@ class InlineQueryManager {
78
69
  return (0, _3_types_js_1.constructInlineQueryAnswer)(maybeResults[0]);
79
70
  }
80
71
  const then = new Date();
81
- const results = await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").api.messages.getInlineBotResults({ bot, peer, query, offset });
72
+ const results = await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").invoke({ _: "messages.getInlineBotResults", bot, peer, query, offset });
82
73
  if (results.cache_time > 0) {
83
74
  await __classPrivateFieldGet(this, _InlineQueryManager_c, "f").messageStorage.setInlineQueryAnswer(botId, peerId, query, offset, results, then);
84
75
  }
@@ -17,7 +17,7 @@
17
17
  * You should have received a copy of the GNU Lesser General Public License
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
- import { enums, types } from "../2_tl.js";
20
+ import { Api } from "../2_tl.js";
21
21
  import { ID, Story, Update } from "../3_types.js";
22
22
  import { InputStoryContent } from "../types/1_input_story_content.js";
23
23
  import { CreateStoryParams } from "./0_params.js";
@@ -28,7 +28,7 @@ type C = C_ & {
28
28
  fileManager: FileManager;
29
29
  messageManager: MessageManager;
30
30
  };
31
- type StoryManagerUpdate = types.UpdateStory;
31
+ type StoryManagerUpdate = Api.updateStory;
32
32
  export declare class StoryManager {
33
33
  #private;
34
34
  constructor(c: C);
@@ -41,7 +41,7 @@ export declare class StoryManager {
41
41
  addStoryToHighlights(chatId: ID, storyId: number): Promise<void>;
42
42
  removeStoriesFromHighlights(chatId: ID, storyIds: number[]): Promise<void>;
43
43
  removeStoryFromHighlights(chatId: ID, storyId: number): Promise<void>;
44
- static canHandleUpdate(update: enums.Update): update is StoryManagerUpdate;
44
+ static canHandleUpdate(update: Api.Update): update is StoryManagerUpdate;
45
45
  handleUpdate(update: StoryManagerUpdate): Promise<Update | null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