@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
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _Client_instances, _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;
12
+ 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;
13
13
  import { debug, gunzip, Mutex } from "../0_deps.js";
14
14
  import { bigIntFromBuffer, drop, getRandomBigInt, getRandomId, mod, mustPrompt, mustPromptOneOf, Queue, sha1, UNREACHABLE } from "../1_utilities.js";
15
15
  import { as, functions, getChannelChatId, Message_, MessageContainer, peerToChatId, RPCResult, TLError, TLReader, types } from "../2_tl.js";
@@ -20,10 +20,10 @@ import { AuthKeyUnregistered, FloodWait, Migrate, PasswordHashInvalid, PhoneNumb
20
20
  import { parseHtml } from "./0_html.js";
21
21
  import { decryptMessage, encryptMessage, getMessageId } from "./0_message.js";
22
22
  import { checkPassword } from "./0_password.js";
23
- import { isChannelPtsUpdate, isPtsUpdate, resolve } from "./0_utilities.js";
23
+ import { getFileContents, isChannelPtsUpdate, isHttpUrl, isPtsUpdate, resolve } from "./0_utilities.js";
24
24
  import { ClientAbstract } from "./1_client_abstract.js";
25
25
  import { ClientPlain } from "./2_client_plain.js";
26
- import { skip } from "./3_types.js";
26
+ import { Composer, concat, flatten, skip } from "./4_composer.js";
27
27
  const d = debug("Client");
28
28
  const dGap = debug("Client/recoverUpdateGap");
29
29
  const dGapC = debug("Client/recoverChannelUpdateGap");
@@ -34,6 +34,9 @@ const getEntity = Symbol();
34
34
  const getStickerSetName = Symbol();
35
35
  export const handleMigrationError = Symbol();
36
36
  const getMessageWithReply = Symbol();
37
+ export function skipInvoke() {
38
+ return (_ctx, next) => next();
39
+ }
37
40
  export const restartAuth = Symbol();
38
41
  export class ConnectionError extends Error {
39
42
  }
@@ -66,7 +69,6 @@ export class Client extends ClientAbstract {
66
69
  _Client_promises.set(this, new Map());
67
70
  _Client_toAcknowledge.set(this, new Set());
68
71
  _Client_updateState.set(this, void 0);
69
- _Client_errorHandler.set(this, void 0);
70
72
  Object.defineProperty(this, "storage", {
71
73
  enumerable: true,
72
74
  configurable: true,
@@ -117,17 +119,116 @@ export class Client extends ClientAbstract {
117
119
  });
118
120
  _Client_publicKeys.set(this, void 0);
119
121
  _Client_autoStart.set(this, void 0);
122
+ _Client_constructContext.set(this, (update) => {
123
+ const msg = update.message ?? update.editedMessage ?? update.callbackQuery?.message;
124
+ const mustGetMsg = () => {
125
+ if (msg !== undefined) {
126
+ return msg;
127
+ }
128
+ else {
129
+ UNREACHABLE();
130
+ }
131
+ };
132
+ const chat = msg?.chat;
133
+ const from = update.callbackQuery?.from ?? update.inlineQuery?.from ?? update.message?.from ?? update.editedMessage?.from;
134
+ const senderChat = msg?.senderChat;
135
+ const getReplyToMessageId = (quote, effectiveMessage) => {
136
+ const shouldQuote = quote === undefined ? effectiveMessage.chat.type != "private" : quote;
137
+ const replyToMessageId = shouldQuote ? effectiveMessage.id : undefined;
138
+ return replyToMessageId;
139
+ };
140
+ return {
141
+ ...update,
142
+ client: this,
143
+ msg,
144
+ chat,
145
+ from,
146
+ senderChat,
147
+ reply: (text, params) => {
148
+ const effectiveMessage = mustGetMsg();
149
+ const replyToMessageId = getReplyToMessageId(params?.quote, effectiveMessage);
150
+ return this.sendMessage(effectiveMessage.chat.id, text, { ...params, replyToMessageId });
151
+ },
152
+ replyPoll: (question, options, params) => {
153
+ const effectiveMessage = mustGetMsg();
154
+ const replyToMessageId = getReplyToMessageId(params?.quote, effectiveMessage);
155
+ return this.sendPoll(effectiveMessage.chat.id, question, options, { ...params, replyToMessageId });
156
+ },
157
+ replyPhoto: (photo, params) => {
158
+ const effectiveMessage = mustGetMsg();
159
+ const replyToMessageId = getReplyToMessageId(params?.quote, effectiveMessage);
160
+ return this.sendPhoto(effectiveMessage.chat.id, photo, { ...params, replyToMessageId });
161
+ },
162
+ delete: () => {
163
+ const effectiveMessage = mustGetMsg();
164
+ return this.deleteMessage(effectiveMessage.chat.id, effectiveMessage.id);
165
+ },
166
+ forward: (to, params) => {
167
+ const effectiveMessage = mustGetMsg();
168
+ return this.forwardMessage(effectiveMessage.chat.id, to, effectiveMessage.id, params);
169
+ },
170
+ answerCallbackQuery: (params) => {
171
+ const { callbackQuery } = update;
172
+ if (callbackQuery === undefined) {
173
+ UNREACHABLE();
174
+ }
175
+ return this.answerCallbackQuery(callbackQuery.id, params);
176
+ },
177
+ answerInlineQuery: (results, params) => {
178
+ const { inlineQuery } = update;
179
+ if (inlineQuery == undefined) {
180
+ UNREACHABLE();
181
+ }
182
+ return this.answerInlineQuery(inlineQuery.id, results, params);
183
+ },
184
+ sendChatAction: (chatAction, params) => {
185
+ const effectiveMessage = mustGetMsg();
186
+ return this.sendChatAction(effectiveMessage.chat.id, chatAction, params);
187
+ },
188
+ editMessageText: (messageId, text, params) => {
189
+ const effectiveMessage = mustGetMsg();
190
+ return this.editMessageText(effectiveMessage.chat.id, messageId, text, params);
191
+ },
192
+ getMessage: (messageId) => {
193
+ const effectiveMessage = mustGetMsg();
194
+ return this.getMessage(effectiveMessage.chat.id, messageId);
195
+ },
196
+ getMessages: (messageIds) => {
197
+ const effectiveMessage = mustGetMsg();
198
+ return this.getMessages(effectiveMessage.chat.id, messageIds);
199
+ },
200
+ forwardMessage: (to, messageId, params) => {
201
+ const effectiveMessage = mustGetMsg();
202
+ return this.forwardMessage(effectiveMessage.chat.id, to, messageId, params);
203
+ },
204
+ forwardMessages: (to, messageIds, params) => {
205
+ const effectiveMessage = mustGetMsg();
206
+ return this.forwardMessages(effectiveMessage.chat.id, to, messageIds, params);
207
+ },
208
+ deleteMessage: (messageId, params) => {
209
+ const effectiveMessage = mustGetMsg();
210
+ return this.deleteMessage(effectiveMessage.chat.id, messageId, params);
211
+ },
212
+ deleteMessages: (messageIds, params) => {
213
+ const effectiveMessage = mustGetMsg();
214
+ return this.deleteMessages(effectiveMessage.chat.id, messageIds, params);
215
+ },
216
+ get toJSON() {
217
+ return () => update;
218
+ },
219
+ };
220
+ });
120
221
  _Client_lastPropagatedConnectionState.set(this, null);
121
222
  Object.defineProperty(this, "stateChangeHandler", {
122
223
  enumerable: true,
123
224
  configurable: true,
124
225
  writable: true,
125
226
  value: ((connected) => {
126
- __classPrivateFieldGet(this, _Client_connectMutex, "f").acquire().then(async (release) => {
227
+ __classPrivateFieldGet(this, _Client_connectMutex, "f").acquire().then((release) => {
127
228
  try {
128
229
  const connectionState = connected ? "ready" : "notConnected";
129
230
  if (this.connected == connected && __classPrivateFieldGet(this, _Client_lastPropagatedConnectionState, "f") != connectionState) {
130
- await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, connectionState);
231
+ __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, connectionState);
131
232
  __classPrivateFieldSet(this, _Client_lastPropagatedConnectionState, connectionState, "f");
132
233
  }
133
234
  }
@@ -143,16 +244,43 @@ export class Client extends ClientAbstract {
143
244
  _Client_connectionInited.set(this, false);
144
245
  _Client_lastPropagatedAuthorizationState.set(this, null);
145
246
  _Client_selfId.set(this, null);
146
- _Client_lastOutgoing.set(this, null);
247
+ _Client_pingInterval.set(this, 60 * 1000); // 60 seconds
147
248
  _Client_pingLoopStarted.set(this, false);
148
249
  _Client_autoStarted.set(this, false);
149
250
  _Client_lastMsgId.set(this, 0n);
251
+ _Client_handleInvokeError.set(this, skipInvoke());
252
+ /**
253
+ * Invokes a function waiting and returning its reply if the second parameter is not `true`. Requires the client
254
+ * to be connected.
255
+ *
256
+ * @param function_ The function to invoke.
257
+ */
258
+ Object.defineProperty(this, "invoke", {
259
+ enumerable: true,
260
+ configurable: true,
261
+ writable: true,
262
+ value: Object.assign(__classPrivateFieldGet(this, _Client_instances, "m", _Client_invoke), {
263
+ use: (handler) => {
264
+ const handle = __classPrivateFieldGet(this, _Client_handleInvokeError, "f");
265
+ __classPrivateFieldSet(this, _Client_handleInvokeError, async (ctx, next) => {
266
+ let result = null;
267
+ return await handle(ctx, async () => {
268
+ if (result != null)
269
+ return result;
270
+ result = await handler(ctx, next);
271
+ return result;
272
+ });
273
+ }, "f");
274
+ },
275
+ })
276
+ });
150
277
  _Client_handleUpdateQueue.set(this, new Queue("handleUpdate"));
151
278
  _Client_processUpdatesQueue.set(this, new Queue("processUpdates"));
152
279
  _Client_usernameResolver.set(this, async (v) => {
153
280
  const inputPeer = await this.getInputPeer(v).then((v) => v[as](types.InputPeerUser));
154
281
  return new types.InputUser({ userId: inputPeer.userId, accessHash: inputPeer.accessHash });
155
282
  });
283
+ //#region Composer
156
284
  _Client_handle.set(this, skip);
157
285
  this.storage = storage ?? new StorageMemory();
158
286
  this.parseMode = params?.parseMode ?? null;
@@ -164,7 +292,41 @@ export class Client extends ClientAbstract {
164
292
  this.systemVersion = params?.systemVersion ?? SYSTEM_VERSION;
165
293
  __classPrivateFieldSet(this, _Client_publicKeys, params?.publicKeys, "f");
166
294
  __classPrivateFieldSet(this, _Client_autoStart, params?.autoStart ?? true, "f");
167
- __classPrivateFieldSet(this, _Client_errorHandler, params?.errorHandler, "f");
295
+ if (params?.defaultHandlers ?? true) {
296
+ this.on("connectionState", ({ connectionState }, next) => {
297
+ drop((async () => {
298
+ if (connectionState == "notConnected") {
299
+ let delay = 5;
300
+ while (!this.connected) {
301
+ d("reconnecting");
302
+ try {
303
+ await this.connect();
304
+ d("reconnected");
305
+ break;
306
+ }
307
+ catch (err) {
308
+ d("failed to reconnect, retrying in %d: %o", delay, err);
309
+ }
310
+ await new Promise((r) => setTimeout(r, delay * 1000));
311
+ if (delay < 15) {
312
+ delay += 5;
313
+ }
314
+ }
315
+ }
316
+ })());
317
+ return next();
318
+ });
319
+ this.invoke.use(async ({ error }, next) => {
320
+ if (error instanceof FloodWait && error.seconds <= 10) {
321
+ d("sleeping for %d because of: %o", error.seconds, error);
322
+ await new Promise((r) => setTimeout(r, 1000 * error.seconds));
323
+ return true;
324
+ }
325
+ else {
326
+ return next();
327
+ }
328
+ });
329
+ }
168
330
  }
169
331
  /**
170
332
  * Sets the DC and resets the auth key stored in the session provider
@@ -231,14 +393,17 @@ export class Client extends ClientAbstract {
231
393
  }
232
394
  d("encrypted client connected");
233
395
  drop(__classPrivateFieldGet(this, _Client_instances, "m", _Client_receiveLoop).call(this));
396
+ if (__classPrivateFieldGet(this, _Client_pingLoopStarted, "f")) {
397
+ drop(__classPrivateFieldGet(this, _Client_instances, "m", _Client_pingLoop).call(this));
398
+ }
234
399
  }
235
400
  finally {
236
401
  release();
237
402
  }
238
403
  }
239
- 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) {
404
+ 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) {
240
405
  __classPrivateFieldGet(this, _Client_handleUpdateQueue, "f").add(async () => {
241
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { connectionState }, resolve);
406
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { connectionState }), resolve);
242
407
  });
243
408
  }, _Client_setAuth = async function _Client_setAuth(key) {
244
409
  const hash = await sha1(key);
@@ -468,70 +633,6 @@ export class Client extends ClientAbstract {
468
633
  }
469
634
  await this.authorize(params);
470
635
  }
471
- async invoke(function_, noWait) {
472
- if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
473
- if (__classPrivateFieldGet(this, _Client_autoStart, "f") && !__classPrivateFieldGet(this, _Client_autoStarted, "f")) {
474
- await this.start();
475
- }
476
- else {
477
- throw new ConnectionError("Not connected");
478
- }
479
- }
480
- if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
481
- UNREACHABLE();
482
- }
483
- let n = 1;
484
- while (true) {
485
- try {
486
- let seqNo = __classPrivateFieldGet(this, _Client_state, "f").seqNo * 2;
487
- if (!(function_ instanceof functions.Ping) && !(function_ instanceof types.MsgsAck)) {
488
- seqNo++;
489
- __classPrivateFieldGet(this, _Client_state, "f").seqNo++;
490
- }
491
- const messageId = __classPrivateFieldSet(this, _Client_lastMsgId, getMessageId(__classPrivateFieldGet(this, _Client_lastMsgId, "f")), "f");
492
- const message = new Message_(messageId, seqNo, function_);
493
- await this.transport.transport.send(await 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")));
494
- __classPrivateFieldSet(this, _Client_lastOutgoing, new Date(), "f");
495
- d("invoked %s", function_.constructor.name);
496
- if (noWait) {
497
- return;
498
- }
499
- let result;
500
- try {
501
- result = await new Promise((resolve, reject) => {
502
- __classPrivateFieldGet(this, _Client_promises, "f").set(message.id, { resolve, reject });
503
- });
504
- }
505
- catch (err) {
506
- if (err instanceof AuthKeyUnregistered) {
507
- await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateAuthorizationState).call(this, false);
508
- }
509
- throw err;
510
- }
511
- if (result instanceof types.BadServerSalt) {
512
- return await this.invoke(function_);
513
- }
514
- else {
515
- if (!__classPrivateFieldGet(this, _Client_pingLoopStarted, "f")) {
516
- drop(__classPrivateFieldGet(this, _Client_instances, "m", _Client_pingLoop).call(this));
517
- __classPrivateFieldSet(this, _Client_pingLoopStarted, true, "f");
518
- }
519
- return result;
520
- }
521
- }
522
- catch (err) {
523
- if (__classPrivateFieldGet(this, _Client_errorHandler, "f") === undefined) {
524
- throw err;
525
- }
526
- if (__classPrivateFieldGet(this, _Client_errorHandler, "f") !== undefined && await __classPrivateFieldGet(this, _Client_errorHandler, "f").call(this, err, function_, n++)) {
527
- continue;
528
- }
529
- else {
530
- throw err;
531
- }
532
- }
533
- }
534
- }
535
636
  /**
536
637
  * Alias for `invoke` with its second parameter being `true`.
537
638
  */
@@ -586,7 +687,7 @@ export class Client extends ClientAbstract {
586
687
  }
587
688
  }, _Client_propagateAuthorizationState = async function _Client_propagateAuthorizationState(authorized) {
588
689
  if (__classPrivateFieldGet(this, _Client_lastPropagatedAuthorizationState, "f") != authorized) {
589
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { authorizationState: { authorized } }, resolve);
690
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { authorizationState: { authorized } }), resolve);
590
691
  __classPrivateFieldSet(this, _Client_lastPropagatedAuthorizationState, authorized, "f");
591
692
  }
592
693
  }, _Client_getSelfId = async function _Client_getSelfId() {
@@ -706,17 +807,81 @@ export class Client extends ClientAbstract {
706
807
  }
707
808
  }, _Client_pingLoop = async function _Client_pingLoop() {
708
809
  while (this.connected) {
709
- await new Promise((r) => setTimeout(r, 60 * 1000));
710
- if (!__classPrivateFieldGet(this, _Client_lastOutgoing, "f") || (Date.now() - __classPrivateFieldGet(this, _Client_lastOutgoing, "f").getTime() < 60 * 1000)) {
711
- continue;
712
- }
810
+ await new Promise((r) => setTimeout(r, __classPrivateFieldGet(this, _Client_pingInterval, "f")));
713
811
  try {
714
- await this.invoke(new functions.Ping({ pingId: getRandomBigInt(8, true, false) }));
812
+ await this.invoke(new functions.PingDelayDisconnect({ pingId: getRandomBigInt(8, true, false), disconnectDelay: __classPrivateFieldGet(this, _Client_pingInterval, "f") + 15 }));
715
813
  }
716
814
  catch (err) {
717
815
  d("ping loop error: %o", err);
718
816
  }
719
817
  }
818
+ }, _Client_invoke = async function _Client_invoke(function_, noWait) {
819
+ if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
820
+ if (__classPrivateFieldGet(this, _Client_autoStart, "f") && !__classPrivateFieldGet(this, _Client_autoStarted, "f")) {
821
+ await this.start();
822
+ }
823
+ else {
824
+ throw new ConnectionError("Not connected");
825
+ }
826
+ }
827
+ if (!__classPrivateFieldGet(this, _Client_auth, "f") || !this.transport) {
828
+ UNREACHABLE();
829
+ }
830
+ let n = 1;
831
+ while (true) {
832
+ try {
833
+ let seqNo = __classPrivateFieldGet(this, _Client_state, "f").seqNo * 2;
834
+ if (!(function_ instanceof functions.Ping) && !(function_ instanceof types.MsgsAck)) {
835
+ seqNo++;
836
+ __classPrivateFieldGet(this, _Client_state, "f").seqNo++;
837
+ }
838
+ const messageId = __classPrivateFieldSet(this, _Client_lastMsgId, getMessageId(__classPrivateFieldGet(this, _Client_lastMsgId, "f")), "f");
839
+ const message = new Message_(messageId, seqNo, function_);
840
+ await this.transport.transport.send(await 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")));
841
+ d("invoked %s", function_.constructor.name);
842
+ if (noWait) {
843
+ __classPrivateFieldGet(this, _Client_promises, "f").set(message.id, {
844
+ resolve: (result) => {
845
+ if (result instanceof types.BadServerSalt) {
846
+ drop(this.invoke(function_, true));
847
+ }
848
+ },
849
+ reject: () => { },
850
+ });
851
+ return;
852
+ }
853
+ let result;
854
+ try {
855
+ result = await new Promise((resolve, reject) => {
856
+ __classPrivateFieldGet(this, _Client_promises, "f").set(message.id, { resolve, reject });
857
+ });
858
+ }
859
+ catch (err) {
860
+ if (err instanceof AuthKeyUnregistered) {
861
+ await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateAuthorizationState).call(this, false);
862
+ }
863
+ throw err;
864
+ }
865
+ if (result instanceof types.BadServerSalt) {
866
+ return await this.invoke(function_);
867
+ }
868
+ else {
869
+ if (!__classPrivateFieldGet(this, _Client_pingLoopStarted, "f")) {
870
+ drop(__classPrivateFieldGet(this, _Client_instances, "m", _Client_pingLoop).call(this));
871
+ __classPrivateFieldSet(this, _Client_pingLoopStarted, true, "f");
872
+ }
873
+ return result;
874
+ }
875
+ }
876
+ catch (err) {
877
+ if (await __classPrivateFieldGet(this, _Client_handleInvokeError, "f").call(this, Object.freeze({ client: this, error: err, function: function_, n: n++ }), () => Promise.resolve(false))) {
878
+ continue;
879
+ }
880
+ else {
881
+ throw err;
882
+ }
883
+ }
884
+ }
720
885
  }, _Client_processChats = async function _Client_processChats(chats) {
721
886
  for (const chat of chats) {
722
887
  if (chat instanceof types.Channel && chat.accessHash) {
@@ -908,7 +1073,7 @@ export class Client extends ClientAbstract {
908
1073
  return localState;
909
1074
  }, _Client_recoverUpdateGap = async function _Client_recoverUpdateGap(source) {
910
1075
  dGap("recovering from update gap [%s]", source);
911
- await __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, "updating");
1076
+ __classPrivateFieldGet(this, _Client_instances, "m", _Client_propagateConnectionState).call(this, "updating");
912
1077
  try {
913
1078
  let state = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getLocalState).call(this);
914
1079
  while (true) {
@@ -1685,20 +1850,15 @@ export class Client extends ClientAbstract {
1685
1850
  nextOffset: params?.nextOffset,
1686
1851
  }));
1687
1852
  }
1688
- use(handler) {
1689
- const handle = __classPrivateFieldGet(this, _Client_handle, "f");
1690
- __classPrivateFieldSet(this, _Client_handle, async (upd, next) => {
1691
- let called = false;
1692
- await handle(upd, async () => {
1693
- if (called)
1694
- return;
1695
- called = true;
1696
- await handler(upd, next);
1697
- });
1698
- }, "f");
1853
+ use(...middleware) {
1854
+ const composer = new Composer(...middleware);
1855
+ __classPrivateFieldSet(this, _Client_handle, concat(__classPrivateFieldGet(this, _Client_handle, "f"), flatten(composer)), "f");
1856
+ return composer;
1699
1857
  }
1700
- branch(predicate, trueHandler, falseHandler) {
1701
- this.use(async (upd, next) => {
1858
+ branch(predicate, trueHandler_, falseHandler_) {
1859
+ const trueHandler = flatten(trueHandler_);
1860
+ const falseHandler = flatten(falseHandler_);
1861
+ return this.use(async (upd, next) => {
1702
1862
  if (await predicate(upd)) {
1703
1863
  await trueHandler(upd, next);
1704
1864
  }
@@ -1707,19 +1867,19 @@ export class Client extends ClientAbstract {
1707
1867
  }
1708
1868
  });
1709
1869
  }
1710
- filter(predicate, handler) {
1711
- this.branch(predicate, handler, skip);
1870
+ filter(predicate, ...middleware) {
1871
+ return this.branch(predicate, middleware.length == 0 ? skip : middleware.map(flatten).reduce(concat), skip);
1712
1872
  }
1713
- on(filter, handler) {
1873
+ on(filter, ...middleawre) {
1714
1874
  const type = typeof filter === "string" ? filter : filter[0];
1715
1875
  const keys = Array.isArray(filter) ? filter.slice(1) : [];
1716
- this.filter((update) => {
1717
- if (type in update) {
1876
+ return this.filter((ctx) => {
1877
+ if (type in ctx) {
1718
1878
  if (keys.length > 0) {
1719
1879
  for (const key of keys) {
1720
1880
  // deno-lint-ignore ban-ts-comment
1721
1881
  // @ts-ignore
1722
- if (!(key in update[type])) {
1882
+ if (!(key in ctx[type])) {
1723
1883
  return false;
1724
1884
  }
1725
1885
  }
@@ -1729,7 +1889,7 @@ export class Client extends ClientAbstract {
1729
1889
  else {
1730
1890
  return false;
1731
1891
  }
1732
- }, handler);
1892
+ }, ...middleawre);
1733
1893
  }
1734
1894
  /**
1735
1895
  * Set the bot's description in the given language. Bot-only.
@@ -1785,6 +1945,104 @@ export class Client extends ClientAbstract {
1785
1945
  await __classPrivateFieldGet(this, _Client_instances, "m", _Client_assertBot).call(this, "getMyShortDescription");
1786
1946
  return await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getMyInfo).call(this, params?.languageCode).then((v) => v.about);
1787
1947
  }
1948
+ /**
1949
+ * Delete multiple messages.
1950
+ *
1951
+ * @method
1952
+ * @param chatId The chat that contains the messages.
1953
+ * @param messageIds The identifier of the messages to delete.
1954
+ */
1955
+ async deleteMessages(chatId, messageIds, params) {
1956
+ const peer = await this.getInputPeer(chatId);
1957
+ if (peer instanceof types.InputPeerChannel) {
1958
+ await this.invoke(new functions.ChannelsDeleteMessages({ channel: new types.InputChannel(peer), id: messageIds }));
1959
+ }
1960
+ else {
1961
+ await this.invoke(new functions.MessagesDeleteMessages({ id: messageIds, revoke: params?.onlyForMe ? undefined : true }));
1962
+ }
1963
+ }
1964
+ /**
1965
+ * Delete a single message.
1966
+ *
1967
+ * @method
1968
+ * @param chatId The chat that contains the message.
1969
+ * @param messageId The identifier of the message to delete.
1970
+ */
1971
+ async deleteMessage(chatId, messageId, params) {
1972
+ await this.deleteMessages(chatId, [messageId], params);
1973
+ }
1974
+ /**
1975
+ * Send a photo.
1976
+ *
1977
+ * @method
1978
+ * @param chatId The chat to send the photo to.
1979
+ * @param photo The photo to send.
1980
+ */
1981
+ async sendPhoto(chatId, photo, params) {
1982
+ let media = null;
1983
+ const spoiler = params?.hasSpoiler ? true : undefined;
1984
+ if (typeof photo === "string") {
1985
+ let fileId = null;
1986
+ try {
1987
+ fileId = FileID.decode(photo);
1988
+ }
1989
+ catch (err) {
1990
+ d("fileId: %o", err);
1991
+ }
1992
+ if (fileId != null) {
1993
+ if (fileId.fileType != FileType.Photo) {
1994
+ UNREACHABLE();
1995
+ }
1996
+ if (fileId.params.mediaId == undefined || fileId.params.accessHash == undefined || fileId.params.fileReference == undefined) {
1997
+ UNREACHABLE();
1998
+ }
1999
+ media = new types.InputMediaPhoto({
2000
+ id: new types.InputPhoto({
2001
+ id: fileId.params.mediaId,
2002
+ accessHash: fileId.params.accessHash,
2003
+ fileReference: fileId.params.fileReference,
2004
+ }),
2005
+ spoiler,
2006
+ });
2007
+ }
2008
+ }
2009
+ if (media == null) {
2010
+ if (typeof photo === "string" && isHttpUrl(photo)) {
2011
+ media = new types.InputMediaPhotoExternal({ url: photo, spoiler });
2012
+ }
2013
+ else {
2014
+ const [contents, fileName] = await getFileContents(photo);
2015
+ const file = await this.upload(contents, { fileName, chunkSize: params?.chunkSize, signal: params?.signal });
2016
+ media = new types.InputMediaUploadedPhoto({ file, spoiler });
2017
+ }
2018
+ }
2019
+ const peer = await this.getInputPeer(chatId);
2020
+ const randomId = getRandomId();
2021
+ const silent = params?.disableNotification ? true : undefined;
2022
+ const noforwards = params?.protectContent ? true : undefined;
2023
+ const replyToMsgId = params?.replyToMessageId;
2024
+ const topMsgId = params?.messageThreadId;
2025
+ const sendAs = params?.sendAs ? await this.getInputPeer(params.sendAs) : undefined; // TODO: check default sendAs
2026
+ const replyMarkup = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_constructReplyMarkup).call(this, params);
2027
+ const caption_ = params?.caption;
2028
+ const parseResult = caption_ !== undefined ? __classPrivateFieldGet(this, _Client_instances, "m", _Client_parseText).call(this, caption_, { parseMode: params?.parseMode, entities: params?.captionEntities }) : undefined;
2029
+ const caption = parseResult === undefined ? undefined : parseResult[0];
2030
+ const captionEntities = parseResult === undefined ? undefined : parseResult[1];
2031
+ const result = await this.invoke(new functions.MessagesSendMedia({
2032
+ peer,
2033
+ randomId,
2034
+ silent,
2035
+ noforwards,
2036
+ replyMarkup,
2037
+ replyTo: replyToMsgId !== undefined ? new types.InputReplyToMessage({ replyToMsgId, topMsgId }) : undefined,
2038
+ sendAs,
2039
+ media,
2040
+ message: caption ?? "",
2041
+ entities: captionEntities,
2042
+ }));
2043
+ const message = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
2044
+ return __classPrivateFieldGet(Client, _a, "m", _Client_assertMsgHas).call(Client, message, "photo");
2045
+ }
1788
2046
  }
1789
2047
  _a = Client, _Client_handleUpdate =
1790
2048
  // TODO: log errors
@@ -1845,7 +2103,7 @@ async function _Client_handleUpdate(update) {
1845
2103
  const key = update instanceof types.UpdateNewMessage || update instanceof types.UpdateNewChannelMessage ? "message" : "editedMessage";
1846
2104
  if (!(update.message instanceof types.MessageEmpty)) {
1847
2105
  const message = await constructMessage(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this));
1848
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { [key]: message }, resolve);
2106
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { [key]: message }), resolve);
1849
2107
  }
1850
2108
  }
1851
2109
  if (update instanceof types.UpdateDeleteMessages) {
@@ -1861,7 +2119,7 @@ async function _Client_handleUpdate(update) {
1861
2119
  }
1862
2120
  }
1863
2121
  if (deletedMessages.length > 0) {
1864
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { deletedMessages: deletedMessages }, resolve);
2122
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { deletedMessages: deletedMessages }), resolve);
1865
2123
  }
1866
2124
  }
1867
2125
  else if (update instanceof types.UpdateDeleteChannelMessages) {
@@ -1875,14 +2133,14 @@ async function _Client_handleUpdate(update) {
1875
2133
  await this.storage.setMessage(chatId, messageId, null);
1876
2134
  }
1877
2135
  if (deletedMessages.length > 0) {
1878
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { deletedMessages: deletedMessages }, resolve);
2136
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { deletedMessages: deletedMessages }), resolve);
1879
2137
  }
1880
2138
  }
1881
2139
  if (update instanceof types.UpdateBotCallbackQuery || update instanceof types.UpdateInlineBotCallbackQuery) {
1882
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { callbackQuery: await constructCallbackQuery(update, this[getEntity].bind(this), this[getMessageWithReply].bind(this)) }, resolve);
2140
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { callbackQuery: await constructCallbackQuery(update, this[getEntity].bind(this), this[getMessageWithReply].bind(this)) }), resolve);
1883
2141
  }
1884
2142
  else if (update instanceof types.UpdateBotInlineQuery) {
1885
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { inlineQuery: await constructInlineQuery(update, this[getEntity].bind(this)) }, resolve);
2143
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, __classPrivateFieldGet(this, _Client_constructContext, "f").call(this, { inlineQuery: await constructInlineQuery(update, this[getEntity].bind(this)) }), resolve);
1886
2144
  }
1887
2145
  }, _Client_constructReplyMarkup = async function _Client_constructReplyMarkup(params) {
1888
2146
  if (params?.replyMarkup) {
@@ -1894,7 +2152,9 @@ async function _Client_handleUpdate(update) {
1894
2152
  UNREACHABLE();
1895
2153
  }
1896
2154
  return message;
1897
- }, _Client_setMyInfo = async function _Client_setMyInfo(info) {
2155
+ }, _Client_setMyInfo =
2156
+ //#endregion
2157
+ async function _Client_setMyInfo(info) {
1898
2158
  await this.invoke(new functions.BotsSetBotInfo({ bot: new types.InputUserSelf(), ...info }));
1899
2159
  }, _Client_getMyInfo = function _Client_getMyInfo(languageCode) {
1900
2160
  return this.invoke(new functions.BotsGetBotInfo({ bot: new types.InputUserSelf(), langCode: languageCode ?? "" }));
@@ -0,0 +1,4 @@
1
+ import { Composer as Composer_ } from "./4_composer.js";
2
+ import { Context } from "./5_client.js";
3
+ export declare class Composer<C extends Context = Context> extends Composer_<C> {
4
+ }