@mtkruto/node 0.1.112 → 0.1.114

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 (513) hide show
  1. package/esm/0_deps.d.ts +3 -2
  2. package/esm/0_deps.js +3 -2
  3. package/esm/1_utilities.d.ts +1 -0
  4. package/esm/1_utilities.js +1 -0
  5. package/esm/3_types.d.ts +0 -1
  6. package/esm/3_types.js +0 -1
  7. package/esm/4_constants.d.ts +1 -1
  8. package/esm/4_constants.js +1 -1
  9. package/esm/5_client.d.ts +2 -1
  10. package/esm/5_client.js +2 -1
  11. package/esm/client/0_utilities.d.ts +6 -0
  12. package/esm/client/0_utilities.js +53 -0
  13. package/esm/client/3_types.d.ts +76 -8
  14. package/esm/client/3_types.js +1 -1
  15. package/esm/client/4_composer.d.ts +22 -0
  16. package/esm/client/4_composer.js +81 -0
  17. package/esm/client/{4_client.d.ts → 5_client.d.ts} +87 -12
  18. package/esm/client/{4_client.js → 5_client.js} +367 -107
  19. package/esm/client/6_composer.d.ts +4 -0
  20. package/esm/client/6_composer.js +3 -0
  21. package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.d.ts +2 -2
  22. package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.js +2 -2
  23. package/{script/deps/deno.land/std@0.204.0 → esm/deps/deno.land/std@0.207.0}/fmt/colors.d.ts +1 -1
  24. package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/fmt/colors.js +1 -1
  25. package/esm/deps/deno.land/std@0.207.0/path/_common/assert_path.d.ts +1 -0
  26. package/esm/deps/deno.land/std@0.207.0/path/_common/assert_path.js +7 -0
  27. package/esm/deps/deno.land/std@0.207.0/path/_common/basename.d.ts +3 -0
  28. package/esm/deps/deno.land/std@0.207.0/path/_common/basename.js +40 -0
  29. package/esm/deps/deno.land/std@0.207.0/path/_common/common.d.ts +1 -0
  30. package/esm/deps/deno.land/std@0.207.0/path/_common/common.js +23 -0
  31. package/esm/deps/deno.land/std@0.207.0/path/_common/constants.d.ts +39 -0
  32. package/esm/deps/deno.land/std@0.207.0/path/_common/constants.js +46 -0
  33. package/esm/deps/deno.land/std@0.207.0/path/_common/dirname.d.ts +1 -0
  34. package/esm/deps/deno.land/std@0.207.0/path/_common/dirname.js +8 -0
  35. package/esm/deps/deno.land/std@0.207.0/path/_common/format.d.ts +3 -0
  36. package/esm/deps/deno.land/std@0.207.0/path/_common/format.js +19 -0
  37. package/esm/deps/deno.land/std@0.207.0/path/_common/from_file_url.d.ts +1 -0
  38. package/esm/deps/deno.land/std@0.207.0/path/_common/from_file_url.js +9 -0
  39. package/esm/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.d.ts +27 -0
  40. package/esm/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.js +235 -0
  41. package/esm/deps/deno.land/std@0.207.0/path/_common/normalize.d.ts +1 -0
  42. package/esm/deps/deno.land/std@0.207.0/path/_common/normalize.js +8 -0
  43. package/esm/deps/deno.land/std@0.207.0/path/_common/normalize_string.d.ts +1 -0
  44. package/esm/deps/deno.land/std@0.207.0/path/_common/normalize_string.js +77 -0
  45. package/esm/deps/deno.land/std@0.207.0/path/_common/relative.d.ts +1 -0
  46. package/esm/deps/deno.land/std@0.207.0/path/_common/relative.js +9 -0
  47. package/esm/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.d.ts +1 -0
  48. package/esm/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.js +19 -0
  49. package/esm/deps/deno.land/std@0.207.0/path/_common/to_file_url.d.ts +1 -0
  50. package/esm/deps/deno.land/std@0.207.0/path/_common/to_file_url.js +15 -0
  51. package/esm/deps/deno.land/std@0.207.0/path/_interface.d.ts +26 -0
  52. package/esm/deps/deno.land/std@0.207.0/path/_interface.js +3 -0
  53. package/esm/deps/deno.land/std@0.207.0/path/_os.d.ts +3 -0
  54. package/esm/deps/deno.land/std@0.207.0/path/_os.js +18 -0
  55. package/esm/deps/deno.land/std@0.207.0/path/basename.d.ts +8 -0
  56. package/esm/deps/deno.land/std@0.207.0/path/basename.js +17 -0
  57. package/esm/deps/deno.land/std@0.207.0/path/common.d.ts +13 -0
  58. package/esm/deps/deno.land/std@0.207.0/path/common.js +19 -0
  59. package/esm/deps/deno.land/std@0.207.0/path/dirname.d.ts +5 -0
  60. package/esm/deps/deno.land/std@0.207.0/path/dirname.js +12 -0
  61. package/esm/deps/deno.land/std@0.207.0/path/extname.d.ts +6 -0
  62. package/esm/deps/deno.land/std@0.207.0/path/extname.js +13 -0
  63. package/esm/deps/deno.land/std@0.207.0/path/format.d.ts +6 -0
  64. package/esm/deps/deno.land/std@0.207.0/path/format.js +12 -0
  65. package/esm/deps/deno.land/std@0.207.0/path/from_file_url.d.ts +17 -0
  66. package/esm/deps/deno.land/std@0.207.0/path/from_file_url.js +24 -0
  67. package/esm/deps/deno.land/std@0.207.0/path/glob_to_regexp.d.ts +61 -0
  68. package/esm/deps/deno.land/std@0.207.0/path/glob_to_regexp.js +65 -0
  69. package/esm/deps/deno.land/std@0.207.0/path/is_absolute.d.ts +5 -0
  70. package/esm/deps/deno.land/std@0.207.0/path/is_absolute.js +12 -0
  71. package/esm/deps/deno.land/std@0.207.0/path/is_glob.d.ts +2 -0
  72. package/esm/deps/deno.land/std@0.207.0/path/is_glob.js +28 -0
  73. package/esm/deps/deno.land/std@0.207.0/path/join.d.ts +5 -0
  74. package/esm/deps/deno.land/std@0.207.0/path/join.js +12 -0
  75. package/esm/deps/deno.land/std@0.207.0/path/join_globs.d.ts +3 -0
  76. package/esm/deps/deno.land/std@0.207.0/path/join_globs.js +11 -0
  77. package/esm/deps/deno.land/std@0.207.0/path/mod.d.ts +28 -0
  78. package/esm/deps/deno.land/std@0.207.0/path/mod.js +63 -0
  79. package/esm/deps/deno.land/std@0.207.0/path/normalize.d.ts +7 -0
  80. package/esm/deps/deno.land/std@0.207.0/path/normalize.js +14 -0
  81. package/esm/deps/deno.land/std@0.207.0/path/normalize_glob.d.ts +3 -0
  82. package/esm/deps/deno.land/std@0.207.0/path/normalize_glob.js +11 -0
  83. package/esm/deps/deno.land/std@0.207.0/path/parse.d.ts +6 -0
  84. package/esm/deps/deno.land/std@0.207.0/path/parse.js +12 -0
  85. package/esm/deps/deno.land/std@0.207.0/path/posix/_util.d.ts +1 -0
  86. package/esm/deps/deno.land/std@0.207.0/path/posix/_util.js +8 -0
  87. package/esm/deps/deno.land/std@0.207.0/path/posix/basename.d.ts +8 -0
  88. package/esm/deps/deno.land/std@0.207.0/path/posix/basename.js +18 -0
  89. package/esm/deps/deno.land/std@0.207.0/path/posix/common.d.ts +13 -0
  90. package/esm/deps/deno.land/std@0.207.0/path/posix/common.js +19 -0
  91. package/esm/deps/deno.land/std@0.207.0/path/posix/dirname.d.ts +5 -0
  92. package/esm/deps/deno.land/std@0.207.0/path/posix/dirname.js +36 -0
  93. package/esm/deps/deno.land/std@0.207.0/path/posix/extname.d.ts +6 -0
  94. package/esm/deps/deno.land/std@0.207.0/path/posix/extname.js +59 -0
  95. package/esm/deps/deno.land/std@0.207.0/path/posix/format.d.ts +6 -0
  96. package/esm/deps/deno.land/std@0.207.0/path/posix/format.js +11 -0
  97. package/esm/deps/deno.land/std@0.207.0/path/posix/from_file_url.d.ts +11 -0
  98. package/esm/deps/deno.land/std@0.207.0/path/posix/from_file_url.js +17 -0
  99. package/esm/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.d.ts +57 -0
  100. package/esm/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.js +69 -0
  101. package/esm/deps/deno.land/std@0.207.0/path/posix/is_absolute.d.ts +5 -0
  102. package/esm/deps/deno.land/std@0.207.0/path/posix/is_absolute.js +12 -0
  103. package/esm/deps/deno.land/std@0.207.0/path/posix/is_glob.d.ts +1 -0
  104. package/esm/deps/deno.land/std@0.207.0/path/posix/is_glob.js +3 -0
  105. package/esm/deps/deno.land/std@0.207.0/path/posix/join.d.ts +5 -0
  106. package/esm/deps/deno.land/std@0.207.0/path/posix/join.js +26 -0
  107. package/esm/deps/deno.land/std@0.207.0/path/posix/join_globs.d.ts +3 -0
  108. package/esm/deps/deno.land/std@0.207.0/path/posix/join_globs.js +26 -0
  109. package/esm/deps/deno.land/std@0.207.0/path/posix/mod.d.ts +40 -0
  110. package/esm/deps/deno.land/std@0.207.0/path/posix/mod.js +44 -0
  111. package/esm/deps/deno.land/std@0.207.0/path/posix/normalize.d.ts +7 -0
  112. package/esm/deps/deno.land/std@0.207.0/path/posix/normalize.js +25 -0
  113. package/esm/deps/deno.land/std@0.207.0/path/posix/normalize_glob.d.ts +3 -0
  114. package/esm/deps/deno.land/std@0.207.0/path/posix/normalize_glob.js +16 -0
  115. package/esm/deps/deno.land/std@0.207.0/path/posix/parse.d.ts +6 -0
  116. package/esm/deps/deno.land/std@0.207.0/path/posix/parse.js +98 -0
  117. package/esm/deps/deno.land/std@0.207.0/path/posix/relative.d.ts +7 -0
  118. package/esm/deps/deno.land/std@0.207.0/path/posix/relative.js +94 -0
  119. package/esm/deps/deno.land/std@0.207.0/path/posix/resolve.d.ts +5 -0
  120. package/esm/deps/deno.land/std@0.207.0/path/posix/resolve.js +48 -0
  121. package/esm/deps/deno.land/std@0.207.0/path/posix/separator.d.ts +2 -0
  122. package/esm/deps/deno.land/std@0.207.0/path/posix/separator.js +4 -0
  123. package/esm/deps/deno.land/std@0.207.0/path/posix/to_file_url.d.ts +11 -0
  124. package/esm/deps/deno.land/std@0.207.0/path/posix/to_file_url.js +22 -0
  125. package/esm/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.d.ts +5 -0
  126. package/esm/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.js +10 -0
  127. package/esm/deps/deno.land/std@0.207.0/path/relative.d.ts +12 -0
  128. package/esm/deps/deno.land/std@0.207.0/path/relative.js +19 -0
  129. package/esm/deps/deno.land/std@0.207.0/path/resolve.d.ts +5 -0
  130. package/esm/deps/deno.land/std@0.207.0/path/resolve.js +14 -0
  131. package/esm/deps/deno.land/std@0.207.0/path/separator.d.ts +2 -0
  132. package/esm/deps/deno.land/std@0.207.0/path/separator.js +5 -0
  133. package/esm/deps/deno.land/std@0.207.0/path/to_file_url.d.ts +17 -0
  134. package/esm/deps/deno.land/std@0.207.0/path/to_file_url.js +24 -0
  135. package/esm/deps/deno.land/std@0.207.0/path/to_namespaced_path.d.ts +5 -0
  136. package/esm/deps/deno.land/std@0.207.0/path/to_namespaced_path.js +14 -0
  137. package/esm/deps/deno.land/std@0.207.0/path/windows/_util.d.ts +3 -0
  138. package/esm/deps/deno.land/std@0.207.0/path/windows/_util.js +15 -0
  139. package/esm/deps/deno.land/std@0.207.0/path/windows/basename.d.ts +8 -0
  140. package/esm/deps/deno.land/std@0.207.0/path/windows/basename.js +30 -0
  141. package/esm/deps/deno.land/std@0.207.0/path/windows/common.d.ts +13 -0
  142. package/esm/deps/deno.land/std@0.207.0/path/windows/common.js +19 -0
  143. package/esm/deps/deno.land/std@0.207.0/path/windows/dirname.d.ts +5 -0
  144. package/esm/deps/deno.land/std@0.207.0/path/windows/dirname.js +98 -0
  145. package/esm/deps/deno.land/std@0.207.0/path/windows/extname.d.ts +6 -0
  146. package/esm/deps/deno.land/std@0.207.0/path/windows/extname.js +68 -0
  147. package/esm/deps/deno.land/std@0.207.0/path/windows/format.d.ts +6 -0
  148. package/esm/deps/deno.land/std@0.207.0/path/windows/format.js +11 -0
  149. package/esm/deps/deno.land/std@0.207.0/path/windows/from_file_url.d.ts +13 -0
  150. package/esm/deps/deno.land/std@0.207.0/path/windows/from_file_url.js +26 -0
  151. package/esm/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.d.ts +57 -0
  152. package/esm/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.js +69 -0
  153. package/esm/deps/deno.land/std@0.207.0/path/windows/is_absolute.d.ts +5 -0
  154. package/esm/deps/deno.land/std@0.207.0/path/windows/is_absolute.js +27 -0
  155. package/esm/deps/deno.land/std@0.207.0/path/windows/is_glob.d.ts +1 -0
  156. package/esm/deps/deno.land/std@0.207.0/path/windows/is_glob.js +3 -0
  157. package/esm/deps/deno.land/std@0.207.0/path/windows/join.d.ts +5 -0
  158. package/esm/deps/deno.land/std@0.207.0/path/windows/join.js +72 -0
  159. package/esm/deps/deno.land/std@0.207.0/path/windows/join_globs.d.ts +3 -0
  160. package/esm/deps/deno.land/std@0.207.0/path/windows/join_globs.js +26 -0
  161. package/esm/deps/deno.land/std@0.207.0/path/windows/mod.d.ts +40 -0
  162. package/esm/deps/deno.land/std@0.207.0/path/windows/mod.js +44 -0
  163. package/esm/deps/deno.land/std@0.207.0/path/windows/normalize.d.ts +7 -0
  164. package/esm/deps/deno.land/std@0.207.0/path/windows/normalize.js +130 -0
  165. package/esm/deps/deno.land/std@0.207.0/path/windows/normalize_glob.d.ts +3 -0
  166. package/esm/deps/deno.land/std@0.207.0/path/windows/normalize_glob.js +16 -0
  167. package/esm/deps/deno.land/std@0.207.0/path/windows/parse.d.ts +6 -0
  168. package/esm/deps/deno.land/std@0.207.0/path/windows/parse.js +159 -0
  169. package/esm/deps/deno.land/std@0.207.0/path/windows/relative.d.ts +12 -0
  170. package/esm/deps/deno.land/std@0.207.0/path/windows/relative.js +121 -0
  171. package/esm/deps/deno.land/std@0.207.0/path/windows/resolve.d.ts +5 -0
  172. package/esm/deps/deno.land/std@0.207.0/path/windows/resolve.js +143 -0
  173. package/esm/deps/deno.land/std@0.207.0/path/windows/separator.d.ts +2 -0
  174. package/esm/deps/deno.land/std@0.207.0/path/windows/separator.js +4 -0
  175. package/esm/deps/deno.land/std@0.207.0/path/windows/to_file_url.d.ts +13 -0
  176. package/esm/deps/deno.land/std@0.207.0/path/windows/to_file_url.js +31 -0
  177. package/esm/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.d.ts +5 -0
  178. package/esm/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.js +38 -0
  179. package/esm/mod.d.ts +1 -1
  180. package/esm/mod.js +1 -1
  181. package/esm/tl/0_tl_raw_reader.d.ts +1 -0
  182. package/esm/tl/0_tl_raw_reader.js +3 -0
  183. package/esm/tl/3_deserialize.js +7 -2
  184. package/esm/types/1_chat.d.ts +2 -3
  185. package/esm/types/1_chat.js +4 -5
  186. package/esm/types/1_user.d.ts +2 -3
  187. package/esm/types/1_user.js +2 -3
  188. package/esm/types/5_inline_query_result.js +7 -0
  189. package/esm/utilities/0_color.d.ts +3 -0
  190. package/esm/utilities/0_color.js +55 -0
  191. package/package.json +1 -1
  192. package/script/0_deps.d.ts +3 -2
  193. package/script/0_deps.js +18 -5
  194. package/script/1_utilities.d.ts +1 -0
  195. package/script/1_utilities.js +1 -0
  196. package/script/3_types.d.ts +0 -1
  197. package/script/3_types.js +0 -1
  198. package/script/4_constants.d.ts +1 -1
  199. package/script/4_constants.js +1 -1
  200. package/script/5_client.d.ts +2 -1
  201. package/script/5_client.js +2 -1
  202. package/script/client/0_utilities.d.ts +6 -0
  203. package/script/client/0_utilities.js +79 -1
  204. package/script/client/3_types.d.ts +76 -8
  205. package/script/client/3_types.js +0 -3
  206. package/script/client/4_composer.d.ts +22 -0
  207. package/script/client/4_composer.js +88 -0
  208. package/script/client/{4_client.d.ts → 5_client.d.ts} +87 -12
  209. package/script/client/{4_client.js → 5_client.js} +369 -108
  210. package/script/client/6_composer.d.ts +4 -0
  211. package/script/client/6_composer.js +7 -0
  212. package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.d.ts +2 -2
  213. package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/base64.js +2 -2
  214. package/{esm/deps/deno.land/std@0.204.0 → script/deps/deno.land/std@0.207.0}/fmt/colors.d.ts +1 -1
  215. package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/fmt/colors.js +1 -1
  216. package/script/deps/deno.land/std@0.207.0/path/_common/assert_path.d.ts +1 -0
  217. package/script/deps/deno.land/std@0.207.0/path/_common/assert_path.js +11 -0
  218. package/script/deps/deno.land/std@0.207.0/path/_common/basename.d.ts +3 -0
  219. package/script/deps/deno.land/std@0.207.0/path/_common/basename.js +46 -0
  220. package/script/deps/deno.land/std@0.207.0/path/_common/common.d.ts +1 -0
  221. package/script/deps/deno.land/std@0.207.0/path/_common/common.js +27 -0
  222. package/script/deps/deno.land/std@0.207.0/path/_common/constants.d.ts +39 -0
  223. package/script/deps/deno.land/std@0.207.0/path/_common/constants.js +49 -0
  224. package/script/deps/deno.land/std@0.207.0/path/_common/dirname.d.ts +1 -0
  225. package/script/deps/deno.land/std@0.207.0/path/_common/dirname.js +12 -0
  226. package/script/deps/deno.land/std@0.207.0/path/_common/format.d.ts +3 -0
  227. package/script/deps/deno.land/std@0.207.0/path/_common/format.js +24 -0
  228. package/script/deps/deno.land/std@0.207.0/path/_common/from_file_url.d.ts +1 -0
  229. package/script/deps/deno.land/std@0.207.0/path/_common/from_file_url.js +13 -0
  230. package/script/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.d.ts +27 -0
  231. package/script/deps/deno.land/std@0.207.0/path/_common/glob_to_reg_exp.js +239 -0
  232. package/script/deps/deno.land/std@0.207.0/path/_common/normalize.d.ts +1 -0
  233. package/script/deps/deno.land/std@0.207.0/path/_common/normalize.js +12 -0
  234. package/script/deps/deno.land/std@0.207.0/path/_common/normalize_string.d.ts +1 -0
  235. package/script/deps/deno.land/std@0.207.0/path/_common/normalize_string.js +81 -0
  236. package/script/deps/deno.land/std@0.207.0/path/_common/relative.d.ts +1 -0
  237. package/script/deps/deno.land/std@0.207.0/path/_common/relative.js +13 -0
  238. package/script/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.d.ts +1 -0
  239. package/script/deps/deno.land/std@0.207.0/path/_common/strip_trailing_separators.js +23 -0
  240. package/script/deps/deno.land/std@0.207.0/path/_common/to_file_url.d.ts +1 -0
  241. package/script/deps/deno.land/std@0.207.0/path/_common/to_file_url.js +19 -0
  242. package/script/deps/deno.land/std@0.207.0/path/_interface.d.ts +26 -0
  243. package/script/deps/deno.land/std@0.207.0/path/_interface.js +4 -0
  244. package/script/deps/deno.land/std@0.207.0/path/_os.d.ts +3 -0
  245. package/script/deps/deno.land/std@0.207.0/path/_os.js +44 -0
  246. package/script/deps/deno.land/std@0.207.0/path/basename.d.ts +8 -0
  247. package/script/deps/deno.land/std@0.207.0/path/basename.js +21 -0
  248. package/script/deps/deno.land/std@0.207.0/path/common.d.ts +13 -0
  249. package/script/deps/deno.land/std@0.207.0/path/common.js +23 -0
  250. package/script/deps/deno.land/std@0.207.0/path/dirname.d.ts +5 -0
  251. package/script/deps/deno.land/std@0.207.0/path/dirname.js +16 -0
  252. package/script/deps/deno.land/std@0.207.0/path/extname.d.ts +6 -0
  253. package/script/deps/deno.land/std@0.207.0/path/extname.js +17 -0
  254. package/script/deps/deno.land/std@0.207.0/path/format.d.ts +6 -0
  255. package/script/deps/deno.land/std@0.207.0/path/format.js +16 -0
  256. package/script/deps/deno.land/std@0.207.0/path/from_file_url.d.ts +17 -0
  257. package/script/deps/deno.land/std@0.207.0/path/from_file_url.js +28 -0
  258. package/script/deps/deno.land/std@0.207.0/path/glob_to_regexp.d.ts +61 -0
  259. package/script/deps/deno.land/std@0.207.0/path/glob_to_regexp.js +69 -0
  260. package/script/deps/deno.land/std@0.207.0/path/is_absolute.d.ts +5 -0
  261. package/script/deps/deno.land/std@0.207.0/path/is_absolute.js +16 -0
  262. package/script/deps/deno.land/std@0.207.0/path/is_glob.d.ts +2 -0
  263. package/script/deps/deno.land/std@0.207.0/path/is_glob.js +32 -0
  264. package/script/deps/deno.land/std@0.207.0/path/join.d.ts +5 -0
  265. package/script/deps/deno.land/std@0.207.0/path/join.js +16 -0
  266. package/script/deps/deno.land/std@0.207.0/path/join_globs.d.ts +3 -0
  267. package/script/deps/deno.land/std@0.207.0/path/join_globs.js +15 -0
  268. package/script/deps/deno.land/std@0.207.0/path/mod.d.ts +28 -0
  269. package/script/deps/deno.land/std@0.207.0/path/mod.js +92 -0
  270. package/script/deps/deno.land/std@0.207.0/path/normalize.d.ts +7 -0
  271. package/script/deps/deno.land/std@0.207.0/path/normalize.js +18 -0
  272. package/script/deps/deno.land/std@0.207.0/path/normalize_glob.d.ts +3 -0
  273. package/script/deps/deno.land/std@0.207.0/path/normalize_glob.js +15 -0
  274. package/script/deps/deno.land/std@0.207.0/path/parse.d.ts +6 -0
  275. package/script/deps/deno.land/std@0.207.0/path/parse.js +16 -0
  276. package/script/deps/deno.land/std@0.207.0/path/posix/_util.d.ts +1 -0
  277. package/script/deps/deno.land/std@0.207.0/path/posix/_util.js +12 -0
  278. package/script/deps/deno.land/std@0.207.0/path/posix/basename.d.ts +8 -0
  279. package/script/deps/deno.land/std@0.207.0/path/posix/basename.js +22 -0
  280. package/script/deps/deno.land/std@0.207.0/path/posix/common.d.ts +13 -0
  281. package/script/deps/deno.land/std@0.207.0/path/posix/common.js +23 -0
  282. package/script/deps/deno.land/std@0.207.0/path/posix/dirname.d.ts +5 -0
  283. package/script/deps/deno.land/std@0.207.0/path/posix/dirname.js +40 -0
  284. package/script/deps/deno.land/std@0.207.0/path/posix/extname.d.ts +6 -0
  285. package/script/deps/deno.land/std@0.207.0/path/posix/extname.js +63 -0
  286. package/script/deps/deno.land/std@0.207.0/path/posix/format.d.ts +6 -0
  287. package/script/deps/deno.land/std@0.207.0/path/posix/format.js +15 -0
  288. package/script/deps/deno.land/std@0.207.0/path/posix/from_file_url.d.ts +11 -0
  289. package/script/deps/deno.land/std@0.207.0/path/posix/from_file_url.js +21 -0
  290. package/script/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.d.ts +57 -0
  291. package/script/deps/deno.land/std@0.207.0/path/posix/glob_to_regexp.js +73 -0
  292. package/script/deps/deno.land/std@0.207.0/path/posix/is_absolute.d.ts +5 -0
  293. package/script/deps/deno.land/std@0.207.0/path/posix/is_absolute.js +16 -0
  294. package/script/deps/deno.land/std@0.207.0/path/posix/is_glob.d.ts +1 -0
  295. package/script/deps/deno.land/std@0.207.0/path/posix/is_glob.js +7 -0
  296. package/script/deps/deno.land/std@0.207.0/path/posix/join.d.ts +5 -0
  297. package/script/deps/deno.land/std@0.207.0/path/posix/join.js +30 -0
  298. package/script/deps/deno.land/std@0.207.0/path/posix/join_globs.d.ts +3 -0
  299. package/script/deps/deno.land/std@0.207.0/path/posix/join_globs.js +30 -0
  300. package/script/deps/deno.land/std@0.207.0/path/posix/mod.d.ts +40 -0
  301. package/script/deps/deno.land/std@0.207.0/path/posix/mod.js +61 -0
  302. package/script/deps/deno.land/std@0.207.0/path/posix/normalize.d.ts +7 -0
  303. package/script/deps/deno.land/std@0.207.0/path/posix/normalize.js +29 -0
  304. package/script/deps/deno.land/std@0.207.0/path/posix/normalize_glob.d.ts +3 -0
  305. package/script/deps/deno.land/std@0.207.0/path/posix/normalize_glob.js +20 -0
  306. package/script/deps/deno.land/std@0.207.0/path/posix/parse.d.ts +6 -0
  307. package/script/deps/deno.land/std@0.207.0/path/posix/parse.js +102 -0
  308. package/script/deps/deno.land/std@0.207.0/path/posix/relative.d.ts +7 -0
  309. package/script/deps/deno.land/std@0.207.0/path/posix/relative.js +98 -0
  310. package/script/deps/deno.land/std@0.207.0/path/posix/resolve.d.ts +5 -0
  311. package/script/deps/deno.land/std@0.207.0/path/posix/resolve.js +75 -0
  312. package/script/deps/deno.land/std@0.207.0/path/posix/separator.d.ts +2 -0
  313. package/script/deps/deno.land/std@0.207.0/path/posix/separator.js +7 -0
  314. package/script/deps/deno.land/std@0.207.0/path/posix/to_file_url.d.ts +11 -0
  315. package/script/deps/deno.land/std@0.207.0/path/posix/to_file_url.js +26 -0
  316. package/script/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.d.ts +5 -0
  317. package/script/deps/deno.land/std@0.207.0/path/posix/to_namespaced_path.js +14 -0
  318. package/script/deps/deno.land/std@0.207.0/path/relative.d.ts +12 -0
  319. package/script/deps/deno.land/std@0.207.0/path/relative.js +23 -0
  320. package/script/deps/deno.land/std@0.207.0/path/resolve.d.ts +5 -0
  321. package/script/deps/deno.land/std@0.207.0/path/resolve.js +18 -0
  322. package/script/deps/deno.land/std@0.207.0/path/separator.d.ts +2 -0
  323. package/script/deps/deno.land/std@0.207.0/path/separator.js +8 -0
  324. package/script/deps/deno.land/std@0.207.0/path/to_file_url.d.ts +17 -0
  325. package/script/deps/deno.land/std@0.207.0/path/to_file_url.js +28 -0
  326. package/script/deps/deno.land/std@0.207.0/path/to_namespaced_path.d.ts +5 -0
  327. package/script/deps/deno.land/std@0.207.0/path/to_namespaced_path.js +18 -0
  328. package/script/deps/deno.land/std@0.207.0/path/windows/_util.d.ts +3 -0
  329. package/script/deps/deno.land/std@0.207.0/path/windows/_util.js +21 -0
  330. package/script/deps/deno.land/std@0.207.0/path/windows/basename.d.ts +8 -0
  331. package/script/deps/deno.land/std@0.207.0/path/windows/basename.js +34 -0
  332. package/script/deps/deno.land/std@0.207.0/path/windows/common.d.ts +13 -0
  333. package/script/deps/deno.land/std@0.207.0/path/windows/common.js +23 -0
  334. package/script/deps/deno.land/std@0.207.0/path/windows/dirname.d.ts +5 -0
  335. package/script/deps/deno.land/std@0.207.0/path/windows/dirname.js +102 -0
  336. package/script/deps/deno.land/std@0.207.0/path/windows/extname.d.ts +6 -0
  337. package/script/deps/deno.land/std@0.207.0/path/windows/extname.js +72 -0
  338. package/script/deps/deno.land/std@0.207.0/path/windows/format.d.ts +6 -0
  339. package/script/deps/deno.land/std@0.207.0/path/windows/format.js +15 -0
  340. package/script/deps/deno.land/std@0.207.0/path/windows/from_file_url.d.ts +13 -0
  341. package/script/deps/deno.land/std@0.207.0/path/windows/from_file_url.js +30 -0
  342. package/script/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.d.ts +57 -0
  343. package/script/deps/deno.land/std@0.207.0/path/windows/glob_to_regexp.js +73 -0
  344. package/script/deps/deno.land/std@0.207.0/path/windows/is_absolute.d.ts +5 -0
  345. package/script/deps/deno.land/std@0.207.0/path/windows/is_absolute.js +31 -0
  346. package/script/deps/deno.land/std@0.207.0/path/windows/is_glob.d.ts +1 -0
  347. package/script/deps/deno.land/std@0.207.0/path/windows/is_glob.js +7 -0
  348. package/script/deps/deno.land/std@0.207.0/path/windows/join.d.ts +5 -0
  349. package/script/deps/deno.land/std@0.207.0/path/windows/join.js +76 -0
  350. package/script/deps/deno.land/std@0.207.0/path/windows/join_globs.d.ts +3 -0
  351. package/script/deps/deno.land/std@0.207.0/path/windows/join_globs.js +30 -0
  352. package/script/deps/deno.land/std@0.207.0/path/windows/mod.d.ts +40 -0
  353. package/script/deps/deno.land/std@0.207.0/path/windows/mod.js +61 -0
  354. package/script/deps/deno.land/std@0.207.0/path/windows/normalize.d.ts +7 -0
  355. package/script/deps/deno.land/std@0.207.0/path/windows/normalize.js +134 -0
  356. package/script/deps/deno.land/std@0.207.0/path/windows/normalize_glob.d.ts +3 -0
  357. package/script/deps/deno.land/std@0.207.0/path/windows/normalize_glob.js +20 -0
  358. package/script/deps/deno.land/std@0.207.0/path/windows/parse.d.ts +6 -0
  359. package/script/deps/deno.land/std@0.207.0/path/windows/parse.js +163 -0
  360. package/script/deps/deno.land/std@0.207.0/path/windows/relative.d.ts +12 -0
  361. package/script/deps/deno.land/std@0.207.0/path/windows/relative.js +125 -0
  362. package/script/deps/deno.land/std@0.207.0/path/windows/resolve.d.ts +5 -0
  363. package/script/deps/deno.land/std@0.207.0/path/windows/resolve.js +170 -0
  364. package/script/deps/deno.land/std@0.207.0/path/windows/separator.d.ts +2 -0
  365. package/script/deps/deno.land/std@0.207.0/path/windows/separator.js +7 -0
  366. package/script/deps/deno.land/std@0.207.0/path/windows/to_file_url.d.ts +13 -0
  367. package/script/deps/deno.land/std@0.207.0/path/windows/to_file_url.js +35 -0
  368. package/script/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.d.ts +5 -0
  369. package/script/deps/deno.land/std@0.207.0/path/windows/to_namespaced_path.js +42 -0
  370. package/script/mod.d.ts +1 -1
  371. package/script/mod.js +3 -1
  372. package/script/tl/0_tl_raw_reader.d.ts +1 -0
  373. package/script/tl/0_tl_raw_reader.js +3 -0
  374. package/script/tl/3_deserialize.js +7 -2
  375. package/script/types/1_chat.d.ts +2 -3
  376. package/script/types/1_chat.js +4 -5
  377. package/script/types/1_user.d.ts +2 -3
  378. package/script/types/1_user.js +1 -2
  379. package/script/types/5_inline_query_result.js +7 -0
  380. package/script/utilities/0_color.d.ts +3 -0
  381. package/script/utilities/0_color.js +60 -0
  382. package/esm/types/0_color.d.ts +0 -3
  383. package/esm/types/0_color.js +0 -36
  384. package/script/types/0_color.d.ts +0 -3
  385. package/script/types/0_color.js +0 -41
  386. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.d.ts +0 -0
  387. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.js +0 -0
  388. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.d.ts +0 -0
  389. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.js +0 -0
  390. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.d.ts +0 -0
  391. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.js +0 -0
  392. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.d.ts +0 -0
  393. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.js +0 -0
  394. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.d.ts +0 -0
  395. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.js +0 -0
  396. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.d.ts +0 -0
  397. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.js +0 -0
  398. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.d.ts +0 -0
  399. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.js +0 -0
  400. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.d.ts +0 -0
  401. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.js +0 -0
  402. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.d.ts +0 -0
  403. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.js +0 -0
  404. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.d.ts +0 -0
  405. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.js +0 -0
  406. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.d.ts +0 -0
  407. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.js +0 -0
  408. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.d.ts +0 -0
  409. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.js +0 -0
  410. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.d.ts +0 -0
  411. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.js +0 -0
  412. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.d.ts +0 -0
  413. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.js +0 -0
  414. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.d.ts +0 -0
  415. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.js +0 -0
  416. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.d.ts +0 -0
  417. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.js +0 -0
  418. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.d.ts +0 -0
  419. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.js +0 -0
  420. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.d.ts +0 -0
  421. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.js +0 -0
  422. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.d.ts +0 -0
  423. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.js +0 -0
  424. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.d.ts +0 -0
  425. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.js +0 -0
  426. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.d.ts +0 -0
  427. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.js +0 -0
  428. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.d.ts +0 -0
  429. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.js +0 -0
  430. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.d.ts +0 -0
  431. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.js +0 -0
  432. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.d.ts +0 -0
  433. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.js +0 -0
  434. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.d.ts +0 -0
  435. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.js +0 -0
  436. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.d.ts +0 -0
  437. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.js +0 -0
  438. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.d.ts +0 -0
  439. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.js +0 -0
  440. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.d.ts +0 -0
  441. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.js +0 -0
  442. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.d.ts +0 -0
  443. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.js +0 -0
  444. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.d.ts +0 -0
  445. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.js +0 -0
  446. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.d.ts +0 -0
  447. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.js +0 -0
  448. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.d.ts +0 -0
  449. /package/esm/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.js +0 -0
  450. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.d.ts +0 -0
  451. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_constants.js +0 -0
  452. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.d.ts +0 -0
  453. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_diff.js +0 -0
  454. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.d.ts +0 -0
  455. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/_format.js +0 -0
  456. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.d.ts +0 -0
  457. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert.js +0 -0
  458. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.d.ts +0 -0
  459. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_almost_equals.js +0 -0
  460. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.d.ts +0 -0
  461. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_array_includes.js +0 -0
  462. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.d.ts +0 -0
  463. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_equals.js +0 -0
  464. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.d.ts +0 -0
  465. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_exists.js +0 -0
  466. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.d.ts +0 -0
  467. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_false.js +0 -0
  468. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.d.ts +0 -0
  469. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater.js +0 -0
  470. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.d.ts +0 -0
  471. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_greater_or_equal.js +0 -0
  472. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.d.ts +0 -0
  473. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_instance_of.js +0 -0
  474. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.d.ts +0 -0
  475. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_is_error.js +0 -0
  476. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.d.ts +0 -0
  477. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less.js +0 -0
  478. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.d.ts +0 -0
  479. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_less_or_equal.js +0 -0
  480. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.d.ts +0 -0
  481. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_match.js +0 -0
  482. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.d.ts +0 -0
  483. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_equals.js +0 -0
  484. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.d.ts +0 -0
  485. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_instance_of.js +0 -0
  486. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.d.ts +0 -0
  487. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_match.js +0 -0
  488. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.d.ts +0 -0
  489. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_not_strict_equals.js +0 -0
  490. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.d.ts +0 -0
  491. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_object_match.js +0 -0
  492. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.d.ts +0 -0
  493. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_rejects.js +0 -0
  494. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.d.ts +0 -0
  495. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_strict_equals.js +0 -0
  496. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.d.ts +0 -0
  497. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_string_includes.js +0 -0
  498. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.d.ts +0 -0
  499. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assert_throws.js +0 -0
  500. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.d.ts +0 -0
  501. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/assertion_error.js +0 -0
  502. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.d.ts +0 -0
  503. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/equal.js +0 -0
  504. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.d.ts +0 -0
  505. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/fail.js +0 -0
  506. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.d.ts +0 -0
  507. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/mod.js +0 -0
  508. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.d.ts +0 -0
  509. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unimplemented.js +0 -0
  510. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.d.ts +0 -0
  511. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/assert/unreachable.js +0 -0
  512. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.d.ts +0 -0
  513. /package/script/deps/deno.land/{std@0.204.0 → std@0.207.0}/encoding/_util.js +0 -0
