@mtkruto/node 0.1.191 → 0.1.201

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 (265) hide show
  1. package/esm/1_utilities.d.ts +1 -1
  2. package/esm/1_utilities.js +1 -1
  3. package/esm/2_tl.d.ts +6 -6
  4. package/esm/2_tl.js +6 -6
  5. package/esm/3_storage.d.ts +5 -5
  6. package/esm/3_storage.js +5 -5
  7. package/esm/3_types.d.ts +6 -5
  8. package/esm/3_types.js +6 -5
  9. package/esm/4_constants.d.ts +2 -2
  10. package/esm/4_constants.js +2 -2
  11. package/esm/5_client.d.ts +1 -1
  12. package/esm/5_client.js +1 -1
  13. package/esm/client/0_params.d.ts +7 -1
  14. package/esm/client/0_types.d.ts +1 -0
  15. package/esm/client/0_utilities.d.ts +0 -3
  16. package/esm/client/0_utilities.js +0 -20
  17. package/esm/client/1_business_connection_manager.d.ts +11 -0
  18. package/esm/client/1_business_connection_manager.js +47 -0
  19. package/esm/client/1_update_manager.d.ts +8 -1
  20. package/esm/client/1_update_manager.js +88 -8
  21. package/esm/client/2_message_manager.d.ts +7 -6
  22. package/esm/client/2_message_manager.js +48 -31
  23. package/esm/client/4_client.d.ts +426 -428
  24. package/esm/client/4_client.js +570 -530
  25. package/esm/storage/0_storage.d.ts +5 -0
  26. package/esm/storage/0_storage.js +20 -0
  27. package/esm/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +1 -1
  28. package/esm/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +1 -1
  29. package/{script/storage/1_storage_memory.d.ts → esm/storage/2_storage_memory.d.ts} +1 -4
  30. package/esm/storage/{1_storage_memory.js → 2_storage_memory.js} +8 -28
  31. package/esm/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +1 -1
  32. package/esm/tl/2_types.d.ts +1071 -183
  33. package/esm/tl/2_types.js +2916 -464
  34. package/esm/tl/3_functions.d.ts +381 -17
  35. package/esm/tl/3_functions.js +1002 -120
  36. package/{script/tl/4_tl_writer.d.ts → esm/tl/5_tl_writer.d.ts} +1 -1
  37. package/{script/tl/4_rpc_result.d.ts → esm/tl/6_rpc_result.d.ts} +1 -1
  38. package/esm/tl/{4_rpc_result.js → 6_rpc_result.js} +1 -1
  39. package/esm/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
  40. package/esm/tl/{6_message.js → 7_message.js} +3 -3
  41. package/esm/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
  42. package/esm/tl/{7_message_container.js → 8_message_container.js} +3 -3
  43. package/esm/types/0_chat_photo.js +1 -1
  44. package/esm/types/0_message_entity.d.ts +1 -1
  45. package/esm/types/0_thumbnail.js +1 -1
  46. package/esm/types/1_bot_command_scope.d.ts +1 -1
  47. package/esm/types/1_photo.js +2 -2
  48. package/esm/types/1_story_privacy.d.ts +1 -1
  49. package/esm/types/2_business_connection.d.ts +11 -0
  50. package/esm/types/2_business_connection.js +12 -0
  51. package/esm/types/2_chat_member.d.ts +1 -1
  52. package/esm/types/2_chosen_inline_result.d.ts +1 -1
  53. package/esm/types/2_game.js +1 -1
  54. package/esm/types/2_inline_keyboard_button.d.ts +1 -1
  55. package/esm/types/2_inline_query.d.ts +1 -1
  56. package/esm/types/2_invite_link.d.ts +1 -1
  57. package/esm/types/2_message_reaction_count.d.ts +1 -1
  58. package/esm/types/2_message_reactions.d.ts +1 -1
  59. package/esm/types/2_story_content.js +1 -1
  60. package/esm/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
  61. package/esm/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +1 -1
  62. package/esm/types/3_chat_member_updated.d.ts +1 -1
  63. package/esm/types/3_reply_markup.d.ts +1 -1
  64. package/esm/types/3_story.d.ts +2 -2
  65. package/esm/types/3_story.js +1 -1
  66. package/esm/types/4_inline_query_result.d.ts +1 -1
  67. package/esm/types/4_inline_query_result.js +1 -1
  68. package/esm/types/4_message.d.ts +9 -3
  69. package/esm/types/4_message.js +22 -5
  70. package/esm/types/5_callback_query.d.ts +1 -1
  71. package/esm/types/5_chat.d.ts +1 -1
  72. package/esm/types/6_update.d.ts +12 -2
  73. package/package.json +1 -1
  74. package/script/1_utilities.d.ts +1 -1
  75. package/script/1_utilities.js +1 -1
  76. package/script/2_tl.d.ts +6 -6
  77. package/script/2_tl.js +6 -6
  78. package/script/3_storage.d.ts +5 -5
  79. package/script/3_storage.js +5 -5
  80. package/script/3_types.d.ts +6 -5
  81. package/script/3_types.js +6 -5
  82. package/script/4_constants.d.ts +2 -2
  83. package/script/4_constants.js +2 -2
  84. package/script/5_client.d.ts +1 -1
  85. package/script/5_client.js +1 -1
  86. package/script/client/0_params.d.ts +7 -1
  87. package/script/client/0_types.d.ts +1 -0
  88. package/script/client/0_utilities.d.ts +0 -3
  89. package/script/client/0_utilities.js +1 -23
  90. package/script/client/1_business_connection_manager.d.ts +11 -0
  91. package/script/client/1_business_connection_manager.js +51 -0
  92. package/script/client/1_update_manager.d.ts +8 -1
  93. package/script/client/1_update_manager.js +88 -8
  94. package/script/client/2_message_manager.d.ts +7 -6
  95. package/script/client/2_message_manager.js +47 -30
  96. package/script/client/4_client.d.ts +426 -428
  97. package/script/client/4_client.js +570 -530
  98. package/script/storage/0_storage.d.ts +5 -0
  99. package/script/storage/0_storage.js +20 -0
  100. package/script/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +7 -7
  101. package/script/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +10 -10
  102. package/{esm/storage/1_storage_memory.d.ts → script/storage/2_storage_memory.d.ts} +1 -4
  103. package/script/storage/{1_storage_memory.js → 2_storage_memory.js} +12 -32
  104. package/script/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +10 -10
  105. package/script/tl/2_types.d.ts +1071 -183
  106. package/script/tl/2_types.js +3028 -504
  107. package/script/tl/3_functions.d.ts +381 -17
  108. package/script/tl/3_functions.js +1047 -143
  109. package/{esm/tl/4_tl_writer.d.ts → script/tl/5_tl_writer.d.ts} +1 -1
  110. package/{esm/tl/4_rpc_result.d.ts → script/tl/6_rpc_result.d.ts} +1 -1
  111. package/script/tl/{4_rpc_result.js → 6_rpc_result.js} +2 -2
  112. package/script/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
  113. package/script/tl/{6_message.js → 7_message.js} +8 -8
  114. package/script/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
  115. package/script/tl/{7_message_container.js → 8_message_container.js} +7 -7
  116. package/script/types/0_chat_photo.js +9 -9
  117. package/script/types/0_message_entity.d.ts +1 -1
  118. package/script/types/0_thumbnail.js +6 -6
  119. package/script/types/1_bot_command_scope.d.ts +1 -1
  120. package/script/types/1_photo.js +7 -7
  121. package/script/types/1_story_privacy.d.ts +1 -1
  122. package/script/types/2_business_connection.d.ts +11 -0
  123. package/script/types/2_business_connection.js +16 -0
  124. package/script/types/2_chat_member.d.ts +1 -1
  125. package/script/types/2_chosen_inline_result.d.ts +1 -1
  126. package/script/types/2_game.js +3 -3
  127. package/script/types/2_inline_keyboard_button.d.ts +1 -1
  128. package/script/types/2_inline_query.d.ts +1 -1
  129. package/script/types/2_invite_link.d.ts +1 -1
  130. package/script/types/2_message_reaction_count.d.ts +1 -1
  131. package/script/types/2_message_reactions.d.ts +1 -1
  132. package/script/types/2_story_content.js +4 -4
  133. package/script/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
  134. package/script/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +2 -2
  135. package/script/types/3_chat_member_updated.d.ts +1 -1
  136. package/script/types/3_reply_markup.d.ts +1 -1
  137. package/script/types/3_story.d.ts +2 -2
  138. package/script/types/3_story.js +2 -2
  139. package/script/types/4_inline_query_result.d.ts +1 -1
  140. package/script/types/4_inline_query_result.js +2 -2
  141. package/script/types/4_message.d.ts +9 -3
  142. package/script/types/4_message.js +37 -20
  143. package/script/types/5_callback_query.d.ts +1 -1
  144. package/script/types/5_chat.d.ts +1 -1
  145. package/script/types/6_update.d.ts +12 -2
  146. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
  147. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -203
  148. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
  149. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -274
  150. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
  151. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -51
  152. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
  153. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -191
  154. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
  155. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -385
  156. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
  157. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -431
  158. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
  159. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1046
  160. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
  161. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -52
  162. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
  163. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -122
  164. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
  165. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -24
  166. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
  167. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -121
  168. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
  169. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -30
  170. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
  171. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2127
  172. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
  173. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -108
  174. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
  175. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -1
  176. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
  177. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -95
  178. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
  179. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -128
  180. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
  181. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -110
  182. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
  183. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -120
  184. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
  185. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -6
  186. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
  187. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -110
  188. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
  189. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -75
  190. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
  191. package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -101
  192. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
  193. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -207
  194. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
  195. package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -301
  196. package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
  197. package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -55
  198. package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
  199. package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -222
  200. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
  201. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -404
  202. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
  203. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -438
  204. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
  205. package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1052
  206. package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
  207. package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -88
  208. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
  209. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -128
  210. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
  211. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -30
  212. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
  213. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -129
  214. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
  215. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -32
  216. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
  217. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2129
  218. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
  219. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -110
  220. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
  221. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -3
  222. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
  223. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -114
  224. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
  225. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -134
  226. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
  227. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -118
  228. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
  229. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -129
  230. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
  231. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -22
  232. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
  233. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -119
  234. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
  235. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -86
  236. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
  237. package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -112
  238. /package/esm/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
  239. /package/esm/storage/{0_utilities.js → 1_utilities.js} +0 -0
  240. /package/esm/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
  241. /package/esm/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
  242. /package/esm/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
  243. /package/esm/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
  244. /package/esm/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
  245. /package/esm/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
  246. /package/esm/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
  247. /package/esm/types/{0_venue.js → 1_venue.js} +0 -0
  248. /package/esm/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
  249. /package/esm/types/{0__file_id.js → _file_id.js} +0 -0
  250. /package/esm/types/{1__getters.d.ts → _getters.d.ts} +0 -0
  251. /package/esm/types/{1__getters.js → _getters.js} +0 -0
  252. /package/script/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
  253. /package/script/storage/{0_utilities.js → 1_utilities.js} +0 -0
  254. /package/script/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
  255. /package/script/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
  256. /package/script/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
  257. /package/script/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
  258. /package/script/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
  259. /package/script/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
  260. /package/script/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
  261. /package/script/types/{0_venue.js → 1_venue.js} +0 -0
  262. /package/script/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
  263. /package/script/types/{0__file_id.js → _file_id.js} +0 -0
  264. /package/script/types/{1__getters.d.ts → _getters.d.ts} +0 -0
  265. /package/script/types/{1__getters.js → _getters.js} +0 -0
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _Client_instances, _Client_client, _Client_guaranteeUpdateDelivery, _Client_updateManager, _Client_networkStatisticsManager, _Client_botInfoManager, _Client_fileManager, _Client_reactionManager, _Client_messageManager, _Client_storyManager, _Client_callbackQueryManager, _Client_inlineQueryManager, _Client_chatListManager, _Client_accountManager, _Client_parseMode, _Client_publicKeys, _Client_ignoreOutgoing, _Client_storeMessages, _Client_Lauthorize, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_namespaceProxies, _Client_getApiId, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_pingLoopStarted, _Client_pingLoopAbortController, _Client_pingInterval, _Client_lastUpdates, _Client_startPingLoop, _Client_pingLoop, _Client_invoke, _Client_handleInvokeError, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
12
+ var _Client_instances, _Client_client, _Client_guaranteeUpdateDelivery, _Client_updateManager, _Client_networkStatisticsManager, _Client_botInfoManager, _Client_fileManager, _Client_reactionManager, _Client_businessConnectionManager, _Client_messageManager, _Client_storyManager, _Client_callbackQueryManager, _Client_inlineQueryManager, _Client_chatListManager, _Client_accountManager, _Client_parseMode, _Client_publicKeys, _Client_ignoreOutgoing, _Client_storeMessages, _Client_Lauthorize, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_namespaceProxies, _Client_getApiId, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_pingLoopStarted, _Client_pingLoopAbortController, _Client_pingInterval, _Client_lastUpdates, _Client_startPingLoop, _Client_pingLoop, _Client_invoke, _Client_handleInvokeError, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
13
13
  import { AccessError, InputError } from "../0_errors.js";
