rubjs 1.1.0 → 2.2.3

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 (449) hide show
  1. package/README.md +55 -0
  2. package/package.json +1 -1
  3. package/rubjs/client.d.ts +1 -0
  4. package/rubjs/client.js +1 -0
  5. package/rubjs/index.d.ts +5 -2
  6. package/rubjs/index.js +41 -1
  7. package/rubjs/methods/auth/index.d.ts +5 -4
  8. package/rubjs/methods/auth/index.js +9 -7
  9. package/rubjs/methods/auth/logout.d.ts +3 -0
  10. package/rubjs/methods/{messages/send_text.js → auth/logout.js} +3 -3
  11. package/rubjs/methods/auth/registerDevice.d.ts +3 -0
  12. package/rubjs/methods/auth/{register_device.js → registerDevice.js} +2 -2
  13. package/rubjs/methods/auth/sendCode.d.ts +3 -0
  14. package/rubjs/methods/auth/{send_code.js → sendCode.js} +2 -2
  15. package/rubjs/methods/auth/signIn.d.ts +3 -0
  16. package/rubjs/methods/auth/{sign_in.js → signIn.js} +2 -2
  17. package/rubjs/methods/channels/addChannel.d.ts +3 -0
  18. package/rubjs/methods/channels/addChannel.js +26 -0
  19. package/rubjs/methods/channels/addChannelMembers.d.ts +3 -0
  20. package/rubjs/methods/channels/addChannelMembers.js +22 -0
  21. package/rubjs/methods/channels/banChannelMember.d.ts +3 -0
  22. package/rubjs/methods/channels/banChannelMember.js +23 -0
  23. package/rubjs/methods/channels/cancelChangeObjectOwner.d.ts +3 -0
  24. package/rubjs/methods/channels/cancelChangeObjectOwner.js +17 -0
  25. package/rubjs/methods/channels/channelPreviewByJoinLink.d.ts +3 -0
  26. package/rubjs/methods/{messages/send_photo.js → channels/channelPreviewByJoinLink.js} +5 -3
  27. package/rubjs/methods/channels/checkChannelUsername.d.ts +3 -0
  28. package/rubjs/methods/channels/checkChannelUsername.js +19 -0
  29. package/rubjs/methods/channels/createChannelVoiceChat.d.ts +3 -0
  30. package/rubjs/methods/channels/createChannelVoiceChat.js +17 -0
  31. package/rubjs/methods/channels/discardChannelVoiceChat.d.ts +3 -0
  32. package/rubjs/methods/channels/discardChannelVoiceChat.js +20 -0
  33. package/rubjs/methods/channels/editChannelInfo.d.ts +4 -0
  34. package/rubjs/methods/channels/editChannelInfo.js +48 -0
  35. package/rubjs/methods/channels/getBannedChannelMembers.d.ts +3 -0
  36. package/rubjs/methods/channels/getBannedChannelMembers.js +20 -0
  37. package/rubjs/methods/channels/getChannelAdminAccessList.d.ts +3 -0
  38. package/rubjs/methods/channels/getChannelAdminAccessList.js +20 -0
  39. package/rubjs/methods/channels/getChannelAdminMembers.d.ts +3 -0
  40. package/rubjs/methods/channels/getChannelAdminMembers.js +20 -0
  41. package/rubjs/methods/channels/getChannelAllMembers.d.ts +3 -0
  42. package/rubjs/methods/channels/getChannelAllMembers.js +21 -0
  43. package/rubjs/methods/channels/getChannelInfo.d.ts +3 -0
  44. package/rubjs/methods/channels/getChannelInfo.js +17 -0
  45. package/rubjs/methods/channels/getChannelLink.d.ts +3 -0
  46. package/rubjs/methods/channels/getChannelLink.js +17 -0
  47. package/rubjs/methods/channels/getPendingObjectOwner.d.ts +3 -0
  48. package/rubjs/methods/channels/getPendingObjectOwner.js +17 -0
  49. package/rubjs/methods/channels/index.d.ts +26 -0
  50. package/rubjs/methods/channels/index.js +56 -0
  51. package/rubjs/methods/channels/joinChannelAction.d.ts +3 -0
  52. package/rubjs/methods/channels/joinChannelAction.js +19 -0
  53. package/rubjs/methods/channels/joinChannelByLink.d.ts +3 -0
  54. package/rubjs/methods/channels/joinChannelByLink.js +19 -0
  55. package/rubjs/methods/channels/leaveChannelVoiceChat.d.ts +3 -0
  56. package/rubjs/methods/channels/leaveChannelVoiceChat.js +20 -0
  57. package/rubjs/methods/channels/removeChannel.d.ts +3 -0
  58. package/rubjs/methods/channels/removeChannel.js +17 -0
  59. package/rubjs/methods/channels/requestChangeObjectOwner.d.ts +3 -0
  60. package/rubjs/methods/{messages/edit_message.js → channels/requestChangeObjectOwner.js} +5 -7
  61. package/rubjs/methods/channels/seenChannelMessages.d.ts +3 -0
  62. package/rubjs/methods/channels/seenChannelMessages.js +21 -0
  63. package/rubjs/methods/channels/setChannelLink.d.ts +3 -0
  64. package/rubjs/methods/channels/setChannelLink.js +17 -0
  65. package/rubjs/methods/channels/setChannelVoiceChatSetting.d.ts +3 -0
  66. package/rubjs/methods/channels/setChannelVoiceChatSetting.js +26 -0
  67. package/rubjs/methods/channels/updateChannelUsername.d.ts +3 -0
  68. package/rubjs/methods/channels/updateChannelUsername.js +20 -0
  69. package/rubjs/methods/chats/actionOnJoinRequest.d.ts +3 -0
  70. package/rubjs/methods/chats/actionOnJoinRequest.js +22 -0
  71. package/rubjs/methods/chats/addLiveComment.d.ts +3 -0
  72. package/rubjs/methods/chats/addLiveComment.js +17 -0
  73. package/rubjs/methods/chats/clickMessageUrl.d.ts +3 -0
  74. package/rubjs/methods/chats/clickMessageUrl.js +17 -0
  75. package/rubjs/methods/chats/createJoinLink.d.ts +3 -0
  76. package/rubjs/methods/chats/createJoinLink.js +23 -0
  77. package/rubjs/methods/chats/deleteAvatar.d.ts +3 -0
  78. package/rubjs/methods/chats/deleteAvatar.js +17 -0
  79. package/rubjs/methods/chats/deleteChatHistory.d.ts +3 -0
  80. package/rubjs/methods/chats/deleteChatHistory.js +20 -0
  81. package/rubjs/methods/chats/editJoinLink.d.ts +3 -0
  82. package/rubjs/methods/chats/editJoinLink.js +34 -0
  83. package/rubjs/methods/chats/getAbsObjects.d.ts +3 -0
  84. package/rubjs/methods/chats/getAbsObjects.js +19 -0
  85. package/rubjs/methods/chats/getAvatars.d.ts +3 -0
  86. package/rubjs/methods/chats/getAvatars.js +17 -0
  87. package/rubjs/methods/chats/getChatReaction.d.ts +3 -0
  88. package/rubjs/methods/chats/getChatReaction.js +17 -0
  89. package/rubjs/methods/chats/getChats.d.ts +3 -0
  90. package/rubjs/methods/chats/getChats.js +17 -0
  91. package/rubjs/methods/chats/getChatsUpdates.d.ts +3 -0
  92. package/rubjs/methods/chats/getChatsUpdates.js +17 -0
  93. package/rubjs/methods/chats/getJoinLinks.d.ts +3 -0
  94. package/rubjs/methods/chats/getJoinLinks.js +17 -0
  95. package/rubjs/methods/chats/getJoinRequests.d.ts +3 -0
  96. package/rubjs/methods/chats/getJoinRequests.js +17 -0
  97. package/rubjs/methods/chats/getLinkFromAppUrl.d.ts +3 -0
  98. package/rubjs/methods/chats/getLinkFromAppUrl.js +17 -0
  99. package/rubjs/methods/chats/getLiveComments.d.ts +3 -0
  100. package/rubjs/methods/chats/getLiveComments.js +17 -0
  101. package/rubjs/methods/chats/getLivePlayUrl.d.ts +3 -0
  102. package/rubjs/methods/chats/getLivePlayUrl.js +17 -0
  103. package/rubjs/methods/chats/getLiveStatus.d.ts +3 -0
  104. package/rubjs/methods/chats/getLiveStatus.js +17 -0
  105. package/rubjs/methods/chats/getObjectInfoByUsername.d.ts +3 -0
  106. package/rubjs/methods/chats/getObjectInfoByUsername.js +19 -0
  107. package/rubjs/methods/chats/getTopChatUsers.d.ts +3 -0
  108. package/rubjs/methods/chats/getTopChatUsers.js +18 -0
  109. package/rubjs/methods/chats/index.d.ts +29 -0
  110. package/rubjs/methods/chats/index.js +62 -0
  111. package/rubjs/methods/chats/removeFromTopChatUsers.d.ts +3 -0
  112. package/rubjs/methods/chats/removeFromTopChatUsers.js +17 -0
  113. package/rubjs/methods/chats/removeJoinLink.d.ts +3 -0
  114. package/rubjs/methods/chats/removeJoinLink.js +19 -0
  115. package/rubjs/methods/chats/searchChatMessages.d.ts +3 -0
  116. package/rubjs/methods/chats/searchChatMessages.js +23 -0
  117. package/rubjs/methods/chats/searchGlobalMessages.d.ts +3 -0
  118. package/rubjs/methods/chats/searchGlobalMessages.js +17 -0
  119. package/rubjs/methods/chats/seenChats.d.ts +3 -0
  120. package/rubjs/methods/chats/seenChats.js +17 -0
  121. package/rubjs/methods/chats/sendChatActivity.d.ts +3 -0
  122. package/rubjs/methods/chats/sendChatActivity.js +19 -0
  123. package/rubjs/methods/chats/sendLive.d.ts +3 -0
  124. package/rubjs/methods/chats/sendLive.js +28 -0
  125. package/rubjs/methods/chats/setActionChat.d.ts +3 -0
  126. package/rubjs/methods/chats/setActionChat.js +19 -0
  127. package/rubjs/methods/chats/uploadAvatar.d.ts +3 -0
  128. package/rubjs/methods/chats/uploadAvatar.js +29 -0
  129. package/rubjs/methods/contacts/addAddressBook.d.ts +3 -0
  130. package/rubjs/methods/contacts/addAddressBook.js +17 -0
  131. package/rubjs/methods/contacts/deleteContact.d.ts +3 -0
  132. package/rubjs/methods/contacts/deleteContact.js +17 -0
  133. package/rubjs/methods/contacts/getContacts.d.ts +3 -0
  134. package/rubjs/methods/contacts/getContacts.js +17 -0
  135. package/rubjs/methods/contacts/getContactsLastOnline.d.ts +3 -0
  136. package/rubjs/methods/contacts/getContactsLastOnline.js +17 -0
  137. package/rubjs/methods/contacts/getContactsUpdates.d.ts +3 -0
  138. package/rubjs/methods/contacts/getContactsUpdates.js +17 -0
  139. package/rubjs/methods/contacts/index.d.ts +7 -0
  140. package/rubjs/methods/contacts/index.js +18 -0
  141. package/rubjs/methods/contacts/resetContacts.d.ts +3 -0
  142. package/rubjs/methods/contacts/resetContacts.js +18 -0
  143. package/rubjs/methods/extras/banMember.d.ts +3 -0
  144. package/rubjs/methods/extras/banMember.js +20 -0
  145. package/rubjs/methods/extras/getInfo.d.ts +3 -0
  146. package/rubjs/methods/extras/getInfo.js +26 -0
  147. package/rubjs/methods/extras/getObjectByUsername.d.ts +3 -0
  148. package/rubjs/methods/extras/getObjectByUsername.js +19 -0
  149. package/rubjs/methods/extras/getProfileLinkItems.d.ts +3 -0
  150. package/rubjs/methods/extras/getProfileLinkItems.js +17 -0
  151. package/rubjs/methods/extras/getRelatedObjects.d.ts +3 -0
  152. package/rubjs/methods/extras/getRelatedObjects.js +17 -0
  153. package/rubjs/methods/extras/getTranscription.d.ts +3 -0
  154. package/rubjs/methods/extras/getTranscription.js +20 -0
  155. package/rubjs/methods/extras/index.d.ts +13 -0
  156. package/rubjs/methods/extras/index.js +30 -0
  157. package/rubjs/methods/extras/join.d.ts +3 -0
  158. package/rubjs/methods/extras/join.js +22 -0
  159. package/rubjs/methods/extras/leaveChat.d.ts +3 -0
  160. package/rubjs/methods/extras/leaveChat.js +20 -0
  161. package/rubjs/methods/extras/reportObject.d.ts +14 -0
  162. package/rubjs/methods/extras/reportObject.js +32 -0
  163. package/rubjs/methods/extras/searchGlobalObjects.d.ts +3 -0
  164. package/rubjs/methods/extras/searchGlobalObjects.js +17 -0
  165. package/rubjs/methods/extras/transcribeVoice.d.ts +3 -0
  166. package/rubjs/methods/extras/transcribeVoice.js +17 -0
  167. package/rubjs/methods/extras/userIsAdmin.d.ts +3 -0
  168. package/rubjs/methods/extras/userIsAdmin.js +29 -0
  169. package/rubjs/methods/gif/addToMyGifSet.d.ts +3 -0
  170. package/rubjs/methods/gif/addToMyGifSet.js +17 -0
  171. package/rubjs/methods/gif/getMyGifSet.d.ts +3 -0
  172. package/rubjs/methods/gif/getMyGifSet.js +17 -0
  173. package/rubjs/methods/gif/index.d.ts +4 -0
  174. package/rubjs/methods/gif/index.js +12 -0
  175. package/rubjs/methods/gif/removeFromMyGifSet.d.ts +3 -0
  176. package/rubjs/methods/gif/removeFromMyGifSet.js +17 -0
  177. package/rubjs/methods/groups/addGroup.d.ts +3 -0
  178. package/rubjs/methods/groups/addGroup.js +19 -0
  179. package/rubjs/methods/groups/addGroupMembers.d.ts +3 -0
  180. package/rubjs/methods/groups/addGroupMembers.js +19 -0
  181. package/rubjs/methods/groups/banGroupMember.d.ts +3 -0
  182. package/rubjs/methods/groups/banGroupMember.js +23 -0
  183. package/rubjs/methods/groups/createGroupVoiceChat.d.ts +3 -0
  184. package/rubjs/methods/groups/createGroupVoiceChat.js +17 -0
  185. package/rubjs/methods/groups/deleteNoAccessGroupChat.d.ts +3 -0
  186. package/rubjs/methods/groups/deleteNoAccessGroupChat.js +17 -0
  187. package/rubjs/methods/groups/discardGroupVoiceChat.d.ts +3 -0
  188. package/rubjs/methods/groups/discardGroupVoiceChat.js +20 -0
  189. package/rubjs/methods/groups/editGroupInfo.d.ts +6 -0
  190. package/rubjs/methods/groups/editGroupInfo.js +51 -0
  191. package/rubjs/methods/groups/getBannedGroupMembers.d.ts +3 -0
  192. package/rubjs/methods/groups/getBannedGroupMembers.js +17 -0
  193. package/rubjs/methods/groups/getGroupAdminAccessList.d.ts +3 -0
  194. package/rubjs/methods/groups/getGroupAdminAccessList.js +20 -0
  195. package/rubjs/methods/groups/getGroupAdminMembers.d.ts +3 -0
  196. package/rubjs/methods/groups/getGroupAdminMembers.js +17 -0
  197. package/rubjs/methods/groups/getGroupAllMembers.d.ts +3 -0
  198. package/rubjs/methods/groups/getGroupAllMembers.js +21 -0
  199. package/rubjs/methods/groups/getGroupDefaultAccess.d.ts +3 -0
  200. package/rubjs/methods/groups/getGroupDefaultAccess.js +17 -0
  201. package/rubjs/methods/groups/getGroupInfo.d.ts +3 -0
  202. package/rubjs/methods/groups/getGroupInfo.js +17 -0
  203. package/rubjs/methods/groups/getGroupLink.d.ts +3 -0
  204. package/rubjs/methods/groups/getGroupLink.js +17 -0
  205. package/rubjs/methods/groups/getGroupMentionList.d.ts +3 -0
  206. package/rubjs/methods/groups/getGroupMentionList.js +20 -0
  207. package/rubjs/methods/groups/getGroupOnlineCount.d.ts +3 -0
  208. package/rubjs/methods/groups/getGroupOnlineCount.js +17 -0
  209. package/rubjs/methods/groups/getGroupVoiceChatUpdates.d.ts +3 -0
  210. package/rubjs/methods/groups/getGroupVoiceChatUpdates.js +21 -0
  211. package/rubjs/methods/groups/groupPreviewByJoinLink.d.ts +3 -0
  212. package/rubjs/methods/groups/groupPreviewByJoinLink.js +19 -0
  213. package/rubjs/methods/groups/index.d.ts +28 -0
  214. package/rubjs/methods/groups/index.js +60 -0
  215. package/rubjs/methods/groups/joinGroup.d.ts +3 -0
  216. package/rubjs/methods/groups/joinGroup.js +19 -0
  217. package/rubjs/methods/groups/leaveGroup.d.ts +3 -0
  218. package/rubjs/methods/groups/leaveGroup.js +17 -0
  219. package/rubjs/methods/groups/leaveGroupVoiceChat.d.ts +3 -0
  220. package/rubjs/methods/groups/leaveGroupVoiceChat.js +20 -0
  221. package/rubjs/methods/groups/removeGroup.d.ts +3 -0
  222. package/rubjs/methods/groups/removeGroup.js +17 -0
  223. package/rubjs/methods/groups/seenGroupMessages.d.ts +3 -0
  224. package/rubjs/methods/groups/seenGroupMessages.js +21 -0
  225. package/rubjs/methods/groups/setGroupAdmin.d.ts +5 -0
  226. package/rubjs/methods/groups/setGroupAdmin.js +26 -0
  227. package/rubjs/methods/groups/setGroupDefaultAccess.d.ts +4 -0
  228. package/rubjs/methods/groups/setGroupDefaultAccess.js +22 -0
  229. package/rubjs/methods/groups/setGroupLink.d.ts +3 -0
  230. package/rubjs/methods/groups/setGroupLink.js +17 -0
  231. package/rubjs/methods/groups/setGroupVoiceChatSetting.d.ts +3 -0
  232. package/rubjs/methods/groups/setGroupVoiceChatSetting.js +26 -0
  233. package/rubjs/methods/index.d.ts +181 -41
  234. package/rubjs/methods/index.js +821 -57
  235. package/rubjs/methods/messages/actionOnMessageReaction.d.ts +3 -0
  236. package/rubjs/methods/messages/{action_on_message_reaction.js → actionOnMessageReaction.js} +2 -2
  237. package/rubjs/methods/messages/createPoll.d.ts +3 -0
  238. package/rubjs/methods/messages/{create_poll.js → createPoll.js} +2 -2
  239. package/rubjs/methods/messages/deleteMessages.d.ts +3 -0
  240. package/rubjs/methods/messages/{delete_messages.js → deleteMessages.js} +2 -2
  241. package/rubjs/methods/messages/editMessage.d.ts +3 -0
  242. package/rubjs/methods/messages/editMessage.js +23 -0
  243. package/rubjs/methods/messages/forwardMessages.d.ts +3 -0
  244. package/rubjs/methods/messages/{forward_messages.js → forwardMessages.js} +2 -2
  245. package/rubjs/methods/messages/getMessageShareUrl.d.ts +3 -0
  246. package/rubjs/methods/messages/{get_message_share_url.js → getMessageShareUrl.js} +2 -2
  247. package/rubjs/methods/messages/getMessages.d.ts +3 -0
  248. package/rubjs/methods/messages/getMessages.js +23 -0
  249. package/rubjs/methods/messages/getMessagesByID.d.ts +3 -0
  250. package/rubjs/methods/messages/{get_messages_by_id.js → getMessagesByID.js} +2 -2
  251. package/rubjs/methods/messages/getMessagesInterval.d.ts +3 -0
  252. package/rubjs/methods/messages/{get_messages_interval.js → getMessagesInterval.js} +2 -2
  253. package/rubjs/methods/messages/getMessagesUpdates.d.ts +3 -0
  254. package/rubjs/methods/messages/{get_messages_updates.js → getMessagesUpdates.js} +2 -2
  255. package/rubjs/methods/messages/getPollOptionVoters.d.ts +3 -0
  256. package/rubjs/methods/messages/{get_poll_option_voters.js → getPollOptionVoters.js} +2 -2
  257. package/rubjs/methods/messages/getPollStatus.d.ts +3 -0
  258. package/rubjs/methods/messages/{get_poll_status.js → getPollStatus.js} +2 -2
  259. package/rubjs/methods/messages/index.d.ts +26 -17
  260. package/rubjs/methods/messages/index.js +51 -33
  261. package/rubjs/methods/messages/requestSendFile.d.ts +4 -0
  262. package/rubjs/methods/{utilities/request_send_file.js → messages/requestSendFile.js} +2 -2
  263. package/rubjs/methods/messages/sendDocument.d.ts +3 -0
  264. package/rubjs/methods/messages/sendDocument.js +17 -0
  265. package/rubjs/methods/messages/sendGif.d.ts +3 -0
  266. package/rubjs/methods/messages/sendGif.js +17 -0
  267. package/rubjs/methods/messages/sendMessage.d.ts +3 -0
  268. package/rubjs/methods/messages/{send_message.js → sendMessage.js} +10 -10
  269. package/rubjs/methods/messages/sendMusic.d.ts +3 -0
  270. package/rubjs/methods/messages/sendMusic.js +17 -0
  271. package/rubjs/methods/messages/sendPhoto.d.ts +3 -0
  272. package/rubjs/methods/messages/sendPhoto.js +17 -0
  273. package/rubjs/methods/messages/sendSticker.d.ts +3 -0
  274. package/rubjs/methods/messages/sendSticker.js +17 -0
  275. package/rubjs/methods/messages/sendText.d.ts +3 -0
  276. package/rubjs/methods/messages/sendText.js +17 -0
  277. package/rubjs/methods/messages/sendVideo.d.ts +3 -0
  278. package/rubjs/methods/messages/sendVideo.js +17 -0
  279. package/rubjs/methods/messages/sendVideoMessage.d.ts +3 -0
  280. package/rubjs/methods/messages/sendVideoMessage.js +17 -0
  281. package/rubjs/methods/messages/sendVoice.d.ts +3 -0
  282. package/rubjs/methods/messages/sendVoice.js +17 -0
  283. package/rubjs/methods/messages/setPinMessage.d.ts +3 -0
  284. package/rubjs/methods/messages/{set_pin_message.js → setPinMessage.js} +2 -2
  285. package/rubjs/methods/messages/votePoll.d.ts +3 -0
  286. package/rubjs/methods/messages/{vote_poll.js → votePoll.js} +2 -2
  287. package/rubjs/methods/settings/changePassword.d.ts +3 -0
  288. package/rubjs/methods/settings/changePassword.js +17 -0
  289. package/rubjs/methods/settings/checkTwoStepPasscode.d.ts +3 -0
  290. package/rubjs/methods/settings/checkTwoStepPasscode.js +17 -0
  291. package/rubjs/methods/settings/deleteFolder.d.ts +3 -0
  292. package/rubjs/methods/settings/deleteFolder.js +17 -0
  293. package/rubjs/methods/settings/getBlockedUsers.d.ts +3 -0
  294. package/rubjs/methods/settings/getBlockedUsers.js +17 -0
  295. package/rubjs/methods/settings/getFolders.d.ts +3 -0
  296. package/rubjs/methods/settings/getFolders.js +17 -0
  297. package/rubjs/methods/settings/getMySessions.d.ts +3 -0
  298. package/rubjs/methods/settings/getMySessions.js +17 -0
  299. package/rubjs/methods/settings/getPrivacySetting.d.ts +3 -0
  300. package/rubjs/methods/settings/getPrivacySetting.js +17 -0
  301. package/rubjs/methods/settings/getSuggestedFolders.d.ts +3 -0
  302. package/rubjs/methods/settings/getSuggestedFolders.js +17 -0
  303. package/rubjs/methods/settings/getTwoPasscodeStatus.d.ts +3 -0
  304. package/rubjs/methods/settings/getTwoPasscodeStatus.js +17 -0
  305. package/rubjs/methods/settings/index.d.ts +19 -0
  306. package/rubjs/methods/settings/index.js +42 -0
  307. package/rubjs/methods/settings/requestRecoveryEmail.d.ts +3 -0
  308. package/rubjs/methods/settings/requestRecoveryEmail.js +20 -0
  309. package/rubjs/methods/settings/setSetting.d.ts +5 -0
  310. package/rubjs/methods/settings/setSetting.js +50 -0
  311. package/rubjs/methods/settings/setupTwoStepVerification.d.ts +3 -0
  312. package/rubjs/methods/settings/setupTwoStepVerification.js +21 -0
  313. package/rubjs/methods/settings/terminateOtherSessions.d.ts +3 -0
  314. package/rubjs/methods/settings/terminateOtherSessions.js +18 -0
  315. package/rubjs/methods/settings/terminateSession.d.ts +3 -0
  316. package/rubjs/methods/settings/terminateSession.js +17 -0
  317. package/rubjs/methods/settings/turnOffTwoStep.d.ts +3 -0
  318. package/rubjs/methods/settings/turnOffTwoStep.js +18 -0
  319. package/rubjs/methods/settings/updateProfile.d.ts +3 -0
  320. package/rubjs/methods/settings/updateProfile.js +30 -0
  321. package/rubjs/methods/settings/updateUsername.d.ts +3 -0
  322. package/rubjs/methods/settings/updateUsername.js +17 -0
  323. package/rubjs/methods/settings/verifyRecoveryEmail.d.ts +3 -0
  324. package/rubjs/methods/settings/verifyRecoveryEmail.js +17 -0
  325. package/rubjs/methods/stickers/actionOnStickerSet.d.ts +3 -0
  326. package/rubjs/methods/stickers/actionOnStickerSet.js +19 -0
  327. package/rubjs/methods/stickers/getMyStickerSets.d.ts +3 -0
  328. package/rubjs/methods/stickers/getMyStickerSets.js +17 -0
  329. package/rubjs/methods/stickers/getStickerSetByID.d.ts +3 -0
  330. package/rubjs/methods/stickers/getStickerSetByID.js +17 -0
  331. package/rubjs/methods/stickers/getStickersByEmoji.d.ts +3 -0
  332. package/rubjs/methods/stickers/getStickersByEmoji.js +17 -0
  333. package/rubjs/methods/stickers/getStickersBySetIds.d.ts +3 -0
  334. package/rubjs/methods/stickers/getStickersBySetIds.js +19 -0
  335. package/rubjs/methods/stickers/getTrendStickerSets.d.ts +3 -0
  336. package/rubjs/methods/stickers/getTrendStickerSets.js +17 -0
  337. package/rubjs/methods/stickers/index.d.ts +8 -0
  338. package/rubjs/methods/stickers/index.js +20 -0
  339. package/rubjs/methods/stickers/searchStickers.d.ts +3 -0
  340. package/rubjs/methods/stickers/searchStickers.js +17 -0
  341. package/rubjs/methods/users/checkUserUsername.d.ts +3 -0
  342. package/rubjs/methods/users/checkUserUsername.js +17 -0
  343. package/rubjs/methods/users/deleteUserChat.d.ts +3 -0
  344. package/rubjs/methods/users/deleteUserChat.js +20 -0
  345. package/rubjs/methods/users/getMe.d.ts +3 -0
  346. package/rubjs/methods/users/getMe.js +17 -0
  347. package/rubjs/methods/users/getUserInfo.d.ts +4 -0
  348. package/rubjs/methods/users/{get_user_info.js → getUserInfo.js} +2 -2
  349. package/rubjs/methods/users/index.d.ts +6 -2
  350. package/rubjs/methods/users/index.js +11 -3
  351. package/rubjs/methods/users/setBlockUser.d.ts +3 -0
  352. package/rubjs/methods/users/setBlockUser.js +19 -0
  353. package/rubjs/methods/utilities/download.d.ts +3 -0
  354. package/rubjs/methods/utilities/download.js +17 -0
  355. package/rubjs/methods/utilities/downloadProfilePicture.d.ts +3 -0
  356. package/rubjs/methods/utilities/downloadProfilePicture.js +27 -0
  357. package/rubjs/methods/utilities/index.d.ts +5 -3
  358. package/rubjs/methods/utilities/index.js +9 -5
  359. package/rubjs/methods/utilities/run.js +8 -1
  360. package/rubjs/methods/utilities/start.js +8 -7
  361. package/rubjs/network/index.d.ts +3 -3
  362. package/rubjs/network/index.js +14 -12
  363. package/rubjs/parser/index.d.ts +25 -0
  364. package/rubjs/parser/index.js +110 -0
  365. package/rubjs/session/index.js +1 -1
  366. package/rubjs/{methods/auth/types/sign_in.d.ts → types/auth.d.ts} +11 -1
  367. package/rubjs/types/chats.d.ts +79 -0
  368. package/rubjs/{methods/types/message_update.d.ts → types/decorators.d.ts} +56 -0
  369. package/rubjs/types/groups.d.ts +129 -0
  370. package/rubjs/types/index.d.ts +8 -0
  371. package/rubjs/types/index.js +53 -0
  372. package/rubjs/types/message.d.ts +18 -0
  373. package/rubjs/types/message.js +31 -0
  374. package/rubjs/types/messages.d.ts +176 -0
  375. package/rubjs/{methods/users/types/get_user_info.d.ts → types/users.d.ts} +1 -0
  376. package/rubjs/utils/filters.d.ts +28 -16
  377. package/rubjs/utils/filters.js +90 -31
  378. package/rubjs/utils/index.d.ts +2 -1
  379. package/rubjs/utils/index.js +3 -1
  380. package/rubjs/utils/utils.d.ts +10 -0
  381. package/rubjs/utils/utils.js +12 -0
  382. package/rubjs/methods/auth/register_device.d.ts +0 -3
  383. package/rubjs/methods/auth/send_code.d.ts +0 -4
  384. package/rubjs/methods/auth/sign_in.d.ts +0 -4
  385. package/rubjs/methods/auth/types/index.d.ts +0 -3
  386. package/rubjs/methods/auth/types/send_code.d.ts +0 -10
  387. package/rubjs/methods/messages/action_on_message_reaction.d.ts +0 -4
  388. package/rubjs/methods/messages/create_poll.d.ts +0 -4
  389. package/rubjs/methods/messages/delete_messages.d.ts +0 -4
  390. package/rubjs/methods/messages/edit_message.d.ts +0 -4
  391. package/rubjs/methods/messages/forward_messages.d.ts +0 -4
  392. package/rubjs/methods/messages/get_message_share_url.d.ts +0 -4
  393. package/rubjs/methods/messages/get_messages_by_id.d.ts +0 -4
  394. package/rubjs/methods/messages/get_messages_interval.d.ts +0 -4
  395. package/rubjs/methods/messages/get_messages_updates.d.ts +0 -4
  396. package/rubjs/methods/messages/get_poll_option_voters.d.ts +0 -4
  397. package/rubjs/methods/messages/get_poll_status.d.ts +0 -4
  398. package/rubjs/methods/messages/send_message.d.ts +0 -4
  399. package/rubjs/methods/messages/send_photo.d.ts +0 -4
  400. package/rubjs/methods/messages/send_text.d.ts +0 -4
  401. package/rubjs/methods/messages/set_pin_message.d.ts +0 -4
  402. package/rubjs/methods/messages/types/action_on_message_reaction.d.ts +0 -10
  403. package/rubjs/methods/messages/types/delete_message.d.ts +0 -34
  404. package/rubjs/methods/messages/types/edit_message.d.ts +0 -38
  405. package/rubjs/methods/messages/types/forward_messages.d.ts +0 -7
  406. package/rubjs/methods/messages/types/forward_messages.js +0 -2
  407. package/rubjs/methods/messages/types/get_messages_by_id.d.ts +0 -14
  408. package/rubjs/methods/messages/types/get_messages_by_id.js +0 -2
  409. package/rubjs/methods/messages/types/get_messages_interval.d.ts +0 -43
  410. package/rubjs/methods/messages/types/get_messages_interval.js +0 -2
  411. package/rubjs/methods/messages/types/get_messages_updates.d.ts +0 -29
  412. package/rubjs/methods/messages/types/get_messages_updates.js +0 -2
  413. package/rubjs/methods/messages/types/get_poll_option_voters.d.ts +0 -19
  414. package/rubjs/methods/messages/types/get_poll_option_voters.js +0 -2
  415. package/rubjs/methods/messages/types/get_poll_status.d.ts +0 -13
  416. package/rubjs/methods/messages/types/get_poll_status.js +0 -2
  417. package/rubjs/methods/messages/types/index.d.ts +0 -13
  418. package/rubjs/methods/messages/types/index.js +0 -2
  419. package/rubjs/methods/messages/types/message_result.d.ts +0 -7
  420. package/rubjs/methods/messages/types/message_result.js +0 -2
  421. package/rubjs/methods/messages/types/mini_typs.d.ts +0 -5
  422. package/rubjs/methods/messages/types/mini_typs.js +0 -2
  423. package/rubjs/methods/messages/types/set_pin_message.d.ts +0 -15
  424. package/rubjs/methods/messages/types/set_pin_message.js +0 -2
  425. package/rubjs/methods/messages/vote_poll.d.ts +0 -4
  426. package/rubjs/methods/types/chat_updates.d.ts +0 -26
  427. package/rubjs/methods/types/chat_updates.js +0 -2
  428. package/rubjs/methods/types/index.d.ts +0 -5
  429. package/rubjs/methods/types/index.js +0 -2
  430. package/rubjs/methods/types/message_update.js +0 -2
  431. package/rubjs/methods/types/show_activities.d.ts +0 -7
  432. package/rubjs/methods/types/show_activities.js +0 -2
  433. package/rubjs/methods/types/show_notifications.d.ts +0 -14
  434. package/rubjs/methods/types/show_notifications.js +0 -2
  435. package/rubjs/methods/users/get_user_info.d.ts +0 -4
  436. package/rubjs/methods/users/types/get_user_info.js +0 -2
  437. package/rubjs/methods/users/types/index.d.ts +0 -2
  438. package/rubjs/methods/users/types/index.js +0 -2
  439. package/rubjs/methods/utilities/request_send_file.d.ts +0 -4
  440. package/rubjs/methods/utilities/types/index.d.ts +0 -2
  441. package/rubjs/methods/utilities/types/index.js +0 -2
  442. package/rubjs/methods/utilities/types/request_send_file.d.ts +0 -7
  443. package/rubjs/methods/utilities/types/request_send_file.js +0 -2
  444. /package/rubjs/{methods/auth/types/index.js → types/auth.js} +0 -0
  445. /package/rubjs/{methods/auth/types/send_code.js → types/chats.js} +0 -0
  446. /package/rubjs/{methods/auth/types/sign_in.js → types/decorators.js} +0 -0
  447. /package/rubjs/{methods/messages/types/action_on_message_reaction.js → types/groups.js} +0 -0
  448. /package/rubjs/{methods/messages/types/delete_message.js → types/messages.js} +0 -0
  449. /package/rubjs/{methods/messages/types/edit_message.js → types/users.js} +0 -0
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function updateProfile() {
13
+ return __awaiter(this, arguments, void 0, function* (first_name = null, last_name = null, bio = null) {
14
+ let input = {};
15
+ if (typeof first_name === "string") {
16
+ input.updated_parameters.push("first_name");
17
+ input.first_name = first_name;
18
+ }
19
+ if (typeof last_name === "string") {
20
+ input.updated_parameters.push("last_name");
21
+ input.last_name = last_name;
22
+ }
23
+ if (typeof bio === "string") {
24
+ input.updated_parameters.push("bio");
25
+ input.bio = bio;
26
+ }
27
+ return yield this.builder("updateProfile", input);
28
+ });
29
+ }
30
+ exports.default = updateProfile;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function updateUsername(this: Client, username: string): Promise<any>;
3
+ export default updateUsername;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function updateUsername(username) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return yield this.builder("updateUsername", { username });
15
+ });
16
+ }
17
+ exports.default = updateUsername;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function verifyRecoveryEmail(this: Client, password: string, code: string): Promise<any>;
3
+ export default verifyRecoveryEmail;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function verifyRecoveryEmail(password, code) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return yield this.builder("verifyRecoveryEmail", { password, code });
15
+ });
16
+ }
17
+ exports.default = verifyRecoveryEmail;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function actionOnStickerSet(this: Client, sticker_set_id: string, action: "Add" | "Remove"): Promise<any>;
3
+ export default actionOnStickerSet;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function actionOnStickerSet(sticker_set_id, action) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ if (!["Add", "Remove"].includes(action))
15
+ throw new Error('The `action` argument can only be in `("Add", "Remove")`.');
16
+ return yield this.builder("actionOnStickerSet", { sticker_set_id, action });
17
+ });
18
+ }
19
+ exports.default = actionOnStickerSet;
@@ -0,0 +1,3 @@
1
+ import Client from '../..';
2
+ declare function getMyStickerSets(this: Client): Promise<any>;
3
+ export default getMyStickerSets;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function getMyStickerSets() {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return yield this.builder('getMyStickerSets', {});
15
+ });
16
+ }
17
+ exports.default = getMyStickerSets;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function getStickerSetByID(this: Client, sticker_set_id: string): Promise<any>;
3
+ export default getStickerSetByID;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function getStickerSetByID(sticker_set_id) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return yield this.builder("getStickerSetByID", { sticker_set_id });
15
+ });
16
+ }
17
+ exports.default = getStickerSetByID;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function getStickersByEmoji(this: Client, emoji: string, suggest_by?: string): Promise<any>;
3
+ export default getStickersByEmoji;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function getStickersByEmoji(emoji_1) {
13
+ return __awaiter(this, arguments, void 0, function* (emoji, suggest_by = "All") {
14
+ return yield this.builder("getStickersByEmoji", { emoji, suggest_by });
15
+ });
16
+ }
17
+ exports.default = getStickersByEmoji;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function getStickersBySetIds(this: Client, sticker_set_ids: string[]): Promise<any>;
3
+ export default getStickersBySetIds;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function getStickersBySetIds(sticker_set_ids) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ if (typeof sticker_set_ids === "string")
15
+ sticker_set_ids = [sticker_set_ids];
16
+ return yield this.builder("getStickersBySetIds", { sticker_set_ids });
17
+ });
18
+ }
19
+ exports.default = getStickersBySetIds;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function getTrendStickerSets(this: Client, start_id?: string | null): Promise<any>;
3
+ export default getTrendStickerSets;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function getTrendStickerSets() {
13
+ return __awaiter(this, arguments, void 0, function* (start_id = null) {
14
+ return yield this.builder("getTrendStickerSets", { start_id: start_id });
15
+ });
16
+ }
17
+ exports.default = getTrendStickerSets;
@@ -0,0 +1,8 @@
1
+ import actionOnStickerSet from './actionOnStickerSet';
2
+ import getMyStickerSets from './getMyStickerSets';
3
+ import getStickersByEmoji from './getStickersByEmoji';
4
+ import getStickersBySetIds from './getStickersBySetIds';
5
+ import getStickerSetByID from './getStickerSetByID';
6
+ import getTrendStickerSets from './getTrendStickerSets';
7
+ import searchStickers from './searchStickers';
8
+ export { actionOnStickerSet, getMyStickerSets, getStickersByEmoji, getStickersBySetIds, getStickerSetByID, getTrendStickerSets, searchStickers };
@@ -0,0 +1,20 @@
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.searchStickers = exports.getTrendStickerSets = exports.getStickerSetByID = exports.getStickersBySetIds = exports.getStickersByEmoji = exports.getMyStickerSets = exports.actionOnStickerSet = void 0;
7
+ const actionOnStickerSet_1 = __importDefault(require("./actionOnStickerSet"));
8
+ exports.actionOnStickerSet = actionOnStickerSet_1.default;
9
+ const getMyStickerSets_1 = __importDefault(require("./getMyStickerSets"));
10
+ exports.getMyStickerSets = getMyStickerSets_1.default;
11
+ const getStickersByEmoji_1 = __importDefault(require("./getStickersByEmoji"));
12
+ exports.getStickersByEmoji = getStickersByEmoji_1.default;
13
+ const getStickersBySetIds_1 = __importDefault(require("./getStickersBySetIds"));
14
+ exports.getStickersBySetIds = getStickersBySetIds_1.default;
15
+ const getStickerSetByID_1 = __importDefault(require("./getStickerSetByID"));
16
+ exports.getStickerSetByID = getStickerSetByID_1.default;
17
+ const getTrendStickerSets_1 = __importDefault(require("./getTrendStickerSets"));
18
+ exports.getTrendStickerSets = getTrendStickerSets_1.default;
19
+ const searchStickers_1 = __importDefault(require("./searchStickers"));
20
+ exports.searchStickers = searchStickers_1.default;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function searchStickers(this: Client, search_text: string, start_id: string): Promise<any>;
3
+ export default searchStickers;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function searchStickers(search_text, start_id) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return yield this.builder("searchStickers", { search_text, start_id });
15
+ });
16
+ }
17
+ exports.default = searchStickers;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function checkUserUsername(this: Client, username: string): Promise<any>;
3
+ export default checkUserUsername;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function checkUserUsername(username) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return yield this.builder("checkUserUsername", { username });
15
+ });
16
+ }
17
+ exports.default = checkUserUsername;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function deleteUserChat(this: Client, user_guid: string, last_deleted_message_id: string): Promise<any>;
3
+ export default deleteUserChat;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function deleteUserChat(user_guid, last_deleted_message_id) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return yield this.builder("deleteUserChat", {
15
+ user_guid,
16
+ last_deleted_message_id,
17
+ });
18
+ });
19
+ }
20
+ exports.default = deleteUserChat;
@@ -0,0 +1,3 @@
1
+ import Client from '../..';
2
+ declare function getMe(this: Client): Promise<import("../../types/users").UserInfo>;
3
+ export default getMe;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function getMe() {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return yield this.getUserInfo();
15
+ });
16
+ }
17
+ exports.default = getMe;
@@ -0,0 +1,4 @@
1
+ import Client from '../..';
2
+ import UserInfo from '../../types/users';
3
+ declare function getUserInfo(this: Client, user_guid?: string | null): Promise<UserInfo>;
4
+ export default getUserInfo;
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- function get_user_info() {
12
+ function getUserInfo() {
13
13
  return __awaiter(this, arguments, void 0, function* (user_guid = null) {
14
14
  const result = yield this.builder("getUserInfo", user_guid ? { user_guid } : {}, this.auth ? false : true);
15
15
  return result;
16
16
  });
17
17
  }
18
- exports.default = get_user_info;
18
+ exports.default = getUserInfo;
@@ -1,2 +1,6 @@
1
- import get_user_info from "./get_user_info";
2
- export { get_user_info };
1
+ import checkUserUsername from './checkUserUsername';
2
+ import deleteUserChat from './deleteUserChat';
3
+ import getMe from './getMe';
4
+ import getUserInfo from './getUserInfo';
5
+ import setBlockUser from './setBlockUser';
6
+ export { checkUserUsername, deleteUserChat, getMe, getUserInfo, setBlockUser };
@@ -3,6 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.get_user_info = void 0;
7
- const get_user_info_1 = __importDefault(require("./get_user_info"));
8
- exports.get_user_info = get_user_info_1.default;
6
+ exports.setBlockUser = exports.getUserInfo = exports.getMe = exports.deleteUserChat = exports.checkUserUsername = void 0;
7
+ const checkUserUsername_1 = __importDefault(require("./checkUserUsername"));
8
+ exports.checkUserUsername = checkUserUsername_1.default;
9
+ const deleteUserChat_1 = __importDefault(require("./deleteUserChat"));
10
+ exports.deleteUserChat = deleteUserChat_1.default;
11
+ const getMe_1 = __importDefault(require("./getMe"));
12
+ exports.getMe = getMe_1.default;
13
+ const getUserInfo_1 = __importDefault(require("./getUserInfo"));
14
+ exports.getUserInfo = getUserInfo_1.default;
15
+ const setBlockUser_1 = __importDefault(require("./setBlockUser"));
16
+ exports.setBlockUser = setBlockUser_1.default;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function setBlockUser(this: Client, user_guid: string, action?: "Block" | "Unblock"): Promise<any>;
3
+ export default setBlockUser;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function setBlockUser(user_guid_1) {
13
+ return __awaiter(this, arguments, void 0, function* (user_guid, action = "Block") {
14
+ if (!["Block", "Unblock"].includes(action))
15
+ throw new Error("`action` argument can only be `Block` or `Unblock`.");
16
+ return yield this.builder("setBlockUser", { user_guid, action });
17
+ });
18
+ }
19
+ exports.default = setBlockUser;
@@ -0,0 +1,3 @@
1
+ import Client from '../..';
2
+ declare function download(this: Client): Promise<any>;
3
+ export default download;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function download() {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return yield this.builder('download', {});
15
+ });
16
+ }
17
+ exports.default = download;
@@ -0,0 +1,3 @@
1
+ import Client from "../..";
2
+ declare function downloadProfilePicture(this: Client, object_guid: string): Promise<Buffer | null>;
3
+ export default downloadProfilePicture;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function downloadProfilePicture(object_guid) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ let avatars = yield this.getAvatars(object_guid);
15
+ if (avatars) {
16
+ avatars = avatars.avatars[0].main;
17
+ const url = `https://messenger${avatars.dc_id}.iranlms.ir/InternFile.ashx`;
18
+ const response = yield this.network.session.get(url, {
19
+ params: { id: avatars.file_id, ach: avatars.access_hash_rec },
20
+ responseType: "arraybuffer",
21
+ });
22
+ if (response.status === 200)
23
+ return yield response.data;
24
+ }
25
+ });
26
+ }
27
+ exports.default = downloadProfilePicture;
@@ -1,4 +1,6 @@
1
- import start from "./start";
1
+ import download from "./download";
2
+ import downloadProfilePicture from "./downloadProfilePicture";
2
3
  import run from "./run";