@@ -10,9 +10,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
11
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
12
  };
13
- var _Client_instances, _a, _Client_auth, _Client_sessionId, _Client_state, _Client_promises, _Client_toAcknowledge, _Client_updateState, _Client_errorHandler, _Client_publicKeys, _Client_autoStart, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_storageInited, _Client_setAuth, _Client_authKeyWasCreated, _Client_connectMutex, _Client_assertUser, _Client_assertBot, _Client_fetchState, _Client_connectionInited, _Client_initConnection, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_selfId, _Client_getSelfId, _Client_receiveLoop, _Client_pingLoop, _Client_lastOutgoing, _Client_pingLoopStarted, _Client_autoStarted, _Client_lastMsgId, _Client_processChats, _Client_processUsers, _Client_handleUpdateQueue, _Client_processUpdatesQueue, _Client_checkChannelGap, _Client_processUpdates, _Client_setUpdateStateDate, _Client_getLocalState, _Client_recoverUpdateGap, _Client_recoverChannelUpdateGap, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_updatesToMessages, _Client_resolveSendAs, _Client_parseText, _Client_getMessagesInner, _Client_downloadInner, _Client_handleUpdate, _Client_usernameResolver, _Client_constructReplyMarkup, _Client_assertMsgHas, _Client_handle, _Client_setMyInfo, _Client_getMyInfo;
13
+ var _Client_instances, _a, _Client_auth, _Client_sessionId, _Client_state, _Client_promises, _Client_toAcknowledge, _Client_updateState, _Client_publicKeys, _Client_autoStart, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_storageInited, _Client_setAuth, _Client_authKeyWasCreated, _Client_connectMutex, _Client_assertUser, _Client_assertBot, _Client_fetchState, _Client_connectionInited, _Client_initConnection, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_selfId, _Client_getSelfId, _Client_receiveLoop, _Client_pingInterval, _Client_pingLoop, _Client_pingLoopStarted, _Client_autoStarted, _Client_lastMsgId, _Client_invoke, _Client_handleInvokeError, _Client_processChats, _Client_processUsers, _Client_handleUpdateQueue, _Client_processUpdatesQueue, _Client_checkChannelGap, _Client_processUpdates, _Client_setUpdateStateDate, _Client_getLocalState, _Client_recoverUpdateGap, _Client_recoverChannelUpdateGap, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_updatesToMessages, _Client_resolveSendAs, _Client_parseText, _Client_getMessagesInner, _Client_downloadInner, _Client_handleUpdate, _Client_usernameResolver, _Client_constructReplyMarkup, _Client_assertMsgHas, _Client_handle, _Client_setMyInfo, _Client_getMyInfo;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.Client = exports.ConnectionError = exports.restartAuth = exports.handleMigrationError = void 0;
15
+ exports.Client = exports.ConnectionError = exports.restartAuth = exports.skipInvoke = exports.handleMigrationError = void 0;
16
16
  const _0_deps_js_1 = require("../0_deps.js");
