@mtcute/core 0.18.0-rc.5 → 0.18.0

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 (630) hide show
  1. package/client.d.cts +1 -0
  2. package/highlevel/base.d.cts +115 -0
  3. package/highlevel/base.test.d.cts +1 -0
  4. package/highlevel/client.d.cts +5045 -0
  5. package/highlevel/client.types.d.cts +61 -0
  6. package/highlevel/index.d.cts +4 -0
  7. package/highlevel/managers/app-config-manager.d.cts +11 -0
  8. package/highlevel/managers/timers.d.cts +10 -0
  9. package/highlevel/methods/_imports.d.cts +1 -0
  10. package/highlevel/methods/_init.d.cts +1 -0
  11. package/highlevel/methods/auth/check-password.d.cts +10 -0
  12. package/highlevel/methods/auth/get-password-hint.d.cts +7 -0
  13. package/highlevel/methods/auth/log-out.d.cts +17 -0
  14. package/highlevel/methods/auth/recover-password.d.cts +12 -0
  15. package/highlevel/methods/auth/resend-code.d.cts +16 -0
  16. package/highlevel/methods/auth/run.d.cts +16 -0
  17. package/highlevel/methods/auth/send-code.d.cts +18 -0
  18. package/highlevel/methods/auth/send-recovery-code.d.cts +7 -0
  19. package/highlevel/methods/auth/sign-in-bot.d.cts +10 -0
  20. package/highlevel/methods/auth/sign-in-qr.d.cts +33 -0
  21. package/highlevel/methods/auth/sign-in.d.cts +19 -0
  22. package/highlevel/methods/auth/start-test.d.cts +30 -0
  23. package/highlevel/methods/auth/start.d.cts +89 -0
  24. package/highlevel/methods/auth/utils.d.cts +9 -0
  25. package/highlevel/methods/bots/answer-callback-query.d.cts +41 -0
  26. package/highlevel/methods/bots/answer-inline-query.d.cts +88 -0
  27. package/highlevel/methods/bots/answer-pre-checkout-query.d.cts +12 -0
  28. package/highlevel/methods/bots/delete-my-commands.d.cts +22 -0
  29. package/highlevel/methods/bots/get-bot-info.d.cts +18 -0
  30. package/highlevel/methods/bots/get-bot-menu-button.d.cts +7 -0
  31. package/highlevel/methods/bots/get-callback-answer.d.cts +41 -0
  32. package/highlevel/methods/bots/get-game-high-scores.d.cts +17 -0
  33. package/highlevel/methods/bots/get-my-commands.d.cts +21 -0
  34. package/highlevel/methods/bots/normalize-command-scope.d.cts +5 -0
  35. package/highlevel/methods/bots/open-webview.d.cts +73 -0
  36. package/highlevel/methods/bots/prepare-inline-message.d.cts +32 -0
  37. package/highlevel/methods/bots/set-bot-info.d.cts +23 -0
  38. package/highlevel/methods/bots/set-bot-menu-button.d.cts +7 -0
  39. package/highlevel/methods/bots/set-game-score.d.cts +54 -0
  40. package/highlevel/methods/bots/set-my-commands.d.cts +26 -0
  41. package/highlevel/methods/bots/set-my-default-rights.d.cts +11 -0
  42. package/highlevel/methods/bots/toggle-emoji-status-permission.d.cts +11 -0
  43. package/highlevel/methods/chats/add-chat-members.d.cts +20 -0
  44. package/highlevel/methods/chats/archive-chats.d.cts +9 -0
  45. package/highlevel/methods/chats/ban-chat-member.d.cts +24 -0
  46. package/highlevel/methods/chats/batched-queries.d.cts +11 -0
  47. package/highlevel/methods/chats/create-channel.d.cts +17 -0
  48. package/highlevel/methods/chats/create-group.d.cts +33 -0
  49. package/highlevel/methods/chats/create-supergroup.d.cts +27 -0
  50. package/highlevel/methods/chats/delete-channel.d.cts +8 -0
  51. package/highlevel/methods/chats/delete-chat-photo.d.cts +10 -0
  52. package/highlevel/methods/chats/delete-group.d.cts +8 -0
  53. package/highlevel/methods/chats/delete-history.d.cts +22 -0
  54. package/highlevel/methods/chats/delete-user-history.d.cts +16 -0
  55. package/highlevel/methods/chats/edit-admin-rights.d.cts +16 -0
  56. package/highlevel/methods/chats/get-chat-event-log.d.cts +61 -0
  57. package/highlevel/methods/chats/get-chat-member.d.cts +15 -0
  58. package/highlevel/methods/chats/get-chat-members.d.cts +51 -0
  59. package/highlevel/methods/chats/get-chat-preview.d.cts +12 -0
  60. package/highlevel/methods/chats/get-chat.d.cts +11 -0
  61. package/highlevel/methods/chats/get-full-chat.d.cts +11 -0
  62. package/highlevel/methods/chats/get-full-user.d.cts +8 -0
  63. package/highlevel/methods/chats/get-nearby-chats.d.cts +9 -0
  64. package/highlevel/methods/chats/get-similar-channels.d.cts +12 -0
  65. package/highlevel/methods/chats/get-user.d.cts +8 -0
  66. package/highlevel/methods/chats/iter-chat-event-log.d.cts +26 -0
  67. package/highlevel/methods/chats/iter-chat-members.d.cts +22 -0
  68. package/highlevel/methods/chats/join-chat.d.cts +14 -0
  69. package/highlevel/methods/chats/kick-chat-member.d.cts +15 -0
  70. package/highlevel/methods/chats/leave-chat.d.cts +13 -0
  71. package/highlevel/methods/chats/mark-chat-unread.d.cts +8 -0
  72. package/highlevel/methods/chats/open-chat.d.cts +26 -0
  73. package/highlevel/methods/chats/reorder-usernames.d.cts +8 -0
  74. package/highlevel/methods/chats/restrict-chat-member.d.cts +28 -0
  75. package/highlevel/methods/chats/save-draft.d.cts +10 -0
  76. package/highlevel/methods/chats/set-chat-color.d.cts +38 -0
  77. package/highlevel/methods/chats/set-chat-default-permissions.d.cts +16 -0
  78. package/highlevel/methods/chats/set-chat-description.d.cts +11 -0
  79. package/highlevel/methods/chats/set-chat-photo.d.cts +20 -0
  80. package/highlevel/methods/chats/set-chat-title.d.cts +11 -0
  81. package/highlevel/methods/chats/set-chat-ttl.d.cts +9 -0
  82. package/highlevel/methods/chats/set-chat-username.d.cts +11 -0
  83. package/highlevel/methods/chats/set-slow-mode.d.cts +12 -0
  84. package/highlevel/methods/chats/toggle-content-protection.d.cts +9 -0
  85. package/highlevel/methods/chats/toggle-fragment-username.d.cts +20 -0
  86. package/highlevel/methods/chats/toggle-join-requests.d.cts +12 -0
  87. package/highlevel/methods/chats/toggle-join-to-send.d.cts +12 -0
  88. package/highlevel/methods/chats/unarchive-chats.d.cts +9 -0
  89. package/highlevel/methods/chats/unban-chat-member.d.cts +16 -0
  90. package/highlevel/methods/contacts/add-contact.d.cts +28 -0
  91. package/highlevel/methods/contacts/delete-contacts.d.cts +12 -0
  92. package/highlevel/methods/contacts/get-contacts.d.cts +6 -0
  93. package/highlevel/methods/contacts/import-contacts.d.cts +9 -0
  94. package/highlevel/methods/dialogs/create-folder.d.cts +13 -0
  95. package/highlevel/methods/dialogs/delete-folder.d.cts +8 -0
  96. package/highlevel/methods/dialogs/edit-folder.d.cts +18 -0
  97. package/highlevel/methods/dialogs/find-dialogs.d.cts +12 -0
  98. package/highlevel/methods/dialogs/find-folder.d.cts +19 -0
  99. package/highlevel/methods/dialogs/get-chatlist-preview.d.cts +8 -0
  100. package/highlevel/methods/dialogs/get-folders.d.cts +9 -0
  101. package/highlevel/methods/dialogs/get-peer-dialogs.d.cts +10 -0
  102. package/highlevel/methods/dialogs/iter-dialogs.d.cts +103 -0
  103. package/highlevel/methods/dialogs/join-chatlist.d.cts +15 -0
  104. package/highlevel/methods/dialogs/set-folders-order.d.cts +7 -0
  105. package/highlevel/methods/files/download-buffer.d.cts +11 -0
  106. package/highlevel/methods/files/download-file.d.cts +1 -0
  107. package/highlevel/methods/files/download-iterable.cjs +9 -7
  108. package/highlevel/methods/files/download-iterable.d.cts +10 -0
  109. package/highlevel/methods/files/download-iterable.js +9 -7
  110. package/highlevel/methods/files/download-node-stream.d.cts +1 -0
  111. package/highlevel/methods/files/download-stream.d.cts +9 -0
  112. package/highlevel/methods/files/normalize-file-to-document.d.cts +9 -0
  113. package/highlevel/methods/files/normalize-input-file.d.cts +13 -0
  114. package/highlevel/methods/files/normalize-input-media.d.cts +12 -0
  115. package/highlevel/methods/files/upload-file.d.cts +72 -0
  116. package/highlevel/methods/files/upload-media.d.cts +28 -0
  117. package/highlevel/methods/forums/create-forum-topic.d.cts +36 -0
  118. package/highlevel/methods/forums/delete-forum-topic-history.d.cts +15 -0
  119. package/highlevel/methods/forums/edit-forum-topic.d.cts +34 -0
  120. package/highlevel/methods/forums/get-forum-topics-by-id.d.cts +9 -0
  121. package/highlevel/methods/forums/get-forum-topics.d.cts +28 -0
  122. package/highlevel/methods/forums/iter-forum-topics.d.cts +20 -0
  123. package/highlevel/methods/forums/reorder-pinned-forum-topics.d.cts +19 -0
  124. package/highlevel/methods/forums/toggle-forum-topic-closed.d.cts +22 -0
  125. package/highlevel/methods/forums/toggle-forum-topic-pinned.d.cts +15 -0
  126. package/highlevel/methods/forums/toggle-forum.d.cts +11 -0
  127. package/highlevel/methods/forums/toggle-general-topic-hidden.d.cts +20 -0
  128. package/highlevel/methods/invite-links/create-invite-link.d.cts +38 -0
  129. package/highlevel/methods/invite-links/edit-invite-link.d.cts +36 -0
  130. package/highlevel/methods/invite-links/export-invite-link.d.cts +12 -0
  131. package/highlevel/methods/invite-links/get-invite-link-members.d.cts +45 -0
  132. package/highlevel/methods/invite-links/get-invite-link.d.cts +9 -0
  133. package/highlevel/methods/invite-links/get-invite-links.d.cts +39 -0
  134. package/highlevel/methods/invite-links/get-primary-invite-link.d.cts +8 -0
  135. package/highlevel/methods/invite-links/hide-all-join-requests.d.cts +13 -0
  136. package/highlevel/methods/invite-links/hide-join-request.d.cts +13 -0
  137. package/highlevel/methods/invite-links/iter-invite-link-members.d.cts +25 -0
  138. package/highlevel/methods/invite-links/iter-invite-links.d.cts +27 -0
  139. package/highlevel/methods/invite-links/revoke-invite-link.d.cts +13 -0
  140. package/highlevel/methods/messages/_business-connection.d.cts +8 -0
  141. package/highlevel/methods/messages/close-poll.d.cts +15 -0
  142. package/highlevel/methods/messages/delete-messages.d.cts +29 -0
  143. package/highlevel/methods/messages/delete-scheduled-messages.d.cts +9 -0
  144. package/highlevel/methods/messages/edit-inline-message.d.cts +51 -0
  145. package/highlevel/methods/messages/edit-message.d.cts +55 -0
  146. package/highlevel/methods/messages/find-in-update.d.cts +13 -0
  147. package/highlevel/methods/messages/forward-messages.d.cts +84 -0
  148. package/highlevel/methods/messages/get-all-scheduled-messages.d.cts +8 -0
  149. package/highlevel/methods/messages/get-available-effects.d.cts +6 -0
  150. package/highlevel/methods/messages/get-callback-query-message.d.cts +14 -0
  151. package/highlevel/methods/messages/get-discussion-message.d.cts +21 -0
  152. package/highlevel/methods/messages/get-fact-check.d.cts +11 -0
  153. package/highlevel/methods/messages/get-history.d.cts +59 -0
  154. package/highlevel/methods/messages/get-message-by-link.d.cts +6 -0
  155. package/highlevel/methods/messages/get-message-group.d.cts +9 -0
  156. package/highlevel/methods/messages/get-message-reactions.d.cts +28 -0
  157. package/highlevel/methods/messages/get-messages-unsafe.d.cts +19 -0
  158. package/highlevel/methods/messages/get-messages.d.cts +17 -0
  159. package/highlevel/methods/messages/get-reaction-users.d.cts +24 -0
  160. package/highlevel/methods/messages/get-reply-to.d.cts +10 -0
  161. package/highlevel/methods/messages/get-scheduled-messages.d.cts +13 -0
  162. package/highlevel/methods/messages/iter-history.d.cts +23 -0
  163. package/highlevel/methods/messages/iter-reaction-users.d.cts +26 -0
  164. package/highlevel/methods/messages/iter-search-global.d.cts +27 -0
  165. package/highlevel/methods/messages/iter-search-messages.d.cts +26 -0
  166. package/highlevel/methods/messages/pin-message.d.cts +21 -0
  167. package/highlevel/methods/messages/read-history.d.cts +24 -0
  168. package/highlevel/methods/messages/read-reactions.d.cts +14 -0
  169. package/highlevel/methods/messages/search-global.d.cts +51 -0
  170. package/highlevel/methods/messages/search-hashtag.d.cts +44 -0
  171. package/highlevel/methods/messages/search-messages.d.cts +93 -0
  172. package/highlevel/methods/messages/send-answer.d.cts +12 -0
  173. package/highlevel/methods/messages/send-comment.d.cts +39 -0
  174. package/highlevel/methods/messages/send-common.d.cts +122 -0
  175. package/highlevel/methods/messages/send-copy-group.d.cts +21 -0
  176. package/highlevel/methods/messages/send-copy.d.cts +32 -0
  177. package/highlevel/methods/messages/send-media-group.d.cts +35 -0
  178. package/highlevel/methods/messages/send-media.d.cts +48 -0
  179. package/highlevel/methods/messages/send-paid-reaction.d.cts +24 -0
  180. package/highlevel/methods/messages/send-quote.d.cts +33 -0
  181. package/highlevel/methods/messages/send-reaction.d.cts +21 -0
  182. package/highlevel/methods/messages/send-reply.d.cts +12 -0
  183. package/highlevel/methods/messages/send-scheduled.d.cts +14 -0
  184. package/highlevel/methods/messages/send-text.d.cts +31 -0
  185. package/highlevel/methods/messages/send-text.test.d.cts +1 -0
  186. package/highlevel/methods/messages/send-typing.d.cts +32 -0
  187. package/highlevel/methods/messages/send-vote.d.cts +15 -0
  188. package/highlevel/methods/messages/set-typing.d.cts +33 -0
  189. package/highlevel/methods/messages/translate-message.d.cts +11 -0
  190. package/highlevel/methods/messages/translate-text.d.cts +9 -0
  191. package/highlevel/methods/messages/unpin-all-messages.d.cts +18 -0
  192. package/highlevel/methods/messages/unpin-message.d.cts +12 -0
  193. package/highlevel/methods/misc/chain-id.d.cts +4 -0
  194. package/highlevel/methods/misc/get-collectible-info.d.cts +6 -0
  195. package/highlevel/methods/misc/init-takeout-session.d.cts +9 -0
  196. package/highlevel/methods/misc/normalize-privacy-rules.d.cts +8 -0
  197. package/highlevel/methods/misc/normalize-text.d.cts +5 -0
  198. package/highlevel/methods/misc/with-params.d.cts +10 -0
  199. package/highlevel/methods/password/change-cloud-password.d.cts +12 -0
  200. package/highlevel/methods/password/enable-cloud-password.d.cts +17 -0
  201. package/highlevel/methods/password/password-email.d.cts +15 -0
  202. package/highlevel/methods/password/remove-cloud-password.d.cts +7 -0
  203. package/highlevel/methods/premium/accept-star-gift.d.cts +16 -0
  204. package/highlevel/methods/premium/apply-boost.d.cts +8 -0
  205. package/highlevel/methods/premium/can-apply-boost.d.cts +29 -0
  206. package/highlevel/methods/premium/create-business-chat-link.d.cts +12 -0
  207. package/highlevel/methods/premium/edit-business-chat-link.d.cts +20 -0
  208. package/highlevel/methods/premium/get-boost-stats.d.cts +9 -0
  209. package/highlevel/methods/premium/get-boosts.d.cts +18 -0
  210. package/highlevel/methods/premium/get-business-chat-links.d.cts +6 -0
  211. package/highlevel/methods/premium/get-business-connection.d.cts +8 -0
  212. package/highlevel/methods/premium/get-my-boost-slots.d.cts +9 -0
  213. package/highlevel/methods/premium/get-star-gift-options.d.cts +6 -0
  214. package/highlevel/methods/premium/get-star-gifts.d.cts +22 -0
  215. package/highlevel/methods/premium/get-stars-transactions.d.cts +34 -0
  216. package/highlevel/methods/premium/iter-boosters.d.cts +24 -0
  217. package/highlevel/methods/premium/iter-star-gifts.d.cts +26 -0
  218. package/highlevel/methods/premium/iter-stars-transactions.d.cts +29 -0
  219. package/highlevel/methods/premium/send-star-gift.d.cts +35 -0
  220. package/highlevel/methods/premium/set-business-intro.d.cts +22 -0
  221. package/highlevel/methods/premium/set-business-work-hours.d.cts +18 -0
  222. package/highlevel/methods/stickers/_utils.d.cts +10 -0
  223. package/highlevel/methods/stickers/add-sticker-to-set.d.cts +21 -0
  224. package/highlevel/methods/stickers/create-sticker-set.d.cts +66 -0
  225. package/highlevel/methods/stickers/delete-sticker-from-set.d.cts +15 -0
  226. package/highlevel/methods/stickers/get-custom-emojis.d.cts +14 -0
  227. package/highlevel/methods/stickers/get-installed-stickers.d.cts +10 -0
  228. package/highlevel/methods/stickers/get-my-sticker-sets.d.cts +13 -0
  229. package/highlevel/methods/stickers/get-sticker-set.d.cts +8 -0
  230. package/highlevel/methods/stickers/move-sticker-in-set.d.cts +17 -0
  231. package/highlevel/methods/stickers/replace-sticker-in-set.d.cts +24 -0
  232. package/highlevel/methods/stickers/set-chat-sticker-set.d.cts +11 -0
  233. package/highlevel/methods/stickers/set-sticker-set-thumb.d.cts +20 -0
  234. package/highlevel/methods/stories/can-send-story.d.cts +13 -0
  235. package/highlevel/methods/stories/delete-stories.d.cts +20 -0
  236. package/highlevel/methods/stories/edit-story.d.cts +38 -0
  237. package/highlevel/methods/stories/find-in-update.d.cts +5 -0
  238. package/highlevel/methods/stories/get-all-stories.d.cts +15 -0
  239. package/highlevel/methods/stories/get-peer-stories.d.cts +8 -0
  240. package/highlevel/methods/stories/get-profile-stories.d.cts +25 -0
  241. package/highlevel/methods/stories/get-stories-by-id.d.cts +10 -0
  242. package/highlevel/methods/stories/get-stories-interactions.d.cts +9 -0
  243. package/highlevel/methods/stories/get-story-link.d.cts +11 -0
  244. package/highlevel/methods/stories/get-story-viewers.d.cts +33 -0
  245. package/highlevel/methods/stories/hide-my-stories-views.d.cts +21 -0
  246. package/highlevel/methods/stories/increment-stories-views.d.cts +13 -0
  247. package/highlevel/methods/stories/iter-all-stories.d.cts +16 -0
  248. package/highlevel/methods/stories/iter-profile-stories.d.cts +21 -0
  249. package/highlevel/methods/stories/iter-story-viewers.d.cts +22 -0
  250. package/highlevel/methods/stories/read-stories.d.cts +11 -0
  251. package/highlevel/methods/stories/send-story-reaction.d.cts +14 -0
  252. package/highlevel/methods/stories/send-story.d.cts +51 -0
  253. package/highlevel/methods/stories/toggle-peer-stories-archived.d.cts +8 -0
  254. package/highlevel/methods/stories/toggle-stories-pinned.d.cts +24 -0
  255. package/highlevel/methods/users/block-user.d.cts +8 -0
  256. package/highlevel/methods/users/delete-profile-photos.d.cts +9 -0
  257. package/highlevel/methods/users/edit-close-friends.d.cts +14 -0
  258. package/highlevel/methods/users/get-common-chats.d.cts +9 -0
  259. package/highlevel/methods/users/get-global-ttl.d.cts +5 -0
  260. package/highlevel/methods/users/get-me.d.cts +6 -0
  261. package/highlevel/methods/users/get-my-username.d.cts +8 -0
  262. package/highlevel/methods/users/get-profile-photo.d.cts +11 -0
  263. package/highlevel/methods/users/get-profile-photos.d.cts +22 -0
  264. package/highlevel/methods/users/get-users.d.cts +12 -0
  265. package/highlevel/methods/users/get-users.test.d.cts +1 -0
  266. package/highlevel/methods/users/is-peer-available.d.cts +20 -0
  267. package/highlevel/methods/users/iter-profile-photos.d.cts +23 -0
  268. package/highlevel/methods/users/resolve-peer-many.d.cts +26 -0
  269. package/highlevel/methods/users/resolve-peer.d.cts +20 -0
  270. package/highlevel/methods/users/resolve-peer.test.d.cts +1 -0
  271. package/highlevel/methods/users/set-emoji-status.d.cts +32 -0
  272. package/highlevel/methods/users/set-global-ttl.d.cts +8 -0
  273. package/highlevel/methods/users/set-my-birthday.d.cts +12 -0
  274. package/highlevel/methods/users/set-my-profile-photo.d.cts +16 -0
  275. package/highlevel/methods/users/set-my-username.d.cts +11 -0
  276. package/highlevel/methods/users/set-online.d.cts +19 -0
  277. package/highlevel/methods/users/unblock-user.d.cts +8 -0
  278. package/highlevel/methods/users/update-profile.d.cts +23 -0
  279. package/highlevel/methods.d.cts +291 -0
  280. package/highlevel/storage/index.d.cts +4 -0
  281. package/highlevel/storage/provider.d.cts +7 -0
  282. package/highlevel/storage/repository/peers.d.cts +44 -0
  283. package/highlevel/storage/repository/ref-messages.d.cts +20 -0
  284. package/highlevel/storage/service/current-user.d.cts +23 -0
  285. package/highlevel/storage/service/peers.d.cts +23 -0
  286. package/highlevel/storage/service/ref-messages.d.cts +15 -0
  287. package/highlevel/storage/service/updates.d.cts +16 -0
  288. package/highlevel/storage/storage.d.cts +27 -0
  289. package/highlevel/types/auth/index.d.cts +1 -0
  290. package/highlevel/types/auth/sent-code.d.cts +56 -0
  291. package/highlevel/types/bots/command-scope/index.d.cts +10 -0
  292. package/highlevel/types/bots/command-scope/inner.d.cts +54 -0
  293. package/highlevel/types/bots/game-high-score.d.cts +23 -0
  294. package/highlevel/types/bots/index.d.cts +6 -0
  295. package/highlevel/types/bots/inline-message/factories.d.cts +47 -0
  296. package/highlevel/types/bots/inline-message/index.d.cts +3 -0
  297. package/highlevel/types/bots/inline-message/types.d.cts +114 -0
  298. package/highlevel/types/bots/inline-result/factories.d.cts +97 -0
  299. package/highlevel/types/bots/inline-result/index.d.cts +3 -0
  300. package/highlevel/types/bots/inline-result/types.d.cts +417 -0
  301. package/highlevel/types/bots/keyboards/builder.d.cts +38 -0
  302. package/highlevel/types/bots/keyboards/builder.test.d.cts +1 -0
  303. package/highlevel/types/bots/keyboards/factories.d.cts +208 -0
  304. package/highlevel/types/bots/keyboards/index.d.cts +15 -0
  305. package/highlevel/types/bots/keyboards/keyboards.test.d.cts +1 -0
  306. package/highlevel/types/bots/keyboards/types.d.cts +34 -0
  307. package/highlevel/types/bots/webview.d.cts +114 -0
  308. package/highlevel/types/calls/discard-reason.d.cts +13 -0
  309. package/highlevel/types/calls/index.d.cts +1 -0
  310. package/highlevel/types/conversation.d.cts +210 -0
  311. package/highlevel/types/errors.d.cts +33 -0
  312. package/highlevel/types/files/file-location.d.cts +48 -0
  313. package/highlevel/types/files/index.d.cts +4 -0
  314. package/highlevel/types/files/uploaded-file.d.cts +24 -0
  315. package/highlevel/types/files/utils.d.cts +89 -0
  316. package/highlevel/types/files/web-document.d.cts +32 -0
  317. package/highlevel/types/index.d.cts +15 -0
  318. package/highlevel/types/media/audio.d.cts +31 -0
  319. package/highlevel/types/media/contact.d.cts +31 -0
  320. package/highlevel/types/media/dice.d.cts +155 -0
  321. package/highlevel/types/media/document-utils.d.cts +11 -0
  322. package/highlevel/types/media/document.d.cts +75 -0
  323. package/highlevel/types/media/extended-media.d.cts +20 -0
  324. package/highlevel/types/media/game.d.cts +38 -0
  325. package/highlevel/types/media/index.d.cts +19 -0
  326. package/highlevel/types/media/input-media/factories.d.cts +142 -0
  327. package/highlevel/types/media/input-media/index.d.cts +3 -0
  328. package/highlevel/types/media/input-media/types.d.cts +520 -0
  329. package/highlevel/types/media/invoice.d.cts +89 -0
  330. package/highlevel/types/media/location.d.cts +83 -0
  331. package/highlevel/types/media/paid-media.d.cts +33 -0
  332. package/highlevel/types/media/photo.d.cts +72 -0
  333. package/highlevel/types/media/poll.d.cts +110 -0
  334. package/highlevel/types/media/sticker.d.cts +123 -0
  335. package/highlevel/types/media/story.d.cts +33 -0
  336. package/highlevel/types/media/thumbnail.d.cts +70 -0
  337. package/highlevel/types/media/venue.d.cts +58 -0
  338. package/highlevel/types/media/video.d.cts +48 -0
  339. package/highlevel/types/media/voice.d.cts +23 -0
  340. package/highlevel/types/media/web-page.d.cts +151 -0
  341. package/highlevel/types/messages/dialog.d.cts +110 -0
  342. package/highlevel/types/messages/draft-message.d.cts +29 -0
  343. package/highlevel/types/messages/fact-check.d.cts +30 -0
  344. package/highlevel/types/messages/index.d.cts +14 -0
  345. package/highlevel/types/messages/input-message-id.d.cts +20 -0
  346. package/highlevel/types/messages/message-action.d.cts +420 -0
  347. package/highlevel/types/messages/message-effect.d.cts +20 -0
  348. package/highlevel/types/messages/message-entity.d.cts +89 -0
  349. package/highlevel/types/messages/message-forward.d.cts +39 -0
  350. package/highlevel/types/messages/message-media.d.cts +23 -0
  351. package/highlevel/types/messages/message-reactions.d.cts +31 -0
  352. package/highlevel/types/messages/message-replies.d.cts +42 -0
  353. package/highlevel/types/messages/message.d.cts +249 -0
  354. package/highlevel/types/messages/replied-message.d.cts +103 -0
  355. package/highlevel/types/messages/search-filters.d.cts +82 -0
  356. package/highlevel/types/misc/app-config.d.cts +887 -0
  357. package/highlevel/types/misc/collectible-info.d.cts +27 -0
  358. package/highlevel/types/misc/entities.d.cts +22 -0
  359. package/highlevel/types/misc/index.d.cts +6 -0
  360. package/highlevel/types/misc/input-privacy-rule/allow.d.cts +22 -0
  361. package/highlevel/types/misc/input-privacy-rule/bundle.d.cts +3 -0
  362. package/highlevel/types/misc/input-privacy-rule/disallow.d.cts +20 -0
  363. package/highlevel/types/misc/input-privacy-rule/index.d.cts +3 -0
  364. package/highlevel/types/misc/input-privacy-rule/types.d.cts +11 -0
  365. package/highlevel/types/misc/sticker-set.d.cts +154 -0
  366. package/highlevel/types/misc/takeout-session.d.cts +49 -0
  367. package/highlevel/types/peers/bot-info.d.cts +21 -0
  368. package/highlevel/types/peers/chat-colors.d.cts +25 -0
  369. package/highlevel/types/peers/chat-event/actions.d.cts +279 -0
  370. package/highlevel/types/peers/chat-event/filters.d.cts +10 -0
  371. package/highlevel/types/peers/chat-event/index.d.cts +27 -0
  372. package/highlevel/types/peers/chat-invite-link-member.d.cts +33 -0
  373. package/highlevel/types/peers/chat-invite-link.d.cts +72 -0
  374. package/highlevel/types/peers/chat-location.d.cts +17 -0
  375. package/highlevel/types/peers/chat-member.d.cts +86 -0
  376. package/highlevel/types/peers/chat-permissions.d.cts +127 -0
  377. package/highlevel/types/peers/chat-photo.d.cts +39 -0
  378. package/highlevel/types/peers/chat-preview.d.cts +55 -0
  379. package/highlevel/types/peers/chat.d.cts +250 -0
  380. package/highlevel/types/peers/chatlist-preview.d.cts +21 -0
  381. package/highlevel/types/peers/forum-topic.d.cts +96 -0
  382. package/highlevel/types/peers/full-chat.cjs +1 -1
  383. package/highlevel/types/peers/full-chat.d.cts +161 -0
  384. package/highlevel/types/peers/full-chat.js +1 -1
  385. package/highlevel/types/peers/full-user.d.cts +115 -0
  386. package/highlevel/types/peers/index.d.cts +19 -0
  387. package/highlevel/types/peers/index.d.ts +1 -0
  388. package/highlevel/types/peers/peer.d.cts +49 -0
  389. package/highlevel/types/peers/peers-index.d.cts +15 -0
  390. package/highlevel/types/peers/peers-index.test.d.cts +1 -0
  391. package/highlevel/types/peers/typing-status.d.cts +26 -0
  392. package/highlevel/types/peers/user.d.cts +268 -0
  393. package/highlevel/types/peers/user.test.d.cts +1 -0
  394. package/highlevel/types/premium/boost-slot.d.cts +37 -0
  395. package/highlevel/types/premium/boost-stats.d.cts +54 -0
  396. package/highlevel/types/premium/boost.d.cts +56 -0
  397. package/highlevel/types/premium/boost.d.ts +1 -2
  398. package/highlevel/types/premium/business-account.d.cts +19 -0
  399. package/highlevel/types/premium/business-chat-link.d.cts +19 -0
  400. package/highlevel/types/premium/business-connection.d.cts +23 -0
  401. package/highlevel/types/premium/business-intro.d.cts +22 -0
  402. package/highlevel/types/premium/business-location.d.cts +10 -0
  403. package/highlevel/types/premium/business-work-hours.d.cts +42 -0
  404. package/highlevel/types/premium/business-work-hours.test.d.cts +1 -0
  405. package/highlevel/types/premium/index.d.cts +12 -0
  406. package/highlevel/types/premium/index.d.ts +1 -0
  407. package/highlevel/types/premium/stars-gift.d.cts +68 -0
  408. package/highlevel/types/premium/stars-status.d.cts +16 -0
  409. package/highlevel/types/premium/stars-status.d.ts +1 -1
  410. package/highlevel/types/premium/stars-transaction.cjs +7 -3
  411. package/highlevel/types/premium/stars-transaction.d.cts +134 -0
  412. package/highlevel/types/premium/stars-transaction.d.ts +1 -1
  413. package/highlevel/types/premium/stars-transaction.js +7 -3
  414. package/highlevel/types/reactions/emoji-status.d.cts +12 -0
  415. package/highlevel/types/reactions/index.d.cts +4 -0
  416. package/highlevel/types/reactions/index.d.ts +2 -0
  417. package/highlevel/types/reactions/peer-reaction.d.cts +53 -0
  418. package/highlevel/types/reactions/reaction-count.d.cts +25 -0
  419. package/highlevel/types/reactions/types.d.cts +16 -0
  420. package/highlevel/types/stories/all-stories.d.cts +28 -0
  421. package/highlevel/types/stories/index.d.cts +7 -0
  422. package/highlevel/types/stories/interactive/base.d.cts +16 -0
  423. package/highlevel/types/stories/interactive/channel-post.d.cts +17 -0
  424. package/highlevel/types/stories/interactive/index.d.cts +12 -0
  425. package/highlevel/types/stories/interactive/input.d.cts +68 -0
  426. package/highlevel/types/stories/interactive/location.d.cts +15 -0
  427. package/highlevel/types/stories/interactive/reaction.d.cts +21 -0
  428. package/highlevel/types/stories/interactive/url.d.cts +11 -0
  429. package/highlevel/types/stories/interactive/venue.d.cts +28 -0
  430. package/highlevel/types/stories/interactive/weather.d.cts +15 -0
  431. package/highlevel/types/stories/peer-stories.d.cts +20 -0
  432. package/highlevel/types/stories/stealth-mode.d.cts +9 -0
  433. package/highlevel/types/stories/story-interactions.d.cts +34 -0
  434. package/highlevel/types/stories/story-viewer.d.cts +75 -0
  435. package/highlevel/types/stories/story.d.cts +79 -0
  436. package/highlevel/types/updates/bot-chat-join-request.d.cts +42 -0
  437. package/highlevel/types/updates/bot-reaction.d.cts +71 -0
  438. package/highlevel/types/updates/bot-stopped.d.cts +28 -0
  439. package/highlevel/types/updates/business-message.d.cts +18 -0
  440. package/highlevel/types/updates/callback-query.d.cts +95 -0
  441. package/highlevel/types/updates/chat-join-request.d.cts +30 -0
  442. package/highlevel/types/updates/chat-member-update.cjs +1 -0
  443. package/highlevel/types/updates/chat-member-update.d.cts +76 -0
  444. package/highlevel/types/updates/chat-member-update.js +1 -0
  445. package/highlevel/types/updates/chosen-inline-result.d.cts +50 -0
  446. package/highlevel/types/updates/delete-business-message-update.d.cts +21 -0
  447. package/highlevel/types/updates/delete-message-update.d.cts +16 -0
  448. package/highlevel/types/updates/delete-story-update.d.cts +18 -0
  449. package/highlevel/types/updates/history-read-update.d.cts +39 -0
  450. package/highlevel/types/updates/index.d.cts +107 -0
  451. package/highlevel/types/updates/inline-query.d.cts +42 -0
  452. package/highlevel/types/updates/parse-update.d.cts +4 -0
  453. package/highlevel/types/updates/poll-update.d.cts +39 -0
  454. package/highlevel/types/updates/poll-vote.d.cts +52 -0
  455. package/highlevel/types/updates/pre-checkout-query.d.cts +36 -0
  456. package/highlevel/types/updates/story-update.d.cts +22 -0
  457. package/highlevel/types/updates/user-status-update.d.cts +28 -0
  458. package/highlevel/types/updates/user-typing-update.d.cts +31 -0
  459. package/highlevel/types/utils.d.cts +12 -0
  460. package/highlevel/updates/index.d.cts +2 -0
  461. package/highlevel/updates/manager.d.cts +121 -0
  462. package/highlevel/updates/parsed.d.cts +26 -0
  463. package/highlevel/updates/types.d.cts +147 -0
  464. package/highlevel/updates/utils.d.cts +21 -0
  465. package/highlevel/utils/convert-file-id.d.cts +46 -0
  466. package/highlevel/utils/entities.d.cts +19 -0
  467. package/highlevel/utils/entities.test.d.cts +1 -0
  468. package/highlevel/utils/file-type.d.cts +2 -0
  469. package/highlevel/utils/file-type.test.d.cts +1 -0
  470. package/highlevel/utils/file-utils.d.cts +31 -0
  471. package/highlevel/utils/file-utils.test.d.cts +1 -0
  472. package/highlevel/utils/index.d.cts +11 -0
  473. package/highlevel/utils/inline-utils.d.cts +14 -0
  474. package/highlevel/utils/inline-utils.test.d.cts +1 -0
  475. package/highlevel/utils/inspectable.d.cts +9 -0
  476. package/highlevel/utils/inspectable.test.d.cts +1 -0
  477. package/highlevel/utils/memoize.d.cts +1 -0
  478. package/highlevel/utils/memoize.test.d.cts +1 -0
  479. package/highlevel/utils/misc-utils.d.cts +12 -0
  480. package/highlevel/utils/peer-utils.d.cts +11 -0
  481. package/highlevel/utils/peer-utils.test.d.cts +1 -0
  482. package/highlevel/utils/query-batcher.d.cts +49 -0
  483. package/highlevel/utils/query-batcher.test.d.cts +1 -0
  484. package/highlevel/utils/rps-meter.d.cts +9 -0
  485. package/highlevel/utils/stream-utils.d.cts +1 -0
  486. package/highlevel/utils/string-session.d.cts +16 -0
  487. package/highlevel/utils/string-session.test.d.cts +1 -0
  488. package/highlevel/utils/voice-utils.d.cts +14 -0
  489. package/highlevel/utils/voice-utils.test.d.cts +1 -0
  490. package/highlevel/worker/app-config.d.cts +9 -0
  491. package/highlevel/worker/errors.d.cts +8 -0
  492. package/highlevel/worker/index.d.cts +3 -0
  493. package/highlevel/worker/invoker.d.cts +18 -0
  494. package/highlevel/worker/port.d.cts +60 -0
  495. package/highlevel/worker/protocol.d.cts +57 -0
  496. package/highlevel/worker/storage.d.cts +39 -0
  497. package/highlevel/worker/worker.d.cts +15 -0
  498. package/index.cjs +8 -0
  499. package/index.d.cts +10 -0
  500. package/index.js +8 -0
  501. package/methods.d.cts +1 -0
  502. package/network/auth-key.d.cts +21 -0
  503. package/network/auth-key.test.d.cts +1 -0
  504. package/network/authorization.d.cts +9 -0
  505. package/network/client.d.cts +218 -0
  506. package/network/config-manager.d.cts +19 -0
  507. package/network/config-manager.test.d.cts +1 -0
  508. package/network/index.d.cts +6 -0
  509. package/network/middlewares/bundle.d.cts +3 -0
  510. package/network/middlewares/default.d.cts +8 -0
  511. package/network/middlewares/flood-waiter.d.cts +37 -0
  512. package/network/middlewares/index.d.cts +4 -0
  513. package/network/middlewares/index.d.ts +2 -0
  514. package/network/middlewares/internal-errors.d.cts +17 -0
  515. package/network/middlewares/on-error.d.cts +30 -0
  516. package/network/middlewares/on-method.d.cts +39 -0
  517. package/network/mtproto-session.d.cts +127 -0
  518. package/network/mtproxy/_fake-tls.d.cts +22 -0
  519. package/network/mtproxy/index.d.cts +42 -0
  520. package/network/multi-session-connection.cjs +25 -43
  521. package/network/multi-session-connection.d.cts +43 -0
  522. package/network/multi-session-connection.d.ts +5 -5
  523. package/network/multi-session-connection.js +25 -43
  524. package/network/network-manager.cjs +7 -20
  525. package/network/network-manager.d.cts +256 -0
  526. package/network/network-manager.js +7 -20
  527. package/network/persistent-connection.cjs +8 -0
  528. package/network/persistent-connection.d.cts +55 -0
  529. package/network/persistent-connection.d.ts +3 -1
  530. package/network/persistent-connection.js +8 -0
  531. package/network/server-salt.d.cts +12 -0
  532. package/network/session-connection.cjs +35 -18
  533. package/network/session-connection.d.cts +94 -0
  534. package/network/session-connection.d.ts +5 -3
  535. package/network/session-connection.js +35 -18
  536. package/network/transports/abstract.d.cts +47 -0
  537. package/network/transports/index.d.cts +3 -0
  538. package/network/transports/intermediate.d.cts +23 -0
  539. package/network/transports/intermediate.test.d.cts +1 -0
  540. package/network/transports/obfuscated.d.cts +23 -0
  541. package/network/transports/obfuscated.test.d.cts +1 -0
  542. package/package.json +13 -13
  543. package/storage/driver.d.cts +58 -0
  544. package/storage/index.d.cts +6 -0
  545. package/storage/memory/driver.d.cts +6 -0
  546. package/storage/memory/index.d.cts +22 -0
  547. package/storage/memory/memory.test.d.cts +1 -0
  548. package/storage/memory/repository/auth-keys.d.cts +19 -0
  549. package/storage/memory/repository/kv.d.cts +11 -0
  550. package/storage/memory/repository/peers.d.cts +18 -0
  551. package/storage/memory/repository/ref-messages.d.cts +16 -0
  552. package/storage/provider.d.cts +10 -0
  553. package/storage/repository/auth-keys.d.cts +41 -0
  554. package/storage/repository/index.d.cts +2 -0
  555. package/storage/repository/key-value.d.cts +10 -0
  556. package/storage/service/auth-keys.d.cts +9 -0
  557. package/storage/service/auth-keys.test.d.cts +1 -0
  558. package/storage/service/base.d.cts +19 -0
  559. package/storage/service/default-dcs.d.cts +10 -0
  560. package/storage/service/future-salts.d.cts +11 -0
  561. package/storage/service/updates.test.d.cts +1 -0
  562. package/storage/service/utils.test-utils.d.cts +2 -0
  563. package/storage/sqlite/driver.d.cts +24 -0
  564. package/storage/sqlite/index.d.cts +17 -0
  565. package/storage/sqlite/repository/auth-keys.d.cts +20 -0
  566. package/storage/sqlite/repository/kv.d.cts +14 -0
  567. package/storage/sqlite/repository/peers.d.cts +19 -0
  568. package/storage/sqlite/repository/ref-messages.d.cts +16 -0
  569. package/storage/sqlite/types.d.cts +18 -0
  570. package/storage/storage.d.cts +55 -0
  571. package/types/errors.d.cts +53 -0
  572. package/types/index.d.cts +4 -0
  573. package/types/peers.d.cts +4 -0
  574. package/types/platform.d.cts +15 -0
  575. package/types/utils.d.cts +9 -0
  576. package/utils/abort-signal.d.cts +1 -0
  577. package/utils/bigint-utils.d.cts +18 -0
  578. package/utils/bigint-utils.test.d.cts +1 -0
  579. package/utils/binary/asn1-parser.d.cts +17 -0
  580. package/utils/crypto/abstract.d.cts +29 -0
  581. package/utils/crypto/factorization.d.cts +6 -0
  582. package/utils/crypto/factorization.test.d.cts +1 -0
  583. package/utils/crypto/index.d.cts +6 -0
  584. package/utils/crypto/keys.d.cts +27 -0
  585. package/utils/crypto/keys.test.d.cts +1 -0
  586. package/utils/crypto/miller-rabin.d.cts +2 -0
  587. package/utils/crypto/miller-rabin.test.d.cts +1 -0
  588. package/utils/crypto/mtproto.d.cts +31 -0
  589. package/utils/crypto/mtproto.test.d.cts +1 -0
  590. package/utils/crypto/password.d.cts +29 -0
  591. package/utils/crypto/password.test.d.cts +1 -0
  592. package/utils/dcs.d.cts +18 -0
  593. package/utils/early-timer.d.cts +41 -0
  594. package/utils/error-reporting.d.cts +3 -0
  595. package/utils/function-utils.d.cts +22 -0
  596. package/utils/function-utils.test.d.cts +1 -0
  597. package/utils/index.d.cts +20 -0
  598. package/utils/linked-list.d.cts +21 -0
  599. package/utils/linked-list.test.d.cts +1 -0
  600. package/utils/links/bots.d.cts +72 -0
  601. package/utils/links/bots.test.d.cts +1 -0
  602. package/utils/links/bundle.d.cts +7 -0
  603. package/utils/links/calls.d.cts +17 -0
  604. package/utils/links/chat.d.cts +47 -0
  605. package/utils/links/chat.test.d.cts +1 -0
  606. package/utils/links/common.d.cts +31 -0
  607. package/utils/links/index.d.cts +2 -0
  608. package/utils/links/misc.d.cts +26 -0
  609. package/utils/links/misc.test.d.cts +1 -0
  610. package/utils/links/proxy.d.cts +18 -0
  611. package/utils/links/proxy.test.d.cts +1 -0
  612. package/utils/links/stickers.d.cts +10 -0
  613. package/utils/links/user.d.cts +28 -0
  614. package/utils/links/user.test.d.cts +1 -0
  615. package/utils/logger.d.cts +54 -0
  616. package/utils/logger.test.d.cts +1 -0
  617. package/utils/long-utils.d.cts +67 -0
  618. package/utils/long-utils.test.d.cts +1 -0
  619. package/utils/misc-utils.d.cts +2 -0
  620. package/utils/peer-utils.d.cts +29 -0
  621. package/utils/peer-utils.test.d.cts +1 -0
  622. package/utils/sorted-array.d.cts +17 -0
  623. package/utils/sorted-array.test.d.cts +1 -0
  624. package/utils/timers.d.cts +1 -0
  625. package/utils/tl-json.d.cts +13 -0
  626. package/utils/tl-json.test.d.cts +1 -0
  627. package/utils/type-assertions.d.cts +29 -0
  628. package/utils/type-assertions.test.d.cts +1 -0
  629. package/utils.d.cts +1 -0
  630. package/worker.d.cts +1 -0