14
14
  import { cleanObject, drop, getLogger, getRandomId, mustPrompt, mustPromptOneOf, UNREACHABLE, ZERO_CHANNEL_ID } from "../1_utilities.js";
15
15
  import { as, chatIdToPeerId, functions, getChatIdPeerType, name, peerToChatId, types } from "../2_tl.js";
@@ -21,6 +21,7 @@ import { checkPassword } from "./0_password.js";
21
21
  import { getUsername, resolve } from "./0_utilities.js";
22
22
  import { AccountManager } from "./1_account_manager.js";
23
23
  import { BotInfoManager } from "./1_bot_info_manager.js";
24
+ import { BusinessConnectionManager } from "./1_business_connection_manager.js";
24
25
  import { ClientEncrypted } from "./1_client_encrypted.js";
25
26
  import { ClientPlain } from "./1_client_plain.js";
26
27
  import { Composer as Composer_ } from "./1_composer.js";
@@ -77,6 +78,7 @@ export class Client extends Composer {
77
78
  _Client_botInfoManager.set(this, void 0);
78
79
  _Client_fileManager.set(this, void 0);
79
80
  _Client_reactionManager.set(this, void 0);
81
+ _Client_businessConnectionManager.set(this, void 0);
80
82
  _Client_messageManager.set(this, void 0);
81
83
  _Client_storyManager.set(this, void 0);
82
84
  _Client_callbackQueryManager.set(this, void 0);
@@ -200,7 +202,7 @@ export class Client extends Composer {
200
202
  const reactions = "messageInteractions" in update ? update.messageInteractions : undefined;
201
203
  const mustGetMsg = () => {
202
204
  if (msg !== undefined) {
203
- return { chatId: msg.chat.id, messageId: msg.id, senderId: (msg.from ?? msg.senderChat)?.id };
205
+ return { chatId: msg.chat.id, messageId: msg.id, businessConnectionId: msg.businessConnectionId, senderId: (msg.from ?? msg.senderChat)?.id };
204
206
  }
205
207
  else if (reactions !== undefined) {
206
208
  return { chatId: reactions.chatId, messageId: reactions.messageId };
@@ -259,74 +261,74 @@ export class Client extends Composer {
259
261
  return () => update;
260
262
  },
261
263
  reply: (text, params) => {
262
- const { chatId, messageId } = mustGetMsg();
264
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
263
265
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
264
- return this.sendMessage(chatId, text, { ...params, replyToMessageId });
266
+ return this.sendMessage(chatId, text, { ...params, replyToMessageId, businessConnectionId });
265
267
  },
266
268
  replyPoll: (question, options, params) => {
267
- const { chatId, messageId } = mustGetMsg();
269
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
268
270
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
269
- return this.sendPoll(chatId, question, options, { ...params, replyToMessageId });
271
+ return this.sendPoll(chatId, question, options, { ...params, replyToMessageId, businessConnectionId });
270
272
  },
271
273
  replyPhoto: (photo, params) => {
272
- const { chatId, messageId } = mustGetMsg();
274
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
273
275
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
274
- return this.sendPhoto(chatId, photo, { ...params, replyToMessageId });
276
+ return this.sendPhoto(chatId, photo, { ...params, replyToMessageId, businessConnectionId });
275
277
  },
276
278
  replyDocument: (document, params) => {
277
- const { chatId, messageId } = mustGetMsg();
279
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
278
280
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
279
- return this.sendDocument(chatId, document, { ...params, replyToMessageId });
281
+ return this.sendDocument(chatId, document, { ...params, replyToMessageId, businessConnectionId });
280
282
  },
281
283
  replySticker: (sticker, params) => {
282
- const { chatId, messageId } = mustGetMsg();
284
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
283
285
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
284
- return this.sendSticker(chatId, sticker, { ...params, replyToMessageId });
286
+ return this.sendSticker(chatId, sticker, { ...params, replyToMessageId, businessConnectionId });
285
287
  },
286
288
  replyContact: (firstName, number, params) => {
287
- const { chatId, messageId } = mustGetMsg();
289
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
288
290
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
289
- return this.sendContact(chatId, firstName, number, { ...params, replyToMessageId });
291
+ return this.sendContact(chatId, firstName, number, { ...params, replyToMessageId, businessConnectionId });
290
292
  },
291
293
  replyLocation: (latitude, longitude, params) => {
292
- const { chatId, messageId } = mustGetMsg();
294
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
293
295
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
294
- return this.sendLocation(chatId, latitude, longitude, { ...params, replyToMessageId });
296
+ return this.sendLocation(chatId, latitude, longitude, { ...params, replyToMessageId, businessConnectionId });
295
297
  },
296
298
  replyDice: (params) => {
297
- const { chatId, messageId } = mustGetMsg();
299
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
298
300
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
299
- return this.sendDice(chatId, { ...params, replyToMessageId });
301
+ return this.sendDice(chatId, { ...params, replyToMessageId, businessConnectionId });
300
302
  },
301
303
  replyVenue: (latitude, longitude, title, address, params) => {
302
- const { chatId, messageId } = mustGetMsg();
304
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
303
305
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
304
- return this.sendVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId });
306
+ return this.sendVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId, businessConnectionId });
305
307
  },
306
308
  replyVideo: (video, params) => {
307
- const { chatId, messageId } = mustGetMsg();
309
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
308
310
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
309
- return this.sendVideo(chatId, video, { ...params, replyToMessageId });
311
+ return this.sendVideo(chatId, video, { ...params, replyToMessageId, businessConnectionId });
310
312
  },
311
313
  replyAnimation: (document, params) => {
312
- const { chatId, messageId } = mustGetMsg();
314
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
313
315
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
314
- return this.sendAnimation(chatId, document, { ...params, replyToMessageId });
316
+ return this.sendAnimation(chatId, document, { ...params, replyToMessageId, businessConnectionId });
315
317
  },