17
17
  const _1_utilities_js_1 = require("../1_utilities.js");
18
18
  const _2_tl_js_1 = require("../2_tl.js");
@@ -26,7 +26,7 @@ const _0_password_js_1 = require("./0_password.js");
26
26
  const _0_utilities_js_1 = require("./0_utilities.js");
27
27
  const _1_client_abstract_js_1 = require("./1_client_abstract.js");
28
28
  const _2_client_plain_js_1 = require("./2_client_plain.js");
29
- const _3_types_js_2 = require("./3_types.js");
29
+ const _4_composer_js_1 = require("./4_composer.js");
30
30
  const d = (0, _0_deps_js_1.debug)("Client");
31
31
  const dGap = (0, _0_deps_js_1.debug)("Client/recoverUpdateGap");
32
32
  const dGapC = (0, _0_deps_js_1.debug)("Client/recoverChannelUpdateGap");
@@ -37,6 +37,10 @@ const getEntity = Symbol();
37
37
  const getStickerSetName = Symbol();
38
38
  exports.handleMigrationError = Symbol();
39
39
  const getMessageWithReply = Symbol();
40
+ function skipInvoke() {
41
+ return (_ctx, next) => next();
42
+ }
43
+ exports.skipInvoke = skipInvoke;
40
44
  exports.restartAuth = Symbol();
