@mtkruto/node 0.0.997 → 0.0.999

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 (347) hide show
  1. package/esm/0_deps.d.ts +2 -2
  2. package/esm/0_deps.js +2 -2
  3. package/esm/3_types.d.ts +39 -3
  4. package/esm/3_types.js +39 -3
  5. package/esm/4_constants.d.ts +1 -1
  6. package/esm/4_constants.js +1 -1
  7. package/esm/client/0_html.js +1 -1
  8. package/esm/client/3_types.d.ts +3 -6
  9. package/esm/client/3_types.js +1 -1
  10. package/esm/client/4_client.d.ts +20 -5
  11. package/esm/client/4_client.js +56 -40
  12. package/esm/connection/1_connection_web_socket.js +2 -1
  13. package/esm/deps/deno.land/std@0.201.0/assert/assert_greater.d.ts +5 -0
  14. package/esm/deps/deno.land/std@0.201.0/assert/assert_greater.js +14 -0
  15. package/esm/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.d.ts +5 -0
  16. package/esm/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.js +14 -0
  17. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.js +2 -2
  18. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.js +4 -1
  19. package/esm/deps/deno.land/std@0.201.0/assert/assert_less.d.ts +5 -0
  20. package/esm/deps/deno.land/std@0.201.0/assert/assert_less.js +14 -0
  21. package/esm/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.d.ts +5 -0
  22. package/esm/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.js +14 -0
  23. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.d.ts +4 -0
  24. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.js +4 -0
  25. package/{script/deps/deno.land/std@0.200.0 → esm/deps/deno.land/std@0.201.0}/fmt/colors.d.ts +8 -1
  26. package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/fmt/colors.js +8 -1
  27. package/esm/tl/3_tl_reader.d.ts +1 -1
  28. package/esm/tl/3_tl_reader.js +6 -0
  29. package/esm/tl/4_tl_writer.js +8 -0
  30. package/esm/tl/6_message.js +3 -0
  31. package/esm/types/0_bot_command.d.ts +4 -0
  32. package/esm/types/0_chat_action.d.ts +1 -1
  33. package/esm/types/0_chat_id.d.ts +4 -0
  34. package/esm/types/0_chat_id.js +1 -0
  35. package/esm/types/0_chat_photo.js +1 -1
  36. package/esm/types/0_input_contact_message_content.d.ts +6 -0
  37. package/esm/types/0_input_contact_message_content.js +1 -0
  38. package/esm/types/0_input_location_message_content.d.ts +8 -0
  39. package/esm/types/0_input_location_message_content.js +1 -0
  40. package/esm/types/0_input_venue_message_content.d.ts +10 -0
  41. package/esm/types/0_input_venue_message_content.js +1 -0
  42. package/esm/types/0_labeled_price.d.ts +4 -0
  43. package/esm/types/0_labeled_price.js +1 -0
  44. package/esm/types/0_message_entity.d.ts +10 -10
  45. package/esm/types/0_message_entity.js +12 -12
  46. package/esm/types/0_parse_mode.d.ts +1 -0
  47. package/esm/types/0_parse_mode.js +1 -0
  48. package/esm/types/0_thumbnail.js +1 -1
  49. package/esm/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
  50. package/esm/types/1__getters.js +1 -0
  51. package/esm/types/1_bot_command_scope.d.ts +32 -0
  52. package/esm/types/1_bot_command_scope.js +27 -0
  53. package/esm/types/1_chat.d.ts +5 -10
  54. package/esm/types/1_chat.js +4 -11
  55. package/esm/types/1_inline_query_result_button.d.ts +6 -0
  56. package/esm/types/1_inline_query_result_button.js +1 -0
  57. package/esm/types/1_input_invoice_message_content.d.ts +23 -0
  58. package/esm/types/1_input_invoice_message_content.js +1 -0
  59. package/esm/types/1_input_text_message_content.d.ts +8 -0
  60. package/esm/types/1_input_text_message_content.js +1 -0
  61. package/esm/types/1_photo.js +1 -1
  62. package/esm/types/1_sticker.d.ts +2 -2
  63. package/esm/types/1_sticker.js +1 -1
  64. package/esm/types/2_game.js +1 -1
  65. package/esm/types/{1_inline_keyboard_button.d.ts → 2_inline_keyboard_button.d.ts} +2 -2
  66. package/esm/types/2_inline_query.d.ts +1 -1
  67. package/esm/types/2_input_message_content.d.ts +6 -0
  68. package/esm/types/2_input_message_content.js +1 -0
  69. package/{script/types/2_inline_keyboard_markup.d.ts → esm/types/3_inline_keyboard_markup.d.ts} +3 -2
  70. package/esm/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +1 -1
  71. package/esm/types/3_message.d.ts +2 -2
  72. package/esm/types/3_message.js +5 -5
  73. package/esm/types/4_callback_query.d.ts +1 -1
  74. package/esm/types/4_inline_query_result_article.d.ts +15 -0
  75. package/esm/types/4_inline_query_result_article.js +1 -0
  76. package/esm/types/4_inline_query_result_audio.d.ts +17 -0
  77. package/esm/types/4_inline_query_result_audio.js +1 -0
  78. package/esm/types/4_inline_query_result_cached_audio.d.ts +14 -0
  79. package/esm/types/4_inline_query_result_cached_audio.js +1 -0
  80. package/esm/types/4_inline_query_result_cached_document.d.ts +15 -0
  81. package/esm/types/4_inline_query_result_cached_document.js +1 -0
  82. package/esm/types/4_inline_query_result_cached_gif.d.ts +15 -0
  83. package/esm/types/4_inline_query_result_cached_gif.js +1 -0
  84. package/esm/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
  85. package/esm/types/4_inline_query_result_cached_mpeg4_gif.js +1 -0
  86. package/esm/types/4_inline_query_result_cached_photo.d.ts +16 -0
  87. package/esm/types/4_inline_query_result_cached_photo.js +1 -0
  88. package/esm/types/4_inline_query_result_cached_sticker.d.ts +9 -0
  89. package/esm/types/4_inline_query_result_cached_sticker.js +1 -0
  90. package/esm/types/4_inline_query_result_cached_video.d.ts +16 -0
  91. package/esm/types/4_inline_query_result_cached_video.js +1 -0
  92. package/esm/types/4_inline_query_result_cached_voice.d.ts +15 -0
  93. package/esm/types/4_inline_query_result_cached_voice.js +1 -0
  94. package/esm/types/4_inline_query_result_contact.d.ts +15 -0
  95. package/esm/types/4_inline_query_result_contact.js +1 -0
  96. package/esm/types/4_inline_query_result_document.d.ts +18 -0
  97. package/esm/types/4_inline_query_result_document.js +1 -0
  98. package/esm/types/4_inline_query_result_game.d.ts +7 -0
  99. package/esm/types/4_inline_query_result_game.js +1 -0
  100. package/esm/types/4_inline_query_result_gif.d.ts +20 -0
  101. package/esm/types/4_inline_query_result_gif.js +1 -0
  102. package/esm/types/4_inline_query_result_location.d.ts +18 -0
  103. package/esm/types/4_inline_query_result_location.js +1 -0
  104. package/esm/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
  105. package/esm/types/4_inline_query_result_mpeg4_gif.js +1 -0
  106. package/esm/types/4_inline_query_result_photo.d.ts +19 -0
  107. package/esm/types/4_inline_query_result_photo.js +1 -0
  108. package/esm/types/4_inline_query_result_venue.d.ts +19 -0
  109. package/esm/types/4_inline_query_result_venue.js +1 -0
  110. package/esm/types/4_inline_query_result_video.d.ts +21 -0
  111. package/esm/types/4_inline_query_result_video.js +1 -0
  112. package/esm/types/4_inline_query_result_voice.d.ts +16 -0
  113. package/esm/types/4_inline_query_result_voice.js +1 -0
  114. package/esm/types/4_reply_markup.d.ts +7 -0
  115. package/esm/types/4_reply_markup.js +22 -0
  116. package/esm/types/5_inline_query_result.d.ts +29 -0
  117. package/esm/types/5_inline_query_result.js +256 -0
  118. package/package.json +1 -1
  119. package/script/0_deps.d.ts +2 -2
  120. package/script/0_deps.js +2 -2
  121. package/script/3_types.d.ts +39 -3
  122. package/script/3_types.js +39 -3
  123. package/script/4_constants.d.ts +1 -1
  124. package/script/4_constants.js +1 -1
  125. package/script/client/0_html.js +1 -1
  126. package/script/client/3_types.d.ts +3 -6
  127. package/script/client/3_types.js +3 -0
  128. package/script/client/4_client.d.ts +20 -5
  129. package/script/client/4_client.js +55 -39
  130. package/script/connection/1_connection_web_socket.js +2 -1
  131. package/script/deps/deno.land/std@0.201.0/assert/assert_greater.d.ts +5 -0
  132. package/script/deps/deno.land/std@0.201.0/assert/assert_greater.js +18 -0
  133. package/script/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.d.ts +5 -0
  134. package/script/deps/deno.land/std@0.201.0/assert/assert_greater_or_equal.js +18 -0
  135. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.js +2 -2
  136. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.js +4 -1
  137. package/script/deps/deno.land/std@0.201.0/assert/assert_less.d.ts +5 -0
  138. package/script/deps/deno.land/std@0.201.0/assert/assert_less.js +18 -0
  139. package/script/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.d.ts +5 -0
  140. package/script/deps/deno.land/std@0.201.0/assert/assert_less_or_equal.js +18 -0
  141. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.d.ts +4 -0
  142. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/mod.js +4 -0
  143. package/{esm/deps/deno.land/std@0.200.0 → script/deps/deno.land/std@0.201.0}/fmt/colors.d.ts +8 -1
  144. package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/fmt/colors.js +10 -3
  145. package/script/tl/3_tl_reader.d.ts +1 -1
  146. package/script/tl/3_tl_reader.js +6 -0
  147. package/script/tl/4_tl_writer.js +8 -0
  148. package/script/tl/6_message.js +3 -0
  149. package/script/types/0_bot_command.d.ts +4 -0
  150. package/script/types/0_chat_action.d.ts +1 -1
  151. package/script/types/0_chat_id.d.ts +4 -0
  152. package/script/types/0_chat_id.js +2 -0
  153. package/script/types/0_chat_photo.js +7 -7
  154. package/script/types/0_input_contact_message_content.d.ts +6 -0
  155. package/script/types/0_input_contact_message_content.js +2 -0
  156. package/script/types/0_input_location_message_content.d.ts +8 -0
  157. package/script/types/0_input_location_message_content.js +2 -0
  158. package/script/types/0_input_venue_message_content.d.ts +10 -0
  159. package/script/types/0_input_venue_message_content.js +2 -0
  160. package/script/types/0_labeled_price.d.ts +4 -0
  161. package/script/types/0_labeled_price.js +2 -0
  162. package/script/types/0_message_entity.d.ts +10 -10
  163. package/script/types/0_message_entity.js +12 -12
  164. package/script/types/0_parse_mode.d.ts +1 -0
  165. package/script/types/0_parse_mode.js +2 -0
  166. package/script/types/0_thumbnail.js +5 -5
  167. package/script/types/{!0_misc.d.ts → 1__getters.d.ts} +7 -0
  168. package/script/types/1__getters.js +2 -0
  169. package/script/types/1_bot_command_scope.d.ts +32 -0
  170. package/script/types/1_bot_command_scope.js +31 -0
  171. package/script/types/1_chat.d.ts +5 -10
  172. package/script/types/1_chat.js +5 -12
  173. package/script/types/1_inline_query_result_button.d.ts +6 -0
  174. package/script/types/1_inline_query_result_button.js +2 -0
  175. package/script/types/1_input_invoice_message_content.d.ts +23 -0
  176. package/script/types/1_input_invoice_message_content.js +2 -0
  177. package/script/types/1_input_text_message_content.d.ts +8 -0
  178. package/script/types/1_input_text_message_content.js +2 -0
  179. package/script/types/1_photo.js +5 -5
  180. package/script/types/1_sticker.d.ts +2 -2
  181. package/script/types/1_sticker.js +1 -1
  182. package/script/types/2_game.js +3 -3
  183. package/script/types/{1_inline_keyboard_button.d.ts → 2_inline_keyboard_button.d.ts} +2 -2
  184. package/script/types/2_inline_query.d.ts +1 -1
  185. package/script/types/2_input_message_content.d.ts +6 -0
  186. package/script/types/2_input_message_content.js +2 -0
  187. package/{esm/types/2_inline_keyboard_markup.d.ts → script/types/3_inline_keyboard_markup.d.ts} +3 -2
  188. package/script/types/{2_inline_keyboard_markup.js → 3_inline_keyboard_markup.js} +3 -3
  189. package/script/types/3_message.d.ts +2 -2
  190. package/script/types/3_message.js +14 -14
  191. package/script/types/4_callback_query.d.ts +1 -1
  192. package/script/types/4_inline_query_result_article.d.ts +15 -0
  193. package/script/types/4_inline_query_result_article.js +2 -0
  194. package/script/types/4_inline_query_result_audio.d.ts +17 -0
  195. package/script/types/4_inline_query_result_audio.js +2 -0
  196. package/script/types/4_inline_query_result_cached_audio.d.ts +14 -0
  197. package/script/types/4_inline_query_result_cached_audio.js +2 -0
  198. package/script/types/4_inline_query_result_cached_document.d.ts +15 -0
  199. package/script/types/4_inline_query_result_cached_document.js +2 -0
  200. package/script/types/4_inline_query_result_cached_gif.d.ts +15 -0
  201. package/script/types/4_inline_query_result_cached_gif.js +2 -0
  202. package/script/types/4_inline_query_result_cached_mpeg4_gif.d.ts +15 -0
  203. package/script/types/4_inline_query_result_cached_mpeg4_gif.js +2 -0
  204. package/script/types/4_inline_query_result_cached_photo.d.ts +16 -0
  205. package/script/types/4_inline_query_result_cached_photo.js +2 -0
  206. package/script/types/4_inline_query_result_cached_sticker.d.ts +9 -0
  207. package/script/types/4_inline_query_result_cached_sticker.js +2 -0
  208. package/script/types/4_inline_query_result_cached_video.d.ts +16 -0
  209. package/script/types/4_inline_query_result_cached_video.js +2 -0
  210. package/script/types/4_inline_query_result_cached_voice.d.ts +15 -0
  211. package/script/types/4_inline_query_result_cached_voice.js +2 -0
  212. package/script/types/4_inline_query_result_contact.d.ts +15 -0
  213. package/script/types/4_inline_query_result_contact.js +2 -0
  214. package/script/types/4_inline_query_result_document.d.ts +18 -0
  215. package/script/types/4_inline_query_result_document.js +2 -0
  216. package/script/types/4_inline_query_result_game.d.ts +7 -0
  217. package/script/types/4_inline_query_result_game.js +2 -0
  218. package/script/types/4_inline_query_result_gif.d.ts +20 -0
  219. package/script/types/4_inline_query_result_gif.js +2 -0
  220. package/script/types/4_inline_query_result_location.d.ts +18 -0
  221. package/script/types/4_inline_query_result_location.js +2 -0
  222. package/script/types/4_inline_query_result_mpeg4_gif.d.ts +20 -0
  223. package/script/types/4_inline_query_result_mpeg4_gif.js +2 -0
  224. package/script/types/4_inline_query_result_photo.d.ts +19 -0
  225. package/script/types/4_inline_query_result_photo.js +2 -0
  226. package/script/types/4_inline_query_result_venue.d.ts +19 -0
  227. package/script/types/4_inline_query_result_venue.js +2 -0
  228. package/script/types/4_inline_query_result_video.d.ts +21 -0
  229. package/script/types/4_inline_query_result_video.js +2 -0
  230. package/script/types/4_inline_query_result_voice.d.ts +16 -0
  231. package/script/types/4_inline_query_result_voice.js +2 -0
  232. package/script/types/4_reply_markup.d.ts +7 -0
  233. package/script/types/4_reply_markup.js +26 -0
  234. package/script/types/5_inline_query_result.d.ts +29 -0
  235. package/script/types/5_inline_query_result.js +260 -0
  236. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.d.ts +0 -0
  237. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.js +0 -0
  238. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.d.ts +0 -0
  239. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.js +0 -0
  240. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.d.ts +0 -0
  241. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.js +0 -0
  242. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.d.ts +0 -0
  243. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.js +0 -0
  244. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.d.ts +0 -0
  245. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.js +0 -0
  246. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.d.ts +0 -0
  247. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.js +0 -0
  248. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.d.ts +0 -0
  249. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.js +0 -0
  250. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.d.ts +0 -0
  251. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.js +0 -0
  252. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.d.ts +0 -0
  253. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.js +0 -0
  254. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.d.ts +0 -0
  255. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.d.ts +0 -0
  256. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.d.ts +0 -0
  257. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.js +0 -0
  258. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.d.ts +0 -0
  259. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.js +0 -0
  260. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.d.ts +0 -0
  261. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.js +0 -0
  262. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.d.ts +0 -0
  263. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.js +0 -0
  264. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.d.ts +0 -0
  265. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.js +0 -0
  266. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.d.ts +0 -0
  267. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.js +0 -0
  268. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.d.ts +0 -0
  269. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.js +0 -0
  270. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.d.ts +0 -0
  271. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.js +0 -0
  272. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.d.ts +0 -0
  273. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.js +0 -0
  274. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.d.ts +0 -0
  275. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.js +0 -0
  276. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.d.ts +0 -0
  277. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.js +0 -0
  278. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.d.ts +0 -0
  279. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.js +0 -0
  280. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.d.ts +0 -0
  281. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.js +0 -0
  282. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.d.ts +0 -0
  283. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.js +0 -0
  284. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.d.ts +0 -0
  285. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.js +0 -0
  286. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.d.ts +0 -0
  287. /package/esm/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.js +0 -0
  288. /package/esm/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
  289. /package/esm/types/{!0_file_id.js → 0__file_id.js} +0 -0
  290. /package/esm/types/{!0_misc.js → 0_bot_command.js} +0 -0
  291. /package/esm/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
  292. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.d.ts +0 -0
  293. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_constants.js +0 -0
  294. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.d.ts +0 -0
  295. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_diff.js +0 -0
  296. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.d.ts +0 -0
  297. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/_format.js +0 -0
  298. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.d.ts +0 -0
  299. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert.js +0 -0
  300. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.d.ts +0 -0
  301. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_almost_equals.js +0 -0
  302. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.d.ts +0 -0
  303. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_array_includes.js +0 -0
  304. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.d.ts +0 -0
  305. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_equals.js +0 -0
  306. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.d.ts +0 -0
  307. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_exists.js +0 -0
  308. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.d.ts +0 -0
  309. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_false.js +0 -0
  310. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_instance_of.d.ts +0 -0
  311. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_is_error.d.ts +0 -0
  312. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.d.ts +0 -0
  313. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_match.js +0 -0
  314. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.d.ts +0 -0
  315. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_equals.js +0 -0
  316. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.d.ts +0 -0
  317. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_instance_of.js +0 -0
  318. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.d.ts +0 -0
  319. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_match.js +0 -0
  320. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.d.ts +0 -0
  321. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_not_strict_equals.js +0 -0
  322. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.d.ts +0 -0
  323. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_object_match.js +0 -0
  324. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.d.ts +0 -0
  325. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_rejects.js +0 -0
  326. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.d.ts +0 -0
  327. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_strict_equals.js +0 -0
  328. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.d.ts +0 -0
  329. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_string_includes.js +0 -0
  330. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.d.ts +0 -0
  331. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assert_throws.js +0 -0
  332. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.d.ts +0 -0
  333. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/assertion_error.js +0 -0
  334. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.d.ts +0 -0
  335. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/equal.js +0 -0
  336. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.d.ts +0 -0
  337. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/fail.js +0 -0
  338. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.d.ts +0 -0
  339. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unimplemented.js +0 -0
  340. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.d.ts +0 -0
  341. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/assert/unreachable.js +0 -0
  342. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.d.ts +0 -0
  343. /package/script/deps/deno.land/{std@0.200.0 → std@0.201.0}/encoding/base64.js +0 -0
  344. /package/script/types/{!0_file_id.d.ts → 0__file_id.d.ts} +0 -0
  345. /package/script/types/{!0_file_id.js → 0__file_id.js} +0 -0
  346. /package/script/types/{!0_misc.js → 0_bot_command.js} +0 -0
  347. /package/script/types/{1_inline_keyboard_button.js → 2_inline_keyboard_button.js} +0 -0
