@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
@@ -13,8 +13,12 @@ export * from "./assert_array_includes.js";
13
13
  export * from "./assert_equals.js";
14
14
  export * from "./assert_exists.js";
15
15
  export * from "./assert_false.js";
16
+ export * from "./assert_greater_or_equal.js";
17
+ export * from "./assert_greater.js";
16
18
  export * from "./assert_instance_of.js";
17
19
  export * from "./assert_is_error.js";
20
+ export * from "./assert_less_or_equal.js";
21
+ export * from "./assert_less.js";
18
22
  export * from "./assert_match.js";
19
23
  export * from "./assert_not_equals.js";
20
24
  export * from "./assert_not_instance_of.js";
@@ -262,9 +262,16 @@ export declare function rgb24(str: string, color: number | Rgb): string;
262
262
  * @param color code
263
263
  */
264
264
  export declare function bgRgb24(str: string, color: number | Rgb): string;
265
+ /**
266
+ * @deprecated (will be removed in 1.0.0) Use `stripAnsiCode` instead.
267
+ *
268
+ * Remove ANSI escape codes from the string.
269
+ * @param string to remove ANSI escape codes from
270
+ */
271
+ export declare const stripColor: typeof stripAnsiCode;
265
272
  /**
266
273
  * Remove ANSI escape codes from the string.
267
274
  * @param string to remove ANSI escape codes from
268
275
  */
269
- export declare function stripColor(string: string): string;
276
+ export declare function stripAnsiCode(string: string): string;
270
277
  export {};
@@ -465,10 +465,17 @@ const ANSI_PATTERN = new RegExp([
465
465
  "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
466
466
  "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))",
467
467
  ].join("|"), "g");
468
+ /**
469
+ * @deprecated (will be removed in 1.0.0) Use `stripAnsiCode` instead.
470
+ *
471
+ * Remove ANSI escape codes from the string.
472
+ * @param string to remove ANSI escape codes from
473
+ */
474
+ export const stripColor = stripAnsiCode;
468
475
  /**
469
476
  * Remove ANSI escape codes from the string.
470
477
  * @param string to remove ANSI escape codes from
471
478
  */
472
- export function stripColor(string) {
479
+ export function stripAnsiCode(string) {
473
480
  return string.replace(ANSI_PATTERN, "");
474
481
  }
@@ -1,6 +1,6 @@
1
1
  import { TLRawReader } from "./0_tl_raw_reader.js";
2
2
  import { TLObject } from "./1_tl_object.js";
3
- export type ReadObject = TLObject | Array<ReadObject | TLObject>;
3
+ export type ReadObject = boolean | TLObject | Array<ReadObject | TLObject>;
4
4
  export declare class TLReader extends TLRawReader {
5
5
  readObject(id?: number): ReadObject;
6
6
  }
@@ -15,6 +15,12 @@ export class TLReader extends TLRawReader {
15
15
  }
16
16
  return items;
17
17
  }
18
+ else if (id == 0x997275b5) {
19
+ return true;
20
+ }
21
+ else if (id == 0xbc799737) {
22
+ return false;
23
+ }
18
24
  const constructor = map.get(id);
19
25
  if (constructor) {
20
26
  return deserialize(this, constructor[paramDesc], constructor);
@@ -10,6 +10,14 @@ export class TLWriter extends TLRawWriter {
10
10
  this.writeObject(item);
11
11
  }
12
12
  }
13
+ else if (typeof object === "boolean") {
14
+ if (object) {
15
+ this.writeInt32(0x997275b5, false);
16
+ }
17
+ else {
18
+ this.writeInt32(0xbc799737, false);
19
+ }
20
+ }
13
21
  else {
14
22
  this.write(object[serialize]());
15
23
  }
@@ -12,6 +12,9 @@ function calculateLength(object) {
12
12
  length += calculateLength(item);
13
13
  }
14
14
  }