41
45
  class ConnectionError extends Error {
42
46
  }
@@ -70,7 +74,6 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
70
74
  _Client_promises.set(this, new Map());
71
75
  _Client_toAcknowledge.set(this, new Set());
72
76
  _Client_updateState.set(this, void 0);
73
- _Client_errorHandler.set(this, void 0);
74
77
  Object.defineProperty(this, "storage", {
75
78
  enumerable: true,
76
79
  configurable: true,
@@ -121,17 +124,116 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
121
124
  });
122
125
  _Client_publicKeys.set(this, void 0);
123
126
  _Client_autoStart.set(this, void 0);
127
+ _Client_constructContext.set(this, (update) => {
128
+ const msg = update.message ?? update.editedMessage ?? update.callbackQuery?.message;
129
+ const mustGetMsg = () => {
130
+ if (msg !== undefined) {
131
+ return msg;
132
+ }
133
+ else {
134
+ (0, _1_utilities_js_1.UNREACHABLE)();
135
+ }
136
+ };
137
+ const chat = msg?.chat;
138
+ const from = update.callbackQuery?.from ?? update.inlineQuery?.from ?? update.message?.from ?? update.editedMessage?.from;
139
+ const senderChat = msg?.senderChat;
140
+ const getReplyToMessageId = (quote, effectiveMessage) => {
141
+ const shouldQuote = quote === undefined ? effectiveMessage.chat.type != "private" : quote;
142
+ const replyToMessageId = shouldQuote ? effectiveMessage.id : undefined;
143
+ return replyToMessageId;
144
+ };
145
+ return {
146
+ ...update,
147
+ client: this,
148
+ msg,
149
+ chat,
150
+ from,
151
+ senderChat,
152
+ reply: (text, params) => {
153
+ const effectiveMessage = mustGetMsg();
154
+ const replyToMessageId = getReplyToMessageId(params?.quote, effectiveMessage);
155
+ return this.sendMessage(effectiveMessage.chat.id, text, { ...params, replyToMessageId });
156
+ },
157
+ replyPoll: (question, options, params) => {
158
+ const effectiveMessage = mustGetMsg();
159
+ const replyToMessageId = getReplyToMessageId(params?.quote, effectiveMessage);
160
+ return this.sendPoll(effectiveMessage.chat.id, question, options, { ...params, replyToMessageId });
161
+ },
162
+ replyPhoto: (photo, params) => {
163
+ const effectiveMessage = mustGetMsg();
164
+ const replyToMessageId = getReplyToMessageId(params?.quote, effectiveMessage);
165
+ return this.sendPhoto(effectiveMessage.chat.id, photo, { ...params, replyToMessageId });
166
+ },
167
+ delete: () => {
168
+ const effectiveMessage = mustGetMsg();
169
+ return this.deleteMessage(effectiveMessage.chat.id, effectiveMessage.id);
170
+ },
171
+ forward: (to, params) => {
172
+ const effectiveMessage = mustGetMsg();
173
+ return this.forwardMessage(effectiveMessage.chat.id, to, effectiveMessage.id, params);
174
+ },
175
+ answerCallbackQuery: (params) => {
176
+ const { callbackQuery } = update;
177
+ if (callbackQuery === undefined) {
178
+ (0, _1_utilities_js_1.UNREACHABLE)();
179
+ }
180
+ return this.answerCallbackQuery(callbackQuery.id, params);
181
+ },
182
+ answerInlineQuery: (results, params) => {
183
+ const { inlineQuery } = update;
184
+ if (inlineQuery == undefined) {
185
+ (0, _1_utilities_js_1.UNREACHABLE)();
186
+ }
187
+ return this.answerInlineQuery(inlineQuery.id, results, params);
188
+ },
189
+ sendChatAction: (chatAction, params) => {
190
+ const effectiveMessage = mustGetMsg();
191
+ return this.sendChatAction(effectiveMessage.chat.id, chatAction, params);
192
+ },
193
+ editMessageText: (messageId, text, params) => {
194
+ const effectiveMessage = mustGetMsg();
195
+ return this.editMessageText(effectiveMessage.chat.id, messageId, text, params);
196
+ },
197
+ getMessage: (messageId) => {
198
+ const effectiveMessage = mustGetMsg();
199
+ return this.getMessage(effectiveMessage.chat.id, messageId);
200
+ },
201
+ getMessages: (messageIds) => {
202
+ const effectiveMessage = mustGetMsg();
203
+ return this.getMessages(effectiveMessage.chat.id, messageIds);
204
+ },
205
+ forwardMessage: (to, messageId, params) => {
206
+ const effectiveMessage = mustGetMsg();
207
+ return this.forwardMessage(effectiveMessage.chat.id, to, messageId, params);
208
+ },
209
+ forwardMessages: (to, messageIds, params) => {
210
+ const effectiveMessage = mustGetMsg();
211
+ return this.forwardMessages(effectiveMessage.chat.id, to, messageIds, params);
212
+ },
213
+ deleteMessage: (messageId, params) => {
214
+ const effectiveMessage = mustGetMsg();
215
+ return this.deleteMessage(effectiveMessage.chat.id, messageId, params);
216
+ },
217
+ deleteMessages: (messageIds, params) => {
218
+ const effectiveMessage = mustGetMsg();
219
+ return this.deleteMessages(effectiveMessage.chat.id, messageIds, params);
220
+ },
221
+ get toJSON() {
222
+ return () => update;
223
+ },
224
+ };
225
+ });
124
226
  _Client_lastPropagatedConnectionState.set(this, null);