package/esm/0_deps.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./deps/deno.land/std@0.200.0/assert/mod.js";
1
+ export * from "./deps/deno.land/std@0.201.0/assert/mod.js";
2
2
  export { ctr256Decrypt, ctr256Encrypt, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.1.3/mod.js";
3
3
  export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
4
4
  export { Mutex, type MutexInterface } from "async-mutex";
5
5
  export { Parser } from "./deps/deno.land/x/html_parser@v0.1.3/src/mod.js";
6
6
  import { debug as debug_ } from "./deps/raw.githubusercontent.com/MTKruto/debug/main/mod.js";
7
7
  export declare const debug: typeof debug_;
8
- export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.200.0/encoding/base64.js";
8
+ export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.201.0/encoding/base64.js";
package/esm/0_deps.js CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./deps/deno.land/std@0.200.0/assert/mod.js";
1
+ export * from "./deps/deno.land/std@0.201.0/assert/mod.js";
2
2
  export { ctr256Decrypt, ctr256Encrypt, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.1.3/mod.js";
3
3
  export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
4
4
  export { Mutex } from "async-mutex";
5
5
  export { Parser } from "./deps/deno.land/x/html_parser@v0.1.3/src/mod.js";
6
6
  import { debug as debug_ } from "./deps/raw.githubusercontent.com/MTKruto/debug/main/mod.js";
7
7
  export const debug = (v) => debug_(v);
8
- export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.200.0/encoding/base64.js";
8
+ export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.201.0/encoding/base64.js";
package/esm/3_types.d.ts CHANGED
@@ -1,16 +1,24 @@
1
- export * from "./types/!0_file_id.js";
2
1
  export * from "./types/0_audio.js";
2
+ export * from "./types/0_bot_command.js";
3
3
  export * from "./types/0_chat_action.js";
4
4
  export * from "./types/0_chat_administrator_rights.js";
5
+ export * from "./types/0_chat_id.js";
5
6
  export * from "./types/0_chat_photo.js";
7
+ export * from "./types/0_color.js";
6
8
  export * from "./types/0_contact.js";
7
9
  export * from "./types/0_dice.js";
10
+ export * from "./types/0__file_id.js";
8
11
  export * from "./types/0_force_reply.js";
12
+ export * from "./types/0_input_contact_message_content.js";
13
+ export * from "./types/0_input_location_message_content.js";
14
+ export * from "./types/0_input_venue_message_content.js";
9
15
  export * from "./types/0_keyboard_button_poll_type.js";
16
+ export * from "./types/0_labeled_price.js";
10
17
  export * from "./types/0_location.js";
11
18
  export * from "./types/0_login_url.js";
12
19
  export * from "./types/0_mask_position.js";
13
20
  export * from "./types/0_message_entity.js";
21
+ export * from "./types/0_parse_mode.js";
14
22
  export * from "./types/0_poll_option.js";
15
23
  export * from "./types/0_reply_keyboard_remove.js";
16
24
  export * from "./types/0_thumbnail.js";
@@ -18,9 +26,13 @@ export * from "./types/0_venue.js";
18
26
  export * from "./types/0_voice.js";
19
27
  export * from "./types/0_web_app_info.js";
20
28
  export * from "./types/1_animation.js";
29
+ export * from "./types/1_bot_command_scope.js";
21
30
  export * from "./types/1_chat.js";
22
31
  export * from "./types/1_document.js";
23
- export * from "./types/1_inline_keyboard_button.js";
32
+ export * from "./types/1__getters.js";
33
+ export * from "./types/1_inline_query_result_button.js";
34
+ export * from "./types/1_input_invoice_message_content.js";
35
+ export * from "./types/1_input_text_message_content.js";
24
36
  export * from "./types/1_keyboard_button.js";
25
37
  export * from "./types/1_photo.js";
26
38
  export * from "./types/1_poll.js";
@@ -29,8 +41,32 @@ export * from "./types/1_user.js";
29
41
  export * from "./types/1_video_note.js";
30
42
  export * from "./types/1_video.js";
31
43
  export * from "./types/2_game.js";
32
- export * from "./types/2_inline_keyboard_markup.js";
44
+ export * from "./types/2_inline_keyboard_button.js";
33
45
  export * from "./types/2_inline_query.js";
46
+ export * from "./types/2_input_message_content.js";
34
47
  export * from "./types/2_reply_keyboard_markup.js";
48
+ export * from "./types/3_inline_keyboard_markup.js";
35
49
  export * from "./types/3_message.js";
36
50
  export * from "./types/4_callback_query.js";
51
+ export * from "./types/4_inline_query_result_article.js";
52
+ export * from "./types/4_inline_query_result_audio.js";
53
+ export * from "./types/4_inline_query_result_cached_audio.js";
54
+ export * from "./types/4_inline_query_result_cached_document.js";
55
+ export * from "./types/4_inline_query_result_cached_gif.js";
56
+ export * from "./types/4_inline_query_result_cached_mpeg4_gif.js";
57
+ export * from "./types/4_inline_query_result_cached_photo.js";
58
+ export * from "./types/4_inline_query_result_cached_sticker.js";
59
+ export * from "./types/4_inline_query_result_cached_video.js";
60
+ export * from "./types/4_inline_query_result_cached_voice.js";
61
+ export * from "./types/4_inline_query_result_contact.js";
62
+ export * from "./types/4_inline_query_result_document.js";
63
+ export * from "./types/4_inline_query_result_game.js";
64
+ export * from "./types/4_inline_query_result_gif.js";
65
+ export * from "./types/4_inline_query_result_location.js";
66
+ export * from "./types/4_inline_query_result_mpeg4_gif.js";
67
+ export * from "./types/4_inline_query_result_photo.js";
68
+ export * from "./types/4_inline_query_result_venue.js";
69
+ export * from "./types/4_inline_query_result_video.js";
70
+ export * from "./types/4_inline_query_result_voice.js";
71
+ export * from "./types/4_reply_markup.js";
72
+ export * from "./types/5_inline_query_result.js";
package/esm/3_types.js CHANGED
@@ -1,16 +1,24 @@
1
- export * from "./types/!0_file_id.js";
2
1
  export * from "./types/0_audio.js";
2
+ export * from "./types/0_bot_command.js";
3
3
  export * from "./types/0_chat_action.js";
4
4
  export * from "./types/0_chat_administrator_rights.js";
5
+ export * from "./types/0_chat_id.js";
5
6
  export * from "./types/0_chat_photo.js";
7
+ export * from "./types/0_color.js";
6
8
  export * from "./types/0_contact.js";
7
9
  export * from "./types/0_dice.js";
10
+ export * from "./types/0__file_id.js";
8
11
  export * from "./types/0_force_reply.js";
12
+ export * from "./types/0_input_contact_message_content.js";
13
+ export * from "./types/0_input_location_message_content.js";
14
+ export * from "./types/0_input_venue_message_content.js";
9
15
  export * from "./types/0_keyboard_button_poll_type.js";
16
+ export * from "./types/0_labeled_price.js";
10
17
  export * from "./types/0_location.js";
11
18
  export * from "./types/0_login_url.js";
12
19
  export * from "./types/0_mask_position.js";
13
20
  export * from "./types/0_message_entity.js";
21
+ export * from "./types/0_parse_mode.js";
14
22
  export * from "./types/0_poll_option.js";
15
23
  export * from "./types/0_reply_keyboard_remove.js";
16
24
  export * from "./types/0_thumbnail.js";
@@ -18,9 +26,13 @@ export * from "./types/0_venue.js";
18
26
  export * from "./types/0_voice.js";
19
27
  export * from "./types/0_web_app_info.js";
20
28
  export * from "./types/1_animation.js";
29
+ export * from "./types/1_bot_command_scope.js";
21
30
  export * from "./types/1_chat.js";
22
31
  export * from "./types/1_document.js";
23
- export * from "./types/1_inline_keyboard_button.js";
32
+ export * from "./types/1__getters.js";
33
+ export * from "./types/1_inline_query_result_button.js";
34
+ export * from "./types/1_input_invoice_message_content.js";
35
+ export * from "./types/1_input_text_message_content.js";
24
36
  export * from "./types/1_keyboard_button.js";
25
37
  export * from "./types/1_photo.js";
26
38
  export * from "./types/1_poll.js";
@@ -29,8 +41,32 @@ export * from "./types/1_user.js";
29
41
  export * from "./types/1_video_note.js";
30
42
  export * from "./types/1_video.js";
31
43
  export * from "./types/2_game.js";
32
- export * from "./types/2_inline_keyboard_markup.js";
44
+ export * from "./types/2_inline_keyboard_button.js";
33
45
  export * from "./types/2_inline_query.js";
46
+ export * from "./types/2_input_message_content.js";
34
47
  export * from "./types/2_reply_keyboard_markup.js";
48
+ export * from "./types/3_inline_keyboard_markup.js";
35
49
  export * from "./types/3_message.js";
36
50
  export * from "./types/4_callback_query.js";
51
+ export * from "./types/4_inline_query_result_article.js";
52
+ export * from "./types/4_inline_query_result_audio.js";
53
+ export * from "./types/4_inline_query_result_cached_audio.js";
54
+ export * from "./types/4_inline_query_result_cached_document.js";
55
+ export * from "./types/4_inline_query_result_cached_gif.js";
56
+ export * from "./types/4_inline_query_result_cached_mpeg4_gif.js";
57
+ export * from "./types/4_inline_query_result_cached_photo.js";
58
+ export * from "./types/4_inline_query_result_cached_sticker.js";
59
+ export * from "./types/4_inline_query_result_cached_video.js";
60
+ export * from "./types/4_inline_query_result_cached_voice.js";
61
+ export * from "./types/4_inline_query_result_contact.js";
62
+ export * from "./types/4_inline_query_result_document.js";
63
+ export * from "./types/4_inline_query_result_game.js";
64
+ export * from "./types/4_inline_query_result_gif.js";
65
+ export * from "./types/4_inline_query_result_location.js";
66
+ export * from "./types/4_inline_query_result_mpeg4_gif.js";
67
+ export * from "./types/4_inline_query_result_photo.js";
68
+ export * from "./types/4_inline_query_result_venue.js";
69
+ export * from "./types/4_inline_query_result_video.js";
70
+ export * from "./types/4_inline_query_result_voice.js";
71
+ export * from "./types/4_reply_markup.js";
72
+ export * from "./types/5_inline_query_result.js";
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
5
5
  export declare const VECTOR_CONSTRUCTOR = 481674261;
6
6
  export declare const INITIAL_DC: DC;
7
7
  export declare const LAYER = 161;
8
- export declare const APP_VERSION = "MTKruto 0.0.997";
8
+ export declare const APP_VERSION = "MTKruto 0.0.999";
9
9
  export declare const DEVICE_MODEL: string;
10
10
  export declare const LANG_CODE: string;
11
11
  export declare const LANG_PACK = "";
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
54
54
  export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
55
55
  export const INITIAL_DC = "2-test";
56
56
  export const LAYER = 161;
57
- export const APP_VERSION = "MTKruto 0.0.997";
57
+ export const APP_VERSION = "MTKruto 0.0.999";
58
58
  // @ts-ignore: lib
59
59
  export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
60
60
  export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
@@ -27,7 +27,7 @@ export function parseHtml(html) {
27
27
  if (!url) {
28
28
  throw new Error("Missing attribute href");
29
29
  }
30
- queue.push({ type: "text_link", offset: text.length, length: 0, url });
30
+ queue.push({ type: "textLink", offset: text.length, length: 0, url });
31
31
  break;
32
32
  }
33
33
  case "ins":
@@ -1,8 +1,8 @@
1
1
  import { MaybePromise } from "../1_utilities.js";
2
- import { CallbackQuery, ForceReply, InlineKeyboardMarkup, InlineQuery, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "../3_types.js";
2
+ import { CallbackQuery, ChatID, ForceReply, InlineKeyboardMarkup, InlineQuery, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "../3_types.js";
3
3
  import { With } from "./0_utilities.js";
4
4
  import { ClientPlainParams } from "./2_client_plain.js";
5
- export type ParseMode = "html" | "none";
5
+ export type ParseMode = "HTML" | null;
6
6
  export interface ClientParams extends ClientPlainParams {
7
7
  /**
8
8
  * A parse mode to use when the `parseMode` parameter is not specified when sending or editing messages. Defauls to `ParseMode.None`.
@@ -52,10 +52,6 @@ export interface AuthorizeUserParams<S = string> {
52
52
  code: S | (() => MaybePromise<S>);
53
53
  password: S | ((hint: string | null) => MaybePromise<S>);
54
54
  }
55
- /**
56
- * A chat identifier as provided by MTKruto or a string starting with a @ that is followed by a username.
57
- */
58
- export type ChatID = number | string;
59
55
  export interface SendMessagesParams {
60
56
  /**
61
57
  * The parse mode to use. If not provided, the default parse mode will be used.
@@ -217,3 +213,4 @@ export interface Handler<U extends Partial<Update> = Partial<Update>> {
217
213
  export type FilterUpdate<U extends Update, T extends keyof U, F extends keyof NonNullable<U[T]>> = With<U, T> & Pick<{
218
214
  [P in T]-?: With<NonNullable<U[T]>, F>;
219
215
  }, T>;
216
+ export declare const skip: Handler;
@@ -1 +1 @@
1
- export {};
1
+ export const skip = (__, _) => _();
@@ -2,10 +2,10 @@ import { MaybePromise } from "../1_utilities.js";
2
2
  import { functions, ReadObject, types } from "../2_tl.js";
3
3
  import { Storage } from "../3_storage.js";
4
4
  import { DC } from "../3_transport.js";
5
- import { ChatAction, Message } from "../3_types.js";
5
+ import { BotCommand, BotCommandScope, ChatAction, ChatID, InlineQueryResult, InlineQueryResultButton, Message } from "../3_types.js";
6
6
  import { With } from "./0_utilities.js";
7
7
  import { ClientAbstract } from "./1_client_abstract.js";
8
- import { AnswerCallbackQueryParams, AuthorizeUserParams, ChatID, ClientParams, EditMessageParams, FilterableUpdates, FilterUpdate, ForwardMessagesParams, Handler, ParseMode, SendMessagesParams, SendPollParams, Update } from "./3_types.js";
8
+ import { AnswerCallbackQueryParams, AuthorizeUserParams, ClientParams, EditMessageParams, FilterableUpdates, FilterUpdate, ForwardMessagesParams, Handler, ParseMode, SendMessagesParams, SendPollParams, Update } from "./3_types.js";
9
9
  export declare const getEntity: unique symbol;
10
10
  export declare const getStickerSetName: unique symbol;
11
11
  export declare const handleMigrationError: unique symbol;
@@ -36,7 +36,6 @@ export declare class Client extends ClientAbstract {
36
36
  * @param storage The storage provider to use. Defaults to memory storage.
37
37
  * @param apiId App's API ID from [my.telegram.org](https://my.telegram.org/apps). Defaults to 0 (unset).
38
38
  * @param apiHash App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Defaults to empty string (unset).
39
- * @param params Other parameters.
40
39
  */
41
40
  constructor(storage?: Storage, apiId?: number | null, apiHash?: string | null, params?: ClientParams);
42
41
  private propagateConnectionState;
@@ -193,6 +192,7 @@ export declare class Client extends ClientAbstract {
193
192
  * @param id ID of the callback query to answer.
194
193
  */
195
194
  answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
195
+ private usernameResolver;
196
196
  private constructReplyMarkup;
197
197
  private static assertMsgHas;
198
198
  /**
@@ -211,10 +211,25 @@ export declare class Client extends ClientAbstract {
211
211
  * @param messageThreadId The thread to send the chat action to.
212
212
  */
213
213
  sendChatAction(chatId: ChatID, action_: ChatAction, messageThreadId?: number): Promise<void>;
214
+ setMyCommands(commands: BotCommand[], params?: {
215
+ languageCode?: string;
216
+ scope?: BotCommandScope;
217
+ }): Promise<void>;
218
+ getMyCommands(params?: {
219
+ languageCode?: string;
220
+ scope?: BotCommandScope;
221
+ }): Promise<BotCommand[]>;
222
+ answerInlineQuery(id: string, results: InlineQueryResult[], params?: {
223
+ cacheTime?: number;
224
+ isPersonal?: boolean;
225
+ nextOffset?: string;
226
+ isGallery?: boolean;
227
+ button: InlineQueryResultButton;
228
+ }): Promise<void>;
214
229
  private handle;
215
230
  use(handler: Handler): void;
216
231
  branch(predicate: (upd: Update) => MaybePromise<boolean>, trueHandler: Handler, falseHandler: Handler): void;
217
- filter<D extends Update>(predicate: (ctx: Update) => ctx is D, handler: Handler<D>): void;
218
- filter(predicate: (ctx: Update) => MaybePromise<boolean>, handler: Handler): void;
232
+ filter<D extends Update>(predicate: (update: Update) => update is D, handler: Handler<D>): void;
233
+ filter(predicate: (update: Update) => MaybePromise<boolean>, handler: Handler): void;
219
234
  on<T extends keyof Update, F extends keyof NonNullable<Update[T]>>(filter: T extends FilterableUpdates ? T | [T, F, ...F[]] : T, handler: Handler<FilterUpdate<Update, T, F>>): void;
220
235
  }
@@ -2,7 +2,7 @@ import { debug, gunzip, Mutex } from "../0_deps.js";
2
2
  import { bigIntFromBuffer, drop, getRandomBigInt, getRandomId, mustPrompt, mustPromptOneOf, Queue, sha1, UNREACHABLE } from "../1_utilities.js";
3
3
  import { as, functions, getChannelChatId, Message_, MessageContainer, peerToChatId, RPCResult, TLError, TLReader, types } from "../2_tl.js";
4
4
  import { StorageMemory } from "../3_storage.js";
5
- import { constructCallbackQuery, constructInlineQuery, constructMessage, constructUser, FileID, FileType, forceReplyToTlObject, inlineKeyboardMarkupToTlObject, messageEntityToTlObject, replyKeyboardMarkupToTlObject, replyKeyboardRemoveToTlObject, ThumbnailSource } from "../3_types.js";
5
+ import { botCommandScopeToTlObject, constructCallbackQuery, constructInlineQuery, constructMessage, constructUser, FileID, FileType, inlineQueryResultToTlObject, messageEntityToTlObject, replyMarkupToTlObject, ThumbnailSource } from "../3_types.js";
6
6
  import { ACK_THRESHOLD, APP_VERSION, CHANNEL_DIFFERENCE_LIMIT_BOT, CHANNEL_DIFFERENCE_LIMIT_USER, DEVICE_MODEL, LANG_CODE, LANG_PACK, LAYER, MAX_CHANNEL_ID, MAX_CHAT_ID, STICKER_SET_NAME_TTL, SYSTEM_LANG_CODE, SYSTEM_VERSION, USERNAME_TTL, ZERO_CHANNEL_ID } from "../4_constants.js";
7
7
  import { isChannelPtsUpdate, isPtsUpdate, resolve } from "./0_utilities.js";
8
8
  import { decryptMessage, encryptMessage, getMessageId } from "./0_message.js";
@@ -10,6 +10,7 @@ import { checkPassword } from "./0_password.js";
10
10
  import { parseHtml } from "./0_html.js";
11
11
  import { ClientPlain } from "./2_client_plain.js";
12
12
  import { ClientAbstract } from "./1_client_abstract.js";
13
+ import { skip } from "./3_types.js";
13
14
  const d = debug("Client");
14
15
  const dGap = debug("Client/recoverUpdateGap");
15
16
  const dGapC = debug("Client/recoverChannelUpdateGap");
@@ -27,7 +28,6 @@ export class Client extends ClientAbstract {
27
28
  * @param storage The storage provider to use. Defaults to memory storage.
28
29
  * @param apiId App's API ID from [my.telegram.org](https://my.telegram.org/apps). Defaults to 0 (unset).
29
30
  * @param apiHash App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Defaults to empty string (unset).
30
- * @param params Other parameters.
31
31
  */
32
32
  constructor(storage = new StorageMemory(), apiId = 0, apiHash = "", params) {
33
33
  super(params);
@@ -212,15 +212,22 @@ export class Client extends ClientAbstract {
212
212
  writable: true,
213
213
  value: new Queue("processUpdates")
214
214
  });
215
- Object.defineProperty(this, "handle", {
215
+ Object.defineProperty(this, "usernameResolver", {
216
216
  enumerable: true,
217
217
  configurable: true,
218
218
  writable: true,
219
- value: (_, n) => {
220
- return n();
219
+ value: async (v) => {
220
+ const inputPeer = await this.getInputPeer(v).then((v) => v[as](types.InputPeerUser));
221
+ return new types.InputUser({ userId: inputPeer.userId, accessHash: inputPeer.accessHash });
221
222
  }
222
223
  });
223
- this.parseMode = params?.parseMode ?? "none";
224
+ Object.defineProperty(this, "handle", {
225
+ enumerable: true,
226
+ configurable: true,
227
+ writable: true,
228
+ value: skip
229
+ });
230
+ this.parseMode = params?.parseMode ?? null;
224
231
  this.appVersion = params?.appVersion ?? APP_VERSION;
225
232
  this.deviceModel = params?.deviceModel ?? DEVICE_MODEL;
226
233
  this.langCode = params?.langCode ?? LANG_CODE;
@@ -1221,9 +1228,9 @@ export class Client extends ClientAbstract {
1221
1228
  const entities_ = params?.entities ?? [];
1222
1229
  const parseMode = params?.parseMode ?? this.parseMode;
1223
1230
  switch (parseMode) {
1224
- case "none":
1231
+ case null:
1225
1232
  break;
1226
- case "html": {
1233
+ case "HTML": {
1227
1234
  const [newText, entitiesToPush] = parseHtml(text);
1228
1235
  text = newText;
1229
1236
  for (const entity of entitiesToPush) {
@@ -1506,29 +1513,10 @@ export class Client extends ClientAbstract {
1506
1513
  }));
1507
1514
  }
1508
1515
  async constructReplyMarkup(params) {
1509
- let replyMarkup = undefined;
1510
1516
  if (params?.replyMarkup) {
1511
1517
  await this.assertBot("replyMarkup");
1512
- if ("inlineKeyboard" in params.replyMarkup) {
1513
- replyMarkup = await inlineKeyboardMarkupToTlObject(params.replyMarkup, async (v) => {
1514
- const inputPeer = await this.getInputPeer(v).then((v) => v[as](types.InputPeerUser));
1515
- return new types.InputUser({ userId: inputPeer.userId, accessHash: inputPeer.accessHash });
1516
- });
1517
- }
1518
- else if ("keyboard" in params.replyMarkup) {
1519
- replyMarkup = replyKeyboardMarkupToTlObject(params.replyMarkup);
1520
- }
1521
- else if ("removeKeyboard" in params.replyMarkup) {
1522
- replyMarkup = replyKeyboardRemoveToTlObject(params.replyMarkup);
1523
- }
1524
- else if ("forceReply" in params.replyMarkup) {
1525
- replyMarkup = forceReplyToTlObject(params.replyMarkup);
1526
- }
1527
- else {
1528
- throw new Error("The replyMarkup parameter has an unexpected type");
1529
- }
1518
+ return replyMarkupToTlObject(params.replyMarkup, this.usernameResolver.bind(this));
1530
1519
  }
1531
- return replyMarkup;
1532
1520
  }
1533
1521
  static assertMsgHas(message, key) {
1534
1522
  if (!(key in message) || message[key] === undefined) {
@@ -1598,42 +1586,70 @@ export class Client extends ClientAbstract {
1598
1586
  async sendChatAction(chatId, action_, messageThreadId) {
1599
1587
  let action;
1600
1588
  switch (action_) {
1601
- case "typing":
1589
+ case "type":
1602
1590
  action = new types.SendMessageTypingAction();
1603
1591
  break;
1604
- case "upload_photo":
1592
+ case "uploadPhoto":
1605
1593
  action = new types.SendMessageUploadPhotoAction({ progress: 0 });
1606
1594
  break;
1607
- case "record_video":
1595
+ case "recordVideo":
1608
1596
  action = new types.SendMessageRecordVideoAction();
1609
1597
  break;
1610
- case "upload_video":
1598
+ case "uploadVideo":
1611
1599
  action = new types.SendMessageRecordVideoAction();
1612
1600
  break;
1613
- case "record_voice":
1601
+ case "recordVoice":
1614
1602
  action = new types.SendMessageRecordAudioAction();
1615
1603
  break;
1616
- case "upload_audio":
1604
+ case "uploadAudio":
1617
1605
  action = new types.SendMessageUploadAudioAction({ progress: 0 });
1618
1606
  break;
1619
- case "upload_document":
1607
+ case "uploadDocument":
1620
1608
  action = new types.SendMessageUploadDocumentAction({ progress: 0 });
1621
1609
  break;
1622
- case "choose_sticker":
1610
+ case "chooseSticker":
1623
1611
  action = new types.SendMessageChooseStickerAction();
1624
1612
  break;
1625
- case "find_location":
1613
+ case "findLocation":
1626
1614
  action = new types.SendMessageGeoLocationAction();
1627
1615
  break;
1628
- case "record_video_note":
1616
+ case "recordVideoNote":
1629
1617
  action = new types.SendMessageRecordRoundAction();
1630
1618
  break;
1631
- case "upload_video_note":
1619
+ case "uploadVideoNote":
1632
1620
  action = new types.SendMessageUploadRoundAction({ progress: 0 });
1633
1621
  break;
1622
+ default:
1623
+ throw new Error("Invalid chat action: " + action_);
1634
1624
  }
1635
1625
  await this.invoke(new functions.MessagesSetTyping({ peer: await this.getInputPeer(chatId), action, topMsgId: messageThreadId }));
1636
1626
  }
1627
+ async setMyCommands(commands, params) {
1628
+ await this.invoke(new functions.BotsSetBotCommands({
1629
+ commands: commands.map((v) => new types.BotCommand(v)),
1630
+ langCode: params?.languageCode ?? "",
1631
+ scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)), // TODO: use params.scope
1632
+ }));
1633
+ }
1634
+ async getMyCommands(params) {
1635
+ const commands_ = await this.invoke(new functions.BotsGetBotCommands({
1636
+ langCode: params?.languageCode ?? "",
1637
+ scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)), // TODO: use params.scope
1638
+ }));
1639
+ return commands_.map((v) => ({ command: v.command, description: v.description }));
1640
+ }
1641
+ async answerInlineQuery(id, results, params) {
1642
+ await this.invoke(new functions.MessagesSetInlineBotResults({
1643
+ queryId: BigInt(id),
1644
+ results: await Promise.all(results.map((v) => inlineQueryResultToTlObject(v, this.parseText.bind(this), this.usernameResolver.bind(this)))),
1645
+ cacheTime: params?.cacheTime ?? 300,
1646
+ private: params?.isPersonal ? true : undefined,
1647
+ switchWebview: params?.button && params.button.webApp ? new types.InlineBotWebView({ text: params.button.text, url: params.button.webApp.url }) : undefined,
1648
+ switchPm: params?.button && params.button.startParameter ? new types.InlineBotSwitchPM({ text: params.button.text, startParam: params.button.startParameter }) : undefined,
1649
+ gallery: params?.isGallery ? true : undefined,
1650
+ nextOffset: params?.nextOffset,
1651
+ }));
1652
+ }
1637
1653
  use(handler) {
1638
1654
  const handle = this.handle;
1639
1655
  this.handle = async (upd, next) => {
@@ -1657,7 +1673,7 @@ export class Client extends ClientAbstract {
1657
1673
  });
1658
1674
  }
1659
1675
  filter(predicate, handler) {
1660
- this.branch(predicate, handler, (_, n) => n());
1676
+ this.branch(predicate, handler, skip);
1661
1677
  }
1662
1678
  on(filter, handler) {
1663
1679
  const type = typeof filter === "string" ? filter : filter[0];
@@ -1,5 +1,6 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { debug, Mutex } from "../0_deps.js";
3
+ import { UNREACHABLE } from "../1_utilities.js";
3
4
  import { ConnectionUnframed } from "./0_connection.js";
4
5
  const d = debug("ConnectionWebSocket");
5
6
  export class ConnectionWebSocket extends ConnectionUnframed {
@@ -75,7 +76,7 @@ export class ConnectionWebSocket extends ConnectionUnframed {
75
76
  return;
76
77
  }
77
78
  const release = await mutex.acquire();
78
- const data = new Uint8Array(await new Blob([e.data].map((v) => v instanceof Blob ? v : v instanceof ArrayBuffer ? v : Array.isArray(v) ? v.map((v) => v.buffer) : v.buffer).flat()).arrayBuffer());
79
+ const data = new Uint8Array(await new Blob([e.data].map((v) => v instanceof Blob || v instanceof Uint8Array ? v : v instanceof ArrayBuffer ? v : UNREACHABLE())).arrayBuffer());
79
80
  for (const byte of data) {
80
81
  this.buffer.push(byte);
81
82
  }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make an assertion that `actual` is greater than `expected`.
3
+ * If not then throw.
4
+ */
5
+ export declare function assertGreater<T>(actual: T, expected: T, msg?: string): void;
@@ -0,0 +1,14 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ import { format } from "./_format.js";
3
+ import { AssertionError } from "./assertion_error.js";
4
+ /**
5
+ * Make an assertion that `actual` is greater than `expected`.
6
+ * If not then throw.
7
+ */
8
+ export function assertGreater(actual, expected, msg) {
9
+ if (actual > expected)
10
+ return;
11
+ const actualString = format(actual);
12
+ const expectedString = format(expected);
13
+ throw new AssertionError(msg ?? `Expect ${actualString} > ${expectedString}`);
14
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make an assertion that `actual` is greater than or equal to `expected`.
3
+ * If not then throw.
4
+ */
5
+ export declare function assertGreaterOrEqual<T>(actual: T, expected: T, msg?: string): void;
@@ -0,0 +1,14 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ import { format } from "./_format.js";
3
+ import { AssertionError } from "./assertion_error.js";
4
+ /**
5
+ * Make an assertion that `actual` is greater than or equal to `expected`.
6
+ * If not then throw.
7
+ */
8
+ export function assertGreaterOrEqual(actual, expected, msg) {
9
+ if (actual >= expected)
10
+ return;
11
+ const actualString = format(actual);
12
+ const expectedString = format(expected);
13
+ throw new AssertionError(msg ?? `Expect ${actualString} >= ${expectedString}`);
14
+ }
@@ -22,11 +22,11 @@ export function assertInstanceOf(actual, expectedType, msg = "") {
22
22
  else {
23
23
  actualTypeStr = typeof actual;
24
24
  }
25
- if (expectedTypeStr == actualTypeStr) {
25
+ if (expectedTypeStr === actualTypeStr) {
26
26
  msg =
27
27
  `Expected object to be an instance of "${expectedTypeStr}"${msgSuffix}`;
28
28
  }
29
- else if (actualTypeStr == "function") {
29
+ else if (actualTypeStr === "function") {
30
30
  msg =
31
31
  `Expected object to be an instance of "${expectedTypeStr}" but was not an instanced object${msgSuffix}`;
32
32
  }
@@ -20,7 +20,10 @@ ErrorClass, msgIncludes, msg) {
20
20
  }
21
21
  if (msgIncludes && (!(error instanceof Error) ||
22
22
  !stripColor(error.message).includes(stripColor(msgIncludes)))) {
23
- msg = `Expected error message to include "${msgIncludes}", but got "${error instanceof Error ? error.message : "[not an Error]"}"${msgSuffix}`;
23
+ msg = `Expected error message to include ${JSON.stringify(msgIncludes)}, but got ${error instanceof Error
24
+ ? JSON.stringify(error.message)
25
+ : '"[not an Error]"' // TODO(kt3k): show more useful information
26
+ }${msgSuffix}`;
24
27
  throw new AssertionError(msg);
25
28
  }
26
29
  }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make an assertion that `actual` is less than `expected`.
3
+ * If not then throw.
4
+ */
5
+ export declare function assertLess<T>(actual: T, expected: T, msg?: string): void;
@@ -0,0 +1,14 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ import { format } from "./_format.js";
3
+ import { AssertionError } from "./assertion_error.js";
4
+ /**
5
+ * Make an assertion that `actual` is less than `expected`.
6
+ * If not then throw.
7
+ */
8
+ export function assertLess(actual, expected, msg) {
9
+ if (actual < expected)
10
+ return;
11
+ const actualString = format(actual);
12
+ const expectedString = format(expected);
13
+ throw new AssertionError(msg ?? `Expect ${actualString} < ${expectedString}`);
14
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make an assertion that `actual` is less than or equal to `expected`.
3
+ * If not then throw.
4
+ */
5
+ export declare function assertLessOrEqual<T>(actual: T, expected: T, msg?: string): void;
@@ -0,0 +1,14 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ import { format } from "./_format.js";
3
+ import { AssertionError } from "./assertion_error.js";
4
+ /**
5
+ * Make an assertion that `actual` is less than or equal to `expected`.
6
+ * If not then throw.
7
+ */
8
+ export function assertLessOrEqual(actual, expected, msg) {
9
+ if (actual <= expected)
10
+ return;
11
+ const actualString = format(actual);
12
+ const expectedString = format(expected);
13
+ throw new AssertionError(msg ?? `Expect ${actualString} <= ${expectedString}`);
14
+ }
@@ -12,8 +12,12 @@ export * from "./assert_array_includes.js";
12
12
  export * from "./assert_equals.js";
13
13
  export * from "./assert_exists.js";
14
14
  export * from "./assert_false.js";
15
+ export * from "./assert_greater_or_equal.js";
16
+ export * from "./assert_greater.js";
15
17
  export * from "./assert_instance_of.js";
16
18
  export * from "./assert_is_error.js";
19
+ export * from "./assert_less_or_equal.js";
20
+ export * from "./assert_less.js";
17
21
  export * from "./assert_match.js";
18
22
  export * from "./assert_not_equals.js";
19
23
  export * from "./assert_not_instance_of.js";