15
+ else if (typeof object === "boolean") {
16
+ length += 32 / 8; // constructor
17
+ }
15
18
  else {
16
19
  length += object[serialize]().length;
17
20
  }
@@ -0,0 +1,4 @@
1
+ export interface BotCommand {
2
+ command: string;
3
+ description: string;
4
+ }
@@ -1 +1 @@
1
- export type ChatAction = "typing" | "upload_photo" | "record_video" | "upload_video" | "record_voice" | "upload_audio" | "upload_document" | "choose_sticker" | "find_location" | "record_video_note" | "upload_video_note";
1
+ export type ChatAction = "type" | "uploadPhoto" | "recordVideo" | "uploadVideo" | "recordVoice" | "uploadAudio" | "uploadDocument" | "chooseSticker" | "findLocation" | "recordVideoNote" | "uploadVideoNote";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * A chat identifier as provided by MTKruto or a string starting with a @ that is followed by a username.
3
+ */
4
+ export type ChatID = number | string;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./!0_file_id.js";
2
+ import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./0__file_id.js";
3
3
  export function constructChatPhoto(photo, chatId, chatAccessHash) {
4
4
  const smallFileId = new FileID(null, null, FileType.ChatPhoto, photo.dcId, {
5
5
  mediaId: photo.photoId,
@@ -0,0 +1,6 @@
1
+ export interface InputContactMessageContent {
2
+ phoneNumber: string;
3
+ firstName: string;
4
+ lastName?: string;
5
+ vcard?: string;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface InputLocationMessageContent {
2
+ latitude: number;
3
+ longitude: number;
4
+ horizontalAccuracy?: number;
5
+ livePeriod?: number;
6
+ heading?: number;
7
+ proximityAlertRadius?: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export interface InputVenuMessageContent {
2
+ latitude: number;
3
+ loingitude: number;
4
+ title: string;
5
+ address: string;
6
+ foursquareId?: string;
7
+ foursquareType?: string;
8
+ googlePlaceId?: string;
9
+ googlePlaceType?: string;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface LabeledPrice {
2
+ label: string;
3
+ amount: number;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- export type MessageEntityType = "mention" | "hashtag" | "bot_command" | "url" | "email" | "bold" | "italic" | "code" | "pre" | "text_link" | "text_mention" | "cashtag" | "phone_number" | "underline" | "strikethrough" | "blockquote" | "bank_card" | "spoiler" | "custom_emoji";
2
+ export type MessageEntityType = "mention" | "hashtag" | "botCommand" | "url" | "email" | "bold" | "italic" | "code" | "pre" | "textLink" | "textMention" | "cashtag" | "phoneNumber" | "underline" | "strikethrough" | "blockquote" | "bankCard" | "spoiler" | "customEmoji";
3
3
  export declare namespace MessageEntity {
4
4
  interface Base {
5
5
  type: MessageEntityType;
@@ -15,7 +15,7 @@ export declare namespace MessageEntity {
15
15
  type: "hashtag";
16
16
  }
17
17
  interface BotCommand extends Base {
18
- type: "bot_command";
18
+ type: "botCommand";
19
19
  }
20
20
  interface URL extends Base {
21
21
  type: "url";
@@ -38,20 +38,20 @@ export declare namespace MessageEntity {
38
38
  type: "code";
39
39
  }
40
40
  interface TextLink extends Base {
41
- type: "text_link";
42
- /** For "text_link" only, URL that will be opened after user taps on the text */
41
+ type: "textLink";
42
+ /** For "textLink" only, URL that will be opened after user taps on the text */
43
43
  url: string;
44
44
  }
45
45
  interface TextMention extends Base {
46
- type: "text_mention";
47
- /** For "text_mention" only, the ID of the mentioned user */
46
+ type: "textMention";
47
+ /** For "textMention" only, the ID of the mentioned user */
48
48
  userId: number;
49
49
  }
50
50
  interface Cashtag extends Base {
51
51
  type: "cashtag";
52
52
  }
53
53
  interface PhoneNumber extends Base {
54
- type: "phone_number";
54
+ type: "phoneNumber";
55
55
  }
56
56
  interface Underline extends Base {
57
57
  type: "underline";
@@ -63,14 +63,14 @@ export declare namespace MessageEntity {
63
63
  type: "blockquote";
64
64
  }
65
65
  interface BankCard extends Base {
66
- type: "bank_card";
66
+ type: "bankCard";
67
67
  }
68
68
  interface Spoiler extends Base {
69
69
  type: "spoiler";
70
70
  }
71
71
  interface CustomEmoji extends Base {
72
- type: "custom_emoji";
73
- /** For "custom_emoji" only, unique identifier of the custom emoji */
72
+ type: "customEmoji";
73
+ /** For "customEmoji" only, unique identifier of the custom emoji */
74
74
  customEmojiId: string;
75
75
  }
76
76
  }
@@ -7,7 +7,7 @@ export function constructMessageEntity(obj) {
7
7
  return { type: "hashtag", offset: obj.offset, length: obj.length };
8
8
  }
9
9
  else if (obj instanceof types.MessageEntityBotCommand) {
10
- return { type: "bot_command", offset: obj.offset ?? 0, length: obj.length };
10
+ return { type: "botCommand", offset: obj.offset ?? 0, length: obj.length };
11
11
  }
12
12
  else if (obj instanceof types.MessageEntityURL) {
13
13
  return { type: "url", offset: obj.offset, length: obj.length };
@@ -28,16 +28,16 @@ export function constructMessageEntity(obj) {
28
28
  return { type: "pre", offset: obj.offset, length: obj.length, language: obj.language };
29
29
  }
30
30
  else if (obj instanceof types.MessageEntityTextURL) {
31
- return { type: "text_link", offset: obj.offset, length: obj.length, url: obj.url };
31
+ return { type: "textLink", offset: obj.offset, length: obj.length, url: obj.url };
32
32
  }
33
33
  else if (obj instanceof types.MessageEntityMentionName) {
34
- return { type: "text_mention", offset: obj.offset, length: obj.length, userId: Number(obj.userId) };
34
+ return { type: "textMention", offset: obj.offset, length: obj.length, userId: Number(obj.userId) };
35
35
  }
36
36
  else if (obj instanceof types.MessageEntityCashtag) {
37
37
  return { type: "cashtag", offset: obj.offset, length: obj.length };
38
38
  }
39
39
  else if (obj instanceof types.MessageEntityPhone) {
40
- return { type: "phone_number", offset: obj.offset, length: obj.length };
40
+ return { type: "phoneNumber", offset: obj.offset, length: obj.length };
41
41
  }
42
42
  else if (obj instanceof types.MessageEntityUnderline) {
43
43
  return { type: "underline", offset: obj.offset, length: obj.length };
@@ -49,13 +49,13 @@ export function constructMessageEntity(obj) {
49
49
  return { type: "blockquote", offset: obj.offset, length: obj.length };
50
50
  }
51
51
  else if (obj instanceof types.MessageEntityBankCard) {
52
- return { type: "bank_card", offset: obj.offset, length: obj.length };
52
+ return { type: "bankCard", offset: obj.offset, length: obj.length };
53
53
  }
54
54
  else if (obj instanceof types.MessageEntitySpoiler) {
55
55
  return { type: "spoiler", offset: obj.offset, length: obj.length };
56
56
  }
57
57
  else if (obj instanceof types.MessageEntityCustomEmoji) {
58
- return { type: "custom_emoji", offset: obj.offset, length: obj.length, customEmojiId: String(obj.documentId) };
58
+ return { type: "customEmoji", offset: obj.offset, length: obj.length, customEmojiId: String(obj.documentId) };
59
59
  }
60
60
  else {
61
61
  return null;
@@ -68,7 +68,7 @@ export function messageEntityToTlObject(entity) {
68
68
  return new types.MessageEntityMention({ offset, length });
69
69
  case "hashtag":
70
70
  return new types.MessageEntityHashtag({ offset, length });
71
- case "bot_command":
71
+ case "botCommand":
72
72
  return new types.MessageEntityBotCommand({ offset, length });
73
73
  case "url":
74
74
  return new types.MessageEntityURL({ offset, length });
@@ -82,13 +82,13 @@ export function messageEntityToTlObject(entity) {
82
82
  return new types.MessageEntityCode({ offset, length });
83
83
  case "pre":
84
84
  return new types.MessageEntityPre({ offset, length, language: entity.language });
85
- case "text_link":
85
+ case "textLink":
86
86
  return new types.MessageEntityTextURL({ offset, length, url: entity.url });
87
- case "text_mention":
87
+ case "textMention":
88
88
  return new types.MessageEntityMentionName({ offset, length, userId: BigInt(entity.userId) });
89
89
  case "cashtag":
90
90
  return new types.MessageEntityCashtag({ offset, length });
91
- case "phone_number":
91
+ case "phoneNumber":
92
92
  return new types.MessageEntityPhone({ offset, length });
93
93
  case "underline":
94
94
  return new types.MessageEntityUnderline({ offset, length });
@@ -96,11 +96,11 @@ export function messageEntityToTlObject(entity) {
96
96
  return new types.MessageEntityStrike({ offset, length });
97
97
  case "blockquote":
98
98
  return new types.MessageEntityBlockquote({ offset, length });
99
- case "bank_card":
99
+ case "bankCard":
100
100
  return new types.MessageEntityBankCard({ offset, length });
101
101
  case "spoiler":
102
102
  return new types.MessageEntitySpoiler({ offset, length });
103
- case "custom_emoji":
103
+ case "customEmoji":
104
104
  return new types.MessageEntityCustomEmoji({ offset, length, documentId: BigInt(entity.customEmojiId) });
105
105
  }
106
106
  }
@@ -0,0 +1 @@
1
+ export type ParseMode = "HTML" | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./!0_file_id.js";
2
+ import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./0__file_id.js";
3
3
  export function constructThumbnail(size, file) {
4
4
  const fileType = file instanceof types.Photo ? FileType.Photo : FileType.Document;
5
5
  const fileId = new FileID(null, null, fileType, file.dcId, {
@@ -1,7 +1,14 @@
1
1
  import { MaybePromise } from "../1_utilities.js";
2
2
  import { types } from "../2_tl.js";
3
+ import { ChatID } from "./0_chat_id.js";
3
4
  export interface EntityGetter {
4
5
  (peer: types.PeerUser): MaybePromise<types.User | null>;
5
6
  (peer: types.PeerChat): MaybePromise<types.Chat | null>;
6
7
  (peer: types.PeerChannel): MaybePromise<types.Channel | null>;
7
8
  }
9
+ export interface InputPeerGetter {
10
+ (id: ChatID): Promise<types.InputPeerUser | types.InputPeerChannel | types.InputPeerChat>;
11
+ }
12
+ export interface UsernameResolver {
13
+ (username: string): MaybePromise<types.InputUser>;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import { ChatID } from "./0_chat_id.js";
2
+ import { types } from "../2_tl.js";
3
+ import { InputPeerGetter } from "./1__getters.js";
4
+ export declare namespace BotCommandScope {
5
+ interface Default {
6
+ type: "default";
7
+ }
8
+ interface AllPrivateChats {
9
+ type: "allPrivateChats";
10
+ }
11
+ interface AllGroupChats {
12
+ type: "allGroupChats";
13
+ }
14
+ interface AllChatAdministrators {
15
+ type: "allChatAdministrators";
16
+ }
17
+ interface Chat {
18
+ type: "chat";
19
+ chatId: ChatID;
20
+ }
21
+ interface ChatAdministrators {
22
+ type: "chatAdministrators";
23
+ chatId: ChatID;
24
+ }
25
+ interface ChatMember {
26
+ type: "chatMember";
27
+ chatId: ChatID;
28
+ userId: number;
29
+ }
30
+ }
31
+ export type BotCommandScope = BotCommandScope.Default | BotCommandScope.AllPrivateChats | BotCommandScope.AllGroupChats | BotCommandScope.AllChatAdministrators | BotCommandScope.Chat | BotCommandScope.ChatAdministrators | BotCommandScope.ChatMember;
32
+ export declare function botCommandScopeToTlObject(scope: BotCommandScope, getInputPeer: InputPeerGetter): Promise<types.BotCommandScopeDefault | types.BotCommandScopeUsers | types.BotCommandScopeChats | types.BotCommandScopeChatAdmins | types.BotCommandScopePeer | types.BotCommandScopePeerAdmins | types.BotCommandScopePeerUser>;
@@ -0,0 +1,27 @@
1
+ import { types } from "../2_tl.js";
2
+ import { UNREACHABLE } from "../1_utilities.js";
3
+ export async function botCommandScopeToTlObject(scope, getInputPeer) {
4
+ switch (scope.type) {
5
+ case "default":
6
+ return new types.BotCommandScopeDefault();
7
+ case "allPrivateChats":
8
+ return new types.BotCommandScopeUsers();
9
+ case "allGroupChats":
10
+ return new types.BotCommandScopeChats();
11
+ case "allChatAdministrators":
12
+ return new types.BotCommandScopeChatAdmins();
13
+ case "chat":
14
+ return new types.BotCommandScopePeer({ peer: await getInputPeer(scope.chatId) });
15
+ case "chatAdministrators":
16
+ return new types.BotCommandScopePeerAdmins({ peer: await getInputPeer(scope.chatId) });
17
+ case "chatMember": {
18
+ const user = await getInputPeer(scope.userId);
19
+ if (!(user instanceof types.InputPeerUser)) {
20
+ UNREACHABLE();
21
+ }
22
+ return new types.BotCommandScopePeerUser({ peer: await getInputPeer(scope.chatId), userId: new types.InputUser({ userId: user.userId, accessHash: user.accessHash }) });
23
+ }
24
+ default:
25
+ UNREACHABLE();
26
+ }
27
+ }
@@ -1,12 +1,7 @@
1
1
  import { types } from "../2_tl.js";
2
2
  import { Color } from "./0_color.js";
3
3
  import { ChatPhoto } from "./0_chat_photo.js";
4
- export declare enum ChatType {
5
- Private = "private",
6
- Group = "group",
7
- Supergroup = "supergroup",
8
- Channel = "channel"
9
- }
4
+ export type ChatType = "private" | "group" | "supergroup" | "channel";
10
5
  export declare namespace Chat {
11
6
  interface Base {
12
7
  /** Type of chat, can be either "private", "group", "supergroup" or "channel" */
@@ -18,7 +13,7 @@ export declare namespace Chat {
18
13
  photo?: ChatPhoto;
19
14
  }
20
15
  interface Private extends Base {
21
- type: ChatType.Private;
16
+ type: "private";
22
17
  /** True, if this user is a bot */
23
18
  isBot?: boolean;
24
19
  /** First name of the other party in a private chat */
@@ -45,7 +40,7 @@ export declare namespace Chat {
45
40
  restrictionReason?: types.RestrictionReason[];
46
41
  }
47
42
  interface Group extends Base {
48
- type: ChatType.Group;
43
+ type: "group";
49
44
  /** Title, for supergroups, channels and group chats */
50
45
  title: string;
51
46
  /** Chat photo. */
@@ -74,7 +69,7 @@ export declare namespace Chat {
74
69
  restrictionReason?: types.RestrictionReason[];
75
70
  }
76
71
  interface Channel extends ChannelBase {
77
- type: ChatType.Channel;
72
+ type: "channel";
78
73
  /** Title, for supergroups, channels and group chats */
79
74
  title: string;
80
75
  /** Username, for private chats, supergroups and channels if available */
@@ -83,7 +78,7 @@ export declare namespace Chat {
83
78
  also?: string[];
84
79
  }
85
80
  interface Supergroup extends ChannelBase {
86
- type: ChatType.Supergroup;
81
+ type: "supergroup";
87
82
  /** True, if the supergroup chat is a forum (has [topics](https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups) enabled) */
88
83
  isForum: boolean;
89
84
  }
@@ -3,18 +3,11 @@ import { types } from "../2_tl.js";
3
3
  import { ZERO_CHANNEL_ID } from "../4_constants.js";
4
4
  import { getColor } from "./0_color.js";
5
5
  import { constructChatPhoto } from "./0_chat_photo.js";
6
- export var ChatType;
7
- (function (ChatType) {
8
- ChatType["Private"] = "private";
9
- ChatType["Group"] = "group";
10
- ChatType["Supergroup"] = "supergroup";
11
- ChatType["Channel"] = "channel";
12
- })(ChatType || (ChatType = {}));
13
6
  export function constructChat(chat) {
14
7
  if (chat instanceof types.User) {
15
8
  const id = Number(chat.id);
16
9
  const chat_ = {
17
- type: ChatType.Private,
10
+ type: "private",
18
11
  isBot: chat.bot || false,
19
12
  id,
20
13
  color: getColor(id),
@@ -37,7 +30,7 @@ export function constructChat(chat) {
37
30
  else if (chat instanceof types.Chat) {
38
31
  const id = Number(-chat.id);
39
32
  const chat_ = {
40
- type: ChatType.Group,
33
+ type: "group",
41
34
  id,
42
35
  color: getColor(id),
43
36
  title: chat.title,
@@ -56,7 +49,7 @@ export function constructChat(chat) {
56
49
  chat_ = {
57
50
  id,
58
51
  color: getColor(id),
59
- type: ChatType.Supergroup,
52
+ type: "supergroup",
60
53
  title,
61
54
  isScam,
62
55
  isFake,
@@ -70,7 +63,7 @@ export function constructChat(chat) {
70
63
  chat_ = {
71
64
  id,
72
65
  color: getColor(id),
73
- type: ChatType.Channel,
66
+ type: "channel",
74
67
  title,
75
68
  isScam,
76
69
  isFake,
@@ -0,0 +1,6 @@
1
+ import { WebAppInfo } from "./0_web_app_info.js";
2
+ export interface InlineQueryResultButton {
3
+ text: string;
4
+ webApp?: WebAppInfo;
5
+ startParameter?: string;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { LabeledPrice } from "../tl/2_types.js";
2
+ export interface InputInvoiceMessageContent {
3
+ title: string;
4
+ description: string;
5
+ payload: string;
6
+ providerToken: string;
7
+ currency: string;
8
+ prices: LabeledPrice[];
9
+ maxTipAmount?: number;
10
+ suggestedTipAmounts?: number[];
11
+ providerData?: string;
12
+ photoUrl?: string;
13
+ photoSize?: number;
14
+ photoWidth?: number;
15
+ photoHeight?: number;
16
+ needName?: boolean;
17
+ needPhoneNumber?: boolean;
18
+ needEmail?: boolean;
19
+ needShippingAAddress?: boolean;
20
+ sendPhoneNumberToPorvider?: boolean;
21
+ sendEmailToProvider?: boolean;
22
+ isFlexible?: boolean;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { MessageEntity } from "./0_message_entity.js";
2
+ import { ParseMode } from "./0_parse_mode.js";
3
+ export interface InputTextMessageContent {
4
+ messageText: string;
5
+ parseMode?: ParseMode;
6
+ entities?: MessageEntity[];
7
+ disableWebPagePreview?: boolean;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./!0_file_id.js";
2
+ import { FileID, FileType, FileUniqueID, FileUniqueType, ThumbnailSource } from "./0__file_id.js";
3
3
  import { constructThumbnail } from "./0_thumbnail.js";
4
4
  export function constructPhoto(photo) {
5
5
  const sizes = photo.sizes
@@ -8,8 +8,8 @@ export interface Sticker {
8
8
  fileId: string;
9
9
  /** Unique identifier for this file, which is supposed to be the same over time and for different users and bots. Can't be used to download or reuse the file. */
10
10
  fileUniqueId: string;
11
- /** Type of the sticker, currently one of "regular", "mask", "custom_emoji". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
12
- type: "regular" | "mask" | "custom_emoji";
11
+ /** Type of the sticker, currently one of "regular", "mask", "customEmoji". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
12
+ type: "regular" | "mask" | "customEmoji";
13
13
  /** Sticker width */
14
14
  width: number;
15
15
  /** Sticker height */
@@ -9,7 +9,7 @@ export async function constructSticker(document, fileId, fileUniqueId, getSticke
9
9
  return {
10
10
  fileId,
11
11
  fileUniqueId,
12
- // TODO: custom_emoji type?
12
+ // TODO: custom emoji type?
13
13
  type: stickerAttribute.mask ? "mask" : "regular",
14
14
  width: imageSizeAttribute ? imageSizeAttribute.w : videoAttribute ? videoAttribute.w : 512,
15
15
  height: imageSizeAttribute ? imageSizeAttribute.h : videoAttribute ? videoAttribute.h : 512,
@@ -1,6 +1,6 @@
1
1
  import { cleanObject } from "../1_utilities.js";
2
2
  import { as, types } from "../2_tl.js";
3
- import { FileID, FileType, FileUniqueID, FileUniqueType } from "./!0_file_id.js";
3
+ import { FileID, FileType, FileUniqueID, FileUniqueType } from "./0__file_id.js";
4
4
  import { constructAnimation } from "./1_animation.js";
5
5
  import { constructPhoto } from "./1_photo.js";
6
6
  export function constructGame(media_) {
@@ -1,7 +1,7 @@
1
- import { MaybePromise } from "../1_utilities.js";
2
1
  import { types } from "../2_tl.js";
3
2
  import { WebAppInfo } from "./0_web_app_info.js";
4
3
  import { LoginUrl } from "./0_login_url.js";
4
+ import { UsernameResolver } from "./1__getters.js";
5
5
  export declare namespace InlineKeyboardButton {
6
6
  interface Base {
7
7
  /** Label text on the button */
@@ -42,4 +42,4 @@ export declare namespace InlineKeyboardButton {
42
42
  /** This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. */
43
43
  export type InlineKeyboardButton = InlineKeyboardButton.URL | InlineKeyboardButton.Callback | InlineKeyboardButton.WebApp | InlineKeyboardButton.Login | InlineKeyboardButton.SwitchInline | InlineKeyboardButton.SwitchInlineCurrent | InlineKeyboardButton.Game | InlineKeyboardButton.Pay;
44
44
  export declare function constructInlineKeyboardButton(button_: types.TypeKeyboardButton): InlineKeyboardButton;
45
- export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: (username: string) => MaybePromise<types.InputUser>): Promise<types.KeyboardButtonURL | types.KeyboardButtonCallback | types.KeyboardButtonSwitchInline | types.KeyboardButtonBuy | types.InputKeyboardButtonURLAuth | types.KeyboardButtonWebView>;
45
+ export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: UsernameResolver): Promise<types.KeyboardButtonURL | types.KeyboardButtonCallback | types.KeyboardButtonSwitchInline | types.KeyboardButtonBuy | types.InputKeyboardButtonURLAuth | types.KeyboardButtonWebView>;
@@ -1,6 +1,6 @@
1
1
  import { types } from "../2_tl.js";
2
- import { EntityGetter } from "./!0_misc.js";
3
2
  import { Location } from "./0_location.js";
3
+ import { EntityGetter } from "./1__getters.js";
4
4
  import { User } from "./1_user.js";
5
5
  export interface InlineQuery {
6
6
  /** Unique identifier for this query */