125
227
  Object.defineProperty(this, "stateChangeHandler", {
126
228
  enumerable: true,
127
229
  configurable: true,
128
230
  writable: true,
129
231
  value: ((connected) => {
130
- __classPrivateFieldGet(this, _Client_connectMutex, "f").acquire().then(async (release) => {
232
+ __classPrivateFieldGet(this, _Client_connectMutex, "f").acquire().then((release) => {
131
233
  try {
132
234
  const connectionState = connected ? "ready" : "notConnected";
133
235
  if (this.connected == connected && __classPrivateFieldGet(this, _Client_lastPropagatedConnectionState, "f") != connectionState) {
134
- await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, connectionState);
236
+ __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, connectionState);
135
237
  __classPrivateFieldSet(this, _Client_lastPropagatedConnectionState, connectionState, "f");
136
238
  }
137
239
  }
@@ -147,17 +249,44 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
147
249
  _Client_connectionInited.set(this, false);
148
250
  _Client_lastPropagatedAuthorizationState.set(this, null);
149
251
  _Client_selfId.set(this, null);
150
- _Client_lastOutgoing.set(this, null);
252
+ _Client_pingInterval.set(this, 60 * 1000); // 60 seconds
151
253
  _Client_pingLoopStarted.set(this, false);
152
254
  _Client_autoStarted.set(this, false);
153
255
  _Client_lastMsgId.set(this, 0n);
256
+ _Client_handleInvokeError.set(this, skipInvoke());
257
+ /**
258
+ * Invokes a function waiting and returning its reply if the second parameter is not `true`. Requires the client
259
+ * to be connected.
260
+ *
261
+ * @param function_ The function to invoke.
262
+ */
263
+ Object.defineProperty(this, "invoke", {
264
+ enumerable: true,
265
+ configurable: true,
266
+ writable: true,
267
+ value: Object.assign(__classPrivateFieldGet(this, _Client_instances, "m", _Client_invoke), {
268
+ use: (handler) => {
269
+ const handle = __classPrivateFieldGet(this, _Client_handleInvokeError, "f");
270
+ __classPrivateFieldSet(this, _Client_handleInvokeError, async (ctx, next) => {
271
+ let result = null;
272
+ return await handle(ctx, async () => {
273
+ if (result != null)
274
+ return result;
275
+ result = await handler(ctx, next);
276
+ return result;
277
+ });
278
+ }, "f");
279
+ },
280
+ })
281
+ });
154
282
  _Client_handleUpdateQueue.set(this, new _1_utilities_js_1.Queue("handleUpdate"));
155
283
  _Client_processUpdatesQueue.set(this, new _1_utilities_js_1.Queue("processUpdates"));
156
284
  _Client_usernameResolver.set(this, async (v) => {
157
285
  const inputPeer = await this.getInputPeer(v).then((v) => v[_2_tl_js_1.as](_2_tl_js_1.types.InputPeerUser));
158
286
  return new _2_tl_js_1.types.InputUser({ userId: inputPeer.userId, accessHash: inputPeer.accessHash });
159
287
  });
160
- _Client_handle.set(this, _3_types_js_2.skip);
288
+ //#region Composer
289
+ _Client_handle.set(this, _4_composer_js_1.skip);
161
290
  this.storage = storage ?? new _3_storage_js_1.StorageMemory();
162
291
  this.parseMode = params?.parseMode ?? null;
163
292
  this.appVersion = params?.appVersion ?? _4_constants_js_1.APP_VERSION;
@@ -168,7 +297,41 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
168
297
  this.systemVersion = params?.systemVersion ?? _4_constants_js_1.SYSTEM_VERSION;
169
298
  __classPrivateFieldSet(this, _Client_publicKeys, params?.publicKeys, "f");
170
299
  __classPrivateFieldSet(this, _Client_autoStart, params?.autoStart ?? true, "f");
171
- __classPrivateFieldSet(this, _Client_errorHandler, params?.errorHandler, "f");
300
+ if (params?.defaultHandlers ?? true) {
301
+ this.on("connectionState", ({ connectionState }, next) => {
302
+ (0, _1_utilities_js_1.drop)((async () => {
303
+ if (connectionState == "notConnected") {
304
+ let delay = 5;
305
+ while (!this.connected) {
306
+ d("reconnecting");
307
+ try {
308
+ await this.connect();
309
+ d("reconnected");
310
+ break;
311
+ }
312
+ catch (err) {
313
+ d("failed to reconnect, retrying in %d: %o", delay, err);
314
+ }
315
+ await new Promise((r) => setTimeout(r, delay * 1000));
316
+ if (delay < 15) {
317
+ delay += 5;
318
+ }
319
+ }
320
+ }
321
+ })());
322
+ return next();
323
+ });
324
+ this.invoke.use(async ({ error }, next) => {
325
+ if (error instanceof _4_errors_js_1.FloodWait && error.seconds <= 10) {
326
+ d("sleeping for %d because of: %o", error.seconds, error);
327
+ await new Promise((r) => setTimeout(r, 1000 * error.seconds));
328
+ return true;
329
+ }
330
+ else {
331
+ return next();
332
+ }
333
+ });
334
+ }
172
335
  }
173
336
  /**
174
337
  * Sets the DC and resets the auth key stored in the session provider
@@ -235,14 +398,17 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
235
398
  }
236
399
  d("encrypted client connected");
237
400
  (0, _1_utilities_js_1.drop)(__classPrivateFieldGet(this, _Client_instances, "m", _Client_receiveLoop).call(this));
401
+ if (__classPrivateFieldGet(this, _Client_pingLoopStarted, "f")) {
402
+ (0, _1_utilities_js_1.drop)(__classPrivateFieldGet(this, _Client_instances, "m", _Client_pingLoop).call(this));
403
+ }
238
404
  }
239
405
  finally {
240
406
  release();
241
407
  }
242
408
  }
243
- async [(_Client_auth = new WeakMap(), _Client_sessionId = new WeakMap(), _Client_state = new WeakMap(), _Client_promises = new WeakMap(), _Client_toAcknowledge = new WeakMap(), _Client_updateState = new WeakMap(), _Client_errorHandler = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_autoStart = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_authKeyWasCreated = new WeakMap(), _Client_connectMutex = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_selfId = new WeakMap(), _Client_lastOutgoing = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_autoStarted = new WeakMap(), _Client_lastMsgId = new WeakMap(), _Client_handleUpdateQueue = new WeakMap(), _Client_processUpdatesQueue = new WeakMap(), _Client_usernameResolver = new WeakMap(), _Client_handle = new WeakMap(), _Client_instances = new WeakSet(), _Client_propagateConnectionState = function _Client_propagateConnectionState(connectionState) {
409
+ async [(_Client_auth = new WeakMap(), _Client_sessionId = new WeakMap(), _Client_state = new WeakMap(), _Client_promises = new WeakMap(), _Client_toAcknowledge = new WeakMap(), _Client_updateState = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_autoStart = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_authKeyWasCreated = new WeakMap(), _Client_connectMutex = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_selfId = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_autoStarted = new WeakMap(), _Client_lastMsgId = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_handleUpdateQueue = new WeakMap(), _Client_processUpdatesQueue = new WeakMap(), _Client_usernameResolver = new WeakMap(), _Client_handle = new WeakMap(), _Client_instances = new WeakSet(), _Client_propagateConnectionState = function _Client_propagateConnectionState(connectionState) {
244
410
  __classPrivateFieldGet(this, _Client_handleUpdateQueue, "f").add(async () => {
245
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { connectionState }, _0_utilities_js_1.resolve);
411
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { connectionState }), _0_utilities_js_1.resolve);
246
412
  });
247
413
  }, _Client_setAuth = async function _Client_setAuth(key) {
248
414
  const hash = await (0, _1_utilities_js_1.sha1)(key);
@@ -472,70 +638,6 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
472
638
  }
473
639
  await this.authorize(params);
474
640
  }
475
- async invoke(function_, noWait) {
476
- if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
477
- if (__classPrivateFieldGet(this, _Client_autoStart, "f") && !__classPrivateFieldGet(this, _Client_autoStarted, "f")) {
478
- await this.start();
479
- }
480
- else {
481
- throw new ConnectionError("Not connected");
482
- }
483
- }
484
- if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
485
- (0, _1_utilities_js_1.UNREACHABLE)();
486
- }
487
- let n = 1;
488
- while (true) {
489
- try {
490
- let seqNo = __classPrivateFieldGet(this, _Client_state, "f").seqNo * 2;
491
- if (!(function_ instanceof _2_tl_js_1.functions.Ping) && !(function_ instanceof _2_tl_js_1.types.MsgsAck)) {
492
- seqNo++;
493
- __classPrivateFieldGet(this, _Client_state, "f").seqNo++;
494
- }
495
- const messageId = __classPrivateFieldSet(this, _Client_lastMsgId, (0, _0_message_js_1.getMessageId)(__classPrivateFieldGet(this, _Client_lastMsgId, "f")), "f");
496
- const message = new _2_tl_js_1.Message_(messageId, seqNo, function_);
497
- await this.transport.transport.send(await (0, _0_message_js_1.encryptMessage)(message, __classPrivateFieldGet(this, _Client_auth, "f").key, __classPrivateFieldGet(this, _Client_auth, "f").id, __classPrivateFieldGet(this, _Client_state, "f").salt, __classPrivateFieldGet(this, _Client_sessionId, "f")));
498
- __classPrivateFieldSet(this, _Client_lastOutgoing, new Date(), "f");
499
- d("invoked %s", function_.constructor.name);
500
- if (noWait) {
501
- return;
502
- }
503
- let result;
504
- try {
505
- result = await new Promise((resolve, reject) => {
506
- __classPrivateFieldGet(this, _Client_promises, "f").set(message.id, { resolve, reject });
507
- });
508
- }
509
- catch (err) {
510
- if (err instanceof _4_errors_js_1.AuthKeyUnregistered) {
511
- await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateAuthorizationState).call(this, false);
512
- }
513
- throw err;
514
- }
515
- if (result instanceof _2_tl_js_1.types.BadServerSalt) {
516
- return await this.invoke(function_);
517
- }
518
- else {
519
- if (!__classPrivateFieldGet(this, _Client_pingLoopStarted, "f")) {
520
- (0, _1_utilities_js_1.drop)(__classPrivateFieldGet(this, _Client_instances, "m", _Client_pingLoop).call(this));
521
- __classPrivateFieldSet(this, _Client_pingLoopStarted, true, "f");
522
- }
523
- return result;
524
- }
525
- }
526
- catch (err) {
527
- if (__classPrivateFieldGet(this, _Client_errorHandler, "f") === undefined) {
528
- throw err;
529
- }
530
- if (__classPrivateFieldGet(this, _Client_errorHandler, "f") !== undefined && await __classPrivateFieldGet(this, _Client_errorHandler, "f").call(this, err, function_, n++)) {
531
- continue;
532
- }
533
- else {
534
- throw err;
535
- }
536
- }
537
- }
538
- }
539
641
  /**
540
642
  * Alias for `invoke` with its second parameter being `true`.
541
643
  */
@@ -590,7 +692,7 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
590
692
  }
591
693
  }, _Client_propagateAuthorizationState = async function _Client_propagateAuthorizationState(authorized) {
592
694
  if (__classPrivateFieldGet(this, _Client_lastPropagatedAuthorizationState, "f") != authorized) {
593
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { authorizationState: { authorized } }, _0_utilities_js_1.resolve);
695
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { authorizationState: { authorized } }), _0_utilities_js_1.resolve);
594
696
  __classPrivateFieldSet(this, _Client_lastPropagatedAuthorizationState, authorized, "f");
595
697
  }
596
698
  }, _Client_getSelfId = async function _Client_getSelfId() {
@@ -710,17 +812,81 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
710
812
  }