3
- import request_send_file from "./request_send_file";
4
- export { start, run, request_send_file };
4
+ import start from "./start";
5
+ import thumbnail from "./thumbnail";
6
+ export { download, downloadProfilePicture, run, start, thumbnail };
@@ -3,10 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.request_send_file = exports.run = exports.start = void 0;
7
- const start_1 = __importDefault(require("./start"));
8
- exports.start = start_1.default;
6
+ exports.thumbnail = exports.start = exports.run = exports.downloadProfilePicture = exports.download = void 0;
7
+ const download_1 = __importDefault(require("./download"));
8
+ exports.download = download_1.default;
9
+ const downloadProfilePicture_1 = __importDefault(require("./downloadProfilePicture"));
10
+ exports.downloadProfilePicture = downloadProfilePicture_1.default;
9
11
  const run_1 = __importDefault(require("./run"));
10
12
  exports.run = run_1.default;
11
- const request_send_file_1 = __importDefault(require("./request_send_file"));
12
- exports.request_send_file = request_send_file_1.default;
13
+ const start_1 = __importDefault(require("./start"));
14
+ exports.start = start_1.default;
15
+ const thumbnail_1 = __importDefault(require("./thumbnail"));
16
+ exports.thumbnail = thumbnail_1.default;
@@ -11,7 +11,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  function run() {
13
13
  return __awaiter(this, void 0, void 0, function* () {
14
- yield this.network.getUpdates();
14
+ if (!this.initialize) {
15
+ let timeout = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
16
+ yield this.run();
17
+ clearTimeout(timeout);
18
+ }), 2000);
19
+ }
20
+ else
21
+ yield this.network.getUpdates();
15
22
  });
