rubjs 3.0.0 → 3.1.1

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 (524) hide show
  1. package/README.md +32 -11
  2. package/lib/clients/VoiceChatClient.d.ts +4 -3
  3. package/lib/clients/VoiceChatClient.js +60 -92
  4. package/lib/clients/loginClient.d.ts +1 -1
  5. package/lib/clients/loginClient.js +4 -4
  6. package/lib/{core → clients}/network_login.js +1 -1
  7. package/lib/core/bot/bot.d.ts +25 -0
  8. package/lib/core/bot/bot.js +57 -0
  9. package/lib/core/bot/contexts/inline.context.d.ts +16 -0
  10. package/lib/core/bot/contexts/inline.context.js +27 -0
  11. package/lib/core/bot/contexts/message.context.d.ts +17 -0
  12. package/lib/core/bot/contexts/message.context.js +39 -0
  13. package/lib/core/bot/filters.d.ts +14 -0
  14. package/lib/core/bot/filters.js +45 -0
  15. package/lib/core/bot/methods/advanced/builder.d.ts +3 -0
  16. package/lib/core/bot/methods/advanced/builder.js +15 -0
  17. package/lib/core/bot/methods/bot/getMe.d.ts +3 -0
  18. package/lib/core/bot/methods/bot/getMe.js +6 -0
  19. package/lib/core/bot/methods/bot/index.d.ts +2 -0
  20. package/lib/core/bot/methods/bot/index.js +8 -0
  21. package/lib/core/bot/methods/chat/getChat.d.ts +3 -0
  22. package/lib/core/bot/methods/chat/getChat.js +6 -0
  23. package/lib/core/bot/methods/chat/index.d.ts +2 -0
  24. package/lib/core/bot/methods/chat/index.js +8 -0
  25. package/lib/core/bot/methods/files/getFile.d.ts +3 -0
  26. package/lib/core/bot/methods/files/getFile.js +6 -0
  27. package/lib/core/bot/methods/files/index.d.ts +4 -0
  28. package/lib/core/bot/methods/files/index.js +12 -0
  29. package/lib/core/bot/methods/files/requestSendFile.d.ts +4 -0
  30. package/lib/core/bot/methods/files/requestSendFile.js +6 -0
  31. package/lib/core/bot/methods/files/uploadFile.d.ts +3 -0
  32. package/lib/core/bot/methods/files/uploadFile.js +32 -0
  33. package/lib/core/bot/methods/index.d.ts +34 -0
  34. package/lib/core/bot/methods/index.js +116 -0
  35. package/lib/core/bot/methods/messages/deleteMessage.d.ts +3 -0
  36. package/lib/core/bot/methods/messages/deleteMessage.js +9 -0
  37. package/lib/core/bot/methods/messages/editChatKeypad.d.ts +4 -0
  38. package/lib/core/bot/methods/messages/editChatKeypad.js +14 -0
  39. package/lib/core/bot/methods/messages/editMessageKeypad.d.ts +4 -0
  40. package/lib/core/bot/methods/messages/editMessageKeypad.js +11 -0
  41. package/lib/core/bot/methods/messages/editMessageText.d.ts +3 -0
  42. package/lib/core/bot/methods/messages/editMessageText.js +10 -0
  43. package/lib/core/bot/methods/messages/forwardMessage.d.ts +3 -0
  44. package/lib/core/bot/methods/messages/forwardMessage.js +11 -0
  45. package/lib/core/bot/methods/messages/index.d.ts +10 -0
  46. package/lib/core/bot/methods/messages/index.js +24 -0
  47. package/lib/core/bot/methods/messages/sendContact.d.ts +4 -0
  48. package/lib/core/bot/methods/messages/sendContact.js +24 -0
  49. package/lib/core/bot/methods/messages/sendLocation.d.ts +4 -0
  50. package/lib/core/bot/methods/messages/sendLocation.js +23 -0
  51. package/lib/core/bot/methods/messages/sendMessage.d.ts +4 -0
  52. package/lib/core/bot/methods/messages/sendMessage.js +22 -0
  53. package/lib/core/bot/methods/messages/sendPoll.d.ts +3 -0
  54. package/lib/core/bot/methods/messages/sendPoll.js +6 -0
  55. package/lib/core/bot/methods/settings/index.d.ts +3 -0
  56. package/lib/core/bot/methods/settings/index.js +10 -0
  57. package/lib/core/bot/methods/settings/setCommands.d.ts +4 -0
  58. package/lib/core/bot/methods/settings/setCommands.js +6 -0
  59. package/lib/core/bot/methods/settings/updateBotEndpoints.d.ts +4 -0
  60. package/lib/core/bot/methods/settings/updateBotEndpoints.js +9 -0
  61. package/lib/core/bot/methods/utilities/getUpdates.d.ts +3 -0
  62. package/lib/core/bot/methods/utilities/getUpdates.js +6 -0
  63. package/lib/core/bot/methods/utilities/handleUpdates.d.ts +4 -0
  64. package/lib/core/bot/methods/utilities/handleUpdates.js +41 -0
  65. package/lib/core/bot/methods/utilities/index.d.ts +5 -0
  66. package/lib/core/bot/methods/utilities/index.js +14 -0
  67. package/lib/core/bot/methods/utilities/run.d.ts +4 -0
  68. package/lib/core/bot/methods/utilities/run.js +13 -0
  69. package/lib/core/bot/methods/utilities/start.d.ts +3 -0
  70. package/lib/core/bot/methods/utilities/start.js +27 -0
  71. package/lib/core/bot/methods/utilities/webhook.d.ts +4 -0
  72. package/lib/core/bot/methods/utilities/webhook.js +57 -0
  73. package/lib/core/bot/network/index.d.ts +9 -0
  74. package/lib/core/bot/network/index.js +48 -0
  75. package/lib/core/bot/network/polling.d.ts +0 -0
  76. package/lib/core/bot/network/polling.js +44 -0
  77. package/lib/core/bot/types/bot.type.d.ts +26 -0
  78. package/lib/core/bot/types/models.d.ts +303 -0
  79. package/lib/core/bot/types/models.js +131 -0
  80. package/lib/core/client/client.d.ts +29 -0
  81. package/lib/core/client/client.js +65 -0
  82. package/lib/{types → core/client/contexts}/activities.type.d.ts +2 -2
  83. package/lib/{types → core/client/contexts}/chat.type.d.ts +2 -2
  84. package/lib/core/client/contexts/contextConstructors.d.ts +10 -0
  85. package/lib/core/client/contexts/contextConstructors.js +16 -0
  86. package/lib/core/client/contexts/index.d.ts +5 -0
  87. package/lib/core/client/contexts/index.js +14 -0
  88. package/lib/{types → core/client/contexts}/message.type.d.ts +2 -2
  89. package/lib/{types → core/client/contexts}/notifications.type.d.ts +2 -2
  90. package/lib/core/{filters.d.ts → client/filters.d.ts} +3 -3
  91. package/lib/core/{filters.js → client/filters.js} +27 -27
  92. package/lib/core/client/methods/advanced/index.d.ts +2 -0
  93. package/lib/core/client/methods/advanced/index.js +8 -0
  94. package/lib/core/{methods → client/methods}/extras/onEditMessages.d.ts +1 -1
  95. package/lib/core/{methods → client/methods}/groups/joinGroup.js +0 -1
  96. package/lib/core/{methods → client/methods}/index.d.ts +4 -3
  97. package/lib/core/{methods → client/methods}/index.js +8 -17
  98. package/lib/core/client/methods/utilities/download.d.ts +4 -0
  99. package/lib/core/client/methods/utilities/download.js +6 -0
  100. package/lib/core/client/methods/utilities/downloadProfilePicture.d.ts +4 -0
  101. package/lib/core/client/methods/utilities/downloadProfilePicture.js +28 -0
  102. package/lib/core/client/methods/utilities/index.d.ts +8 -0
  103. package/lib/core/{methods → client/methods}/utilities/index.js +5 -5
  104. package/lib/core/{methods → client/methods}/utilities/start.js +2 -3
  105. package/lib/core/{methods → client/methods}/utilities/usePlugin.d.ts +1 -1
  106. package/lib/core/client/network/api.d.ts +16 -0
  107. package/lib/core/client/network/api.js +95 -0
  108. package/lib/core/client/network/file.d.ts +3 -0
  109. package/lib/core/client/network/file.js +117 -0
  110. package/lib/core/client/network/index.d.ts +25 -0
  111. package/lib/core/client/network/index.js +31 -0
  112. package/lib/core/client/network/utils.d.ts +9 -0
  113. package/lib/core/client/network/utils.js +34 -0
  114. package/lib/core/client/network/websocket.d.ts +3 -0
  115. package/lib/core/client/network/websocket.js +174 -0
  116. package/lib/{types → core/client/types}/client.type.d.ts +11 -13
  117. package/lib/{types → core/client/types}/index.type.d.ts +1 -3
  118. package/lib/{types → core/client/types}/index.type.js +1 -8
  119. package/lib/core/client/types/session.type.d.ts +11 -0
  120. package/lib/core/client/types/session.type.js +2 -0
  121. package/lib/exceptions/index.d.ts +6 -0
  122. package/lib/exceptions/index.js +16 -0
  123. package/lib/index.d.ts +11 -7
  124. package/lib/index.js +12 -8
  125. package/lib/utils/checkFilters.d.ts +1 -0
  126. package/lib/utils/checkFilters.js +20 -0
  127. package/lib/{core → utils}/session.d.ts +4 -2
  128. package/lib/{core → utils}/session.js +27 -11
  129. package/package.json +49 -43
  130. package/lib/core/client.d.ts +0 -38
  131. package/lib/core/client.js +0 -53
  132. package/lib/core/methods/utilities/index.d.ts +0 -8
  133. package/lib/core/methods/utilities/runErrorMiddlewares.d.ts +0 -3
  134. package/lib/core/methods/utilities/runErrorMiddlewares.js +0 -13
  135. package/lib/core/methods/utilities/useError.d.ts +0 -4
  136. package/lib/core/methods/utilities/useError.js +0 -6
  137. package/lib/core/network.d.ts +0 -49
  138. package/lib/core/network.js +0 -436
  139. package/lib/types/session.type.d.ts +0 -7
  140. /package/lib/{core → clients}/network_login.d.ts +0 -0
  141. /package/lib/core/{methods → bot/methods}/advanced/index.d.ts +0 -0
  142. /package/lib/core/{methods → bot/methods}/advanced/index.js +0 -0
  143. /package/lib/{types/client.type.js → core/bot/types/bot.type.js} +0 -0
  144. /package/lib/{types → core/client/contexts}/activities.type.js +0 -0
  145. /package/lib/{types → core/client/contexts}/chat.type.js +0 -0
  146. /package/lib/{types → core/client/contexts}/message.type.js +0 -0
  147. /package/lib/{types → core/client/contexts}/notifications.type.js +0 -0
  148. /package/lib/core/{crypto.d.ts → client/crypto.d.ts} +0 -0
  149. /package/lib/core/{crypto.js → client/crypto.js} +0 -0
  150. /package/lib/core/{methods → client/methods}/advanced/builder.d.ts +0 -0
  151. /package/lib/core/{methods → client/methods}/advanced/builder.js +0 -0
  152. /package/lib/core/{methods → client/methods}/auth/index.d.ts +0 -0
  153. /package/lib/core/{methods → client/methods}/auth/index.js +0 -0
  154. /package/lib/core/{methods → client/methods}/auth/logout.d.ts +0 -0
  155. /package/lib/core/{methods → client/methods}/auth/logout.js +0 -0
  156. /package/lib/core/{methods → client/methods}/auth/registerDevice.d.ts +0 -0
  157. /package/lib/core/{methods → client/methods}/auth/registerDevice.js +0 -0
  158. /package/lib/core/{methods → client/methods}/auth/sendCode.d.ts +0 -0
  159. /package/lib/core/{methods → client/methods}/auth/sendCode.js +0 -0
  160. /package/lib/core/{methods → client/methods}/auth/signIn.d.ts +0 -0
  161. /package/lib/core/{methods → client/methods}/auth/signIn.js +0 -0
  162. /package/lib/core/{methods → client/methods}/channels/addChannel.d.ts +0 -0
  163. /package/lib/core/{methods → client/methods}/channels/addChannel.js +0 -0
  164. /package/lib/core/{methods → client/methods}/channels/addChannelMembers.d.ts +0 -0
  165. /package/lib/core/{methods → client/methods}/channels/addChannelMembers.js +0 -0
  166. /package/lib/core/{methods → client/methods}/channels/banChannelMember.d.ts +0 -0
  167. /package/lib/core/{methods → client/methods}/channels/banChannelMember.js +0 -0
  168. /package/lib/core/{methods → client/methods}/channels/cancelChangeObjectOwner.d.ts +0 -0
  169. /package/lib/core/{methods → client/methods}/channels/cancelChangeObjectOwner.js +0 -0
  170. /package/lib/core/{methods → client/methods}/channels/channelPreviewByJoinLink.d.ts +0 -0
  171. /package/lib/core/{methods → client/methods}/channels/channelPreviewByJoinLink.js +0 -0
  172. /package/lib/core/{methods → client/methods}/channels/checkChannelUsername.d.ts +0 -0
  173. /package/lib/core/{methods → client/methods}/channels/checkChannelUsername.js +0 -0
  174. /package/lib/core/{methods → client/methods}/channels/createChannelVoiceChat.d.ts +0 -0
  175. /package/lib/core/{methods → client/methods}/channels/createChannelVoiceChat.js +0 -0
  176. /package/lib/core/{methods → client/methods}/channels/discardChannelVoiceChat.d.ts +0 -0
  177. /package/lib/core/{methods → client/methods}/channels/discardChannelVoiceChat.js +0 -0
  178. /package/lib/core/{methods → client/methods}/channels/editChannelInfo.d.ts +0 -0
  179. /package/lib/core/{methods → client/methods}/channels/editChannelInfo.js +0 -0
  180. /package/lib/core/{methods → client/methods}/channels/getBannedChannelMembers.d.ts +0 -0
  181. /package/lib/core/{methods → client/methods}/channels/getBannedChannelMembers.js +0 -0
  182. /package/lib/core/{methods → client/methods}/channels/getChannelAdminAccessList.d.ts +0 -0
  183. /package/lib/core/{methods → client/methods}/channels/getChannelAdminAccessList.js +0 -0
  184. /package/lib/core/{methods → client/methods}/channels/getChannelAdminMembers.d.ts +0 -0
  185. /package/lib/core/{methods → client/methods}/channels/getChannelAdminMembers.js +0 -0
  186. /package/lib/core/{methods → client/methods}/channels/getChannelAllMembers.d.ts +0 -0
  187. /package/lib/core/{methods → client/methods}/channels/getChannelAllMembers.js +0 -0
  188. /package/lib/core/{methods → client/methods}/channels/getChannelInfo.d.ts +0 -0
  189. /package/lib/core/{methods → client/methods}/channels/getChannelInfo.js +0 -0
  190. /package/lib/core/{methods → client/methods}/channels/getChannelLink.d.ts +0 -0
  191. /package/lib/core/{methods → client/methods}/channels/getChannelLink.js +0 -0
  192. /package/lib/core/{methods → client/methods}/channels/getPendingObjectOwner.d.ts +0 -0
  193. /package/lib/core/{methods → client/methods}/channels/getPendingObjectOwner.js +0 -0
  194. /package/lib/core/{methods → client/methods}/channels/index.d.ts +0 -0
  195. /package/lib/core/{methods → client/methods}/channels/index.js +0 -0
  196. /package/lib/core/{methods → client/methods}/channels/joinChannelAction.d.ts +0 -0
  197. /package/lib/core/{methods → client/methods}/channels/joinChannelAction.js +0 -0
  198. /package/lib/core/{methods → client/methods}/channels/joinChannelByLink.d.ts +0 -0
  199. /package/lib/core/{methods → client/methods}/channels/joinChannelByLink.js +0 -0
  200. /package/lib/core/{methods → client/methods}/channels/leaveChannelVoiceChat.d.ts +0 -0
  201. /package/lib/core/{methods → client/methods}/channels/leaveChannelVoiceChat.js +0 -0
  202. /package/lib/core/{methods → client/methods}/channels/removeChannel.d.ts +0 -0
  203. /package/lib/core/{methods → client/methods}/channels/removeChannel.js +0 -0
  204. /package/lib/core/{methods → client/methods}/channels/requestChangeObjectOwner.d.ts +0 -0
  205. /package/lib/core/{methods → client/methods}/channels/requestChangeObjectOwner.js +0 -0
  206. /package/lib/core/{methods → client/methods}/channels/seenChannelMessages.d.ts +0 -0
  207. /package/lib/core/{methods → client/methods}/channels/seenChannelMessages.js +0 -0
  208. /package/lib/core/{methods → client/methods}/channels/setChannelLink.d.ts +0 -0
  209. /package/lib/core/{methods → client/methods}/channels/setChannelLink.js +0 -0
  210. /package/lib/core/{methods → client/methods}/channels/setChannelVoiceChatSetting.d.ts +0 -0
  211. /package/lib/core/{methods → client/methods}/channels/setChannelVoiceChatSetting.js +0 -0
  212. /package/lib/core/{methods → client/methods}/channels/updateChannelUsername.d.ts +0 -0
  213. /package/lib/core/{methods → client/methods}/channels/updateChannelUsername.js +0 -0
  214. /package/lib/core/{methods → client/methods}/chats/actionOnJoinRequest.d.ts +0 -0
  215. /package/lib/core/{methods → client/methods}/chats/actionOnJoinRequest.js +0 -0
  216. /package/lib/core/{methods → client/methods}/chats/addLiveComment.d.ts +0 -0
  217. /package/lib/core/{methods → client/methods}/chats/addLiveComment.js +0 -0
  218. /package/lib/core/{methods → client/methods}/chats/clickMessageUrl.d.ts +0 -0
  219. /package/lib/core/{methods → client/methods}/chats/clickMessageUrl.js +0 -0
  220. /package/lib/core/{methods → client/methods}/chats/createJoinLink.d.ts +0 -0
  221. /package/lib/core/{methods → client/methods}/chats/createJoinLink.js +0 -0
  222. /package/lib/core/{methods → client/methods}/chats/deleteAvatar.d.ts +0 -0
  223. /package/lib/core/{methods → client/methods}/chats/deleteAvatar.js +0 -0
  224. /package/lib/core/{methods → client/methods}/chats/deleteChatHistory.d.ts +0 -0
  225. /package/lib/core/{methods → client/methods}/chats/deleteChatHistory.js +0 -0
  226. /package/lib/core/{methods → client/methods}/chats/editJoinLink.d.ts +0 -0
  227. /package/lib/core/{methods → client/methods}/chats/editJoinLink.js +0 -0
  228. /package/lib/core/{methods → client/methods}/chats/getAbsObjects.d.ts +0 -0
  229. /package/lib/core/{methods → client/methods}/chats/getAbsObjects.js +0 -0
  230. /package/lib/core/{methods → client/methods}/chats/getAvatars.d.ts +0 -0
  231. /package/lib/core/{methods → client/methods}/chats/getAvatars.js +0 -0
  232. /package/lib/core/{methods → client/methods}/chats/getChatReaction.d.ts +0 -0
  233. /package/lib/core/{methods → client/methods}/chats/getChatReaction.js +0 -0
  234. /package/lib/core/{methods → client/methods}/chats/getChats.d.ts +0 -0
  235. /package/lib/core/{methods → client/methods}/chats/getChats.js +0 -0
  236. /package/lib/core/{methods → client/methods}/chats/getChatsUpdates.d.ts +0 -0
  237. /package/lib/core/{methods → client/methods}/chats/getChatsUpdates.js +0 -0
  238. /package/lib/core/{methods → client/methods}/chats/getJoinLinks.d.ts +0 -0
  239. /package/lib/core/{methods → client/methods}/chats/getJoinLinks.js +0 -0
  240. /package/lib/core/{methods → client/methods}/chats/getJoinRequests.d.ts +0 -0
  241. /package/lib/core/{methods → client/methods}/chats/getJoinRequests.js +0 -0
  242. /package/lib/core/{methods → client/methods}/chats/getLinkFromAppUrl.d.ts +0 -0
  243. /package/lib/core/{methods → client/methods}/chats/getLinkFromAppUrl.js +0 -0
  244. /package/lib/core/{methods → client/methods}/chats/getLiveComments.d.ts +0 -0
  245. /package/lib/core/{methods → client/methods}/chats/getLiveComments.js +0 -0
  246. /package/lib/core/{methods → client/methods}/chats/getLivePlayUrl.d.ts +0 -0
  247. /package/lib/core/{methods → client/methods}/chats/getLivePlayUrl.js +0 -0
  248. /package/lib/core/{methods → client/methods}/chats/getLiveStatus.d.ts +0 -0
  249. /package/lib/core/{methods → client/methods}/chats/getLiveStatus.js +0 -0
  250. /package/lib/core/{methods → client/methods}/chats/getObjectInfoByUsername.d.ts +0 -0
  251. /package/lib/core/{methods → client/methods}/chats/getObjectInfoByUsername.js +0 -0
  252. /package/lib/core/{methods → client/methods}/chats/getTopChatUsers.d.ts +0 -0
  253. /package/lib/core/{methods → client/methods}/chats/getTopChatUsers.js +0 -0
  254. /package/lib/core/{methods → client/methods}/chats/index.d.ts +0 -0
  255. /package/lib/core/{methods → client/methods}/chats/index.js +0 -0
  256. /package/lib/core/{methods → client/methods}/chats/removeFromTopChatUsers.d.ts +0 -0
  257. /package/lib/core/{methods → client/methods}/chats/removeFromTopChatUsers.js +0 -0
  258. /package/lib/core/{methods → client/methods}/chats/removeJoinLink.d.ts +0 -0
  259. /package/lib/core/{methods → client/methods}/chats/removeJoinLink.js +0 -0
  260. /package/lib/core/{methods → client/methods}/chats/searchChatMessages.d.ts +0 -0
  261. /package/lib/core/{methods → client/methods}/chats/searchChatMessages.js +0 -0
  262. /package/lib/core/{methods → client/methods}/chats/searchGlobalMessages.d.ts +0 -0
  263. /package/lib/core/{methods → client/methods}/chats/searchGlobalMessages.js +0 -0
  264. /package/lib/core/{methods → client/methods}/chats/seenChats.d.ts +0 -0
  265. /package/lib/core/{methods → client/methods}/chats/seenChats.js +0 -0
  266. /package/lib/core/{methods → client/methods}/chats/sendChatActivity.d.ts +0 -0
  267. /package/lib/core/{methods → client/methods}/chats/sendChatActivity.js +0 -0
  268. /package/lib/core/{methods → client/methods}/chats/sendLive.d.ts +0 -0
  269. /package/lib/core/{methods → client/methods}/chats/sendLive.js +0 -0
  270. /package/lib/core/{methods → client/methods}/chats/setActionChat.d.ts +0 -0
  271. /package/lib/core/{methods → client/methods}/chats/setActionChat.js +0 -0
  272. /package/lib/core/{methods → client/methods}/chats/uploadAvatar.d.ts +0 -0
  273. /package/lib/core/{methods → client/methods}/chats/uploadAvatar.js +0 -0
  274. /package/lib/core/{methods → client/methods}/contacts/addAddressBook.d.ts +0 -0
  275. /package/lib/core/{methods → client/methods}/contacts/addAddressBook.js +0 -0
  276. /package/lib/core/{methods → client/methods}/contacts/deleteContact.d.ts +0 -0
  277. /package/lib/core/{methods → client/methods}/contacts/deleteContact.js +0 -0
  278. /package/lib/core/{methods → client/methods}/contacts/getContacts.d.ts +0 -0
  279. /package/lib/core/{methods → client/methods}/contacts/getContacts.js +0 -0
  280. /package/lib/core/{methods → client/methods}/contacts/getContactsLastOnline.d.ts +0 -0
  281. /package/lib/core/{methods → client/methods}/contacts/getContactsLastOnline.js +0 -0
  282. /package/lib/core/{methods → client/methods}/contacts/getContactsUpdates.d.ts +0 -0
  283. /package/lib/core/{methods → client/methods}/contacts/getContactsUpdates.js +0 -0
  284. /package/lib/core/{methods → client/methods}/contacts/index.d.ts +0 -0
  285. /package/lib/core/{methods → client/methods}/contacts/index.js +0 -0
  286. /package/lib/core/{methods → client/methods}/contacts/resetContacts.d.ts +0 -0
  287. /package/lib/core/{methods → client/methods}/contacts/resetContacts.js +0 -0
  288. /package/lib/core/{methods → client/methods}/extras/banMember.d.ts +0 -0
  289. /package/lib/core/{methods → client/methods}/extras/banMember.js +0 -0
  290. /package/lib/core/{methods → client/methods}/extras/deleteMessagebyCount.d.ts +0 -0
  291. /package/lib/core/{methods → client/methods}/extras/deleteMessagebyCount.js +0 -0
  292. /package/lib/core/{methods → client/methods}/extras/getInfo.d.ts +0 -0
  293. /package/lib/core/{methods → client/methods}/extras/getInfo.js +0 -0
  294. /package/lib/core/{methods → client/methods}/extras/getObjectByUsername.d.ts +0 -0
  295. /package/lib/core/{methods → client/methods}/extras/getObjectByUsername.js +0 -0
  296. /package/lib/core/{methods → client/methods}/extras/getProfileLinkItems.d.ts +0 -0
  297. /package/lib/core/{methods → client/methods}/extras/getProfileLinkItems.js +0 -0
  298. /package/lib/core/{methods → client/methods}/extras/getRelatedObjects.d.ts +0 -0
  299. /package/lib/core/{methods → client/methods}/extras/getRelatedObjects.js +0 -0
  300. /package/lib/core/{methods → client/methods}/extras/getTranscription.d.ts +0 -0
  301. /package/lib/core/{methods → client/methods}/extras/getTranscription.js +0 -0
  302. /package/lib/core/{methods → client/methods}/extras/index.d.ts +0 -0
  303. /package/lib/core/{methods → client/methods}/extras/index.js +0 -0
  304. /package/lib/core/{methods → client/methods}/extras/join.d.ts +0 -0
  305. /package/lib/core/{methods → client/methods}/extras/join.js +0 -0
  306. /package/lib/core/{methods → client/methods}/extras/joinVoiceChat.d.ts +0 -0
  307. /package/lib/core/{methods → client/methods}/extras/joinVoiceChat.js +0 -0
  308. /package/lib/core/{methods → client/methods}/extras/leaveChat.d.ts +0 -0
  309. /package/lib/core/{methods → client/methods}/extras/leaveChat.js +0 -0
  310. /package/lib/core/{methods → client/methods}/extras/onEditMessages.js +0 -0
  311. /package/lib/core/{methods → client/methods}/extras/reportObject.d.ts +0 -0
  312. /package/lib/core/{methods → client/methods}/extras/reportObject.js +0 -0
  313. /package/lib/core/{methods → client/methods}/extras/searchGlobalObjects.d.ts +0 -0
  314. /package/lib/core/{methods → client/methods}/extras/searchGlobalObjects.js +0 -0
  315. /package/lib/core/{methods → client/methods}/extras/sendVoiceChatActivity.d.ts +0 -0
  316. /package/lib/core/{methods → client/methods}/extras/sendVoiceChatActivity.js +0 -0
  317. /package/lib/core/{methods → client/methods}/extras/setVoiceChatState.d.ts +0 -0
  318. /package/lib/core/{methods → client/methods}/extras/setVoiceChatState.js +0 -0
  319. /package/lib/core/{methods → client/methods}/extras/transcribeVoice.d.ts +0 -0
  320. /package/lib/core/{methods → client/methods}/extras/transcribeVoice.js +0 -0
  321. /package/lib/core/{methods → client/methods}/extras/userIsAdmin.d.ts +0 -0
  322. /package/lib/core/{methods → client/methods}/extras/userIsAdmin.js +0 -0
  323. /package/lib/core/{methods → client/methods}/gif/addToMyGifSet.d.ts +0 -0
  324. /package/lib/core/{methods → client/methods}/gif/addToMyGifSet.js +0 -0
  325. /package/lib/core/{methods → client/methods}/gif/getMyGifSet.d.ts +0 -0
  326. /package/lib/core/{methods → client/methods}/gif/getMyGifSet.js +0 -0
  327. /package/lib/core/{methods → client/methods}/gif/index.d.ts +0 -0
  328. /package/lib/core/{methods → client/methods}/gif/index.js +0 -0
  329. /package/lib/core/{methods → client/methods}/gif/removeFromMyGifSet.d.ts +0 -0
  330. /package/lib/core/{methods → client/methods}/gif/removeFromMyGifSet.js +0 -0
  331. /package/lib/core/{methods → client/methods}/groups/addGroup.d.ts +0 -0
  332. /package/lib/core/{methods → client/methods}/groups/addGroup.js +0 -0
  333. /package/lib/core/{methods → client/methods}/groups/addGroupMembers.d.ts +0 -0
  334. /package/lib/core/{methods → client/methods}/groups/addGroupMembers.js +0 -0
  335. /package/lib/core/{methods → client/methods}/groups/banGroupMember.d.ts +0 -0
  336. /package/lib/core/{methods → client/methods}/groups/banGroupMember.js +0 -0
  337. /package/lib/core/{methods → client/methods}/groups/createGroupVoiceChat.d.ts +0 -0
  338. /package/lib/core/{methods → client/methods}/groups/createGroupVoiceChat.js +0 -0
  339. /package/lib/core/{methods → client/methods}/groups/deleteNoAccessGroupChat.d.ts +0 -0
  340. /package/lib/core/{methods → client/methods}/groups/deleteNoAccessGroupChat.js +0 -0
  341. /package/lib/core/{methods → client/methods}/groups/discardGroupVoiceChat.d.ts +0 -0
  342. /package/lib/core/{methods → client/methods}/groups/discardGroupVoiceChat.js +0 -0
  343. /package/lib/core/{methods → client/methods}/groups/editGroupInfo.d.ts +0 -0
  344. /package/lib/core/{methods → client/methods}/groups/editGroupInfo.js +0 -0
  345. /package/lib/core/{methods → client/methods}/groups/getBannedGroupMembers.d.ts +0 -0
  346. /package/lib/core/{methods → client/methods}/groups/getBannedGroupMembers.js +0 -0
  347. /package/lib/core/{methods → client/methods}/groups/getGroupAdminAccessList.d.ts +0 -0
  348. /package/lib/core/{methods → client/methods}/groups/getGroupAdminAccessList.js +0 -0
  349. /package/lib/core/{methods → client/methods}/groups/getGroupAdminMembers.d.ts +0 -0
  350. /package/lib/core/{methods → client/methods}/groups/getGroupAdminMembers.js +0 -0
  351. /package/lib/core/{methods → client/methods}/groups/getGroupAllMembers.d.ts +0 -0
  352. /package/lib/core/{methods → client/methods}/groups/getGroupAllMembers.js +0 -0
  353. /package/lib/core/{methods → client/methods}/groups/getGroupDefaultAccess.d.ts +0 -0
  354. /package/lib/core/{methods → client/methods}/groups/getGroupDefaultAccess.js +0 -0
  355. /package/lib/core/{methods → client/methods}/groups/getGroupInfo.d.ts +0 -0
  356. /package/lib/core/{methods → client/methods}/groups/getGroupInfo.js +0 -0
  357. /package/lib/core/{methods → client/methods}/groups/getGroupLink.d.ts +0 -0
  358. /package/lib/core/{methods → client/methods}/groups/getGroupLink.js +0 -0
  359. /package/lib/core/{methods → client/methods}/groups/getGroupMentionList.d.ts +0 -0
  360. /package/lib/core/{methods → client/methods}/groups/getGroupMentionList.js +0 -0
  361. /package/lib/core/{methods → client/methods}/groups/getGroupOnlineCount.d.ts +0 -0
  362. /package/lib/core/{methods → client/methods}/groups/getGroupOnlineCount.js +0 -0
  363. /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatParticipants.d.ts +0 -0
  364. /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatParticipants.js +0 -0
  365. /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatUpdates.d.ts +0 -0
  366. /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatUpdates.js +0 -0
  367. /package/lib/core/{methods → client/methods}/groups/groupPreviewByJoinLink.d.ts +0 -0
  368. /package/lib/core/{methods → client/methods}/groups/groupPreviewByJoinLink.js +0 -0
  369. /package/lib/core/{methods → client/methods}/groups/index.d.ts +0 -0
  370. /package/lib/core/{methods → client/methods}/groups/index.js +0 -0
  371. /package/lib/core/{methods → client/methods}/groups/joinGroup.d.ts +0 -0
  372. /package/lib/core/{methods → client/methods}/groups/joinGroupVoiceChat.d.ts +0 -0
  373. /package/lib/core/{methods → client/methods}/groups/joinGroupVoiceChat.js +0 -0
  374. /package/lib/core/{methods → client/methods}/groups/leaveGroup.d.ts +0 -0
  375. /package/lib/core/{methods → client/methods}/groups/leaveGroup.js +0 -0
  376. /package/lib/core/{methods → client/methods}/groups/leaveGroupVoiceChat.d.ts +0 -0
  377. /package/lib/core/{methods → client/methods}/groups/leaveGroupVoiceChat.js +0 -0
  378. /package/lib/core/{methods → client/methods}/groups/removeGroup.d.ts +0 -0
  379. /package/lib/core/{methods → client/methods}/groups/removeGroup.js +0 -0
  380. /package/lib/core/{methods → client/methods}/groups/seenGroupMessages.d.ts +0 -0
  381. /package/lib/core/{methods → client/methods}/groups/seenGroupMessages.js +0 -0
  382. /package/lib/core/{methods → client/methods}/groups/setGroupAdmin.d.ts +0 -0
  383. /package/lib/core/{methods → client/methods}/groups/setGroupAdmin.js +0 -0
  384. /package/lib/core/{methods → client/methods}/groups/setGroupDefaultAccess.d.ts +0 -0
  385. /package/lib/core/{methods → client/methods}/groups/setGroupDefaultAccess.js +0 -0
  386. /package/lib/core/{methods → client/methods}/groups/setGroupLink.d.ts +0 -0
  387. /package/lib/core/{methods → client/methods}/groups/setGroupLink.js +0 -0
  388. /package/lib/core/{methods → client/methods}/groups/setGroupVoiceChatSetting.d.ts +0 -0
  389. /package/lib/core/{methods → client/methods}/groups/setGroupVoiceChatSetting.js +0 -0
  390. /package/lib/core/{methods → client/methods}/messages/actionOnMessageReaction.d.ts +0 -0
  391. /package/lib/core/{methods → client/methods}/messages/actionOnMessageReaction.js +0 -0
  392. /package/lib/core/{methods → client/methods}/messages/createPoll.d.ts +0 -0
  393. /package/lib/core/{methods → client/methods}/messages/createPoll.js +0 -0
  394. /package/lib/core/{methods → client/methods}/messages/deleteMessages.d.ts +0 -0
  395. /package/lib/core/{methods → client/methods}/messages/deleteMessages.js +0 -0
  396. /package/lib/core/{methods → client/methods}/messages/editMessage.d.ts +0 -0
  397. /package/lib/core/{methods → client/methods}/messages/editMessage.js +0 -0
  398. /package/lib/core/{methods → client/methods}/messages/forwardMessages.d.ts +0 -0
  399. /package/lib/core/{methods → client/methods}/messages/forwardMessages.js +0 -0
  400. /package/lib/core/{methods → client/methods}/messages/getMessageShareUrl.d.ts +0 -0
  401. /package/lib/core/{methods → client/methods}/messages/getMessageShareUrl.js +0 -0
  402. /package/lib/core/{methods → client/methods}/messages/getMessages.d.ts +0 -0
  403. /package/lib/core/{methods → client/methods}/messages/getMessages.js +0 -0
  404. /package/lib/core/{methods → client/methods}/messages/getMessagesByID.d.ts +0 -0
  405. /package/lib/core/{methods → client/methods}/messages/getMessagesByID.js +0 -0
  406. /package/lib/core/{methods → client/methods}/messages/getMessagesInterval.d.ts +0 -0
  407. /package/lib/core/{methods → client/methods}/messages/getMessagesInterval.js +0 -0
  408. /package/lib/core/{methods → client/methods}/messages/getMessagesUpdates.d.ts +0 -0
  409. /package/lib/core/{methods → client/methods}/messages/getMessagesUpdates.js +0 -0
  410. /package/lib/core/{methods → client/methods}/messages/getPollOptionVoters.d.ts +0 -0
  411. /package/lib/core/{methods → client/methods}/messages/getPollOptionVoters.js +0 -0
  412. /package/lib/core/{methods → client/methods}/messages/getPollStatus.d.ts +0 -0
  413. /package/lib/core/{methods → client/methods}/messages/getPollStatus.js +0 -0
  414. /package/lib/core/{methods → client/methods}/messages/index.d.ts +0 -0
  415. /package/lib/core/{methods → client/methods}/messages/index.js +0 -0
  416. /package/lib/core/{methods → client/methods}/messages/sendDocument.d.ts +0 -0
  417. /package/lib/core/{methods → client/methods}/messages/sendDocument.js +0 -0
  418. /package/lib/core/{methods → client/methods}/messages/sendFileInline.d.ts +0 -0
  419. /package/lib/core/{methods → client/methods}/messages/sendFileInline.js +0 -0
  420. /package/lib/core/{methods → client/methods}/messages/sendGif.d.ts +0 -0
  421. /package/lib/core/{methods → client/methods}/messages/sendGif.js +0 -0
  422. /package/lib/core/{methods → client/methods}/messages/sendMessage.d.ts +0 -0
  423. /package/lib/core/{methods → client/methods}/messages/sendMessage.js +0 -0
  424. /package/lib/core/{methods → client/methods}/messages/sendMusic.d.ts +0 -0
  425. /package/lib/core/{methods → client/methods}/messages/sendMusic.js +0 -0
  426. /package/lib/core/{methods → client/methods}/messages/sendPhoto.d.ts +0 -0
  427. /package/lib/core/{methods → client/methods}/messages/sendPhoto.js +0 -0
  428. /package/lib/core/{methods → client/methods}/messages/sendSticker.d.ts +0 -0
  429. /package/lib/core/{methods → client/methods}/messages/sendSticker.js +0 -0
  430. /package/lib/core/{methods → client/methods}/messages/sendText.d.ts +0 -0
  431. /package/lib/core/{methods → client/methods}/messages/sendText.js +0 -0
  432. /package/lib/core/{methods → client/methods}/messages/sendVideo.d.ts +0 -0
  433. /package/lib/core/{methods → client/methods}/messages/sendVideo.js +0 -0
  434. /package/lib/core/{methods → client/methods}/messages/sendVideoMessage.d.ts +0 -0
  435. /package/lib/core/{methods → client/methods}/messages/sendVideoMessage.js +0 -0
  436. /package/lib/core/{methods → client/methods}/messages/sendVoice.d.ts +0 -0
  437. /package/lib/core/{methods → client/methods}/messages/sendVoice.js +0 -0
  438. /package/lib/core/{methods → client/methods}/messages/setPinMessage.d.ts +0 -0
  439. /package/lib/core/{methods → client/methods}/messages/setPinMessage.js +0 -0
  440. /package/lib/core/{methods → client/methods}/messages/votePoll.d.ts +0 -0
  441. /package/lib/core/{methods → client/methods}/messages/votePoll.js +0 -0
  442. /package/lib/core/{methods → client/methods}/settings/changePassword.d.ts +0 -0
  443. /package/lib/core/{methods → client/methods}/settings/changePassword.js +0 -0
  444. /package/lib/core/{methods → client/methods}/settings/checkTwoStepPasscode.d.ts +0 -0
  445. /package/lib/core/{methods → client/methods}/settings/checkTwoStepPasscode.js +0 -0
  446. /package/lib/core/{methods → client/methods}/settings/deleteFolder.d.ts +0 -0
  447. /package/lib/core/{methods → client/methods}/settings/deleteFolder.js +0 -0
  448. /package/lib/core/{methods → client/methods}/settings/getBlockedUsers.d.ts +0 -0
  449. /package/lib/core/{methods → client/methods}/settings/getBlockedUsers.js +0 -0
  450. /package/lib/core/{methods → client/methods}/settings/getFolders.d.ts +0 -0
  451. /package/lib/core/{methods → client/methods}/settings/getFolders.js +0 -0
  452. /package/lib/core/{methods → client/methods}/settings/getMySessions.d.ts +0 -0
  453. /package/lib/core/{methods → client/methods}/settings/getMySessions.js +0 -0
  454. /package/lib/core/{methods → client/methods}/settings/getPrivacySetting.d.ts +0 -0
  455. /package/lib/core/{methods → client/methods}/settings/getPrivacySetting.js +0 -0
  456. /package/lib/core/{methods → client/methods}/settings/getSuggestedFolders.d.ts +0 -0
  457. /package/lib/core/{methods → client/methods}/settings/getSuggestedFolders.js +0 -0
  458. /package/lib/core/{methods → client/methods}/settings/getTwoPasscodeStatus.d.ts +0 -0
  459. /package/lib/core/{methods → client/methods}/settings/getTwoPasscodeStatus.js +0 -0
  460. /package/lib/core/{methods → client/methods}/settings/index.d.ts +0 -0
  461. /package/lib/core/{methods → client/methods}/settings/index.js +0 -0
  462. /package/lib/core/{methods → client/methods}/settings/requestRecoveryEmail.d.ts +0 -0
  463. /package/lib/core/{methods → client/methods}/settings/requestRecoveryEmail.js +0 -0
  464. /package/lib/core/{methods → client/methods}/settings/setSetting.d.ts +0 -0
  465. /package/lib/core/{methods → client/methods}/settings/setSetting.js +0 -0
  466. /package/lib/core/{methods → client/methods}/settings/setupTwoStepVerification.d.ts +0 -0
  467. /package/lib/core/{methods → client/methods}/settings/setupTwoStepVerification.js +0 -0
  468. /package/lib/core/{methods → client/methods}/settings/terminateOtherSessions.d.ts +0 -0
  469. /package/lib/core/{methods → client/methods}/settings/terminateOtherSessions.js +0 -0
  470. /package/lib/core/{methods → client/methods}/settings/terminateSession.d.ts +0 -0
  471. /package/lib/core/{methods → client/methods}/settings/terminateSession.js +0 -0
  472. /package/lib/core/{methods → client/methods}/settings/turnOffTwoStep.d.ts +0 -0
  473. /package/lib/core/{methods → client/methods}/settings/turnOffTwoStep.js +0 -0
  474. /package/lib/core/{methods → client/methods}/settings/updateProfile.d.ts +0 -0
  475. /package/lib/core/{methods → client/methods}/settings/updateProfile.js +0 -0
  476. /package/lib/core/{methods → client/methods}/settings/updateUsername.d.ts +0 -0
  477. /package/lib/core/{methods → client/methods}/settings/updateUsername.js +0 -0
  478. /package/lib/core/{methods → client/methods}/settings/verifyRecoveryEmail.d.ts +0 -0
  479. /package/lib/core/{methods → client/methods}/settings/verifyRecoveryEmail.js +0 -0
  480. /package/lib/core/{methods → client/methods}/stickers/actionOnStickerSet.d.ts +0 -0
  481. /package/lib/core/{methods → client/methods}/stickers/actionOnStickerSet.js +0 -0
  482. /package/lib/core/{methods → client/methods}/stickers/getMyStickerSets.d.ts +0 -0
  483. /package/lib/core/{methods → client/methods}/stickers/getMyStickerSets.js +0 -0
  484. /package/lib/core/{methods → client/methods}/stickers/getStickerSetByID.d.ts +0 -0
  485. /package/lib/core/{methods → client/methods}/stickers/getStickerSetByID.js +0 -0
  486. /package/lib/core/{methods → client/methods}/stickers/getStickersByEmoji.d.ts +0 -0
  487. /package/lib/core/{methods → client/methods}/stickers/getStickersByEmoji.js +0 -0
  488. /package/lib/core/{methods → client/methods}/stickers/getStickersBySetIds.d.ts +0 -0
  489. /package/lib/core/{methods → client/methods}/stickers/getStickersBySetIds.js +0 -0
  490. /package/lib/core/{methods → client/methods}/stickers/getTrendStickerSets.d.ts +0 -0
  491. /package/lib/core/{methods → client/methods}/stickers/getTrendStickerSets.js +0 -0
  492. /package/lib/core/{methods → client/methods}/stickers/index.d.ts +0 -0
  493. /package/lib/core/{methods → client/methods}/stickers/index.js +0 -0
  494. /package/lib/core/{methods → client/methods}/stickers/searchStickers.d.ts +0 -0
  495. /package/lib/core/{methods → client/methods}/stickers/searchStickers.js +0 -0
  496. /package/lib/core/{methods → client/methods}/users/checkUserUsername.d.ts +0 -0
  497. /package/lib/core/{methods → client/methods}/users/checkUserUsername.js +0 -0
  498. /package/lib/core/{methods → client/methods}/users/deleteUserChat.d.ts +0 -0
  499. /package/lib/core/{methods → client/methods}/users/deleteUserChat.js +0 -0
  500. /package/lib/core/{methods → client/methods}/users/getMe.d.ts +0 -0
  501. /package/lib/core/{methods → client/methods}/users/getMe.js +0 -0
  502. /package/lib/core/{methods → client/methods}/users/getUserInfo.d.ts +0 -0
  503. /package/lib/core/{methods → client/methods}/users/getUserInfo.js +0 -0
  504. /package/lib/core/{methods → client/methods}/users/index.d.ts +0 -0
  505. /package/lib/core/{methods → client/methods}/users/index.js +0 -0
  506. /package/lib/core/{methods → client/methods}/users/setBlockUser.d.ts +0 -0
  507. /package/lib/core/{methods → client/methods}/users/setBlockUser.js +0 -0
  508. /package/lib/core/{methods → client/methods}/utilities/requestSendFile.d.ts +0 -0
  509. /package/lib/core/{methods → client/methods}/utilities/requestSendFile.js +0 -0
  510. /package/lib/core/{methods → client/methods}/utilities/run.d.ts +0 -0
  511. /package/lib/core/{methods → client/methods}/utilities/run.js +0 -0
  512. /package/lib/core/{methods → client/methods}/utilities/start.d.ts +0 -0
  513. /package/lib/core/{methods → client/methods}/utilities/thumbnail.d.ts +0 -0
  514. /package/lib/core/{methods → client/methods}/utilities/thumbnail.js +0 -0
  515. /package/lib/core/{methods → client/methods}/utilities/usePlugin.js +0 -0
  516. /package/lib/core/{parser.d.ts → client/parser.d.ts} +0 -0
  517. /package/lib/core/{parser.js → client/parser.js} +0 -0
  518. /package/lib/{types/decorators.type.js → core/client/types/client.type.js} +0 -0
  519. /package/lib/{types → core/client/types}/decorators.type.d.ts +0 -0
  520. /package/lib/{types/network.type.js → core/client/types/decorators.type.js} +0 -0
  521. /package/lib/{types → core/client/types}/network.type.d.ts +0 -0
  522. /package/lib/{types/session.type.js → core/client/types/network.type.js} +0 -0
  523. /package/lib/{core → utils}/utils.d.ts +0 -0
  524. /package/lib/{core → utils}/utils.js +0 -0
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getDcs = getDcs;
7
+ exports.sendRequest = sendRequest;
8
+ exports.sendPayload = sendPayload;
9
+ const undici_1 = require("undici");
10
+ const crypto_1 = __importDefault(require("../crypto"));
11
+ /**
12
+ * Retrieves API and WSS server URLs
13
+ */
14
+ async function getDcs(network) {
15
+ const url = 'https://getdcmess.iranlms.ir/';
16
+ const RETRY_DELAY = 3000;
17
+ while (true) {
18
+ try {
19
+ const res = await (0, undici_1.request)(url, {
20
+ method: 'GET',
21
+ dispatcher: network.agent,
22
+ });
23
+ if (res.statusCode === 200) {
24
+ const body = (await res.body.json());
25
+ if (body?.data) {
26
+ const dcs = body.data;
27
+ network.apiUrl = `${dcs.API[dcs.default_api]}/`;
28
+ network.wssUrl = dcs.socket[dcs.default_socket];
29
+ return true;
30
+ }
31
+ }
32
+ console.warn('[getDcs] Unexpected status or data format:', res.statusCode);
33
+ }
34
+ catch (error) {
35
+ console.error('[getDcs] Error:', error);
36
+ }
37
+ await network.delay(RETRY_DELAY);
38
+ }
39
+ }
40
+ /**
41
+ * Sends a POST request with retry logic and enhanced error reporting
42
+ */
43
+ async function sendRequest(network, url, data) {
44
+ const MAX_ATTEMPTS = 3;
45
+ for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
46
+ try {
47
+ const res = await (0, undici_1.request)(url, {
48
+ method: 'POST',
49
+ headers: {
50
+ 'content-type': 'application/json',
51
+ ...network.headers,
52
+ },
53
+ body: JSON.stringify(data),
54
+ dispatcher: network.agent,
55
+ });
56
+ if (res.statusCode === 200) {
57
+ const responseData = await res.body.json();
58
+ return responseData;
59
+ }
60
+ else {
61
+ console.warn(`[request] Attempt ${attempt}: Unexpected status ${res.statusCode}`);
62
+ }
63
+ }
64
+ catch (error) {
65
+ console.error(`[request] Attempt ${attempt} failed:`, error);
66
+ }
67
+ await network.delay(1000);
68
+ }
69
+ throw new Error(`[request] Failed after ${MAX_ATTEMPTS} attempts: ${url}`);
70
+ }
71
+ async function sendPayload(network, datas) {
72
+ await network.getDcs();
73
+ while (!network.apiUrl) {
74
+ await network.delay(1000);
75
+ }
76
+ const { auth, decode_auth, key, privateKey } = network.client;
77
+ if (!key)
78
+ return;
79
+ const credentialsKey = datas.tmp_session ? 'tmp_session' : 'auth';
80
+ const credentialsValue = datas.tmp_session ? auth : decode_auth;
81
+ const dataPayload = JSON.stringify({
82
+ client: network.defaultPlatform,
83
+ method: datas.method,
84
+ input: datas.input,
85
+ });
86
+ const payload = {
87
+ api_version: '6',
88
+ data_enc: crypto_1.default.encrypt(dataPayload, key),
89
+ [credentialsKey]: credentialsValue,
90
+ };
91
+ if (!datas.tmp_session && privateKey) {
92
+ payload.sign = crypto_1.default.sign(payload.data_enc, privateKey);
93
+ }
94
+ return network.request(network.apiUrl, payload);
95
+ }
@@ -0,0 +1,3 @@
1
+ import Network from '.';
2
+ export declare function uploadFile(network: Network, filePath: string, chunkSize?: number): Promise<any>;
3
+ export declare function download(network: Network, dc_id: number, file_id: number, access_hash: string, size: number, chunk?: number): Promise<Buffer>;
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.uploadFile = uploadFile;
7
+ exports.download = download;
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const undici_1 = require("undici");
11
+ async function uploadFile(network, filePath, chunkSize = 1048576) {
12
+ if (!fs_1.default.existsSync(filePath))
13
+ throw new Error('File not found in the given path');
14
+ const stat = await fs_1.default.promises.stat(filePath);
15
+ const fileSize = stat.size;
16
+ const fileName = path_1.default.basename(filePath);
17
+ const mime = filePath.split('.').pop();
18
+ let result = await network.client.requestSendFile(fileName, fileSize, mime);
19
+ let id = result.id;
20
+ let dc_id = result.dc_id;
21
+ let upload_url = result.upload_url;
22
+ let access_hash_send = result.access_hash_send;
23
+ let totalParts = Math.ceil(fileSize / chunkSize);
24
+ const stream = fs_1.default.createReadStream(filePath, { highWaterMark: chunkSize });
25
+ let index = 0;
26
+ for await (const chunk of stream) {
27
+ try {
28
+ const res = await (0, undici_1.request)(upload_url, {
29
+ method: 'POST',
30
+ headers: {
31
+ auth: network.client.auth,
32
+ 'file-id': id,
33
+ 'total-part': totalParts.toString(),
34
+ 'part-number': (index + 1).toString(),
35
+ 'chunk-size': chunk.length.toString(),
36
+ 'access-hash-send': access_hash_send,
37
+ },
38
+ body: chunk,
39
+ dispatcher: network.agent,
40
+ });
41
+ const response = await res.body.json();
42
+ if (response.status === 'ERROR_TRY_AGAIN') {
43
+ console.log('Retrying upload...');
44
+ stream.close();
45
+ result = await network.client.requestSendFile(fileName, fileSize, mime);
46
+ id = result.id;
47
+ dc_id = result.dc_id;
48
+ upload_url = result.upload_url;
49
+ access_hash_send = result.access_hash_send;
50
+ index = 0;
51
+ return uploadFile(network, filePath, chunkSize);
52
+ }
53
+ index++;
54
+ if (response.status === 'OK' &&
55
+ response.status_det === 'OK' &&
56
+ response.data?.access_hash_rec) {
57
+ return {
58
+ mime,
59
+ size: fileSize,
60
+ dc_id,
61
+ file_id: id,
62
+ file_name: fileName,
63
+ access_hash_rec: response.data.access_hash_rec,
64
+ };
65
+ }
66
+ }
67
+ catch (error) {
68
+ console.error('Upload error:', error);
69
+ await new Promise((resolve) => setTimeout(resolve, 5000));
70
+ }
71
+ }
72
+ throw new Error('Upload failed completely.');
73
+ }
74
+ async function download(network, dc_id, file_id, access_hash, size, chunk = 131072) {
75
+ const headersBase = {
76
+ auth: network.client.auth,
77
+ 'access-hash-rec': access_hash,
78
+ 'file-id': String(file_id),
79
+ 'user-agent': network.userAgent,
80
+ };
81
+ const base_url = `https://messenger${dc_id}.iranlms.ir`;
82
+ const fetchChunk = async (start_index, last_index) => {
83
+ const headers = {
84
+ ...headersBase,
85
+ 'start-index': String(start_index),
86
+ 'last-index': String(last_index),
87
+ };
88
+ try {
89
+ const { body, statusCode } = await (0, undici_1.request)(`${base_url}/GetFile.ashx`, {
90
+ method: 'POST',
91
+ headers,
92
+ });
93
+ if (statusCode !== 200 || !body)
94
+ return Buffer.alloc(0);
95
+ const chunks = [];
96
+ for await (const chunk of body) {
97
+ chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
98
+ }
99
+ return Buffer.concat(chunks);
100
+ }
101
+ catch (err) {
102
+ console.error(`[fetchChunk] Failed at ${start_index}-${last_index}`, err);
103
+ return Buffer.alloc(0);
104
+ }
105
+ };
106
+ let result = Buffer.alloc(0);
107
+ let start_index = 0;
108
+ while (start_index < size) {
109
+ const last_index = Math.min(start_index + chunk, size) - 1;
110
+ const chunkData = await fetchChunk(start_index, last_index);
111
+ if (chunkData.length === 0)
112
+ break;
113
+ result = Buffer.concat([result, chunkData]);
114
+ start_index = last_index + 1;
115
+ }
116
+ return result;
117
+ }
@@ -0,0 +1,25 @@
1
+ import Client from '../client';
2
+ import { Agent, WebSocket as UndiciWebSocket } from 'undici';
3
+ import { delay } from './utils';
4
+ import { NetworkTypes } from '../types/index.type';
5
+ export default class Network {
6
+ client: Client;
7
+ headers: Record<string, string>;
8
+ defaultPlatform: NetworkTypes.Platform;
9
+ agent: Agent;
10
+ userAgent: string;
11
+ ws?: InstanceType<typeof UndiciWebSocket>;
12
+ apiUrl?: string;
13
+ wssUrl?: string;
14
+ heartbeatInterval?: NodeJS.Timeout;
15
+ inactivityTimeout?: NodeJS.Timeout;
16
+ reconnecting: boolean;
17
+ constructor(client: Client);
18
+ getDcs: () => Promise<boolean>;
19
+ request: (url: string, data: any) => Promise<unknown>;
20
+ send: (opts: any) => Promise<any>;
21
+ getUpdates: () => Promise<void>;
22
+ uploadFile: (filePath: string, chunkSize?: number) => Promise<any>;
23
+ download: (dc_id: number, file_id: number, access_hash: string, size: number, chunk?: number) => Promise<Buffer<ArrayBufferLike>>;
24
+ delay: typeof delay;
25
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const undici_1 = require("undici");
7
+ const utils_1 = require("./utils");
8
+ const api_1 = require("./api");
9
+ const websocket_1 = require("./websocket");
10
+ const user_agents_1 = __importDefault(require("user-agents"));
11
+ const file_1 = require("./file");
12
+ class Network {
13
+ constructor(client) {
14
+ this.client = client;
15
+ this.userAgent = new user_agents_1.default().toString();
16
+ this.reconnecting = false;
17
+ this.getDcs = () => (0, api_1.getDcs)(this);
18
+ this.request = (url, data) => (0, api_1.sendRequest)(this, url, data);
19
+ this.send = (opts) => (0, api_1.sendPayload)(this, opts);
20
+ this.getUpdates = async () => (0, websocket_1.setupWebSocket)(this);
21
+ this.uploadFile = (filePath, chunkSize) => (0, file_1.uploadFile)(this, filePath, chunkSize);
22
+ this.download = (dc_id, file_id, access_hash, size, chunk = 131072) => (0, file_1.download)(this, dc_id, file_id, access_hash, size, chunk);
23
+ this.delay = utils_1.delay;
24
+ this.defaultPlatform = (0, utils_1.resolvePlatform)(client.platform);
25
+ this.headers = (0, utils_1.buildHeaders)(client.platform);
26
+ this.agent = new undici_1.Agent({
27
+ connect: { rejectUnauthorized: false },
28
+ });
29
+ }
30
+ }
31
+ exports.default = Network;
@@ -0,0 +1,9 @@
1
+ export declare function delay(ms: number): Promise<unknown>;
2
+ export declare function resolvePlatform(platform: string): {
3
+ app_name: string;
4
+ app_version: string;
5
+ platform: string;
6
+ package: string;
7
+ lang_code: string;
8
+ };
9
+ export declare function buildHeaders(platform: string): Record<string, string>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.delay = delay;
7
+ exports.resolvePlatform = resolvePlatform;
8
+ exports.buildHeaders = buildHeaders;
9
+ const user_agents_1 = __importDefault(require("user-agents"));
10
+ function delay(ms) {
11
+ return new Promise((resolve) => setTimeout(resolve, ms));
12
+ }
13
+ function resolvePlatform(platform) {
14
+ const isAndroid = platform?.toLowerCase() === 'android';
15
+ return {
16
+ app_name: 'Main',
17
+ app_version: isAndroid ? '3.6.4' : '4.4.9',
18
+ platform: isAndroid ? 'Android' : 'Web',
19
+ package: isAndroid ? 'app.rbmain.a' : 'web.rubika.ir',
20
+ lang_code: 'fa',
21
+ };
22
+ }
23
+ function buildHeaders(platform) {
24
+ const headers = {
25
+ 'content-type': 'application/json',
26
+ connection: 'keep-alive',
27
+ 'user-agent': new user_agents_1.default().toString(),
28
+ };
29
+ if (platform.toLowerCase() !== 'android') {
30
+ headers.origin = 'https://web.rubika.ir';
31
+ headers.referer = 'https://web.rubika.ir/';
32
+ }
33
+ return headers;
34
+ }
@@ -0,0 +1,3 @@
1
+ import Network from '.';
2
+ export declare function setupWebSocket(network: Network): Promise<void>;
3
+ export declare function openSocket(network: Network): Promise<void>;
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.setupWebSocket = setupWebSocket;
7
+ exports.openSocket = openSocket;
8
+ const crypto_1 = __importDefault(require("../crypto"));
9
+ const undici_1 = require("undici");
10
+ const contextConstructors_1 = require("../contexts/contextConstructors");
11
+ const checkFilters_1 = require("../../../utils/checkFilters");
12
+ const TYPES = {
13
+ chat: 'chat_updates',
14
+ message: 'message_updates',
15
+ activities: 'show_activities',
16
+ notifications: 'show_notifications',
17
+ };
18
+ async function setupWebSocket(network) {
19
+ while (!network.wssUrl) {
20
+ await network.delay(1000);
21
+ }
22
+ network.ws = new undici_1.WebSocket(network.wssUrl);
23
+ network.ws.addEventListener('open', async () => await openSocket(network));
24
+ network.ws.addEventListener('message', async (event) => await getMessage(event.data, network));
25
+ network.ws.addEventListener('error', async () => {
26
+ if (!network.reconnecting) {
27
+ console.error('WebSocket error, reconnecting...');
28
+ network.reconnecting = true;
29
+ await resetConnection(network);
30
+ }
31
+ });
32
+ network.ws.addEventListener('close', async () => {
33
+ if (!network.reconnecting) {
34
+ console.warn('WebSocket closed, reconnecting...');
35
+ network.reconnecting = true;
36
+ await resetConnection(network);
37
+ }
38
+ });
39
+ }
40
+ async function openSocket(network) {
41
+ try {
42
+ console.log('Starting bot...');
43
+ if (network.ws && network.ws.readyState === undici_1.WebSocket.OPEN) {
44
+ const payload = JSON.stringify({
45
+ api_version: '5',
46
+ auth: network.client.auth,
47
+ data: '',
48
+ method: 'handShake',
49
+ });
50
+ network.ws.send(payload);
51
+ if (network.heartbeatInterval)
52
+ clearInterval(network.heartbeatInterval);
53
+ network.heartbeatInterval = setInterval(() => {
54
+ try {
55
+ if (network.ws?.readyState === undici_1.WebSocket.OPEN) {
56
+ network.ws.send(JSON.stringify({}));
57
+ }
58
+ }
59
+ catch (err) {
60
+ console.error('Error sending heartbeat', err);
61
+ }
62
+ }, 30000);
63
+ }
64
+ else {
65
+ console.warn('WebSocket is not open; cannot send handshake');
66
+ }
67
+ }
68
+ catch (err) {
69
+ console.error('Error during openSocket execution', err);
70
+ }
71
+ }
72
+ async function resetConnection(network) {
73
+ network.ws?.close();
74
+ network.ws = undefined;
75
+ setTimeout(async () => {
76
+ try {
77
+ await network.getUpdates();
78
+ }
79
+ catch (e) {
80
+ console.error('Failed to reconnect:', e);
81
+ }
82
+ finally {
83
+ network.reconnecting = false;
84
+ }
85
+ }, 5000);
86
+ }
87
+ function resetInactivityTimer(network) {
88
+ if (network.inactivityTimeout)
89
+ clearTimeout(network.inactivityTimeout);
90
+ network.inactivityTimeout = setTimeout(() => {
91
+ console.warn('No updates received for 10 minutes. Reconnecting WebSocket...');
92
+ void resetConnection(network).catch((err) => {
93
+ console.error('Error during inactivity reset:', err);
94
+ });
95
+ }, 10 * 60 * 1000);
96
+ }
97
+ async function getMessage(message, network) {
98
+ try {
99
+ const { data_enc } = JSON.parse(message);
100
+ if (!data_enc || !network.client.key)
101
+ return;
102
+ resetInactivityTimer(network);
103
+ const update = JSON.parse(crypto_1.default.decrypt(data_enc, network.client.key));
104
+ const tasks = [];
105
+ for (const ctxKey of Object.keys(TYPES)) {
106
+ const updateKey = TYPES[ctxKey];
107
+ const author_title = getAuthorTitle(update);
108
+ const items = update[updateKey];
109
+ if (!Array.isArray(items) || items.length === 0)
110
+ continue;
111
+ const handlers = network.client.handlers[ctxKey];
112
+ if (!handlers || handlers.length === 0)
113
+ continue;
114
+ tasks.push(handleCategory(ctxKey, handlers, items, network, author_title));
115
+ }
116
+ if (tasks.length === 1) {
117
+ await tasks[0];
118
+ }
119
+ else if (tasks.length > 1) {
120
+ await Promise.all(tasks);
121
+ }
122
+ }
123
+ catch (err) {
124
+ console.error('[getMessage] Failed to decrypt or process message:', err);
125
+ }
126
+ }
127
+ async function handleCategory(type, handlers, updates, network, author_title) {
128
+ const CtxClass = contextConstructors_1.ContextConstructors[type];
129
+ if (!CtxClass) {
130
+ console.warn(`[handleCategory] No constructor found for type: ${type}`);
131
+ return;
132
+ }
133
+ for (let update of updates) {
134
+ if (!update.message)
135
+ update.message = {};
136
+ update.client_guid = network.client.userGuid;
137
+ update.message.author_title = author_title;
138
+ const ctx = new CtxClass(network.client, update);
139
+ for (const { filters, handler, prefix } of handlers) {
140
+ // filters
141
+ const passed = await (0, checkFilters_1.checkFilters)(ctx, filters);
142
+ if (passed) {
143
+ // Prefix logic
144
+ if (type === 'message' && prefix) {
145
+ const text = ctx.message.text;
146
+ if (!text)
147
+ continue;
148
+ if (typeof prefix === 'string' && text !== prefix)
149
+ continue;
150
+ if (prefix instanceof RegExp && !prefix.test(text))
151
+ continue;
152
+ }
153
+ await handler(ctx);
154
+ }
155
+ }
156
+ }
157
+ }
158
+ // utils
159
+ const getAuthorTitle = (update) => {
160
+ const notification = update.show_notifications?.[0];
161
+ const chatUpdate = update.chat_updates?.[0];
162
+ if (notification) {
163
+ const objectGuid = notification?.message_data?.object_guid;
164
+ if (objectGuid?.startsWith('u0'))
165
+ return notification.title;
166
+ else if (objectGuid?.startsWith('g0'))
167
+ return notification.text?.split(':')[0];
168
+ }
169
+ else if (chatUpdate) {
170
+ return chatUpdate.chat?.last_message?.author_title || 'Unknown User';
171
+ }
172
+ else
173
+ return 'Unknown User';
174
+ };
@@ -1,8 +1,8 @@
1
- import Client from '../core/client';
2
- import Chat from './chat.type';
3
- import { Activities } from './index.type';
4
- import Message from './message.type';
5
- import Notifications from './notifications.type';
1
+ import Client from '../client';
2
+ import Chat from '../contexts/chat.type';
3
+ import Activities from '../contexts/activities.type';
4
+ import Message from '../contexts/message.type';
5
+ import Notifications from '../contexts/notifications.type';
6
6
  export interface Session {
7
7
  iv: string;
8
8
  enData: string;
@@ -17,17 +17,15 @@ export interface RubPlugin {
17
17
  version?: string;
18
18
  run: PluginFunction;
19
19
  }
20
- export type ContextMap = {
20
+ export interface ContextMap {
21
21
  chat: Chat;
22
22
  message: Message;
23
23
  activities: Activities;
24
24
  notifications: Notifications;
25
- };
26
- export type Middleware<C> = (ctx: C, next: () => Promise<void>) => Promise<void>;
27
- export type Handler<C> = (ctx: C) => Promise<void>;
28
- export type MiddlewareChain<C> = [...Middleware<C>[], Handler<C>];
29
- export interface Command<C> {
30
- pattern: string | RegExp;
31
- middlewares: MiddlewareChain<C>;
32
25
  }
26
+ export type Handler<T> = {
27
+ filters: Array<(ctx: T) => boolean | Promise<boolean>>;
28
+ handler: (ctx: T) => Promise<void>;
29
+ prefix?: string | RegExp;
30
+ };
33
31
  export {};
@@ -2,6 +2,4 @@ import * as ClientTypes from './client.type';
2
2
  import * as SessionTypes from './session.type';
3
3
  import * as NetworkTypes from './network.type';
4
4
  import * as DecoratorsTypes from './decorators.type';
5
- import Message from './message.type';
6
- import Activities from './activities.type';
7
- export { ClientTypes, SessionTypes, NetworkTypes, DecoratorsTypes, Message, Activities, };
5
+ export { ClientTypes, SessionTypes, NetworkTypes, DecoratorsTypes, };
@@ -32,11 +32,8 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Activities = exports.Message = exports.DecoratorsTypes = exports.NetworkTypes = exports.SessionTypes = exports.ClientTypes = void 0;
36
+ exports.DecoratorsTypes = exports.NetworkTypes = exports.SessionTypes = exports.ClientTypes = void 0;
40
37
  const ClientTypes = __importStar(require("./client.type"));
41
38
  exports.ClientTypes = ClientTypes;
42
39
  const SessionTypes = __importStar(require("./session.type"));
@@ -45,7 +42,3 @@ const NetworkTypes = __importStar(require("./network.type"));
45
42
  exports.NetworkTypes = NetworkTypes;
46
43
  const DecoratorsTypes = __importStar(require("./decorators.type"));
47
44
  exports.DecoratorsTypes = DecoratorsTypes;
48
- const message_type_1 = __importDefault(require("./message.type"));
49
- exports.Message = message_type_1.default;
50
- const activities_type_1 = __importDefault(require("./activities.type"));
51
- exports.Activities = activities_type_1.default;
@@ -0,0 +1,11 @@
1
+ export interface ClientSession {
2
+ phone: string;
3
+ auth: string;
4
+ guid: string;
5
+ agent: string;
6
+ private_key: string;
7
+ }
8
+ export interface BotSession {
9
+ token: string;
10
+ }
11
+ export type SessionData = ClientSession | BotSession;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export declare class BuilderException extends Error {
2
+ code: string;
3
+ data?: any | undefined;
4
+ constructor(message: string, code: string, data?: any | undefined);
5
+ }
6
+ export declare const MeaagesErrors: Record<string, string>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MeaagesErrors = exports.BuilderException = void 0;
4
+ class BuilderException extends Error {
5
+ constructor(message, code, data) {
6
+ super(message);
7
+ this.code = code;
8
+ this.data = data;
9
+ this.name = 'BuilderException';
10
+ }
11
+ }
12
+ exports.BuilderException = BuilderException;
13
+ exports.MeaagesErrors = {
14
+ INVALID_ACCESS: ' invalid access error:',
15
+ INVALID_INPUT: ' invalid input error:',
16
+ };
package/lib/index.d.ts CHANGED
@@ -1,9 +1,13 @@
1
- import Client from './core/client';
2
- import Filters from './core/filters';
3
- import Utils from './core/utils';
4
- import { Middleware, RubPlugin } from './types/client.type';
5
- import type MessageType from './types/message.type';
6
- import * as ContextTypes from './types/index.type';
1
+ import Client from './core/client/client';
2
+ import ClientFilters from './core/client/filters';
3
+ import ClientUtils from './utils/utils';
4
+ import Bot from './core/bot/bot';
5
+ import BotFilters from './core/bot/filters';
6
+ import { RubPlugin } from './core/client/types/client.type';
7
+ import type MessageType from './core/client/contexts/message.type';
8
+ import type ActivitiesType from './core/client/contexts/activities.type';
9
+ import type ChatType from './core/client/contexts/chat.type';
10
+ import type NotificationsType from './core/client/contexts/notifications.type';
7
11
  import * as Clients from './clients';
8
- export { Client, Filters, Utils, Middleware, MessageType, RubPlugin, ContextTypes, Clients, };
12
+ export { Client, ClientFilters, ClientUtils, Bot, BotFilters, RubPlugin, ChatType, MessageType, ActivitiesType, NotificationsType, Clients, };
9
13
  export default Client;
package/lib/index.js CHANGED
@@ -36,15 +36,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Clients = exports.ContextTypes = exports.Utils = exports.Filters = exports.Client = void 0;
40
- const client_1 = __importDefault(require("./core/client"));
39
+ exports.Clients = exports.BotFilters = exports.Bot = exports.ClientUtils = exports.ClientFilters = exports.Client = void 0;
40
+ // client
41
+ const client_1 = __importDefault(require("./core/client/client"));
41
42
  exports.Client = client_1.default;
42
- const filters_1 = __importDefault(require("./core/filters"));
43
- exports.Filters = filters_1.default;
44
- const utils_1 = __importDefault(require("./core/utils"));
45
- exports.Utils = utils_1.default;
46
- const ContextTypes = __importStar(require("./types/index.type"));
47
- exports.ContextTypes = ContextTypes;
43
+ const filters_1 = __importDefault(require("./core/client/filters"));
44
+ exports.ClientFilters = filters_1.default;
45
+ const utils_1 = __importDefault(require("./utils/utils"));
46
+ exports.ClientUtils = utils_1.default;
47
+ // robot
48
+ const bot_1 = __importDefault(require("./core/bot/bot"));
49
+ exports.Bot = bot_1.default;
50
+ const filters_2 = __importDefault(require("./core/bot/filters"));
51
+ exports.BotFilters = filters_2.default;
48
52
  const Clients = __importStar(require("./clients"));
49
53
  exports.Clients = Clients;
50
54
  exports.default = client_1.default;
@@ -0,0 +1 @@
1
+ export declare function checkFilters(ctx: any, filters: (Function | Function[])[]): Promise<boolean>;