711
813
  }, _Client_pingLoop = async function _Client_pingLoop() {
712
814
  while (this.connected) {
713
- await new Promise((r) => setTimeout(r, 60 * 1000));
714
- if (!__classPrivateFieldGet(this, _Client_lastOutgoing, "f") || (Date.now() - __classPrivateFieldGet(this, _Client_lastOutgoing, "f").getTime() < 60 * 1000)) {
715
- continue;
716
- }
815
+ await new Promise((r) => setTimeout(r, __classPrivateFieldGet(this, _Client_pingInterval, "f")));
717
816
  try {
718
- await this.invoke(new _2_tl_js_1.functions.Ping({ pingId: (0, _1_utilities_js_1.getRandomBigInt)(8, true, false) }));
817
+ await this.invoke(new _2_tl_js_1.functions.PingDelayDisconnect({ pingId: (0, _1_utilities_js_1.getRandomBigInt)(8, true, false), disconnectDelay: __classPrivateFieldGet(this, _Client_pingInterval, "f") + 15 }));
719
818
  }
720
819
  catch (err) {
721
820
  d("ping loop error: %o", err);
722
821
  }
723
822
  }
823
+ }, _Client_invoke = async function _Client_invoke(function_, noWait) {
824
+ if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
825
+ if (__classPrivateFieldGet(this, _Client_autoStart, "f") && !__classPrivateFieldGet(this, _Client_autoStarted, "f")) {
826
+ await this.start();
827
+ }
828
+ else {
829
+ throw new ConnectionError("Not connected");
830
+ }
831
+ }
832
+ if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
833
+ (0, _1_utilities_js_1.UNREACHABLE)();
834
+ }
835
+ let n = 1;
836
+ while (true) {
837
+ try {
838
+ let seqNo = __classPrivateFieldGet(this, _Client_state, "f").seqNo * 2;
839
+ if (!(function_ instanceof _2_tl_js_1.functions.Ping) && !(function_ instanceof _2_tl_js_1.types.MsgsAck)) {
840
+ seqNo++;
841
+ __classPrivateFieldGet(this, _Client_state, "f").seqNo++;
842
+ }
843
+ const messageId = __classPrivateFieldSet(this, _Client_lastMsgId, (0, _0_message_js_1.getMessageId)(__classPrivateFieldGet(this, _Client_lastMsgId, "f")), "f");
844
+ const message = new _2_tl_js_1.Message_(messageId, seqNo, function_);
845
+ await this.transport.transport.send(await (0, _0_message_js_1.encryptMessage)(message, __classPrivateFieldGet(this, _Client_auth, "f").key, __classPrivateFieldGet(this, _Client_auth, "f").id, __classPrivateFieldGet(this, _Client_state, "f").salt, __classPrivateFieldGet(this, _Client_sessionId, "f")));
846
+ d("invoked %s", function_.constructor.name);
847
+ if (noWait) {
848
+ __classPrivateFieldGet(this, _Client_promises, "f").set(message.id, {
849
+ resolve: (result) => {
850
+ if (result instanceof _2_tl_js_1.types.BadServerSalt) {
851
+ (0, _1_utilities_js_1.drop)(this.invoke(function_, true));
852
+ }
853
+ },
854
+ reject: () => { },
855
+ });
856
+ return;
857
+ }
858
+ let result;
859
+ try {
860
+ result = await new Promise((resolve, reject) => {
861
+ __classPrivateFieldGet(this, _Client_promises, "f").set(message.id, { resolve, reject });
862
+ });
863
+ }
864
+ catch (err) {
865
+ if (err instanceof _4_errors_js_1.AuthKeyUnregistered) {
866
+ await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateAuthorizationState).call(this, false);
867
+ }
868
+ throw err;
869
+ }
870
+ if (result instanceof _2_tl_js_1.types.BadServerSalt) {
871
+ return await this.invoke(function_);
872
+ }
873
+ else {
874
+ if (!__classPrivateFieldGet(this, _Client_pingLoopStarted, "f")) {
875
+ (0, _1_utilities_js_1.drop)(__classPrivateFieldGet(this, _Client_instances, "m", _Client_pingLoop).call(this));
876
+ __classPrivateFieldSet(this, _Client_pingLoopStarted, true, "f");
877
+ }
878
+ return result;
879
+ }
880
+ }
881
+ catch (err) {
882
+ if (await __classPrivateFieldGet(this, _Client_handleInvokeError, "f").call(this, Object.freeze({ client: this, error: err, function: function_, n: n++ }), () => Promise.resolve(false))) {
883
+ continue;
884
+ }
885
+ else {
886
+ throw err;
887
+ }
888
+ }
889
+ }
724
890
  }, _Client_processChats = async function _Client_processChats(chats) {
725
891
  for (const chat of chats) {
726
892
  if (chat instanceof _2_tl_js_1.types.Channel && chat.accessHash) {
@@ -912,7 +1078,7 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
912
1078
  return localState;
913
1079
  }, _Client_recoverUpdateGap = async function _Client_recoverUpdateGap(source) {
914
1080
  dGap("recovering from update gap [%s]", source);
915
- await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, "updating");
1081
+ __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, "updating");
916
1082
  try {
917
1083
  let state = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getLocalState).call(this);
918
1084
  while (true) {
@@ -1689,20 +1855,15 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
1689
1855
  nextOffset: params?.nextOffset,
1690
1856
  }));