@@ -0,0 +1,420 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { CallDiscardReason } from '../calls/index.js';
3
+ import { TextWithEntities } from '../misc/entities.js';
4
+ import { Peer } from '../peers/peer.js';
5
+ import { Message } from './message.js';
6
+ import { Photo } from '../media/photo.js';
7
+ import { StarGift } from '../premium/stars-gift.js';
8
+ /** Group was created */
9
+ export interface ActionChatCreated {
10
+ readonly type: 'chat_created';
11
+ /** Group name */
12
+ readonly title: string;
13
+ /** IDs of the users in the group */
14
+ readonly users: number[];
15
+ }
16
+ /** Channel/supergroup was created */
17
+ export interface ActionChannelCreated {
18
+ readonly type: 'channel_created';
19
+ /** Original channel/supergroup title */
20
+ readonly title: string;
21
+ }
22
+ /** Chat was migrated to a supergroup with a given ID */
23
+ export interface ActionChatMigrateTo {
24
+ readonly type: 'chat_migrate_to';
25
+ /** Marked ID of the supergroup chat was migrated to */
26
+ readonly id: number;
27
+ }
28
+ /** Supergroup was migrated from a chat with a given ID */
29
+ export interface ActionChannelMigrateFrom {
30
+ readonly type: 'channel_migrate_from';
31
+ /** Marked ID of the chat this channel was migrated from */
32
+ readonly id: number;
33
+ /** Old chat's title */
34
+ readonly title: string;
35
+ }
36
+ /**
37
+ * A message has been pinned.
38
+ *
39
+ * To get the message itself, use {@link Message.getReplyTo}
40
+ */
41
+ export interface ActionMessagePinned {
42
+ readonly type: 'message_pinned';
43
+ }
44
+ /** History was cleared in a private chat. */
45
+ export interface ActionHistoryCleared {
46
+ readonly type: 'history_cleared';
47
+ }
48
+ /** Someone scored in a game (usually only used for newly set high scores) */
49
+ export interface ActionGameScore {
50
+ readonly type: 'game_score';
51
+ /** Game ID */
52
+ readonly gameId: tl.Long;
53
+ /** Score */
54
+ readonly score: number;
55
+ }
56
+ /** Contact has joined Telegram */
57
+ export interface ActionContactJoined {
58
+ readonly type: 'contact_joined';
59
+ }
60
+ /** Group title was changed */
61
+ export interface ActionTitleChanged {
62
+ readonly type: 'title_changed';
63
+ /** New group name */
64
+ readonly title: string;
65
+ }
66
+ /** Group photo was changed */
67
+ export interface ActionPhotoChanged {
68
+ readonly type: 'photo_changed';
69
+ /** New group photo */
70
+ readonly photo: Photo;
71
+ }
72
+ /** Group photo was deleted */
73
+ export interface ActionPhotoDeleted {
74
+ readonly type: 'photo_deleted';
75
+ }
76
+ /** Users were added to the chat */
77
+ export interface ActionUsersAdded {
78
+ readonly type: 'users_added';
79
+ /** IDs of the users that were added */
80
+ readonly users: number[];
81
+ }
82
+ /** User has left the group */
83
+ export interface ActionUserLeft {
84
+ readonly type: 'user_left';
85
+ }
86
+ /** User was removed from the group */
87
+ export interface ActionUserRemoved {
88
+ readonly type: 'user_removed';
89
+ /** ID of the user that was removed from the group */
90
+ readonly user: number;
91
+ }
92
+ /** User has joined the group via an invite link */
93
+ export interface ActionUserJoinedLink {
94
+ readonly type: 'user_joined_link';
95
+ /** ID of the user who created the link */
96
+ readonly inviter: number;
97
+ }
98
+ /**
99
+ * User has joined the group via an invite link
100
+ * and was approved by an administrator
101
+ */
102
+ export interface ActionUserJoinedApproved {
103
+ readonly type: 'user_joined_approved';
104
+ }
105
+ /** A payment was received from a user (bot) */
106
+ export interface ActionPaymentReceived {
107
+ readonly type: 'payment_received';
108
+ /** Three-letter ISO 4217 currency code */
109
+ readonly currency: string;
110
+ /**
111
+ * Price of the product in the smallest units of the currency
112
+ * (integer, not float/double). For example, for a price of
113
+ * `US$ 1.45`, `amount = 145`
114
+ */
115
+ readonly amount: tl.Long;
116
+ /** Bot specified invoice payload */
117
+ readonly payload: Uint8Array;
118
+ /** Order information provided by the user */
119
+ readonly info?: tl.TypePaymentRequestedInfo;
120
+ /** ID of the shipping option chosen by the user */
121
+ readonly shippingOptionId?: string;
122
+ /** Payment provider ID */
123
+ readonly charge?: tl.TypePaymentCharge;
124
+ /** If this is a subscription being bought, the date when the subscription will expire */
125
+ readonly subscriptionUntilDate?: Date;
126
+ }
127
+ /** A payment was sent to a user */
128
+ export interface ActionPaymentSent {
129
+ readonly type: 'payment_sent';
130
+ /** Three-letter ISO 4217 currency code */
131
+ readonly currency: string;
132
+ /**
133
+ * Price of the product in the smallest units of the currency
134
+ * (integer, not float/double). For example, for a price of
135
+ * `US$ 1.45`, `amount = 145`
136
+ */
137
+ readonly amount: tl.Long;
138
+ /** If this is a subscription being bought, the date when the subscription will expire */
139
+ readonly subscriptionUntilDate?: Date;
140
+ }
141
+ /** A phone call */
142
+ export interface ActionCall {
143
+ readonly type: 'call';
144
+ /** Call ID */
145
+ readonly id: tl.Long;
146
+ /** Whether this is a video call */
147
+ readonly isVideo: boolean;
148
+ /** Duration if the call in seconds (0 if not available) */
149
+ readonly duration: number;
150
+ /** Call discard reason, if available */
151
+ readonly reason?: CallDiscardReason;
152
+ }
153
+ /** A screenshot was taken */
154
+ export interface ActionScreenshotTaken {
155
+ readonly type: 'screenshot_taken';
156
+ }
157
+ /** User has authorized via the bot */
158
+ export interface ActionBotAllowed {
159
+ readonly type: 'bot_allowed';
160
+ /** Domain where the user has logged in */
161
+ readonly domain?: string;
162
+ }
163
+ /**
164
+ * A user is in proximity of another user
165
+ * (see [Proximity alerts](https://core.telegram.org/api/live-location#proximity-alert))
166
+ */
167
+ export interface ActionGeoProximity {
168
+ readonly type: 'geo_proximity';
169
+ /** ID of the user who sent the geolocation with proximity alerts */
170
+ readonly targetId: number;
171
+ /** ID of the user who has approached `targetId` */
172
+ readonly userId: number;
173
+ /** Distance between them in meters */
174
+ readonly distance: number;
175
+ }
176
+ /** Group call has started */
177
+ export interface ActionGroupCallStarted {
178
+ readonly type: 'group_call_started';
179
+ /** TL object representing the call */
180
+ readonly call: tl.TypeInputGroupCall;
181
+ }
182
+ /** Group call has ended */
183
+ export interface ActionGroupCallEnded {
184
+ readonly type: 'group_call_ended';
185
+ /** TL object representing the call */
186
+ readonly call: tl.TypeInputGroupCall;
187
+ /** Duration of the call */
188
+ readonly duration: number;
189
+ }
190
+ /** Group call has been scheduled */
191
+ export interface ActionGroupCallScheduled {
192
+ readonly type: 'group_call_scheduled';
193
+ /** TL object representing the call */
194
+ readonly call: tl.TypeInputGroupCall;
195
+ /** Date when the call will start */
196
+ readonly date: Date;
197
+ }
198
+ /** Group call has ended */
199
+ export interface ActionGroupInvite {
200
+ readonly type: 'group_call_invite';
201
+ /** TL object representing the call */
202
+ readonly call: tl.TypeInputGroupCall;
203
+ /** IDs of the users invited to the call */
204
+ readonly userIds: number[];
205
+ }
206
+ /** Messages TTL changed */
207
+ export interface ActionTtlChanged {
208
+ readonly type: 'ttl_changed';
209
+ /** New TTL period */
210
+ readonly period: number;
211
+ }
212
+ /** Forum topic was created */
213
+ export interface ActionTopicCreated {
214
+ readonly type: 'topic_created';
215
+ /** Title of the topic */
216
+ title: string;
217
+ /** Icon color of the topic */
218
+ iconColor: number;
219
+ /** Icon emoji of the topic */
220
+ iconCustomEmoji?: tl.Long;
221
+ }
222
+ /** Forum topic was modified */
223
+ export interface ActionTopicEdited {
224
+ readonly type: 'topic_edited';
225
+ /** New title of the topic */
226
+ title?: string;
227
+ /** New icon emoji of the topic (may be empty) */
228
+ iconCustomEmoji?: tl.Long;
229
+ /** Whether the topic was opened/closed */
230
+ closed?: boolean;
231
+ /** Whether the topic was (un-)hidden - only for "General" topic (`id=1`) */
232
+ hidden?: boolean;
233
+ }
234
+ /** A non-standard action has happened in the chat */
235
+ export interface ActionCustom {
236
+ readonly type: 'custom';
237
+ /** Text to be shown in the interface */
238
+ action: string;
239
+ }
240
+ /** Chat theme was changed */
241
+ export interface ActionThemeChanged {
242
+ readonly type: 'theme_changed';
243
+ /** Emoji representing the new theme */
244
+ emoji: string;
245
+ }
246
+ /** Data was sent from a WebView (user-side action) */
247
+ export interface ActionWebviewDataSent {
248
+ readonly type: 'webview_sent';
249
+ /** Text of the button that was pressed to open the WebView */
250
+ text: string;
251
+ }
252
+ /** Data was received from a WebView (bot-side action) */
253
+ export interface ActionWebviewDataReceived {
254
+ readonly type: 'webview_received';
255
+ /** Text of the button that was pressed to open the WebView */
256
+ text: string;
257
+ /** Data received from the WebView */
258
+ data: string;
259
+ }
260
+ /** Premium subscription was gifted */
261
+ export interface ActionPremiumGifted {
262
+ readonly type: 'premium_gifted';
263
+ /**
264
+ * Currency in which it was paid for.
265
+ * Three-letter ISO 4217 currency code)
266
+ */
267
+ currency: string;
268
+ /**
269
+ * Price of the product in the smallest units of the currency
270
+ * (integer, not float/double). For example, for a price of
271
+ * `US$ 1.45`, `amount = 145`
272
+ */
273
+ amount: number;
274
+ /** Duration of the gifted subscription in months */
275
+ months: number;
276
+ /** If the subscription was bought with crypto, information about it */
277
+ crypto?: {
278
+ /** Crypto currency name */
279
+ currency: string;
280
+ /** Price in the smallest units */
281
+ amount: number;
282
+ };
283
+ /** Message attached to the gift */
284
+ message?: TextWithEntities;
285
+ }
286
+ /** A photo has been suggested as a profile photo */
287
+ export interface ActionPhotoSuggested {
288
+ readonly type: 'photo_suggested';
289
+ /** Photo that was suggested */
290
+ photo: Photo;
291
+ }
292
+ /**
293
+ * A peer was chosen by the user after clicking on a RequestPeer button.
294
+ * The user-side version of {@link ActionPeerChosen}
295
+ */
296
+ export interface ActionPeerSent {
297
+ readonly type: 'peer_sent';
298
+ /** ID of the button passed earlier by the bot */
299
+ buttonId: number;
300
+ /** Brief information about the chosen peers */
301
+ peers: tl.TypeRequestedPeer[];
302
+ }
303
+ /**
304
+ * A peer was chosen by the user after clicking on a RequestPeer button
305
+ * The bot-side version of {@link ActionPeerSent}
306
+ */
307
+ export interface ActionPeerChosen {
308
+ readonly type: 'peer_chosen';
309
+ /** ID of the button passed earlier by the bot */
310
+ buttonId: number;
311
+ /** Chosen peers */
312
+ peers: Peer[];
313
+ }
314
+ /** A wallpaper of the chathas been changed */
315
+ export interface ActionWallpaperChanged {
316
+ readonly type: 'wallpaper_changed';
317
+ /**
318
+ * Whether the user has applied the same wallpaper
319
+ * as the other party previously set in the chat
320
+ */
321
+ same: boolean;
322
+ /**
323
+ * Whether the wallpaper was forcefully applied for
324
+ * both sides, without explicit confirmation from the other
325
+ * side.
326
+ */
327
+ forBoth: boolean;
328
+ /** TL object representing the new wallpaper */
329
+ wallpaper: tl.TypeWallPaper;
330
+ }
331
+ /** A Telergam Premium gift code was received */
332
+ export interface ActionGiftCode {
333
+ readonly type: 'gift_code';
334
+ /** Information about the gift code */
335
+ raw: tl.RawMessageActionGiftCode;
336
+ /** Message attached to the gift */
337
+ message?: TextWithEntities;
338
+ }
339
+ /** A Telergam Premium giveaway was started */
340
+ export interface ActionGiveawayStarted {
341
+ readonly type: 'giveaway_started';
342
+ }
343
+ /** A Telergam Premium giveaway was ended and results are available */
344
+ export interface ActionGiveawayEnded {
345
+ readonly type: 'giveaway_ended';
346
+ /** Number of winners in the giveaway */
347
+ winners: number;
348
+ /** Number of undistributed prizes */
349
+ undistributed: number;
350
+ }
351
+ /** Boosts were applied to the group */
352
+ export interface ActionBoostApply {
353
+ readonly type: 'boost_apply';
354
+ /** Number of boosts applied */
355
+ count: number;
356
+ }
357
+ /** A payment was refunded */
358
+ export interface ActionPaymentRefunded {
359
+ readonly type: 'payment_refunded';
360
+ /** Three-letter ISO 4217 currency code */
361
+ currency: string;
362
+ /** Marked ID of the peer where the stars were refunded (?) */
363
+ peerId: number;
364
+ /** Number of `currency` refunded, in the smallest unit */
365
+ amount: tl.Long;
366
+ /** Payload defined by the bot */
367
+ payload?: Uint8Array;
368
+ /** Information about the charge */
369
+ charge: tl.TypePaymentCharge;
370
+ }
371
+ /** Telegram Stars were gifted by the other chat participant */
372
+ export interface ActionStarGifted {
373
+ readonly type: 'stars_gifted';
374
+ /** Whether `currency` is a cryptocurrency */
375
+ isCrypto: boolean;
376
+ /** Currency in which the stars were paid for */
377
+ currency: string;
378
+ /** Amount of `currency` that was paid */
379
+ amount: tl.Long;
380
+ /** Amount of Telegram Stars that were gifted */
381
+ stars: tl.Long;
382
+ /** Transaction ID, if available */
383
+ transactionId?: string;
384
+ }
385
+ /**
386
+ * Telegram Stars were awarded in a giveaway
387
+ */
388
+ export interface ActionStarsPrize {
389
+ readonly type: 'stars_prize';
390
+ /** Whether this prize was claimed yet */
391
+ claimed: boolean;
392
+ /** Stars prize */
393
+ stars: tl.Long;
394
+ /** Transaction ID */
395
+ transactionId: string;
396
+ boostPeer: Peer;
397
+ /** Message ID containing the giveaway */
398
+ giveawayMessageId: number;
399
+ }
400
+ export interface ActionStarGift {
401
+ readonly type: 'stars_gift';
402
+ /** Whether the sender chose to send the gift anonymously */
403
+ nameHidden: boolean;
404
+ /** Whether this gift was saved to the recipient's profile */
405
+ saved: boolean;
406
+ /** Whether this gift was converted to stars */
407
+ converted: boolean;
408
+ /**
409
+ * Amount of stars the gift can be converted to by the recipient
410
+ * (0 if the gift cannot be converted)
411
+ */
412
+ convertStars: tl.Long;
413
+ /** The gift itself */
414
+ gift: StarGift;
415
+ /** Message attached to the gift */
416
+ message: TextWithEntities | null;
417
+ }
418
+ export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGift | null;
419
+ /** @internal */
420
+ export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
@@ -0,0 +1,20 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { LongMap } from '../../../utils/long-utils.js';
3
+ import { Sticker } from '../media/sticker.js';
4
+ export declare class MessageEffect {
5
+ readonly raw: tl.RawAvailableEffect;
6
+ readonly documentsMap: LongMap<tl.RawDocument>;
7
+ constructor(raw: tl.RawAvailableEffect, documentsMap: LongMap<tl.RawDocument>);
8
+ /** Whether Telegram Premium is required to use this effect */
9
+ get isPremiumRequired(): boolean;
10
+ /** ID of this effect */
11
+ get id(): tl.Long;
12
+ /** Emoji representint this reaction */
13
+ get emoji(): string;
14
+ /** Sticker representing a static icon for this effect (if any) */
15
+ get staticIcon(): Sticker | null;
16
+ /** Animated icon representing the effect */
17
+ get icon(): Sticker;
18
+ /** The animation itself */
19
+ get animation(): Sticker | null;
20
+ }
@@ -0,0 +1,89 @@
1
+ import { tl } from '@mtcute/tl';
2
+ /**
3
+ * Params of the entity. `.kind` can be:
4
+ * - 'mention': `@username`.
5
+ * - 'hashtag': `#hashtag`.
6
+ * - 'cashtag': `$USD`.
7
+ * - 'bot_command': `/start`.
8
+ * - 'url': `https://example.com`
9
+ * - 'email': `example@example.com`.
10
+ * - 'phone_number': `+42000`.
11
+ * - 'bold': **bold text**.
12
+ * - 'italic': *italic text*.
13
+ * - 'underline': <u>underlined</u> text.
14
+ * - 'strikethrough': <s>strikethrough</s> text.
15
+ * - 'code': `monospaced` string.
16
+ * - 'pre': `monospaced` block. `.language` contains the language of the block (if available).
17
+ * - 'text_link': for clickable text URLs.
18
+ * - 'text_mention': for user mention by name. `.userId` contains the ID of the mentioned user.
19
+ * - 'blockquote': A blockquote
20
+ * - 'emoji': A custom emoji. `.emojiId` contains the emoji ID.
21
+ */
22
+ export type MessageEntityParams = {
23
+ kind: 'mention' | 'hashtag' | 'cashtag' | 'bot_command' | 'url' | 'email' | 'phone_number' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'code' | 'bank_card' | 'unknown';
24
+ } | {
25
+ kind: 'blockquote';
26
+ collapsible: boolean;
27
+ } | {
28
+ kind: 'pre';
29
+ language?: string;
30
+ } | {
31
+ kind: 'text_link';
32
+ url: string;
33
+ } | {
34
+ kind: 'text_mention';
35
+ userId: number;
36
+ } | {
37
+ kind: 'emoji';
38
+ emojiId: tl.Long;
39
+ };
40
+ /**
41
+ * Kind of the entity. For more information, see {@link MessageEntityParams}
42
+ */
43
+ export type MessageEntityKind = MessageEntityParams['kind'];
44
+ /**
45
+ * One special entity in a text message (like mention, hashtag, URL, etc.)
46
+ */
47
+ export declare class MessageEntity {
48
+ readonly raw: tl.TypeMessageEntity;
49
+ readonly _text?: string | undefined;
50
+ constructor(raw: tl.TypeMessageEntity, _text?: string | undefined);
51
+ /**
52
+ * Offset in UTF-16 code units to the start of the entity.
53
+ *
54
+ * Since JS strings are UTF-16, you can use this as-is
55
+ */
56
+ get offset(): number;
57
+ /**
58
+ * Length of the entity in UTF-16 code units.
59
+ *
60
+ * Since JS strings are UTF-16, you can use this as-is
61
+ */
62
+ get length(): number;
63
+ /**
64
+ * Kind of the entity (see {@link MessageEntityParams})
65
+ */
66
+ get kind(): MessageEntityKind;
67
+ /**
68
+ * Params of the entity
69
+ */
70
+ get params(): MessageEntityParams;
71
+ /**
72
+ * Text contained in this entity.
73
+ *
74
+ * > **Note**: This does not take into account that entities may overlap,
75
+ * > and is only useful for simple cases.
76
+ */
77
+ get text(): string;
78
+ /**
79
+ * Checks if this entity is of the given type, and adjusts the type accordingly.
80
+ * @param kind
81
+ * @returns
82
+ */
83
+ is<const T extends MessageEntityKind>(kind: T): this is MessageEntity & {
84
+ params: Extract<MessageEntityParams, {
85
+ kind: T;
86
+ }>;
87
+ kind: T;
88
+ };
89
+ }
@@ -0,0 +1,39 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { Peer, PeerSender } from '../peers/peer.js';
3
+ import { PeersIndex } from '../peers/peers-index.js';
4
+ /**
5
+ * Information about forwarded message origin
6
+ */
7
+ export declare class MessageForwardInfo {
8
+ readonly raw: tl.RawMessageFwdHeader;
9
+ readonly _peers: PeersIndex;
10
+ constructor(raw: tl.RawMessageFwdHeader, _peers: PeersIndex);
11
+ /**
12
+ * Date the original message was sent
13
+ */
14
+ get date(): Date;
15
+ /**
16
+ * Sender of the original message (either user or a channel)
17
+ * or their name (for users with private forwards)
18
+ */
19
+ get sender(): PeerSender;
20
+ /**
21
+ * For "saved" messages (i.e. messages forwarded to yourself,
22
+ * "Saved Messages"), the peer where the message was originally sent.
23
+ *
24
+ * `null` for other messages, you might want to use {@link sender} instead
25
+ */
26
+ fromChat(): Peer | null;
27
+ /**
28
+ * For messages forwarded from channels,
29
+ * identifier of the original message in the channel
30
+ *
31
+ * (only availale if {@link fromChat} is not `null`)
32
+ */
33
+ get fromMessageId(): number | null;
34
+ /**
35
+ * For messages forwarded from channels,
36
+ * signature of the post author (if present)
37
+ */
38
+ get signature(): string | null;
39
+ }
@@ -0,0 +1,23 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { Audio } from '../media/audio.js';
3
+ import { Document } from '../media/document.js';
4
+ import { Sticker } from '../media/sticker.js';
5
+ import { Video } from '../media/video.js';
6
+ import { Voice } from '../media/voice.js';
7
+ import { PeersIndex } from '../peers/peers-index.js';
8
+ import { Contact } from '../media/contact.js';
9
+ import { Dice } from '../media/dice.js';
10
+ import { Game } from '../media/game.js';
11
+ import { Invoice } from '../media/invoice.js';
12
+ import { LiveLocation, Location } from '../media/location.js';
13
+ import { PaidMedia } from '../media/paid-media.js';
14
+ import { Photo } from '../media/photo.js';
15
+ import { Poll } from '../media/poll.js';
16
+ import { MediaStory } from '../media/story.js';
17
+ import { Venue } from '../media/venue.js';
18
+ import { WebPage } from '../media/web-page.js';
19
+ /** A media inside of a {@link Message} */
20
+ export type MessageMedia = Photo | Dice | Contact | Audio | Voice | Sticker | Document | Video | Location | LiveLocation | Game | WebPage | Venue | Poll | Invoice | MediaStory | PaidMedia | null;
21
+ export type MessageMediaType = Exclude<MessageMedia, null>['type'];
22
+ /** @internal */
23
+ export declare function _messageMediaFromTl(peers: PeersIndex | null, m: tl.TypeMessageMedia): MessageMedia;
@@ -0,0 +1,31 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { PeersIndex } from '../peers/index.js';
3
+ import { PaidPeerReaction, PeerReaction } from '../reactions/peer-reaction.js';
4
+ import { ReactionCount } from '../reactions/reaction-count.js';
5
+ /**
6
+ * Reactions on a message
7
+ */
8
+ export declare class MessageReactions {
9
+ readonly messageId: number;
10
+ readonly chatId: number;
11
+ readonly raw: tl.RawMessageReactions;
12
+ readonly _peers: PeersIndex;
13
+ constructor(messageId: number, chatId: number, raw: tl.RawMessageReactions, _peers: PeersIndex);
14
+ /**
15
+ * Whether you can use {@link getUsers}
16
+ * (or {@link TelegramClient.getReactionUsers})
17
+ * to get the users who reacted to this message
18
+ */
19
+ get usersVisible(): boolean;
20
+ /**
21
+ * Reactions on the message, along with their counts
22
+ */
23
+ get reactions(): ReactionCount[];
24
+ /**
25
+ * Recently reacted users.
26
+ * To get a full list of users, use {@link getUsers}
27
+ */
28
+ get recentReactions(): PeerReaction[];
29
+ /** Leaderboard of paid reactions to the message */
30
+ get paidReactions(): PaidPeerReaction[];
31
+ }
@@ -0,0 +1,42 @@
1
+ import { tl } from '@mtcute/tl';
2
+ import { Peer } from '../peers/peer.js';
3
+ import { PeersIndex } from '../peers/peers-index.js';
4
+ /**
5
+ * Information about replies to a message
6
+ */
7
+ export declare class MessageRepliesInfo {
8
+ readonly raw: tl.RawMessageReplies;
9
+ readonly _peers: PeersIndex;
10
+ constructor(raw: tl.RawMessageReplies, _peers: PeersIndex);
11
+ /**
12
+ * Whether this message is a channel post that has a comments thread
13
+ * in the linked discussion group
14
+ */
15
+ get hasComments(): boolean;
16
+ /**
17
+ * Total number of replies
18
+ */
19
+ get count(): number;
20
+ /**
21
+ * Whether this reply thread has unread messages
22
+ */
23
+ get hasUnread(): boolean;
24
+ /**
25
+ * ID of the last message in the thread (if any)
26
+ */
27
+ get lastMessageId(): number | null;
28
+ /**
29
+ * ID of the last read message in the thread (if any)
30
+ */
31
+ get lastReadMessageId(): number | null;
32
+ /**
33
+ * ID of the discussion group for the post
34
+ *
35
+ * `null` if the post is not a channel post
36
+ */
37
+ get discussion(): number | null;
38
+ /**
39
+ * Last few commenters to the post (usually 3)
40
+ */
41
+ get repliers(): Peer[];
42
+ }