@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
@@ -2,9 +2,9 @@ import { MaybePromise } from "../1_utilities.js";
2
2
  import { enums, functions, types } from "../2_tl.js";
3
3
  import { Storage } from "../3_storage.js";
4
4
  import { DC } from "../3_transport.js";
5
- import { BotCommand, Chat, ChatAction, ChatMember, ChatP, FileSource, ID, InactiveChat, InlineQueryResult, InputStoryContent, InviteLink, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Poll, Reaction, Sticker, Story, Update, User } from "../3_types.js";
5
+ import { BotCommand, BusinessConnection, Chat, ChatAction, ChatMember, ChatP, FileSource, ID, InactiveChat, InlineQueryResult, InputStoryContent, InviteLink, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Poll, Reaction, Sticker, Story, Update, User } from "../3_types.js";
6
6
  import { Migrate } from "../4_errors.js";
7
- import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, StopPollParams, UploadParams } from "./0_params.js";
7
+ import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, StopPollParams } from "./0_params.js";
8
8
  import { Api } from "./0_types.js";
9
9
  import { ClientPlainParams } from "./1_client_plain.js";
10
10
  import { Composer as Composer_, NextFunction } from "./1_composer.js";
@@ -21,34 +21,35 @@ export interface Context {
21
21
  from?: User;
22
22
  /** Resolves to `msg?.senderChat`. */
23
23
  senderChat?: ChatP;
24
+ toJSON: () => Update;
24
25
  /** Context-aware alias for `client.sendMessage()`. */
25
- reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId"> & ReplyParams) => Promise<MessageText>;
26
+ reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageText>;
26
27
  /** Context-aware alias for `client.sendPoll()`. */
27
- replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePoll>;
28
+ replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessagePoll>;
28
29
  /** Context-aware alias for `client.sendPhoto()`. */
29
- replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePhoto>;
30
+ replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessagePhoto>;
30
31
  /** Context-aware alias for `client.sendDocument()`. */
31
- replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDocument>;
32
+ replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageDocument>;
32
33
  /** Context-aware alias for `client.sendSticker()`. */
33
- replySticker: (sticker: FileSource, params?: Omit<SendStickerParams, "replyToMessageId"> & ReplyParams) => Promise<MessageSticker>;
34
+ replySticker: (sticker: FileSource, params?: Omit<SendStickerParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageSticker>;
34
35
  /** Context-aware alias for `client.sendLocation()`. */
35
- replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageLocation>;
36
+ replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageLocation>;
36
37
  /** Context-aware alias for `client.sendDice()`. */
37
- replyDice: (params?: Omit<SendDiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDice>;
38
+ replyDice: (params?: Omit<SendDiceParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageDice>;
38
39
  /** Context-aware alias for `client.sendVenue()`. */
39
- replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVenue>;
40
+ replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVenue>;
40
41
  /** Context-aware alias for `client.sendContact()`. */
41
- replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId"> & ReplyParams) => Promise<MessageContact>;
42
+ replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageContact>;
42
43
  /** Context-aware alias for `client.sendVideo()`. */
43
- replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideo>;
44
+ replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideo>;
44
45
  /** Context-aware alias for `client.sendAnimation()`. */
45
- replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAnimation>;
46
+ replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageAnimation>;
46
47
  /** Context-aware alias for `client.sendVoice()`. */
47
- replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVoice>;
48
+ replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVoice>;
48
49
  /** Context-aware alias for `client.sendAudio()`. */
49
- replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAudio>;
50
+ replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageAudio>;
50
51
  /** Context-aware alias for `client.sendPoll()`. */
51
- replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideoNote>;
52
+ replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideoNote>;
52
53
  /** Context-aware alias for `client.deleteMessage()`. */
53
54
  delete: () => Promise<void>;
54
55
  /** Context-aware alias for `client.forwardMessage()`. */
@@ -147,7 +148,8 @@ export interface Context {
147
148
  setChatStickerSet: (setName: string) => Promise<void>;
148
149
  /** Context-aware alias for `client.deleteChatStickerSet()`. */
149
150
  deleteChatStickerSet: () => Promise<void>;
150
- toJSON: () => Update;
151
+ /** Context-aware alias for `client.getBusinessConnection()`. */
152
+ getBusinessConnection: () => Promise<BusinessConnection>;
151
153
  }
152
154
  export declare class Composer<C extends Context = Context> extends Composer_<C> {
153
155
  }
@@ -233,27 +235,24 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
233
235
  [handleMigrationError](err: Migrate): Promise<void>;
234
236
  disconnect(): Promise<void>;
235
237
  /**
236
- * Calls [initConnection](1) and authorizes the client with one of the following:
238
+ * Authorizes the client with one of the following:
237
239
  *
238
240
  * - Bot token (`string`)
239
- * - Exported authorization (`types.AuthExportedAuthorization`)
240
241
  * - User authorization handlers (`AuthorizeUserParams`)
241
242
  *
242
- * if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](2).
243
+ * if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](1).
243
244
  *
244
245
  * Notes:
245
246
  * 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
246
247
  * 2. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
247
- * 3. The parameters passed to the [initConnection][1] call can be configured with the last parameter of the constructor.
248
248
  *
249
- * [1]: https://core.telegram.org/method/initConnection
250
- * [2]: https://core.telegram.org/method/updates.getState
249
+ * [1]: https://core.telegram.org/method/updates.getState
251
250
  */
252
- authorize(params?: string | types.auth.ExportedAuthorization | AuthorizeUserParams): Promise<void>;
251
+ authorize(params?: string | AuthorizeUserParams): Promise<void>;
253
252
  /**
254
253
  * Same as calling `.connect()` followed by `.authorize(params)`.
255
254
  */
256
- start(params?: string | types.auth.ExportedAuthorization | AuthorizeUserParams): Promise<void>;
255
+ start(params?: string | AuthorizeUserParams): Promise<void>;
257
256
  /**
258
257
  * Invokes a function waiting and returning its reply if the second parameter is not `true`. Requires the client
259
258
  * to be connected.
@@ -294,6 +293,51 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
294
293
  private [getEntity];
295
294
  private [getEntity];
296
295
  private [getEntity];
296
+ /**
297
+ * Get information on the currently authorized user.
298
+ *
299
+ * @method ac
300
+ */
301
+ getMe(): Promise<User>;
302
+ /**
303
+ * Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
304
+ *
305
+ * @method ac
306
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
307
+ * @param username The username to show.
308
+ */
309
+ showUsername(id: ID, username: string): Promise<void>;
310
+ /**
311
+ * Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
312
+ *
313
+ * @method ac
314
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
315
+ * @param username The username to hide.
316
+ */
317
+ hideUsername(id: ID, username: string): Promise<void>;
318
+ /**
319
+ * Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
320
+ *
321
+ * @method ac
322
+ * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
323
+ * @param order The new order to use.
324
+ * @returns Whether the order was changed.
325
+ */
326
+ reorderUsernames(id: ID, order: string[]): Promise<boolean>;
327
+ /**
328
+ * Hide all usernames from the a supergroup or a channel's profile. User-only.
329
+ *
330
+ * @method ac
331
+ * @param id A supergroup ID or a channel ID.
332
+ */
333
+ hideUsernames(id: ID): Promise<boolean>;
334
+ /**
335
+ * Get a business connection. Bot-only.
336
+ *
337
+ * @method ac
338
+ * @param id The identifier of the business connection.
339
+ */
340
+ getBusinessConnection(id: string): Promise<BusinessConnection>;
297
341
  /**
298
342
  * Send a text message.
299
343
  *
@@ -303,6 +347,128 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
303
347
  * @returns The sent text message.
304
348
  */
305
349
  sendMessage(chatId: ID, text: string, params?: SendMessageParams): Promise<MessageText>;
350
+ /**
351
+ * Send a photo.
352
+ *
353
+ * @method ms
354
+ * @param chatId The chat to send the photo to.
355
+ * @param photo The photo to send.
356
+ * @returns The sent photo.
357
+ */
358
+ sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
359
+ /**
360
+ * Send a document.
361
+ *
362
+ * @method ms
363
+ * @param chatId The chat to send the document to.
364
+ * @param document The document to send.
365
+ * @returns The sent document.
366
+ */
367
+ sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
368
+ /**
369
+ * Send a sticker.
370
+ *
371
+ * @method ms
372
+ * @param chatId The chat to send the sticker to.
373
+ * @param document The sticker to send.
374
+ * @returns The sent sticker.
375
+ */
376
+ sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
377
+ /**
378
+ * Send a video.
379
+ *
380
+ * @method ms
381
+ * @param chatId The chat to send the video to.
382
+ * @param video The video to send.
383
+ * @returns The sent video.
384
+ */
385
+ sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
386
+ /**
387
+ * Send an animation.
388
+ *
389
+ * @method ms
390
+ * @param chatId The chat to send the animation to.
391
+ * @param animation The animation to send.
392
+ * @returns The sent animation.
393
+ */
394
+ sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
395
+ /**
396
+ * Send a voice message.
397
+ *
398
+ * @method ms
399
+ * @param chatId The chat to send the voice message to.
400
+ * @param voice The voice to send.
401
+ * @returns The sent voice message.
402
+ */
403
+ sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
404
+ /**
405
+ * Send an audio file.
406
+ *
407
+ * @method ms
408
+ * @param chatId The chat to send the audio file to.
409
+ * @param audio The audio to send.
410
+ * @returns The sent audio filr.
411
+ */
412
+ sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
413
+ /**
414
+ * Send a video note.
415
+ *
416
+ * @method ms
417
+ * @param chatId The chat to send the video note to.
418
+ * @param videoNote The video note to send.
419
+ * @returns The sent video note.
420
+ */
421
+ sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
422
+ /**
423
+ * Send a location.
424
+ *
425
+ * @method ms
426
+ * @param chatId The chat to send the location to.
427
+ * @param latitude The location's latitude.
428
+ * @param longitude The location's longitude.
429
+ * @returns The sent location.
430
+ */
431
+ sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
432
+ /**
433
+ * Send a contact.
434
+ *
435
+ * @method ms
436
+ * @param chatId The chat to send the contact to.
437
+ * @param firstName The contact's first name.
438
+ * @param number The contact's phone number.
439
+ * @returns The sent contact.
440
+ */
441
+ sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
442
+ /**
443
+ * Send a dice.
444
+ *
445
+ * @method ms
446
+ * @param chatId The chat to send the dice to.
447
+ * @returns The sent dice.
448
+ */
449
+ sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
450
+ /**
451
+ * Send a venue.
452
+ *
453
+ * @method ms
454
+ * @param chatId The chat to send the venue to.
455
+ * @param latitude The latitude of the venue.
456
+ * @param longitude The longitude of the venue.
457
+ * @param title The title of the venue.
458
+ * @param address The written address of the venue.
459
+ * @returns The sent venue.
460
+ */
461
+ sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
462
+ /**
463
+ * Send a poll.
464
+ *
465
+ * @method ms
466
+ * @param chatId The chat to send the poll to.
467
+ * @param question The poll's question.
468
+ * @param options The poll's options.
469
+ * @returns The sent poll.
470
+ */
471
+ sendPoll(chatId: ID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<MessagePoll>;
306
472
  /**
307
473
  * Edit a message's text.
308
474
  *
@@ -383,18 +549,52 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
383
549
  */
384
550
  getMessage(chatId: ID, messageId: number): Promise<Message | null>;
385
551
  /**
386
- * Download a file.
552
+ * Delete multiple messages.
387
553
  *
388
- * @method fs
389
- * @param fileId The identifier of the file to download.
390
- * @example ```ts
391
- * for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
392
- * await outFile.write(chunk);
393
- * }
394
- * ```
395
- * @returns A generator yielding the contents of the file.
554
+ * @method ms
555
+ * @param chatId The identifier of the chat that contains the messages.
556
+ * @param messageIds The identifiers of the messages to delete.
396
557
  */
397
- download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
558
+ deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
559
+ /**
560
+ * Delete a single message.
561
+ *
562
+ * @method ms
563
+ * @param chatId The identifier of the chat that contains the message.
564
+ * @param messageId The identifier of the message to delete.
565
+ */
566
+ deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise<void>;
567
+ /**
568
+ * Delete all messages sent by a specific member of a chat. User-only.
569
+ *
570
+ * @method ms
571
+ * @param chatId The identifier of the chat. Must be a supergroup.
572
+ * @param memberId The identifier of the member.
573
+ */
574
+ deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
575
+ /**
576
+ * Pin a message in a chat.
577
+ *
578
+ * @method ms
579
+ * @param chatId The identifier of the chat that contains the message.
580
+ * @param messageId The message's identifier.
581
+ */
582
+ pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
583
+ /**
584
+ * Unpin a pinned message.
585
+ *
586
+ * @method ms
587
+ * @param chatId The identifier of the chat that contains the message.
588
+ * @param messageId The message's identifier.
589
+ */
590
+ unpinMessage(chatId: ID, messageId: number): Promise<void>;
591
+ /**
592
+ * Unpin all pinned messages.
593
+ *
594
+ * @method ms
595
+ * @param chatId The identifier of the chat.
596
+ */
597
+ unpinMessages(chatId: ID): Promise<void>;
398
598
  /**
399
599
  * Forward multiple messages.
400
600
  *
@@ -415,29 +615,6 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
415
615
  * @returns The forwarded message.
416
616
  */
417
617
  forwardMessage(from: ID, to: ID, messageId: number, params?: ForwardMessagesParams): Promise<Message>;
418
- /**
419
- * Get information on the currently authorized user.
420
- *
421
- * @method ac
422
- */
423
- getMe(): Promise<User>;
424
- /**
425
- * Answer a callback query. Bot-only.
426
- *
427
- * @method cq
428
- * @param id ID of the callback query to answer.
429
- */
430
- answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
431
- /**
432
- * Send a poll.
433
- *
434
- * @method ms
435
- * @param chatId The chat to send the poll to.
436
- * @param question The poll's question.
437
- * @param options The poll's options.
438
- * @returns The sent poll.
439
- */
440
- sendPoll(chatId: ID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<MessagePoll>;
441
618
  /**
442
619
  * Stop a poll.
443
620
  *
@@ -459,258 +636,281 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
459
636
  messageThreadId?: number;
460
637
  }): Promise<void>;
461
638
  /**
462
- * Upload a file.
639
+ * Search the messages of a chat. User-only.
463
640
  *
464
- * @method fs
465
- * @param contents The contents of the file.
466
- * @returns The uploaded file.
641
+ * @method ms
642
+ * @param chatId The identifier of the chat to search the messages in.
643
+ * @param query The message search query.
467
644
  */
468
- upload(contents: Uint8Array, params?: UploadParams): Promise<any>;
645
+ searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
469
646
  /**
470
- * Set the bot's commands in the given scope and/or language. Bot-only.
647
+ * Download a file.
471
648
  *
472
- * @method bs
473
- * @param commands The commands to set.
474
- */
475
- setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
476
- /**
477
- * Get the bot's commands in the given scope and/or language. Bot-only.
649
+ * @method fs
650
+ * @param fileId The identifier of the file to download.
651
+ * @example ```ts
652
+ * for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
653
+ * await outFile.write(chunk);
654
+ * }
655
+ * ```
656
+ * @returns A generator yielding the contents of the file.
657
+ */
658
+ download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
659
+ /**
660
+ * Get custom emoji documents for download.
478
661
  *
479
- * @method bs
480
- * @returns The current bot's commands in the specified language.
662
+ * @method fs
663
+ * @param id Identifier of one or more of custom emojis.
664
+ * @returns The custom emoji documents.
481
665
  */
482
- getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
666
+ getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
483
667
  /**
484
- * Answer an inline query. Bot-only.
668
+ * Get chats from a chat list. User-only.
485
669
  *
486
- * @method iq
487
- * @param id The ID of the inline query to answer.
488
- * @param results The results to answer with.
670
+ * @method ch
489
671
  */
490
- answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
672
+ getChats(params?: GetChatsParams): Promise<Chat[]>;
491
673
  /**
492
- * Set the bot's description in the given language. Bot-only.
674
+ * Get a chat.
493
675
  *
494
- * @method bs
676
+ * @method ch
495
677
  */
496
- setMyDescription(params?: {
497
- description?: string;
498
- languageCode?: string;
499
- }): Promise<void>;
678
+ getChat(chatId: ID): Promise<Chat>;
500
679
  /**
501
- * Set the bot's name in the given language. Bot-only.
680
+ * Get chat history. User-only.
502
681
  *
503
- * @method bs
682
+ * @method ch
683
+ * @param chatId The identifier of the chat to get its history.
504
684
  */
505
- setMyName(params?: {
506
- name?: string;
507
- languageCode?: string;
508
- }): Promise<void>;
685
+ getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
509
686
  /**
510
- * Set the bot's short description in the given language. Bot-only.
687
+ * Set a chat's available reactions. User-only.
511
688
  *
512
- * @method bs
689
+ * @method ch
690
+ * @param chatId The identifier of the chat.
691
+ * @param availableReactions The new available reactions.
513
692
  */
514
- setMyShortDescription(params?: {
515
- shortDescription?: string;
516
- languageCode?: string;
517
- }): Promise<void>;
693
+ setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
518
694
  /**
519
- * Get the bot's description in the given language. Bot-only.
695
+ * Set a chat's photo.
520
696
  *
521
- * @method bs
522
- * @returns The current bot's description in the specified language.
697
+ * @method ch
698
+ * @param chatId The identifier of the chat.
699
+ * @param photo A photo to set as the chat's photo.
523
700
  */
524
- getMyDescription(params?: {
525
- languageCode?: string;
526
- }): Promise<string>;
701
+ setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
527
702
  /**
528
- * Get the bot's name in the given language. Bot-only.
703
+ * Delete a chat's photo.
529
704
  *
530
- * @method bs
531
- * @returns The current bot's name in the specified language.
705
+ * @method ch
706
+ * @param chatId The identifier of the chat.
532
707
  */
533
- getMyName(params?: {
534
- languageCode?: string;
535
- }): Promise<string>;
708
+ deleteChatPhoto(chatId: number): Promise<void>;
536
709
  /**
537
- * Get the bot's short description in the given language. Bot-only.
710
+ * Ban a member from a chat.
538
711
  *
539
- * @method bs
540
- * @returns The current bot's short description in the specified language.
712
+ * @method ch
713
+ * @param chatId The identifier of the chat.
714
+ * @param memberId The identifier of the member.
541
715
  */
542
- getMyShortDescription(params?: {
543
- languageCode?: string;
544
- }): Promise<string>;
716
+ banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
545
717
  /**
546
- * Delete multiple messages.
718
+ * Unban a member from a chat.
547
719
  *
548
- * @method ms
549
- * @param chatId The identifier of the chat that contains the messages.
550
- * @param messageIds The identifiers of the messages to delete.
720
+ * @method ch
721
+ * @param chatId The identifier of the chat. Must be a supergroup.
722
+ * @param memberId The identifier of the member.
551
723
  */
552
- deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
724
+ unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
553
725
  /**
554
- * Delete a single message.
726
+ * Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
555
727
  *
556
- * @method ms
557
- * @param chatId The identifier of the chat that contains the message.
558
- * @param messageId The identifier of the message to delete.
728
+ * @method ch
729
+ * @param chatId The identifier of the chat. Must be a supergroup.
730
+ * @param memberId The identifier of the member.
559
731
  */
560
- deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise<void>;
732
+ kickChatMember(chatId: ID, memberId: ID): Promise<void>;
561
733
  /**
562
- * Send a photo.
734
+ * Set the rights of a chat member.
563
735
  *
564
- * @method ms
565
- * @param chatId The chat to send the photo to.
566
- * @param photo The photo to send.
567
- * @returns The sent photo.
736
+ * @method ch
737
+ * @param chatId The identifier of the chat. Must be a supergroup.
738
+ * @param memberId The identifier of a member.
568
739
  */
569
- sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
740
+ setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
570
741
  /**
571
- * Send a document.
742
+ * Get the administrators of a chat.
572
743
  *
573
- * @method ms
574
- * @param chatId The chat to send the document to.
575
- * @param document The document to send.
576
- * @returns The sent document.
744
+ * @method ch
745
+ * @param chatId The identifier of the chat.
746
+ * @returns The chat's administrators.
577
747
  */
578
- sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
748
+ getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
579
749
  /**
580
- * Send a sticker.
750
+ * Enable join requests in a chat. User-only.
581
751
  *
582
- * @method ms
583
- * @param chatId The chat to send the sticker to.
584
- * @param document The sticker to send.
585
- * @returns The sent sticker.
752
+ * @method ch
753
+ * @param chatId The identifier of the chat. Must be a channel or a supergroup.
586
754
  */
587
- sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
755
+ enableJoinRequests(chatId: ID): Promise<void>;
588
756
  /**
589
- * Send a video.
757
+ * Disable join requests in a chat. User-only.
590
758
  *
591
- * @method ms
592
- * @param chatId The chat to send the video to.
593
- * @param video The video to send.
594
- * @returns The sent video.
759
+ * @method ch
760
+ * @param chatId The identifier of the chat. Must be a channel or a supergroup.
595
761
  */
596
- sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
762
+ disableJoinRequests(chatId: ID): Promise<void>;
597
763
  /**
598
- * Send an animation.
764
+ * Get inactive chats. User-only.
599
765
  *
600
- * @method ms
601
- * @param chatId The chat to send the animation to.
602
- * @param animation The animation to send.
603
- * @returns The sent animation.
766
+ * @method ch
767
+ * @retuns A list of inactive chats the current user is member of.
604
768
  */
605
- sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
769
+ getInactiveChats(): Promise<InactiveChat[]>;
606
770
  /**
607
- * Send a voice message.
771
+ * Get the invite links created for a chat. User-only.
608
772
  *
609
- * @method ms
610
- * @param chatId The chat to send the voice message to.
611
- * @param voice The voice to send.
612
- * @returns The sent voice message.
773
+ * @method ch
774
+ * @param chatId The identifier of the chat.
775
+ * @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.
613
776
  */
614
- sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
777
+ getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
615
778
  /**
616
- * Send an audio file.
779
+ * Join a chat. User-only.
617
780
  *
618
- * @method ms
619
- * @param chatId The chat to send the audio file to.
620
- * @param audio The audio to send.
621
- * @returns The sent audio filr.
781
+ * @method ch
782
+ * @param chatId The identifier of the chat to join.
622
783
  */
623
- sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
784
+ joinChat(chatId: ID): Promise<void>;
624
785
  /**
625
- * Send a video note.
786
+ * Leave a chat.
626
787
  *
627
- * @method ms
628
- * @param chatId The chat to send the video note to.
629
- * @param videoNote The video note to send.
630
- * @returns The sent video note.
788
+ * @method ch
789
+ * @param chatId The identifier of the chat to leave.
631
790
  */
632
- sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
791
+ leaveChat(chatId: ID): Promise<void>;
633
792
  /**
634
- * Send a location.
793
+ * Get information on a user's chat membership.
635
794
  *
636
- * @method ms
637
- * @param chatId The chat to send the location to.
638
- * @param latitude The location's latitude.
639
- * @param longitude The location's longitude.
640
- * @returns The sent location.
795
+ * @method ch
796
+ * @param chatId The identifier of a chat that includes the user.
797
+ * @param userId The identifier of the user.
641
798
  */
642
- sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
799
+ getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
643
800
  /**
644
- * Send a contact.
801
+ * Set a chat's sticker set.
645
802
  *
646
- * @method ms
647
- * @param chatId The chat to send the contact to.
648
- * @param firstName The contact's first name.
649
- * @param number The contact's phone number.
650
- * @returns The sent contact.
803
+ * @method ch
804
+ * @param chatId The identifier of the chat. Must be a supergroup.
805
+ * @param setName The name of the set.
651
806
  */
652
- sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
807
+ setChatStickerSet(chatId: ID, setName: string): Promise<void>;
653
808
  /**
654
- * Send a dice.
809
+ * Delete a chat's sticker set.
655
810
  *
656
- * @method ms
657
- * @param chatId The chat to send the dice to.
658
- * @returns The sent dice.
811
+ * @method ch
812
+ * @param chatId The identifier of the chat. Must be a supergroup.
659
813
  */
660
- sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
814
+ deleteChatStickerSet(chatId: ID): Promise<void>;
661
815
  /**
662
- * Send a venue.
816
+ * Set the number of boosts required to circument a chat's default restrictions. User-only.
663
817
  *
664
- * @method ms
665
- * @param chatId The chat to send the venue to.
666
- * @param latitude The latitude of the venue.
667
- * @param longitude The longitude of the venue.
668
- * @param title The title of the venue.
669
- * @param address The written address of the venue.
670
- * @returns The sent venue.
818
+ * @method ch
819
+ * @param chatId The identifier of the chat.
820
+ * @param boosts The number of boosts required to circumvent its restrictions.
671
821
  */
672
- sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
822
+ setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
673
823
  /**
674
- * Get network statistics. This might not always be available.
824
+ * Create an invite link.
675
825
  *
676
- * @method mc
826
+ * @method ch
827
+ * @param chatId The identifier of the chat to create the invite link for.
828
+ * @returns The newly created invite link.
677
829
  */
678
- getNetworkStatistics(): Promise<NetworkStatistics>;
830
+ createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
831
+ /**
832
+ * Answer a callback query. Bot-only.
833
+ *
834
+ * @method cq
835
+ * @param id ID of the callback query to answer.
836
+ */
837
+ answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
838
+ /**
839
+ * Answer an inline query. Bot-only.
840
+ *
841
+ * @method iq
842
+ * @param id The ID of the inline query to answer.
843
+ * @param results The results to answer with.
844
+ */
845
+ answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
846
+ /**
847
+ * Set the bot's description in the given language. Bot-only.
848
+ *
849
+ * @method bs
850
+ */
851
+ setMyDescription(params?: {
852
+ description?: string;
853
+ languageCode?: string;
854
+ }): Promise<void>;
855
+ /**
856
+ * Set the bot's name in the given language. Bot-only.
857
+ *
858
+ * @method bs
859
+ */
860
+ setMyName(params?: {
861
+ name?: string;
862
+ languageCode?: string;
863
+ }): Promise<void>;
864
+ /**
865
+ * Set the bot's short description in the given language. Bot-only.
866
+ *
867
+ * @method bs
868
+ */
869
+ setMyShortDescription(params?: {
870
+ shortDescription?: string;
871
+ languageCode?: string;
872
+ }): Promise<void>;
679
873
  /**
680
- * Get chats from a chat list. User-only.
874
+ * Get the bot's description in the given language. Bot-only.
681
875
  *
682
- * @method ch
876
+ * @method bs
877
+ * @returns The current bot's description in the specified language.
683
878
  */
684
- getChats(params?: GetChatsParams): Promise<Chat[]>;
879
+ getMyDescription(params?: {
880
+ languageCode?: string;
881
+ }): Promise<string>;
685
882
  /**
686
- * Get a chat.
883
+ * Get the bot's name in the given language. Bot-only.
687
884
  *
688
- * @method ch
885
+ * @method bs
886
+ * @returns The current bot's name in the specified language.
689
887
  */
690
- getChat(chatId: ID): Promise<Chat>;
888
+ getMyName(params?: {
889
+ languageCode?: string;
890
+ }): Promise<string>;
691
891
  /**
692
- * Get chat history. User-only.
892
+ * Get the bot's short description in the given language. Bot-only.
693
893
  *
694
- * @method ch
695
- * @param chatId The identifier of the chat to get its history.
894
+ * @method bs
895
+ * @returns The current bot's short description in the specified language.
696
896
  */
697
- getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
897
+ getMyShortDescription(params?: {
898
+ languageCode?: string;
899
+ }): Promise<string>;
698
900
  /**
699
- * Get custom emoji documents for download.
901
+ * Set the bot's commands in the given scope and/or language. Bot-only.
700
902
  *
701
- * @method fs
702
- * @param id Identifier of one or more of custom emojis.
703
- * @returns The custom emoji documents.
903
+ * @method bs
904
+ * @param commands The commands to set.
704
905
  */
705
- getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
906
+ setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
706
907
  /**
707
- * Set a chat's available reactions. User-only.
908
+ * Get the bot's commands in the given scope and/or language. Bot-only.
708
909
  *
709
- * @method ch
710
- * @param chatId The identifier of the chat.
711
- * @param availableReactions The new available reactions.
910
+ * @method bs
911
+ * @returns The current bot's commands in the specified language.
712
912
  */
713
- setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
913
+ getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
714
914
  /**
715
915
  * Change reactions made to a message.
716
916
  *
@@ -738,92 +938,6 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
738
938
  * @param reaction The reaction to remove.
739
939
  */
740
940
  removeReaction(chatId: number, messageId: number, reaction: Reaction): Promise<void>;
741
- /**
742
- * Set a chat's photo.
743
- *
744
- * @method ch
745
- * @param chatId The identifier of the chat.
746
- * @param photo A photo to set as the chat's photo.
747
- */
748
- setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
749
- /**
750
- * Delete a chat's photo.
751
- *
752
- * @method ch
753
- * @param chatId The identifier of the chat.
754
- */
755
- deleteChatPhoto(chatId: number): Promise<void>;
756
- /**
757
- * Delete all messages sent by a specific member of a chat. User-only.
758
- *
759
- * @method ms
760
- * @param chatId The identifier of the chat. Must be a supergroup.
761
- * @param memberId The identifier of the member.
762
- */
763
- deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
764
- /**
765
- * Pin a message in a chat.
766
- *
767
- * @method ms
768
- * @param chatId The identifier of the chat that contains the message.
769
- * @param messageId The message's identifier.
770
- */
771
- pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
772
- /**
773
- * Unpin a pinned message.
774
- *
775
- * @method ms
776
- * @param chatId The identifier of the chat that contains the message.
777
- * @param messageId The message's identifier.
778
- */
779
- unpinMessage(chatId: ID, messageId: number): Promise<void>;
780
- /**
781
- * Unpin all pinned messages.
782
- *
783
- * @method ms
784
- * @param chatId The identifier of the chat.
785
- */
786
- unpinMessages(chatId: ID): Promise<void>;
787
- /**
788
- * Ban a member from a chat.
789
- *
790
- * @method ch
791
- * @param chatId The identifier of the chat.
792
- * @param memberId The identifier of the member.
793
- */
794
- banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
795
- /**
796
- * Unban a member from a chat.
797
- *
798
- * @method ch
799
- * @param chatId The identifier of the chat. Must be a supergroup.
800
- * @param memberId The identifier of the member.
801
- */
802
- unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
803
- /**
804
- * Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
805
- *
806
- * @method ch
807
- * @param chatId The identifier of the chat. Must be a supergroup.
808
- * @param memberId The identifier of the member.
809
- */
810
- kickChatMember(chatId: ID, memberId: ID): Promise<void>;
811
- /**
812
- * Set the rights of a chat member.
813
- *
814
- * @method ch
815
- * @param chatId The identifier of the chat. Must be a supergroup.
816
- * @param memberId The identifier of a member.
817
- */
818
- setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
819
- /**
820
- * Get the administrators of a chat.
821
- *
822
- * @method ch
823
- * @param chatId The identifier of the chat.
824
- * @returns The chat's administrators.
825
- */
826
- getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
827
941
  /**
828
942
  * Create a story. User-only.
829
943
  *
@@ -898,104 +1012,11 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
898
1012
  */
899
1013
  removeStoryFromHighlights(chatId: ID, storyId: number): Promise<void>;
900
1014
  /**
901
- * Enable join requests in a chat. User-only.
902
- *
903
- * @method ch
904
- * @param chatId The identifier of the chat. Must be a channel or a supergroup.
905
- */
906
- enableJoinRequests(chatId: ID): Promise<void>;
907
- /**
908
- * Disable join requests in a chat. User-only.
909
- *
910
- * @method ch
911
- * @param chatId The identifier of the chat. Must be a channel or a supergroup.
912
- */
913
- disableJoinRequests(chatId: ID): Promise<void>;
914
- /**
915
- * Show a username in the current account, a bot account, sa upergroup, or a channel's profile. User-only.
916
- *
917
- * @method ac
918
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
919
- * @param username The username to show.
920
- */
921
- showUsername(id: ID, username: string): Promise<void>;
922
- /**
923
- * Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
924
- *
925
- * @method ac
926
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
927
- * @param username The username to hide.
928
- */
929
- hideUsername(id: ID, username: string): Promise<void>;
930
- /**
931
- * Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
932
- *
933
- * @method ac
934
- * @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
935
- * @param order The new order to use.
936
- * @returns Whether the order was changed.
937
- */
938
- reorderUsernames(id: ID, order: string[]): Promise<boolean>;
939
- /**
940
- * Hide all usernames from the a supergroup or a channel's profile. User-only.
941
- *
942
- * @method ac
943
- * @param id A supergroup ID or a channel ID.
944
- */
945
- hideUsernames(id: ID): Promise<boolean>;
946
- /**
947
- * Get inactive chats. User-only.
948
- *
949
- * @method ch
950
- * @retuns A list of inactive chats the current user is member of.
951
- */
952
- getInactiveChats(): Promise<InactiveChat[]>;
953
- /**
954
- * Search the messages of a chat. User-only.
955
- *
956
- * @method ms
957
- * @param chatId The identifier of the chat to search the messages in.
958
- * @param query The message search query.
959
- */
960
- searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
961
- /**
962
- * Set the number of boosts required to circument a chat's default restrictions. User-only.
963
- *
964
- * @method ch
965
- * @param chatId The identifier of the chat.
966
- * @param boosts The number of boosts required to circumvent its restrictions.
967
- */
968
- setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
969
- /**
970
- * Create an invite link.
971
- *
972
- * @method ch
973
- * @param chatId The identifier of the chat to create the invite link for.
974
- * @returns The newly created invite link.
975
- */
976
- createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
977
- /**
978
- * Get the invite links created for a chat. User-only.
979
- *
980
- * @method ch
981
- * @param chatId The identifier of the chat.
982
- * @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.
983
- */
984
- getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
985
- /**
986
- * Join a chat. User-only.
987
- *
988
- * @method ch
989
- * @param chatId The identifier of the chat to join.
990
- */
991
- joinChat(chatId: ID): Promise<void>;
992
- /**
993
- * Leave a chat.
1015
+ * Get network statistics. This might not always be available.
994
1016
  *
995
- * @method ch
996
- * @param chatId The identifier of the chat to leave.
1017
+ * @method mc
997
1018
  */
998
- leaveChat(chatId: ID): Promise<void>;
1019
+ getNetworkStatistics(): Promise<NetworkStatistics>;
999
1020
  /**
1000
1021
  * Block a user. User-only.
1001
1022
  *
@@ -1010,28 +1031,5 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
1010
1031
  * @param userId The identifier of the user to unblock.
1011
1032
  */
1012
1033
  unblockUser(userId: ID): Promise<void>;
1013
- /**
1014
- * Get information on a user's chat membership.
1015
- *
1016
- * @method ch
1017
- * @param chatId The identifier of a chat that includes the user.
1018
- * @param userId The identifier of the user.
1019
- */
1020
- getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
1021
- /**
1022
- * Set a chat's sticker set.
1023
- *
1024
- * @method ch
1025
- * @param chatId The identifier of the chat. Must be a supergroup.
1026
- * @param setName The name of the set.
1027
- */
1028
- setChatStickerSet(chatId: ID, setName: string): Promise<void>;
1029
- /**
1030
- * Delete a chat's sticker set.
1031
- *
1032
- * @method ch
1033
- * @param chatId The identifier of the chat. Must be a supergroup.
1034
- */
1035
- deleteChatStickerSet(chatId: ID): Promise<void>;
1036
1034
  }
1037
1035
  export {};