1691
1857
  }
1692
- use(handler) {
1693
- const handle = __classPrivateFieldGet(this, _Client_handle, "f");
1694
- __classPrivateFieldSet(this, _Client_handle, async (upd, next) => {
1695
- let called = false;
1696
- await handle(upd, async () => {
1697
- if (called)
1698
- return;
1699
- called = true;
1700
- await handler(upd, next);
1701
- });
1702
- }, "f");
1858
+ use(...middleware) {
1859
+ const composer = new _4_composer_js_1.Composer(...middleware);
1860
+ __classPrivateFieldSet(this, _Client_handle, (0, _4_composer_js_1.concat)(__classPrivateFieldGet(this, _Client_handle, "f"), (0, _4_composer_js_1.flatten)(composer)), "f");
1861
+ return composer;
1703
1862
  }
1704
- branch(predicate, trueHandler, falseHandler) {
1705
- this.use(async (upd, next) => {
1863
+ branch(predicate, trueHandler_, falseHandler_) {
1864
+ const trueHandler = (0, _4_composer_js_1.flatten)(trueHandler_);
1865
+ const falseHandler = (0, _4_composer_js_1.flatten)(falseHandler_);
1866
+ return this.use(async (upd, next) => {
1706
1867
  if (await predicate(upd)) {
1707
1868
  await trueHandler(upd, next);
1708
1869
  }
@@ -1711,19 +1872,19 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
1711
1872
  }
1712
1873
  });
1713
1874
  }
1714
- filter(predicate, handler) {
1715
- this.branch(predicate, handler, _3_types_js_2.skip);
1875
+ filter(predicate, ...middleware) {
1876
+ return this.branch(predicate, middleware.length == 0 ? _4_composer_js_1.skip : middleware.map(_4_composer_js_1.flatten).reduce(_4_composer_js_1.concat), _4_composer_js_1.skip);
1716
1877
  }
1717
- on(filter, handler) {
1878
+ on(filter, ...middleawre) {
1718
1879
  const type = typeof filter === "string" ? filter : filter[0];
1719
1880
  const keys = Array.isArray(filter) ? filter.slice(1) : [];
1720
- this.filter((update) => {
1721
- if (type in update) {
1881
+ return this.filter((ctx) => {
1882
+ if (type in ctx) {
1722
1883
  if (keys.length > 0) {
1723
1884
  for (const key of keys) {
1724
1885
  // deno-lint-ignore ban-ts-comment
1725
1886
  // @ts-ignore
1726
- if (!(key in update[type])) {
1887
+ if (!(key in ctx[type])) {
1727
1888
  return false;
1728
1889
  }
1729
1890
  }
@@ -1733,7 +1894,7 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
1733
1894
  else {
1734
1895
  return false;
1735
1896
  }
1736
- }, handler);
1897
+ }, ...middleawre);
1737
1898
  }
1738
1899
  /**
1739
1900
  * Set the bot's description in the given language. Bot-only.
@@ -1789,6 +1950,104 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
1789
1950
  await __classPrivateFieldGet(this, _Client_instances, "m", _Client_assertBot).call(this, "getMyShortDescription");
1790
1951
  return await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getMyInfo).call(this, params?.languageCode).then((v) => v.about);
1791
1952
  }
1953
+ /**
1954
+ * Delete multiple messages.
1955
+ *
1956
+ * @method
1957
+ * @param chatId The chat that contains the messages.
1958
+ * @param messageIds The identifier of the messages to delete.
1959
+ */
1960
+ async deleteMessages(chatId, messageIds, params) {
1961
+ const peer = await this.getInputPeer(chatId);
1962
+ if (peer instanceof _2_tl_js_1.types.InputPeerChannel) {
1963
+ await this.invoke(new _2_tl_js_1.functions.ChannelsDeleteMessages({ channel: new _2_tl_js_1.types.InputChannel(peer), id: messageIds }));
1964
+ }
1965
+ else {
1966
+ await this.invoke(new _2_tl_js_1.functions.MessagesDeleteMessages({ id: messageIds, revoke: params?.onlyForMe ? undefined : true }));
1967
+ }
1968
+ }
1969
+ /**
1970
+ * Delete a single message.
1971
+ *
1972
+ * @method
1973
+ * @param chatId The chat that contains the message.
1974
+ * @param messageId The identifier of the message to delete.
1975
+ */
1976
+ async deleteMessage(chatId, messageId, params) {
1977
+ await this.deleteMessages(chatId, [messageId], params);
1978
+ }
1979
+ /**
1980
+ * Send a photo.
1981
+ *
1982
+ * @method
1983
+ * @param chatId The chat to send the photo to.
1984
+ * @param photo The photo to send.
1985
+ */
1986
+ async sendPhoto(chatId, photo, params) {
1987
+ let media = null;
1988
+ const spoiler = params?.hasSpoiler ? true : undefined;
1989
+ if (typeof photo === "string") {
1990
+ let fileId = null;
1991
+ try {
1992
+ fileId = _3_types_js_1.FileID.decode(photo);
1993
+ }
1994
+ catch (err) {
1995
+ d("fileId: %o", err);
1996
+ }
1997
+ if (fileId != null) {
1998
+ if (fileId.fileType != _3_types_js_1.FileType.Photo) {
1999
+ (0, _1_utilities_js_1.UNREACHABLE)();
2000
+ }
2001
+ if (fileId.params.mediaId == undefined || fileId.params.accessHash == undefined || fileId.params.fileReference == undefined) {
2002
+ (0, _1_utilities_js_1.UNREACHABLE)();
2003
+ }
2004
+ media = new _2_tl_js_1.types.InputMediaPhoto({
2005
+ id: new _2_tl_js_1.types.InputPhoto({
2006
+ id: fileId.params.mediaId,
2007
+ accessHash: fileId.params.accessHash,
2008
+ fileReference: fileId.params.fileReference,
2009
+ }),
2010
+ spoiler,
2011
+ });
2012
+ }
2013
+ }
2014
+ if (media == null) {
2015
+ if (typeof photo === "string" && (0, _0_utilities_js_1.isHttpUrl)(photo)) {
2016
+ media = new _2_tl_js_1.types.InputMediaPhotoExternal({ url: photo, spoiler });
2017
+ }
2018
+ else {
2019
+ const [contents, fileName] = await (0, _0_utilities_js_1.getFileContents)(photo);
2020
+ const file = await this.upload(contents, { fileName, chunkSize: params?.chunkSize, signal: params?.signal });
2021
+ media = new _2_tl_js_1.types.InputMediaUploadedPhoto({ file, spoiler });
2022
+ }
2023
+ }
2024
+ const peer = await this.getInputPeer(chatId);
2025
+ const randomId = (0, _1_utilities_js_1.getRandomId)();
2026
+ const silent = params?.disableNotification ? true : undefined;
2027
+ const noforwards = params?.protectContent ? true : undefined;
2028
+ const replyToMsgId = params?.replyToMessageId;
2029
+ const topMsgId = params?.messageThreadId;
2030
+ const sendAs = params?.sendAs ? await this.getInputPeer(params.sendAs) : undefined; // TODO: check default sendAs
2031
+ const replyMarkup = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_constructReplyMarkup).call(this, params);
2032
+ const caption_ = params?.caption;
2033
+ const parseResult = caption_ !== undefined ? __classPrivateFieldGet(this, _Client_instances, "m", _Client_parseText).call(this, caption_, { parseMode: params?.parseMode, entities: params?.captionEntities }) : undefined;
2034
+ const caption = parseResult === undefined ? undefined : parseResult[0];
2035
+ const captionEntities = parseResult === undefined ? undefined : parseResult[1];
2036
+ const result = await this.invoke(new _2_tl_js_1.functions.MessagesSendMedia({
2037
+ peer,
2038
+ randomId,
2039
+ silent,
2040
+ noforwards,
2041
+ replyMarkup,
2042
+ replyTo: replyToMsgId !== undefined ? new _2_tl_js_1.types.InputReplyToMessage({ replyToMsgId, topMsgId }) : undefined,
2043
+ sendAs,
2044
+ media,
2045
+ message: caption ?? "",
2046
+ entities: captionEntities,
2047
+ }));
2048
+ const message = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
2049
+ return __classPrivateFieldGet(Client, _a, "m", _Client_assertMsgHas).call(Client, message, "photo");
2050
+ }
1792
2051
  }
1793
2052
  exports.Client = Client;
1794
2053
  _a = Client, _Client_handleUpdate =
@@ -1850,7 +2109,7 @@ async function _Client_handleUpdate(update) {
1850
2109
  const key = update instanceof _2_tl_js_1.types.UpdateNewMessage || update instanceof _2_tl_js_1.types.UpdateNewChannelMessage ? "message" : "editedMessage";
1851
2110
  if (!(update.message instanceof _2_tl_js_1.types.MessageEmpty)) {
1852
2111
  const message = await (0, _3_types_js_1.constructMessage)(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this));
1853
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { [key]: message }, _0_utilities_js_1.resolve);
2112
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { [key]: message }), _0_utilities_js_1.resolve);
1854
2113
  }
1855
2114
  }
1856
2115
  if (update instanceof _2_tl_js_1.types.UpdateDeleteMessages) {
@@ -1866,7 +2125,7 @@ async function _Client_handleUpdate(update) {
1866
2125
  }
1867
2126
  }
1868
2127
  if (deletedMessages.length > 0) {
1869
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { deletedMessages: deletedMessages }, _0_utilities_js_1.resolve);
2128
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { deletedMessages: deletedMessages }), _0_utilities_js_1.resolve);
1870
2129
  }