316
318
  replyVoice: (document, params) => {
317
- const { chatId, messageId } = mustGetMsg();
319
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
318
320
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
319
- return this.sendVoice(chatId, document, { ...params, replyToMessageId });
321
+ return this.sendVoice(chatId, document, { ...params, replyToMessageId, businessConnectionId });
320
322
  },
321
323
  replyAudio: (document, params) => {
322
- const { chatId, messageId } = mustGetMsg();
324
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
323
325
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
324
- return this.sendAudio(chatId, document, { ...params, replyToMessageId });
326
+ return this.sendAudio(chatId, document, { ...params, replyToMessageId, businessConnectionId });
325
327
  },
326
328
  replyVideoNote: (videoNote, params) => {
327
- const { chatId, messageId } = mustGetMsg();
329
+ const { chatId, messageId, businessConnectionId } = mustGetMsg();
328
330
  const replyToMessageId = getReplyToMessageId(params?.quote, chatId, messageId);
329
- return this.sendVideoNote(chatId, videoNote, { ...params, replyToMessageId });
331
+ return this.sendVideoNote(chatId, videoNote, { ...params, replyToMessageId, businessConnectionId });
330
332
  },
331
333
  delete: () => {
332
334
  const { chatId, messageId } = mustGetMsg();
@@ -531,6 +533,13 @@ export class Client extends Composer {
531
533
  const { chatId } = mustGetMsg();
532
534
  return this.deleteChatStickerSet(chatId);
533
535
  },
536
+ getBusinessConnection: () => {
537
+ const { businessConnectionId } = mustGetMsg();
538
+ if (!businessConnectionId) {
539
+ UNREACHABLE();
540
+ }
541
+ return this.getBusinessConnection(businessConnectionId);
542
+ },
534
543
  };
535
544
  return cleanObject(context);
536
545
  });