16
23
  }
17
24
  exports.default = run;
@@ -19,12 +19,12 @@ function start() {
19
19
  try {
20
20
  this.key = Buffer.from(crypto_1.default.passphrase(this.auth), "utf8");
21
21
  this.decode_auth = crypto_1.default.decode_auth(this.auth);
22
- const result = yield this.get_user_info();
22
+ const result = yield this.getMe();
23
23
  this.userGuid = result.user.user_guid;
24
+ this.initialize = true;
24
25
  }
25
26
  catch (error) {
26
- // console.log(this.auth);
27
- if (!this.auth)
27
+ if (this.auth)
28
28
  throw new Error("robot has any error" + error.message);
29
29
  let phone_number = yield input_1.default.text("Phone Number: ");
30
30
  let is_phone_number_true = true;
@@ -39,11 +39,11 @@ function start() {
39
39
  }
40
40
  }
41
41
  phone_number = `98${phone_number.slice(1)}`;
42
- let result = yield this.send_code(phone_number);
42
+ let result = yield this.sendCode(phone_number);
43
43
  if (result.status == "SendPassKey") {
44
44
  while (true) {
45
45
  let pass_key = yield input_1.default.text(`Password [${result.hint_pass_key}] > `);
46
- result = yield this.send_code((phone_number = phone_number), (pass_key = pass_key));
46
+ result = yield this.sendCode((phone_number = phone_number), (pass_key = pass_key));
47
47
  if (result.status == "OK")
48
48
  break;
49
49
  }
@@ -52,17 +52,18 @@ function start() {
52
52
  this.privateKey = privateKey;
53
53
  while (true) {
54
54
  let phone_code = yield input_1.default.text("Code: ");
55
- let response = yield this.sign_in(phone_code, phone_number, result.phone_code_hash, publicKey);
55
+ let response = yield this.signIn(phone_code, phone_number, result.phone_code_hash, publicKey);
56
56
  if (response.status === "OK") {
57
57
  response.auth = crypto_1.default.decrypt_RSA_OAEP(this.privateKey, response.auth);
58
58
  this.key = Buffer.from(crypto_1.default.passphrase(response.auth), "utf8");
59
59
  this.auth = response.auth;
60
60
  this.decode_auth = crypto_1.default.decode_auth(this.auth);
61
61
  this.sessionDb.saveSession(response.user.phone, this.auth, response.user.user_guid, this.userAgent, this.privateKey);
62
- yield this.register_device();
62
+ yield this.registerDevice();
63
63
  break;
64
64
  }
65
65
  }
66
+ this.initialize = true;
66
67
  }
67
68
  });
68
69
  }
@@ -9,8 +9,8 @@ declare class Network {
9
9
  };
10
10
  client: Client;
11
11
  session: Axios;
12
- api_url: null | string;
13
- wss_url: null | string;
12
+ apiUrl: null | string;
13
+ wssUrl: null | string;
14
14
  ws: WebSocket;
15
15
  agent: https.Agent;
16
16
  constructor(client: Client);
@@ -25,7 +25,7 @@ declare class Network {
25
25
  handleConnect(): Promise<void>;
26
26
  resetConnection(): Promise<void>;
27
27
  handleMessage(message: string): Promise<void>;
28
- upload_file(file: Buffer<ArrayBufferLike> | string, mime?: string | null, fileName?: string | null, chunk?: number, callback?: any): Promise<{
28
+ uploadFile(file: Buffer<ArrayBufferLike> | string, mime?: string | null, fileName?: string | null, chunk?: number, callback?: any): Promise<{
29
29
  mime: string;
30
30
  size: number;
31
31
  dc_id: string;