1871
2130
  }
1872
2131
  else if (update instanceof _2_tl_js_1.types.UpdateDeleteChannelMessages) {
@@ -1880,14 +2139,14 @@ async function _Client_handleUpdate(update) {
1880
2139
  await this.storage.setMessage(chatId, messageId, null);
1881
2140
  }
1882
2141
  if (deletedMessages.length > 0) {
1883
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { deletedMessages: deletedMessages }, _0_utilities_js_1.resolve);
2142
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { deletedMessages: deletedMessages }), _0_utilities_js_1.resolve);
1884
2143
  }
1885
2144
  }
1886
2145
  if (update instanceof _2_tl_js_1.types.UpdateBotCallbackQuery || update instanceof _2_tl_js_1.types.UpdateInlineBotCallbackQuery) {
1887
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { callbackQuery: await (0, _3_types_js_1.constructCallbackQuery)(update, this[getEntity].bind(this), this[getMessageWithReply].bind(this)) }, _0_utilities_js_1.resolve);
2146
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { callbackQuery: await (0, _3_types_js_1.constructCallbackQuery)(update, this[getEntity].bind(this), this[getMessageWithReply].bind(this)) }), _0_utilities_js_1.resolve);
1888
2147
  }
1889
2148
  else if (update instanceof _2_tl_js_1.types.UpdateBotInlineQuery) {
1890
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { inlineQuery: await (0, _3_types_js_1.constructInlineQuery)(update, this[getEntity].bind(this)) }, _0_utilities_js_1.resolve);
2149
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { inlineQuery: await (0, _3_types_js_1.constructInlineQuery)(update, this[getEntity].bind(this)) }), _0_utilities_js_1.resolve);
1891
2150
  }
1892
2151
  }, _Client_constructReplyMarkup = async function _Client_constructReplyMarkup(params) {
1893
2152
  if (params?.replyMarkup) {
@@ -1899,7 +2158,9 @@ async function _Client_handleUpdate(update) {
1899
2158
  (0, _1_utilities_js_1.UNREACHABLE)();
1900
2159
  }
1901
2160
  return message;
1902
- }, _Client_setMyInfo = async function _Client_setMyInfo(info) {
2161
+ }, _Client_setMyInfo =
2162
+ //#endregion
2163
+ async function _Client_setMyInfo(info) {
1903
2164
  await this.invoke(new _2_tl_js_1.functions.BotsSetBotInfo({ bot: new _2_tl_js_1.types.InputUserSelf(), ...info }));
1904
2165
  }, _Client_getMyInfo = function _Client_getMyInfo(languageCode) {
1905
2166
  return this.invoke(new _2_tl_js_1.functions.BotsGetBotInfo({ bot: new _2_tl_js_1.types.InputUserSelf(), langCode: languageCode ?? "" }));