@@ -636,6 +645,14 @@ export class Client extends Composer {
636
645
  const c = {
637
646
  id,
638
647
  api: this.api,
648
+ invoke: async (function_, businessConnectionId) => {
649
+ if (businessConnectionId) {
650
+ return await this.api.invokeWithBusinessConnection({ connection_id: businessConnectionId, query: function_ });
651
+ }
652
+ else {
653
+ return await this.invoke(function_);
654
+ }
655
+ },
639
656
  storage: this.storage,
640
657
  messageStorage: this.messageStorage,
641
658
  guaranteeUpdateDelivery: __classPrivateFieldGet(this, _Client_guaranteeUpdateDelivery, "f"),
@@ -664,8 +681,7 @@ export class Client extends Composer {
664
681
  if (ctx.error instanceof AuthKeyUnregistered && dcId) {
665
682
  try {
666
683
  const exportedAuth = await this.api.auth.exportAuthorization({ dc_id: dcId });
667
- await client.authorize(exportedAuth);
668
- // throw 1;
684
+ await client.api.auth.importAuthorization(exportedAuth);
669
685
  return true;
670
686
  }
671
687
  catch (err) {
@@ -700,6 +716,7 @@ export class Client extends Composer {
700
716
  __classPrivateFieldSet(this, _Client_botInfoManager, new BotInfoManager(c), "f");
701
717
  __classPrivateFieldSet(this, _Client_fileManager, new FileManager(c), "f");
702
718
  __classPrivateFieldSet(this, _Client_reactionManager, new ReactionManager(c), "f");
719
+ __classPrivateFieldSet(this, _Client_businessConnectionManager, new BusinessConnectionManager(c), "f");
703
720
  __classPrivateFieldSet(this, _Client_messageManager, new MessageManager({ ...c, fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f") }), "f");
704
721
  __classPrivateFieldSet(this, _Client_callbackQueryManager, new CallbackQueryManager({ ...c, messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
705
722
  __classPrivateFieldSet(this, _Client_storyManager, new StoryManager({ ...c, fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f"), messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
@@ -814,7 +831,7 @@ export class Client extends Composer {
814
831
  }
815
832
  await this.connect();
816
833
  }
817
- async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_storeMessages = new WeakMap(), _Client_Lauthorize = new WeakMap(), _Client_LpingLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_L$initConncetion = new WeakMap(), _Client_namespaceProxies = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_pingLoopAbortController = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_instances = new WeakSet(), _Client_getApiId = async function _Client_getApiId() {
834
+ async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_businessConnectionManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_storeMessages = new WeakMap(), _Client_Lauthorize = new WeakMap(), _Client_LpingLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_L$initConncetion = new WeakMap(), _Client_namespaceProxies = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_pingLoopAbortController = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_instances = new WeakSet(), _Client_getApiId = async function _Client_getApiId() {
818
835
  const apiId = this.apiId || await this.storage.getApiId();
819
836
  if (!apiId) {
820
837
  throw new Error("apiId not set");
@@ -845,21 +862,18 @@ export class Client extends Composer {
845
862
  __classPrivateFieldGet(this, _Client_pingLoopAbortController, "f")?.abort();
846
863
  }
847
864
  /**
848
- * Calls [initConnection](1) and authorizes the client with one of the following:
865
+ * Authorizes the client with one of the following:
849
866
  *
850
867
  * - Bot token (`string`)
851
- * - Exported authorization (`types.AuthExportedAuthorization`)
852
868
  * - User authorization handlers (`AuthorizeUserParams`)
853
869
  *
854
- * if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](2).
870
+ * if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](1).
855
871
  *
856
872
  * Notes:
857
873
  * 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
858
874
  * 2. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
859
- * 3. The parameters passed to the [initConnection][1] call can be configured with the last parameter of the constructor.
860
875
  *
861
- * [1]: https://core.telegram.org/method/initConnection
862
- * [2]: https://core.telegram.org/method/updates.getState
876
+ * [1]: https://core.telegram.org/method/updates.getState
863
877
  */
864
878
  async authorize(params) {
865
879
  try {
@@ -911,11 +925,6 @@ export class Client extends Composer {
911
925
  await __classPrivateFieldGet(this, _Client_updateManager, "f").fetchState("authorize");
912
926
  return;
913
927
  }
914
- if (params instanceof types.auth.ExportedAuthorization) {
915
- await this.api.auth.importAuthorization({ id: params.id, bytes: params.bytes });
916
- __classPrivateFieldGet(this, _Client_Lauthorize, "f").debug("authorization imported");
917
- return;
918
- }
919
928
  auth: while (true) {
920
929
  try {
921
930
  let phone;
@@ -1056,7 +1065,7 @@ export class Client extends Composer {
1056
1065
  inputPeer.access_hash = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getUserAccessHash).call(this, inputPeer.user_id);
1057
1066
  }
1058
1067
  }
1059
- else {
1068
+ if ((inputPeer instanceof types.InputPeerUser || inputPeer instanceof types.InputPeerChannel && inputPeer.access_hash == 0n) && await this.storage.getAccountType() == "user") {
1060
1069
  throw new AccessError(`Cannot access the chat ${id} because there is no access hash for it.`);
1061
1070
  }
1062
1071
  return inputPeer;
@@ -1249,6 +1258,77 @@ export class Client extends Composer {
1249
1258
  }
1250
1259
  return await this.messageStorage.getEntity(id);
1251
1260
  }
1261
+ //
1262
+ // ========================= ACCOUNT ========================= //
1263
+ //
1264
+ /**
1265
+ * Get information on the currently authorized user.
1266
+ *
1267
+ * @method ac
1268
+ */
1269
+ async getMe() {
1270
+ let user_ = await this[getEntity](new types.PeerUser({ user_id: BigInt(await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getSelfId).call(this)) }));
1271
+ if (user_ == null) {
1272
+ const users = await this.api.users.getUsers({ id: [new types.InputUserSelf()] });
1273
+ user_ = users[0][as](types.User);
1274
+ await this.messageStorage.setEntity(user_);
1275
+ }
1276
+ const user = constructUser(user_);
1277
+ __classPrivateFieldSet(this, _Client_lastGetMe, user, "f");
1278
+ return user;
1279
+ }
1280
+ /**
1281
+ * Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
1282
+ *
1283
+ * @method ac
1284
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
1285
+ * @param username The username to show.
1286
+ */
1287
+ async showUsername(id, username) {
1288
+ await __classPrivateFieldGet(this, _Client_accountManager, "f").showUsername(id, username);
1289
+ }
1290
+ /**
1291
+ * Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
1292
+ *
1293
+ * @method ac
1294
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
1295
+ * @param username The username to hide.
1296
+ */
1297
+ async hideUsername(id, username) {
1298
+ await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsername(id, username);
1299
+ }
1300
+ /**
1301
+ * Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
1302
+ *
1303
+ * @method ac
1304
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
1305
+ * @param order The new order to use.
1306
+ * @returns Whether the order was changed.
1307
+ */
1308
+ async reorderUsernames(id, order) {
1309
+ return await __classPrivateFieldGet(this, _Client_accountManager, "f").reorderUsernames(id, order);
1310
+ }
1311
+ /**
1312
+ * Hide all usernames from the a supergroup or a channel's profile. User-only.
1313
+ *
1314
+ * @method ac
1315
+ * @param id A supergroup ID or a channel ID.
1316
+ */
1317
+ async hideUsernames(id) {
1318
+ return await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsernames(id);
1319
+ }
1320
+ /**
1321
+ * Get a business connection. Bot-only.
1322
+ *
1323
+ * @method ac
1324
+ * @param id The identifier of the business connection.
1325
+ */
1326
+ async getBusinessConnection(id) {
1327
+ return await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").getBusinessConnection(id);
1328
+ }
1329
+ //
1330
+ // ========================= MESSAGES ========================= //
1331
+ //
1252
1332
  /**
1253
1333
  * Send a text message.
1254
1334
  *
@@ -1260,6 +1340,154 @@ export class Client extends Composer {
1260
1340
  async sendMessage(chatId, text, params) {
1261
1341
  return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendMessage(chatId, text, params);
1262
1342
  }
1343
+ /**
1344
+ * Send a photo.
1345
+ *
1346
+ * @method ms
1347
+ * @param chatId The chat to send the photo to.
1348
+ * @param photo The photo to send.
1349
+ * @returns The sent photo.
1350
+ */
1351
+ async sendPhoto(chatId, photo, params) {
1352
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendPhoto(chatId, photo, params);
1353
+ }
1354
+ /**
1355
+ * Send a document.
1356
+ *
1357
+ * @method ms
1358
+ * @param chatId The chat to send the document to.
1359
+ * @param document The document to send.
1360
+ * @returns The sent document.
1361
+ */
1362
+ async sendDocument(chatId, document, params) {
1363
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendDocument(chatId, document, params);
1364
+ }
1365
+ /**
1366
+ * Send a sticker.
1367
+ *
1368
+ * @method ms
1369
+ * @param chatId The chat to send the sticker to.
1370
+ * @param document The sticker to send.
1371
+ * @returns The sent sticker.
1372
+ */
1373
+ async sendSticker(chatId, sticker, params) {
1374
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendSticker(chatId, sticker, params);
1375
+ }
1376
+ /**
1377
+ * Send a video.
1378
+ *
1379
+ * @method ms
1380
+ * @param chatId The chat to send the video to.
1381
+ * @param video The video to send.
1382
+ * @returns The sent video.
1383
+ */
1384
+ async sendVideo(chatId, video, params) {
1385
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVideo(chatId, video, params);
1386
+ }
1387
+ /**
1388
+ * Send an animation.
1389
+ *
1390
+ * @method ms
1391
+ * @param chatId The chat to send the animation to.
1392
+ * @param animation The animation to send.
1393
+ * @returns The sent animation.
1394
+ */
1395
+ async sendAnimation(chatId, animation, params) {
1396
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendAnimation(chatId, animation, params);
1397
+ }
1398
+ /**
1399
+ * Send a voice message.
1400
+ *
1401
+ * @method ms
1402
+ * @param chatId The chat to send the voice message to.
1403
+ * @param voice The voice to send.
1404
+ * @returns The sent voice message.
1405
+ */
1406
+ async sendVoice(chatId, voice, params) {
1407
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVoice(chatId, voice, params);
1408
+ }
1409
+ /**
1410
+ * Send an audio file.
1411
+ *
1412
+ * @method ms
1413
+ * @param chatId The chat to send the audio file to.
1414
+ * @param audio The audio to send.
1415
+ * @returns The sent audio filr.
1416
+ */
1417
+ async sendAudio(chatId, audio, params) {
1418
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendAudio(chatId, audio, params);
1419
+ }
1420
+ /**
1421
+ * Send a video note.
1422
+ *
1423
+ * @method ms
1424
+ * @param chatId The chat to send the video note to.
1425
+ * @param videoNote The video note to send.
1426
+ * @returns The sent video note.
1427
+ */
1428
+ async sendVideoNote(chatId, videoNote, params) {
1429
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVideoNote(chatId, videoNote, params);
1430
+ }
1431
+ /**
1432
+ * Send a location.
1433
+ *
1434
+ * @method ms
1435
+ * @param chatId The chat to send the location to.
1436
+ * @param latitude The location's latitude.
1437
+ * @param longitude The location's longitude.
1438
+ * @returns The sent location.
1439
+ */
1440
+ async sendLocation(chatId, latitude, longitude, params) {
1441
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendLocation(chatId, latitude, longitude, params);
1442
+ }
1443
+ /**
1444
+ * Send a contact.
1445
+ *
1446
+ * @method ms
1447
+ * @param chatId The chat to send the contact to.
1448
+ * @param firstName The contact's first name.
1449
+ * @param number The contact's phone number.
1450
+ * @returns The sent contact.
1451
+ */
1452
+ async sendContact(chatId, firstName, number, params) {
1453
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendContact(chatId, firstName, number, params);
1454
+ }
1455
+ /**
1456
+ * Send a dice.
1457
+ *
1458
+ * @method ms
1459
+ * @param chatId The chat to send the dice to.
1460
+ * @returns The sent dice.
1461
+ */
1462
+ async sendDice(chatId, params) {
1463
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendDice(chatId, params);
1464
+ }
1465
+ /**
1466
+ * Send a venue.
1467
+ *
1468
+ * @method ms
1469
+ * @param chatId The chat to send the venue to.
1470
+ * @param latitude The latitude of the venue.
1471
+ * @param longitude The longitude of the venue.
1472
+ * @param title The title of the venue.
1473
+ * @param address The written address of the venue.
1474
+ * @returns The sent venue.
1475
+ */
1476
+ async sendVenue(chatId, latitude, longitude, title, address, params) {
1477
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVenue(chatId, latitude, longitude, title, address, params);
1478
+ }
1479
+ /**
1480
+ * Send a poll.
1481
+ *
1482
+ * @method ms
1483
+ * @param chatId The chat to send the poll to.
1484
+ * @param question The poll's question.
1485
+ * @param options The poll's options.
1486
+ * @returns The sent poll.
1487
+ */
1488
+ async sendPoll(chatId, question, options, params) {
1489
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendPoll(chatId, question, options, params);
1490
+ }
1263
1491
  /**
1264
1492
  * Edit a message's text.
1265
1493
  *
@@ -1356,82 +1584,87 @@ export class Client extends Composer {
1356
1584
  return await __classPrivateFieldGet(this, _Client_messageManager, "f").getMessage(chatId, messageId);
1357
1585
  }
1358
1586
  /**
1359
- * Download a file.
1587
+ * Delete multiple messages.
1360
1588
  *
1361
- * @method fs
1362
- * @param fileId The identifier of the file to download.
1363
- * @example ```ts
1364
- * for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
1365
- * await outFile.write(chunk);
1366
- * }
1367
- * ```
1368
- * @returns A generator yielding the contents of the file.
1589
+ * @method ms
1590
+ * @param chatId The identifier of the chat that contains the messages.
1591
+ * @param messageIds The identifiers of the messages to delete.
1369
1592
  */
1370
- async *download(fileId, params) {
1371
- for await (const chunk of __classPrivateFieldGet(this, _Client_fileManager, "f").download(fileId, params)) {
1372
- yield chunk;
1373
- }
1593
+ async deleteMessages(chatId, messageIds, params) {
1594
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteMessages(chatId, messageIds, params);
1374
1595
  }
1375
1596
  /**
1376
- * Forward multiple messages.
1597
+ * Delete a single message.
1377
1598
  *
1378
1599
  * @method ms
1379
- * @param from The identifier of the chat to forward the messages from.
1380
- * @param to The identifier of the chat to forward the messages to.
1381
- * @param messageIds The identifiers of the messages to forward.
1382
- * @returns The forwarded messages.
1600
+ * @param chatId The identifier of the chat that contains the message.
1601
+ * @param messageId The identifier of the message to delete.
1383
1602
  */
1384
- async forwardMessages(from, to, messageIds, params) {
1385
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").forwardMessages(from, to, messageIds, params);
1603
+ async deleteMessage(chatId, messageId, params) {
1604
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteMessages(chatId, [messageId], params);
1386
1605
  }
1387
1606
  /**
1388
- * Forward a single message.
1607
+ * Delete all messages sent by a specific member of a chat. User-only.
1389
1608
  *
1390
1609
  * @method ms
1391
- * @param from The identifier of the chat to forward the message from.
1392
- * @param to The identifier of the chat to forward the message to.
1393
- * @param messageId The identifier of the message to forward.
1394
- * @returns The forwarded message.
1610
+ * @param chatId The identifier of the chat. Must be a supergroup.
1611
+ * @param memberId The identifier of the member.
1395
1612
  */
1396
- async forwardMessage(from, to, messageId, params) {
1397
- return await this.forwardMessages(from, to, [messageId], params).then((v) => v[0]);
1613
+ async deleteChatMemberMessages(chatId, memberId) {
1614
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatMemberMessages(chatId, memberId);
1398
1615
  }
1399
1616
  /**
1400
- * Get information on the currently authorized user.
1617
+ * Pin a message in a chat.
1401
1618
  *
1402
- * @method ac
1619
+ * @method ms
1620
+ * @param chatId The identifier of the chat that contains the message.
1621
+ * @param messageId The message's identifier.
1403
1622
  */
1404
- async getMe() {
1405
- let user_ = await this[getEntity](new types.PeerUser({ user_id: BigInt(await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getSelfId).call(this)) }));
1406
- if (user_ == null) {
1407
- const users = await this.api.users.getUsers({ id: [new types.InputUserSelf()] });
1408
- user_ = users[0][as](types.User);
1409
- await this.messageStorage.setEntity(user_);
1410
- }
1411
- const user = constructUser(user_);
1412
- __classPrivateFieldSet(this, _Client_lastGetMe, user, "f");
1413
- return user;
1623
+ async pinMessage(chatId, messageId, params) {
1624
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").pinMessage(chatId, messageId, params);
1414
1625
  }
1415
1626
  /**
1416
- * Answer a callback query. Bot-only.
1627
+ * Unpin a pinned message.
1417
1628
  *
1418
- * @method cq
1419
- * @param id ID of the callback query to answer.
1629
+ * @method ms
1630
+ * @param chatId The identifier of the chat that contains the message.
1631
+ * @param messageId The message's identifier.
1420
1632
  */
1421
- async answerCallbackQuery(id, params) {
1422
- await __classPrivateFieldGet(this, _Client_callbackQueryManager, "f").answerCallbackQuery(id, params);
1633
+ async unpinMessage(chatId, messageId) {
1634
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").unpinMessage(chatId, messageId);
1423
1635
  }
1424
1636
  /**
1425
- * Send a poll.
1637
+ * Unpin all pinned messages.
1426
1638
  *
1427
1639
  * @method ms
1428
- * @param chatId The chat to send the poll to.
1429
- * @param question The poll's question.
1430
- * @param options The poll's options.
1431
- * @returns The sent poll.
1640
+ * @param chatId The identifier of the chat.
1432
1641
  */
1433
- async sendPoll(chatId, question, options, params) {
1434
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendPoll(chatId, question, options, params);
1642
+ async unpinMessages(chatId) {
1643
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").unpinMessages(chatId);
1644
+ }
1645
+ /**
1646
+ * Forward multiple messages.
1647
+ *
1648
+ * @method ms
1649
+ * @param from The identifier of the chat to forward the messages from.
1650
+ * @param to The identifier of the chat to forward the messages to.
1651
+ * @param messageIds The identifiers of the messages to forward.
1652
+ * @returns The forwarded messages.
1653
+ */
1654
+ async forwardMessages(from, to, messageIds, params) {
1655
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").forwardMessages(from, to, messageIds, params);
1656
+ }
1657
+ /**
1658
+ * Forward a single message.
1659
+ *
1660
+ * @method ms
1661
+ * @param from The identifier of the chat to forward the message from.
1662
+ * @param to The identifier of the chat to forward the message to.
1663
+ * @param messageId The identifier of the message to forward.
1664
+ * @returns The forwarded message.
1665
+ */
1666
+ async forwardMessage(from, to, messageId, params) {
1667
+ return await this.forwardMessages(from, to, [messageId], params).then((v) => v[0]);
1435
1668
  }
1436
1669
  /**
1437
1670
  * Stop a poll.
@@ -1456,446 +1689,393 @@ export class Client extends Composer {
1456
1689
  await __classPrivateFieldGet(this, _Client_messageManager, "f").sendChatAction(chatId, action, params);
1457
1690
  }
1458
1691
  /**
1459
- * Upload a file.
1460
- *
1461
- * @method fs
1462
- * @param contents The contents of the file.
1463
- * @returns The uploaded file.
1464
- */
1465
- // deno-lint-ignore no-explicit-any
1466
- async upload(contents, params) {
1467
- return await __classPrivateFieldGet(this, _Client_fileManager, "f").upload(contents, params);
1468
- }
1469
- /**
1470
- * Set the bot's commands in the given scope and/or language. Bot-only.
1471
- *
1472
- * @method bs
1473
- * @param commands The commands to set.
1474
- */
1475
- async setMyCommands(commands, params) {
1476
- await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyCommands(commands, params);
1477
- }
1478
- /**
1479
- * Get the bot's commands in the given scope and/or language. Bot-only.
1480
- *
1481
- * @method bs
1482
- * @returns The current bot's commands in the specified language.
1483
- */
1484
- async getMyCommands(params) {
1485
- return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyCommands(params);
1486
- }
1487
- /**
1488
- * Answer an inline query. Bot-only.
1489
- *
1490
- * @method iq
1491
- * @param id The ID of the inline query to answer.
1492
- * @param results The results to answer with.
1493
- */
1494
- async answerInlineQuery(id, results, params) {
1495
- await __classPrivateFieldGet(this, _Client_inlineQueryManager, "f").answerInlineQuery(id, results, params);
1496
- }
1497
- /**
1498
- * Set the bot's description in the given language. Bot-only.
1499
- *
1500
- * @method bs
1501
- */
1502
- async setMyDescription(params) {
1503
- await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyDescription(params);
1504
- }
1505
- /**
1506
- * Set the bot's name in the given language. Bot-only.
1507
- *
1508
- * @method bs
1509
- */
1510
- async setMyName(params) {
1511
- await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyName(params);
1512
- }
1513
- /**
1514
- * Set the bot's short description in the given language. Bot-only.
1692
+ * Search the messages of a chat. User-only.
1515
1693
  *
1516
- * @method bs
1694
+ * @method ms
1695
+ * @param chatId The identifier of the chat to search the messages in.
1696
+ * @param query The message search query.
1517
1697
  */
1518
- async setMyShortDescription(params) {
1519
- await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyShortDescription(params);
1698
+ async searchMessages(chatId, query, params) {
1699
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").searchMessages(chatId, query, params);
1520
1700
  }
1701
+ //
1702
+ // ========================= FILES ========================= //
1703
+ //
1521
1704
  /**
1522
- * Get the bot's description in the given language. Bot-only.
1705
+ * Download a file.
1523
1706
  *
1524
- * @method bs
1525
- * @returns The current bot's description in the specified language.
1707
+ * @method fs
1708
+ * @param fileId The identifier of the file to download.
1709
+ * @example ```ts
1710
+ * for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
1711
+ * await outFile.write(chunk);
1712
+ * }
1713
+ * ```
1714
+ * @returns A generator yielding the contents of the file.
1526
1715
  */
1527
- async getMyDescription(params) {
1528
- return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyDescription(params);
1716
+ async *download(fileId, params) {
1717
+ for await (const chunk of __classPrivateFieldGet(this, _Client_fileManager, "f").download(fileId, params)) {
1718
+ yield chunk;
1719
+ }
1529
1720
  }
1530
1721
  /**
1531
- * Get the bot's name in the given language. Bot-only.
1722
+ * Get custom emoji documents for download.
1532
1723
  *
1533
- * @method bs
1534
- * @returns The current bot's name in the specified language.
1724
+ * @method fs
1725
+ * @param id Identifier of one or more of custom emojis.
1726
+ * @returns The custom emoji documents.
1535
1727
  */
1536
- async getMyName(params) {
1537
- return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyName(params);
1728
+ async getCustomEmojiStickers(id) {
1729
+ return await __classPrivateFieldGet(this, _Client_fileManager, "f").getCustomEmojiStickers(id);
1538
1730
  }
1731
+ //
1732
+ // ========================= CHATS ========================= //
1733
+ //
1539
1734
  /**
1540
- * Get the bot's short description in the given language. Bot-only.
1735
+ * Get chats from a chat list. User-only.
1541
1736
  *
1542
- * @method bs
1543
- * @returns The current bot's short description in the specified language.
1737
+ * @method ch
1544
1738
  */
1545
- async getMyShortDescription(params) {
1546
- return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyShortDescription(params);
1739
+ async getChats(params) {
1740
+ return await __classPrivateFieldGet(this, _Client_chatListManager, "f").getChats(params?.from, params?.after, params?.limit);
1547
1741
  }
1548
1742
  /**
1549
- * Delete multiple messages.
1743
+ * Get a chat.
1550
1744
  *
1551
- * @method ms
1552
- * @param chatId The identifier of the chat that contains the messages.
1553
- * @param messageIds The identifiers of the messages to delete.
1745
+ * @method ch
1554
1746
  */
1555
- async deleteMessages(chatId, messageIds, params) {
1556
- await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteMessages(chatId, messageIds, params);
1747
+ async getChat(chatId) {
1748
+ return await __classPrivateFieldGet(this, _Client_chatListManager, "f").getChat(chatId);
1557
1749
  }
1558
1750
  /**
1559
- * Delete a single message.
1751
+ * Get chat history. User-only.
1560
1752
  *
1561
- * @method ms
1562
- * @param chatId The identifier of the chat that contains the message.
1563
- * @param messageId The identifier of the message to delete.
1753
+ * @method ch
1754
+ * @param chatId The identifier of the chat to get its history.
1564
1755
  */
1565
- async deleteMessage(chatId, messageId, params) {
1566
- await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteMessages(chatId, [messageId], params);
1756
+ async getHistory(chatId, params) {
1757
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").getHistory(chatId, params);
1567
1758
  }
1568
1759
  /**
1569
- * Send a photo.
1760
+ * Set a chat's available reactions. User-only.
1570
1761
  *
1571
- * @method ms
1572
- * @param chatId The chat to send the photo to.
1573
- * @param photo The photo to send.
1574
- * @returns The sent photo.
1762
+ * @method ch
1763
+ * @param chatId The identifier of the chat.
1764
+ * @param availableReactions The new available reactions.
1575
1765
  */
1576
- async sendPhoto(chatId, photo, params) {
1577
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendPhoto(chatId, photo, params);
1766
+ async setAvailableReactions(chatId, availableReactions) {
1767
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").setAvailableReactions(chatId, availableReactions);
1578
1768
  }
1579
1769
  /**
1580
- * Send a document.
1770
+ * Set a chat's photo.
1581
1771
  *
1582
- * @method ms
1583
- * @param chatId The chat to send the document to.
1584
- * @param document The document to send.
1585
- * @returns The sent document.
1772
+ * @method ch
1773
+ * @param chatId The identifier of the chat.
1774
+ * @param photo A photo to set as the chat's photo.
1586
1775
  */
1587
- async sendDocument(chatId, document, params) {
1588
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendDocument(chatId, document, params);
1776
+ async setChatPhoto(chatId, photo, params) {
1777
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatPhoto(chatId, photo, params);
1589
1778
  }
1590
1779
  /**
1591
- * Send a sticker.
1780
+ * Delete a chat's photo.
1592
1781
  *
1593
- * @method ms
1594
- * @param chatId The chat to send the sticker to.
1595
- * @param document The sticker to send.
1596
- * @returns The sent sticker.
1782
+ * @method ch
1783
+ * @param chatId The identifier of the chat.
1597
1784
  */
1598
- async sendSticker(chatId, sticker, params) {
1599
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendSticker(chatId, sticker, params);
1785
+ async deleteChatPhoto(chatId) {
1786
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatPhoto(chatId);
1600
1787
  }
1601
1788
  /**
1602
- * Send a video.
1789
+ * Ban a member from a chat.
1603
1790
  *
1604
- * @method ms
1605
- * @param chatId The chat to send the video to.
1606
- * @param video The video to send.
1607
- * @returns The sent video.
1791
+ * @method ch
1792
+ * @param chatId The identifier of the chat.
1793
+ * @param memberId The identifier of the member.
1608
1794
  */
1609
- async sendVideo(chatId, video, params) {
1610
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVideo(chatId, video, params);
1795
+ async banChatMember(chatId, memberId, params) {
1796
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").banChatMember(chatId, memberId, params);
1611
1797
  }
1612
1798
  /**
1613
- * Send an animation.
1799
+ * Unban a member from a chat.
1614
1800
  *
1615
- * @method ms
1616
- * @param chatId The chat to send the animation to.
1617
- * @param animation The animation to send.
1618
- * @returns The sent animation.
1801
+ * @method ch
1802
+ * @param chatId The identifier of the chat. Must be a supergroup.
1803
+ * @param memberId The identifier of the member.
1619
1804
  */
1620
- async sendAnimation(chatId, animation, params) {
1621
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendAnimation(chatId, animation, params);
1805
+ async unbanChatMember(chatId, memberId) {
1806
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
1622
1807
  }
1623
1808
  /**
1624
- * Send a voice message.
1809
+ * Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
1625
1810
  *
1626
- * @method ms
1627
- * @param chatId The chat to send the voice message to.
1628
- * @param voice The voice to send.
1629
- * @returns The sent voice message.
1811
+ * @method ch
1812
+ * @param chatId The identifier of the chat. Must be a supergroup.
1813
+ * @param memberId The identifier of the member.
1630
1814
  */
1631
- async sendVoice(chatId, voice, params) {
1632
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVoice(chatId, voice, params);
1815
+ async kickChatMember(chatId, memberId) {
1816
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").banChatMember(chatId, memberId);
1817
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
1633
1818
  }
1634
1819
  /**
1635
- * Send an audio file.
1820
+ * Set the rights of a chat member.
1636
1821
  *
1637
- * @method ms
1638
- * @param chatId The chat to send the audio file to.
1639
- * @param audio The audio to send.
1640
- * @returns The sent audio filr.
1822
+ * @method ch
1823
+ * @param chatId The identifier of the chat. Must be a supergroup.
1824
+ * @param memberId The identifier of a member.
1641
1825
  */
1642
- async sendAudio(chatId, audio, params) {
1643
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendAudio(chatId, audio, params);
1826
+ async setChatMemberRights(chatId, memberId, params) {
1827
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatMemberRights(chatId, memberId, params);
1644
1828
  }
1645
1829
  /**
1646
- * Send a video note.
1830
+ * Get the administrators of a chat.
1647
1831
  *
1648
- * @method ms
1649
- * @param chatId The chat to send the video note to.
1650
- * @param videoNote The video note to send.
1651
- * @returns The sent video note.
1832
+ * @method ch
1833
+ * @param chatId The identifier of the chat.
1834
+ * @returns The chat's administrators.
1652
1835
  */
1653
- async sendVideoNote(chatId, videoNote, params) {
1654
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVideoNote(chatId, videoNote, params);
1836
+ async getChatAdministrators(chatId) {
1837
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatAdministrators(chatId);
1655
1838
  }
1656
1839
  /**
1657
- * Send a location.
1840
+ * Enable join requests in a chat. User-only.
1658
1841
  *
1659
- * @method ms
1660
- * @param chatId The chat to send the location to.
1661
- * @param latitude The location's latitude.
1662
- * @param longitude The location's longitude.
1663
- * @returns The sent location.
1842
+ * @method ch
1843
+ * @param chatId The identifier of the chat. Must be a channel or a supergroup.
1664
1844
  */
1665
- async sendLocation(chatId, latitude, longitude, params) {
1666
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendLocation(chatId, latitude, longitude, params);
1845
+ async enableJoinRequests(chatId) {
1846
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").enableJoinRequests(chatId);
1667
1847
  }
1668
1848
  /**
1669
- * Send a contact.
1849
+ * Disable join requests in a chat. User-only.
1670
1850
  *
1671
- * @method ms
1672
- * @param chatId The chat to send the contact to.
1673
- * @param firstName The contact's first name.
1674
- * @param number The contact's phone number.
1675
- * @returns The sent contact.
1851
+ * @method ch
1852
+ * @param chatId The identifier of the chat. Must be a channel or a supergroup.
1676
1853
  */
1677
- async sendContact(chatId, firstName, number, params) {
1678
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendContact(chatId, firstName, number, params);
1854
+ async disableJoinRequests(chatId) {
1855
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").disableJoinRequests(chatId);
1679
1856
  }
1680
1857
  /**
1681
- * Send a dice.
1858
+ * Get inactive chats. User-only.
1682
1859
  *
1683
- * @method ms
1684
- * @param chatId The chat to send the dice to.
1685
- * @returns The sent dice.
1860
+ * @method ch
1861
+ * @retuns A list of inactive chats the current user is member of.
1686
1862
  */
1687
- async sendDice(chatId, params) {
1688
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendDice(chatId, params);
1863
+ async getInactiveChats() {
1864
+ return await __classPrivateFieldGet(this, _Client_accountManager, "f").getInactiveChats();
1689
1865
  }
1690
1866
  /**
1691
- * Send a venue.
1867
+ * Get the invite links created for a chat. User-only.
1692
1868
  *
1693
- * @method ms
1694
- * @param chatId The chat to send the venue to.
1695
- * @param latitude The latitude of the venue.
1696
- * @param longitude The longitude of the venue.
1697
- * @param title The title of the venue.
1698
- * @param address The written address of the venue.
1699
- * @returns The sent venue.
1869
+ * @method ch
1870
+ * @param chatId The identifier of the chat.
1871
+ * @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
1700
1872
  */
1701
- async sendVenue(chatId, latitude, longitude, title, address, params) {
1702
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").sendVenue(chatId, latitude, longitude, title, address, params);
1873
+ async getCreatedInviteLinks(chatId, params) {
1874
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").getCreatedInviteLinks(chatId, params);
1703
1875
  }
1704
1876
  /**
1705
- * Get network statistics. This might not always be available.
1877
+ * Join a chat. User-only.
1706
1878
  *
1707
- * @method mc
1879
+ * @method ch
1880
+ * @param chatId The identifier of the chat to join.
1708
1881
  */
1709
- async getNetworkStatistics() {
1710
- return await __classPrivateFieldGet(this, _Client_networkStatisticsManager, "f").getNetworkStatistics();
1882
+ async joinChat(chatId) {
1883
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").joinChat(chatId);
1711
1884
  }
1712
1885
  /**
1713
- * Get chats from a chat list. User-only.
1886
+ * Leave a chat.
1714
1887
  *
1715
1888
  * @method ch
1889
+ * @param chatId The identifier of the chat to leave.
1716
1890
  */
1717
- async getChats(params) {
1718
- return await __classPrivateFieldGet(this, _Client_chatListManager, "f").getChats(params?.from, params?.after, params?.limit);
1891
+ async leaveChat(chatId) {
1892
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").leaveChat(chatId);
1719
1893
  }
1720
1894
  /**
1721
- * Get a chat.
1895
+ * Get information on a user's chat membership.
1722
1896
  *
1723
1897
  * @method ch
1898
+ * @param chatId The identifier of a chat that includes the user.
1899
+ * @param userId The identifier of the user.
1724
1900
  */
1725
- async getChat(chatId) {
1726
- return await __classPrivateFieldGet(this, _Client_chatListManager, "f").getChat(chatId);
1901
+ async getChatMember(chatId, userId) {
1902
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatMember(chatId, userId);
1727
1903
  }
1728
1904
  /**
1729
- * Get chat history. User-only.
1905
+ * Set a chat's sticker set.
1730
1906
  *
1731
1907
  * @method ch
1732
- * @param chatId The identifier of the chat to get its history.
1908
+ * @param chatId The identifier of the chat. Must be a supergroup.
1909
+ * @param setName The name of the set.
1733
1910
  */
1734
- async getHistory(chatId, params) {
1735
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").getHistory(chatId, params);
1911
+ async setChatStickerSet(chatId, setName) {
1912
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatStickerSet(chatId, setName);
1736
1913
  }
1737
1914
  /**
1738
- * Get custom emoji documents for download.
1915
+ * Delete a chat's sticker set.
1739
1916
  *
1740
- * @method fs
1741
- * @param id Identifier of one or more of custom emojis.
1742
- * @returns The custom emoji documents.
1917
+ * @method ch
1918
+ * @param chatId The identifier of the chat. Must be a supergroup.
1743
1919
  */
1744
- async getCustomEmojiStickers(id) {
1745
- return await __classPrivateFieldGet(this, _Client_fileManager, "f").getCustomEmojiStickers(id);
1920
+ async deleteChatStickerSet(chatId) {
1921
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatStickerSet(chatId);
1746
1922
  }
1747
1923
  /**
1748
- * Set a chat's available reactions. User-only.
1924
+ * Set the number of boosts required to circument a chat's default restrictions. User-only.
1749
1925
  *
1750
1926
  * @method ch
1751
1927
  * @param chatId The identifier of the chat.
1752
- * @param availableReactions The new available reactions.
1928
+ * @param boosts The number of boosts required to circumvent its restrictions.
1753
1929
  */
1754
- async setAvailableReactions(chatId, availableReactions) {
1755
- await __classPrivateFieldGet(this, _Client_messageManager, "f").setAvailableReactions(chatId, availableReactions);
1930
+ async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
1931
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").setBoostsRequiredToCircumventRestrictions(chatId, boosts);
1756
1932
  }
1757
1933
  /**
1758
- * Change reactions made to a message.
1934
+ * Create an invite link.
1759
1935
  *
1760
- * @method re
1761
- * @param chatId The identifier of the chat which the message belongs to.
1762
- * @param messageId The identifier of the message to add the reaction to.
1763
- * @param reactions The new reactions.
1936
+ * @method ch
1937
+ * @param chatId The identifier of the chat to create the invite link for.
1938
+ * @returns The newly created invite link.
1764
1939
  */
1765
- async setReactions(chatId, messageId, reactions, params) {
1766
- await __classPrivateFieldGet(this, _Client_messageManager, "f").setReactions(chatId, messageId, reactions, params);
1940
+ async createInviteLink(chatId, params) {
1941
+ return await __classPrivateFieldGet(this, _Client_messageManager, "f").createInviteLink(chatId, params);
1767
1942
  }
1943
+ //
1944
+ // ========================= CALLBACK QUERIES ========================= //
1945
+ //
1768
1946
  /**
1769
- * Make a reaction to a message.
1947
+ * Answer a callback query. Bot-only.
1770
1948
  *
1771
- * @method re
1772
- * @param chatId The identifier of the chat which the message belongs to.
1773
- * @param messageId The identifier of the message to add the reaction to.
1774
- * @param reaction The reaction to add.
1949
+ * @method cq
1950
+ * @param id ID of the callback query to answer.
1775
1951
  */
1776
- async addReaction(chatId, messageId, reaction, params) {
1777
- await __classPrivateFieldGet(this, _Client_messageManager, "f").addReaction(chatId, messageId, reaction, params);
1952
+ async answerCallbackQuery(id, params) {
1953
+ await __classPrivateFieldGet(this, _Client_callbackQueryManager, "f").answerCallbackQuery(id, params);
1778
1954
  }
1955
+ //
1956
+ // ========================= INLINE QUERIES ========================= //
1957
+ //
1779
1958
  /**
1780
- * Undo a reaction made to a message.
1959
+ * Answer an inline query. Bot-only.
1781
1960
  *
1782
- * @method re
1783
- * @param chatId The identifier of the chat which the message belongs to.
1784
- * @param messageId The identifier of the message which the reaction was made to.
1785
- * @param reaction The reaction to remove.
1961
+ * @method iq
1962
+ * @param id The ID of the inline query to answer.
1963
+ * @param results The results to answer with.
1786
1964
  */
1787
- async removeReaction(chatId, messageId, reaction) {
1788
- await __classPrivateFieldGet(this, _Client_messageManager, "f").removeReaction(chatId, messageId, reaction);
1965
+ async answerInlineQuery(id, results, params) {
1966
+ await __classPrivateFieldGet(this, _Client_inlineQueryManager, "f").answerInlineQuery(id, results, params);
1789
1967
  }
1968
+ //
1969
+ // ========================= BOTS ========================= //
1970
+ //
1790
1971
  /**
1791
- * Set a chat's photo.
1972
+ * Set the bot's description in the given language. Bot-only.
1792
1973
  *
1793
- * @method ch
1794
- * @param chatId The identifier of the chat.
1795
- * @param photo A photo to set as the chat's photo.
1974
+ * @method bs
1796
1975
  */
1797
- async setChatPhoto(chatId, photo, params) {
1798
- await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatPhoto(chatId, photo, params);
1976
+ async setMyDescription(params) {
1977
+ await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyDescription(params);
1799
1978
  }
1800
1979
  /**
1801
- * Delete a chat's photo.
1980
+ * Set the bot's name in the given language. Bot-only.
1802
1981
  *
1803
- * @method ch
1804
- * @param chatId The identifier of the chat.
1982
+ * @method bs
1805
1983
  */
1806
- async deleteChatPhoto(chatId) {
1807
- await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatPhoto(chatId);
1984
+ async setMyName(params) {
1985
+ await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyName(params);
1808
1986
  }
1809
1987
  /**
1810
- * Delete all messages sent by a specific member of a chat. User-only.
1988
+ * Set the bot's short description in the given language. Bot-only.
1811
1989
  *
1812
- * @method ms
1813
- * @param chatId The identifier of the chat. Must be a supergroup.
1814
- * @param memberId The identifier of the member.
1990
+ * @method bs
1815
1991
  */
1816
- async deleteChatMemberMessages(chatId, memberId) {
1817
- await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatMemberMessages(chatId, memberId);
1992
+ async setMyShortDescription(params) {
1993
+ await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyShortDescription(params);
1818
1994
  }
1819
1995
  /**
1820
- * Pin a message in a chat.
1996
+ * Get the bot's description in the given language. Bot-only.
1821
1997
  *
1822
- * @method ms
1823
- * @param chatId The identifier of the chat that contains the message.
1824
- * @param messageId The message's identifier.
1998
+ * @method bs
1999
+ * @returns The current bot's description in the specified language.
1825
2000
  */
1826
- async pinMessage(chatId, messageId, params) {
1827
- await __classPrivateFieldGet(this, _Client_messageManager, "f").pinMessage(chatId, messageId, params);
2001
+ async getMyDescription(params) {
2002
+ return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyDescription(params);
1828
2003
  }
1829
2004
  /**
1830
- * Unpin a pinned message.
2005
+ * Get the bot's name in the given language. Bot-only.
1831
2006
  *
1832
- * @method ms
1833
- * @param chatId The identifier of the chat that contains the message.
1834
- * @param messageId The message's identifier.
2007
+ * @method bs
2008
+ * @returns The current bot's name in the specified language.
1835
2009
  */
1836
- async unpinMessage(chatId, messageId) {
1837
- await __classPrivateFieldGet(this, _Client_messageManager, "f").unpinMessage(chatId, messageId);
2010
+ async getMyName(params) {
2011
+ return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyName(params);
1838
2012
  }
1839
2013
  /**
1840
- * Unpin all pinned messages.
2014
+ * Get the bot's short description in the given language. Bot-only.
1841
2015
  *
1842
- * @method ms
1843
- * @param chatId The identifier of the chat.
2016
+ * @method bs
2017
+ * @returns The current bot's short description in the specified language.
1844
2018
  */
1845
- async unpinMessages(chatId) {
1846
- await __classPrivateFieldGet(this, _Client_messageManager, "f").unpinMessages(chatId);
2019
+ async getMyShortDescription(params) {
2020
+ return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyShortDescription(params);
1847
2021
  }
1848
2022
  /**
1849
- * Ban a member from a chat.
2023
+ * Set the bot's commands in the given scope and/or language. Bot-only.
1850
2024
  *
1851
- * @method ch
1852
- * @param chatId The identifier of the chat.
1853
- * @param memberId The identifier of the member.
2025
+ * @method bs
2026
+ * @param commands The commands to set.
1854
2027
  */
1855
- async banChatMember(chatId, memberId, params) {
1856
- await __classPrivateFieldGet(this, _Client_messageManager, "f").banChatMember(chatId, memberId, params);
2028
+ async setMyCommands(commands, params) {
2029
+ await __classPrivateFieldGet(this, _Client_botInfoManager, "f").setMyCommands(commands, params);
1857
2030
  }
1858
2031
  /**
1859
- * Unban a member from a chat.
2032
+ * Get the bot's commands in the given scope and/or language. Bot-only.
1860
2033
  *
1861
- * @method ch
1862
- * @param chatId The identifier of the chat. Must be a supergroup.
1863
- * @param memberId The identifier of the member.
2034
+ * @method bs
2035
+ * @returns The current bot's commands in the specified language.
1864
2036
  */
1865
- async unbanChatMember(chatId, memberId) {
1866
- await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
2037
+ async getMyCommands(params) {
2038
+ return await __classPrivateFieldGet(this, _Client_botInfoManager, "f").getMyCommands(params);
1867
2039
  }
2040
+ //
2041
+ // ========================= REACTIONS ========================= //
2042
+ //
1868
2043
  /**
1869
- * Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
2044
+ * Change reactions made to a message.
1870
2045
  *
1871
- * @method ch
1872
- * @param chatId The identifier of the chat. Must be a supergroup.
1873
- * @param memberId The identifier of the member.
2046
+ * @method re
2047
+ * @param chatId The identifier of the chat which the message belongs to.
2048
+ * @param messageId The identifier of the message to add the reaction to.
2049
+ * @param reactions The new reactions.
1874
2050
  */
1875
- async kickChatMember(chatId, memberId) {
1876
- await __classPrivateFieldGet(this, _Client_messageManager, "f").banChatMember(chatId, memberId);
1877
- await __classPrivateFieldGet(this, _Client_messageManager, "f").unbanChatMember(chatId, memberId);
2051
+ async setReactions(chatId, messageId, reactions, params) {
2052
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").setReactions(chatId, messageId, reactions, params);
1878
2053
  }
1879
2054
  /**
1880
- * Set the rights of a chat member.
2055
+ * Make a reaction to a message.
1881
2056
  *
1882
- * @method ch
1883
- * @param chatId The identifier of the chat. Must be a supergroup.
1884
- * @param memberId The identifier of a member.
2057
+ * @method re
2058
+ * @param chatId The identifier of the chat which the message belongs to.
2059
+ * @param messageId The identifier of the message to add the reaction to.
2060
+ * @param reaction The reaction to add.
1885
2061
  */
1886
- async setChatMemberRights(chatId, memberId, params) {
1887
- await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatMemberRights(chatId, memberId, params);
2062
+ async addReaction(chatId, messageId, reaction, params) {
2063
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").addReaction(chatId, messageId, reaction, params);
1888
2064
  }
1889
2065
  /**
1890
- * Get the administrators of a chat.
2066
+ * Undo a reaction made to a message.
1891
2067
  *
1892
- * @method ch
1893
- * @param chatId The identifier of the chat.
1894
- * @returns The chat's administrators.
2068
+ * @method re
2069
+ * @param chatId The identifier of the chat which the message belongs to.
2070
+ * @param messageId The identifier of the message which the reaction was made to.
2071
+ * @param reaction The reaction to remove.
1895
2072
  */
1896
- async getChatAdministrators(chatId) {
1897
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatAdministrators(chatId);
2073
+ async removeReaction(chatId, messageId, reaction) {
2074
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").removeReaction(chatId, messageId, reaction);
1898
2075
  }
2076
+ //
2077
+ // ========================= STORIES ========================= //
2078
+ //
1899
2079
  /**
1900
2080
  * Create a story. User-only.
1901
2081
  *
@@ -1990,130 +2170,16 @@ export class Client extends Composer {
1990
2170
  async removeStoryFromHighlights(chatId, storyId) {
1991
2171
  await __classPrivateFieldGet(this, _Client_storyManager, "f").removeStoryFromHighlights(chatId, storyId);
1992
2172
  }
2173
+ //
2174
+ // ========================= MISC ========================= //
2175
+ //
1993
2176
  /**
1994
- * Enable join requests in a chat. User-only.
1995
- *
1996
- * @method ch
1997
- * @param chatId The identifier of the chat. Must be a channel or a supergroup.
1998
- */
1999
- async enableJoinRequests(chatId) {
2000
- await __classPrivateFieldGet(this, _Client_messageManager, "f").enableJoinRequests(chatId);
2001
- }
2002
- /**
2003
- * Disable join requests in a chat. User-only.
2004
- *
2005
- * @method ch
2006
- * @param chatId The identifier of the chat. Must be a channel or a supergroup.
2007
- */
2008
- async disableJoinRequests(chatId) {
2009
- await __classPrivateFieldGet(this, _Client_messageManager, "f").disableJoinRequests(chatId);
2010
- }
2011
- /**
2012
- * Show a username in the current account, a bot account, sa upergroup, or a channel's profile. User-only.
2013
- *
2014
- * @method ac
2015
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
2016
- * @param username The username to show.
2017
- */
2018
- async showUsername(id, username) {
2019
- await __classPrivateFieldGet(this, _Client_accountManager, "f").showUsername(id, username);
2020
- }
2021
- /**
2022
- * Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
2023
- *
2024
- * @method ac
2025
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
2026
- * @param username The username to hide.
2027
- */
2028
- async hideUsername(id, username) {
2029
- await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsername(id, username);
2030
- }
2031
- /**
2032
- * Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
2033
- *
2034
- * @method ac
2035
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
2036
- * @param order The new order to use.
2037
- * @returns Whether the order was changed.
2038
- */
2039
- async reorderUsernames(id, order) {
2040
- return await __classPrivateFieldGet(this, _Client_accountManager, "f").reorderUsernames(id, order);
2041
- }
2042
- /**
2043
- * Hide all usernames from the a supergroup or a channel's profile. User-only.
2044
- *
2045
- * @method ac
2046
- * @param id A supergroup ID or a channel ID.
2047
- */
2048
- async hideUsernames(id) {
2049
- return await __classPrivateFieldGet(this, _Client_accountManager, "f").hideUsernames(id);
2050
- }
2051
- /**
2052
- * Get inactive chats. User-only.
2053
- *
2054
- * @method ch
2055
- * @retuns A list of inactive chats the current user is member of.
2056
- */
2057
- async getInactiveChats() {
2058
- return await __classPrivateFieldGet(this, _Client_accountManager, "f").getInactiveChats();
2059
- }
2060
- /**
2061
- * Search the messages of a chat. User-only.
2062
- *
2063
- * @method ms
2064
- * @param chatId The identifier of the chat to search the messages in.
2065
- * @param query The message search query.
2066
- */
2067
- async searchMessages(chatId, query, params) {
2068
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").searchMessages(chatId, query, params);
2069
- }
2070
- /**
2071
- * Set the number of boosts required to circument a chat's default restrictions. User-only.
2072
- *
2073
- * @method ch
2074
- * @param chatId The identifier of the chat.
2075
- * @param boosts The number of boosts required to circumvent its restrictions.
2076
- */
2077
- async setBoostsRequiredToCircumventRestrictions(chatId, boosts) {
2078
- await __classPrivateFieldGet(this, _Client_messageManager, "f").setBoostsRequiredToCircumventRestrictions(chatId, boosts);
2079
- }
2080
- /**
2081
- * Create an invite link.
2082
- *
2083
- * @method ch
2084
- * @param chatId The identifier of the chat to create the invite link for.
2085
- * @returns The newly created invite link.
2086
- */
2087
- async createInviteLink(chatId, params) {
2088
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").createInviteLink(chatId, params);
2089
- }
2090
- /**
2091
- * Get the invite links created for a chat. User-only.
2092
- *
2093
- * @method ch
2094
- * @param chatId The identifier of the chat.
2095
- * @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
2096
- */
2097
- async getCreatedInviteLinks(chatId, params) {
2098
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").getCreatedInviteLinks(chatId, params);
2099
- }
2100
- /**
2101
- * Join a chat. User-only.
2102
- *
2103
- * @method ch
2104
- * @param chatId The identifier of the chat to join.
2105
- */
2106
- async joinChat(chatId) {
2107
- await __classPrivateFieldGet(this, _Client_messageManager, "f").joinChat(chatId);
2108
- }
2109
- /**
2110
- * Leave a chat.
2177
+ * Get network statistics. This might not always be available.
2111
2178
  *
2112
- * @method ch
2113
- * @param chatId The identifier of the chat to leave.
2179
+ * @method mc
2114
2180
  */
2115
- async leaveChat(chatId) {
2116
- await __classPrivateFieldGet(this, _Client_messageManager, "f").leaveChat(chatId);
2181
+ async getNetworkStatistics() {
2182
+ return await __classPrivateFieldGet(this, _Client_networkStatisticsManager, "f").getNetworkStatistics();
2117
2183
  }
2118
2184
  /**
2119
2185
  * Block a user. User-only.
@@ -2133,35 +2199,6 @@ export class Client extends Composer {
2133
2199
  async unblockUser(userId) {
2134
2200
  await __classPrivateFieldGet(this, _Client_messageManager, "f").unblockUser(userId);
2135
2201
  }
2136
- /**
2137
- * Get information on a user's chat membership.
2138
- *
2139
- * @method ch
2140
- * @param chatId The identifier of a chat that includes the user.
2141
- * @param userId The identifier of the user.
2142
- */
2143
- async getChatMember(chatId, userId) {
2144
- return await __classPrivateFieldGet(this, _Client_messageManager, "f").getChatMember(chatId, userId);
2145
- }
2146
- /**
2147
- * Set a chat's sticker set.
2148
- *
2149
- * @method ch
2150
- * @param chatId The identifier of the chat. Must be a supergroup.
2151
- * @param setName The name of the set.
2152
- */
2153
- async setChatStickerSet(chatId, setName) {
2154
- await __classPrivateFieldGet(this, _Client_messageManager, "f").setChatStickerSet(chatId, setName);
2155
- }
2156
- /**
2157
- * Delete a chat's sticker set.
2158
- *
2159
- * @method ch
2160
- * @param chatId The identifier of the chat. Must be a supergroup.
2161
- */
2162
- async deleteChatStickerSet(chatId) {
2163
- await __classPrivateFieldGet(this, _Client_messageManager, "f").deleteChatStickerSet(chatId);
2164
- }
2165
2202
  }
2166
2203
  _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
2167
2204
  await this.middleware()(await __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, update), resolve);
@@ -2221,6 +2258,9 @@ _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
2221
2258
  promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, upd));
2222
2259
  }
2223
2260
  }
2261
+ if (BusinessConnectionManager.canHandleUpdate(update)) {
2262
+ promises.push(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleCtxUpdate).call(this, await __classPrivateFieldGet(this, _Client_businessConnectionManager, "f").handleUpdate(update)));
2263
+ }
2224
2264
  return () => Promise.all(promises);
2225
2265
  }, _Client_getMe = async function _Client_getMe() {
2226
2266
  if (__classPrivateFieldGet(this, _Client_lastGetMe, "f") != null) {