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.
- package/README.md +32 -11
- package/lib/clients/VoiceChatClient.d.ts +4 -3
- package/lib/clients/VoiceChatClient.js +60 -92
- package/lib/clients/loginClient.d.ts +1 -1
- package/lib/clients/loginClient.js +4 -4
- package/lib/{core → clients}/network_login.js +1 -1
- package/lib/core/bot/bot.d.ts +25 -0
- package/lib/core/bot/bot.js +57 -0
- package/lib/core/bot/contexts/inline.context.d.ts +16 -0
- package/lib/core/bot/contexts/inline.context.js +27 -0
- package/lib/core/bot/contexts/message.context.d.ts +17 -0
- package/lib/core/bot/contexts/message.context.js +39 -0
- package/lib/core/bot/filters.d.ts +14 -0
- package/lib/core/bot/filters.js +45 -0
- package/lib/core/bot/methods/advanced/builder.d.ts +3 -0
- package/lib/core/bot/methods/advanced/builder.js +15 -0
- package/lib/core/bot/methods/bot/getMe.d.ts +3 -0
- package/lib/core/bot/methods/bot/getMe.js +6 -0
- package/lib/core/bot/methods/bot/index.d.ts +2 -0
- package/lib/core/bot/methods/bot/index.js +8 -0
- package/lib/core/bot/methods/chat/getChat.d.ts +3 -0
- package/lib/core/bot/methods/chat/getChat.js +6 -0
- package/lib/core/bot/methods/chat/index.d.ts +2 -0
- package/lib/core/bot/methods/chat/index.js +8 -0
- package/lib/core/bot/methods/files/getFile.d.ts +3 -0
- package/lib/core/bot/methods/files/getFile.js +6 -0
- package/lib/core/bot/methods/files/index.d.ts +4 -0
- package/lib/core/bot/methods/files/index.js +12 -0
- package/lib/core/bot/methods/files/requestSendFile.d.ts +4 -0
- package/lib/core/bot/methods/files/requestSendFile.js +6 -0
- package/lib/core/bot/methods/files/uploadFile.d.ts +3 -0
- package/lib/core/bot/methods/files/uploadFile.js +32 -0
- package/lib/core/bot/methods/index.d.ts +34 -0
- package/lib/core/bot/methods/index.js +116 -0
- package/lib/core/bot/methods/messages/deleteMessage.d.ts +3 -0
- package/lib/core/bot/methods/messages/deleteMessage.js +9 -0
- package/lib/core/bot/methods/messages/editChatKeypad.d.ts +4 -0
- package/lib/core/bot/methods/messages/editChatKeypad.js +14 -0
- package/lib/core/bot/methods/messages/editMessageKeypad.d.ts +4 -0
- package/lib/core/bot/methods/messages/editMessageKeypad.js +11 -0
- package/lib/core/bot/methods/messages/editMessageText.d.ts +3 -0
- package/lib/core/bot/methods/messages/editMessageText.js +10 -0
- package/lib/core/bot/methods/messages/forwardMessage.d.ts +3 -0
- package/lib/core/bot/methods/messages/forwardMessage.js +11 -0
- package/lib/core/bot/methods/messages/index.d.ts +10 -0
- package/lib/core/bot/methods/messages/index.js +24 -0
- package/lib/core/bot/methods/messages/sendContact.d.ts +4 -0
- package/lib/core/bot/methods/messages/sendContact.js +24 -0
- package/lib/core/bot/methods/messages/sendLocation.d.ts +4 -0
- package/lib/core/bot/methods/messages/sendLocation.js +23 -0
- package/lib/core/bot/methods/messages/sendMessage.d.ts +4 -0
- package/lib/core/bot/methods/messages/sendMessage.js +22 -0
- package/lib/core/bot/methods/messages/sendPoll.d.ts +3 -0
- package/lib/core/bot/methods/messages/sendPoll.js +6 -0
- package/lib/core/bot/methods/settings/index.d.ts +3 -0
- package/lib/core/bot/methods/settings/index.js +10 -0
- package/lib/core/bot/methods/settings/setCommands.d.ts +4 -0
- package/lib/core/bot/methods/settings/setCommands.js +6 -0
- package/lib/core/bot/methods/settings/updateBotEndpoints.d.ts +4 -0
- package/lib/core/bot/methods/settings/updateBotEndpoints.js +9 -0
- package/lib/core/bot/methods/utilities/getUpdates.d.ts +3 -0
- package/lib/core/bot/methods/utilities/getUpdates.js +6 -0
- package/lib/core/bot/methods/utilities/handleUpdates.d.ts +4 -0
- package/lib/core/bot/methods/utilities/handleUpdates.js +41 -0
- package/lib/core/bot/methods/utilities/index.d.ts +5 -0
- package/lib/core/bot/methods/utilities/index.js +14 -0
- package/lib/core/bot/methods/utilities/run.d.ts +4 -0
- package/lib/core/bot/methods/utilities/run.js +13 -0
- package/lib/core/bot/methods/utilities/start.d.ts +3 -0
- package/lib/core/bot/methods/utilities/start.js +27 -0
- package/lib/core/bot/methods/utilities/webhook.d.ts +4 -0
- package/lib/core/bot/methods/utilities/webhook.js +57 -0
- package/lib/core/bot/network/index.d.ts +9 -0
- package/lib/core/bot/network/index.js +48 -0
- package/lib/core/bot/network/polling.d.ts +0 -0
- package/lib/core/bot/network/polling.js +44 -0
- package/lib/core/bot/types/bot.type.d.ts +26 -0
- package/lib/core/bot/types/models.d.ts +303 -0
- package/lib/core/bot/types/models.js +131 -0
- package/lib/core/client/client.d.ts +29 -0
- package/lib/core/client/client.js +65 -0
- package/lib/{types → core/client/contexts}/activities.type.d.ts +2 -2
- package/lib/{types → core/client/contexts}/chat.type.d.ts +2 -2
- package/lib/core/client/contexts/contextConstructors.d.ts +10 -0
- package/lib/core/client/contexts/contextConstructors.js +16 -0
- package/lib/core/client/contexts/index.d.ts +5 -0
- package/lib/core/client/contexts/index.js +14 -0
- package/lib/{types → core/client/contexts}/message.type.d.ts +2 -2
- package/lib/{types → core/client/contexts}/notifications.type.d.ts +2 -2
- package/lib/core/{filters.d.ts → client/filters.d.ts} +3 -3
- package/lib/core/{filters.js → client/filters.js} +27 -27
- package/lib/core/client/methods/advanced/index.d.ts +2 -0
- package/lib/core/client/methods/advanced/index.js +8 -0
- package/lib/core/{methods → client/methods}/extras/onEditMessages.d.ts +1 -1
- package/lib/core/{methods → client/methods}/groups/joinGroup.js +0 -1
- package/lib/core/{methods → client/methods}/index.d.ts +4 -3
- package/lib/core/{methods → client/methods}/index.js +8 -17
- package/lib/core/client/methods/utilities/download.d.ts +4 -0
- package/lib/core/client/methods/utilities/download.js +6 -0
- package/lib/core/client/methods/utilities/downloadProfilePicture.d.ts +4 -0
- package/lib/core/client/methods/utilities/downloadProfilePicture.js +28 -0
- package/lib/core/client/methods/utilities/index.d.ts +8 -0
- package/lib/core/{methods → client/methods}/utilities/index.js +5 -5
- package/lib/core/{methods → client/methods}/utilities/start.js +2 -3
- package/lib/core/{methods → client/methods}/utilities/usePlugin.d.ts +1 -1
- package/lib/core/client/network/api.d.ts +16 -0
- package/lib/core/client/network/api.js +95 -0
- package/lib/core/client/network/file.d.ts +3 -0
- package/lib/core/client/network/file.js +117 -0
- package/lib/core/client/network/index.d.ts +25 -0
- package/lib/core/client/network/index.js +31 -0
- package/lib/core/client/network/utils.d.ts +9 -0
- package/lib/core/client/network/utils.js +34 -0
- package/lib/core/client/network/websocket.d.ts +3 -0
- package/lib/core/client/network/websocket.js +174 -0
- package/lib/{types → core/client/types}/client.type.d.ts +11 -13
- package/lib/{types → core/client/types}/index.type.d.ts +1 -3
- package/lib/{types → core/client/types}/index.type.js +1 -8
- package/lib/core/client/types/session.type.d.ts +11 -0
- package/lib/core/client/types/session.type.js +2 -0
- package/lib/exceptions/index.d.ts +6 -0
- package/lib/exceptions/index.js +16 -0
- package/lib/index.d.ts +11 -7
- package/lib/index.js +12 -8
- package/lib/utils/checkFilters.d.ts +1 -0
- package/lib/utils/checkFilters.js +20 -0
- package/lib/{core → utils}/session.d.ts +4 -2
- package/lib/{core → utils}/session.js +27 -11
- package/package.json +49 -43
- package/lib/core/client.d.ts +0 -38
- package/lib/core/client.js +0 -53
- package/lib/core/methods/utilities/index.d.ts +0 -8
- package/lib/core/methods/utilities/runErrorMiddlewares.d.ts +0 -3
- package/lib/core/methods/utilities/runErrorMiddlewares.js +0 -13
- package/lib/core/methods/utilities/useError.d.ts +0 -4
- package/lib/core/methods/utilities/useError.js +0 -6
- package/lib/core/network.d.ts +0 -49
- package/lib/core/network.js +0 -436
- package/lib/types/session.type.d.ts +0 -7
- /package/lib/{core → clients}/network_login.d.ts +0 -0
- /package/lib/core/{methods → bot/methods}/advanced/index.d.ts +0 -0
- /package/lib/core/{methods → bot/methods}/advanced/index.js +0 -0
- /package/lib/{types/client.type.js → core/bot/types/bot.type.js} +0 -0
- /package/lib/{types → core/client/contexts}/activities.type.js +0 -0
- /package/lib/{types → core/client/contexts}/chat.type.js +0 -0
- /package/lib/{types → core/client/contexts}/message.type.js +0 -0
- /package/lib/{types → core/client/contexts}/notifications.type.js +0 -0
- /package/lib/core/{crypto.d.ts → client/crypto.d.ts} +0 -0
- /package/lib/core/{crypto.js → client/crypto.js} +0 -0
- /package/lib/core/{methods → client/methods}/advanced/builder.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/advanced/builder.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/index.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/logout.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/logout.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/registerDevice.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/registerDevice.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/sendCode.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/sendCode.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/signIn.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/signIn.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/addChannel.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/addChannel.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/addChannelMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/addChannelMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/banChannelMember.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/banChannelMember.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/cancelChangeObjectOwner.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/cancelChangeObjectOwner.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/channelPreviewByJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/channelPreviewByJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/checkChannelUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/checkChannelUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/createChannelVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/createChannelVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/discardChannelVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/discardChannelVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/editChannelInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/editChannelInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getBannedChannelMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getBannedChannelMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAdminAccessList.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAdminAccessList.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAdminMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAdminMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAllMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAllMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelLink.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getPendingObjectOwner.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getPendingObjectOwner.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/index.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/joinChannelAction.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/joinChannelAction.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/joinChannelByLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/joinChannelByLink.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/leaveChannelVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/leaveChannelVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/removeChannel.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/removeChannel.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/requestChangeObjectOwner.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/requestChangeObjectOwner.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/seenChannelMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/seenChannelMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/setChannelLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/setChannelLink.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/setChannelVoiceChatSetting.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/setChannelVoiceChatSetting.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/updateChannelUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/updateChannelUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/actionOnJoinRequest.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/actionOnJoinRequest.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/addLiveComment.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/addLiveComment.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/clickMessageUrl.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/clickMessageUrl.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/createJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/createJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/deleteAvatar.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/deleteAvatar.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/deleteChatHistory.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/deleteChatHistory.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/editJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/editJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getAbsObjects.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getAbsObjects.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getAvatars.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getAvatars.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChatReaction.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChatReaction.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChats.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChats.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChatsUpdates.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChatsUpdates.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getJoinLinks.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getJoinLinks.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getJoinRequests.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getJoinRequests.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLinkFromAppUrl.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLinkFromAppUrl.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLiveComments.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLiveComments.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLivePlayUrl.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLivePlayUrl.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLiveStatus.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLiveStatus.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getObjectInfoByUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getObjectInfoByUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getTopChatUsers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getTopChatUsers.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/index.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/removeFromTopChatUsers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/removeFromTopChatUsers.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/removeJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/removeJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/searchChatMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/searchChatMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/searchGlobalMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/searchGlobalMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/seenChats.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/seenChats.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/sendChatActivity.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/sendChatActivity.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/sendLive.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/sendLive.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/setActionChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/setActionChat.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/uploadAvatar.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/uploadAvatar.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/addAddressBook.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/addAddressBook.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/deleteContact.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/deleteContact.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContacts.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContacts.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContactsLastOnline.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContactsLastOnline.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContactsUpdates.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContactsUpdates.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/index.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/resetContacts.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/resetContacts.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/banMember.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/banMember.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/deleteMessagebyCount.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/deleteMessagebyCount.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getObjectByUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getObjectByUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getProfileLinkItems.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getProfileLinkItems.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getRelatedObjects.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getRelatedObjects.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getTranscription.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getTranscription.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/index.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/join.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/join.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/joinVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/joinVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/leaveChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/leaveChat.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/onEditMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/reportObject.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/reportObject.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/searchGlobalObjects.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/searchGlobalObjects.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/sendVoiceChatActivity.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/sendVoiceChatActivity.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/setVoiceChatState.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/setVoiceChatState.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/transcribeVoice.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/transcribeVoice.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/userIsAdmin.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/userIsAdmin.js +0 -0
- /package/lib/core/{methods → client/methods}/gif/addToMyGifSet.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/gif/addToMyGifSet.js +0 -0
- /package/lib/core/{methods → client/methods}/gif/getMyGifSet.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/gif/getMyGifSet.js +0 -0
- /package/lib/core/{methods → client/methods}/gif/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/gif/index.js +0 -0
- /package/lib/core/{methods → client/methods}/gif/removeFromMyGifSet.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/gif/removeFromMyGifSet.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/addGroup.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/addGroup.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/addGroupMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/addGroupMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/banGroupMember.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/banGroupMember.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/createGroupVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/createGroupVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/deleteNoAccessGroupChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/deleteNoAccessGroupChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/discardGroupVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/discardGroupVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/editGroupInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/editGroupInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getBannedGroupMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getBannedGroupMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAdminAccessList.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAdminAccessList.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAdminMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAdminMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAllMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAllMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupDefaultAccess.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupDefaultAccess.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupLink.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupMentionList.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupMentionList.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupOnlineCount.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupOnlineCount.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatParticipants.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatParticipants.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatUpdates.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatUpdates.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/groupPreviewByJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/groupPreviewByJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/index.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/joinGroup.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/joinGroupVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/joinGroupVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/leaveGroup.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/leaveGroup.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/leaveGroupVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/leaveGroupVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/removeGroup.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/removeGroup.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/seenGroupMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/seenGroupMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupAdmin.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupAdmin.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupDefaultAccess.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupDefaultAccess.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupLink.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupVoiceChatSetting.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupVoiceChatSetting.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/actionOnMessageReaction.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/actionOnMessageReaction.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/createPoll.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/createPoll.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/deleteMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/deleteMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/editMessage.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/editMessage.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/forwardMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/forwardMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessageShareUrl.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessageShareUrl.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesByID.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesByID.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesInterval.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesInterval.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesUpdates.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesUpdates.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getPollOptionVoters.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getPollOptionVoters.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getPollStatus.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getPollStatus.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/index.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendDocument.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendDocument.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendFileInline.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendFileInline.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendGif.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendGif.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendMessage.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendMessage.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendMusic.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendMusic.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendPhoto.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendPhoto.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendSticker.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendSticker.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendText.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendText.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVideo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVideo.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVideoMessage.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVideoMessage.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVoice.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVoice.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/setPinMessage.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/setPinMessage.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/votePoll.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/votePoll.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/changePassword.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/changePassword.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/checkTwoStepPasscode.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/checkTwoStepPasscode.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/deleteFolder.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/deleteFolder.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getBlockedUsers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getBlockedUsers.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getFolders.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getFolders.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getMySessions.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getMySessions.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getPrivacySetting.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getPrivacySetting.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getSuggestedFolders.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getSuggestedFolders.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getTwoPasscodeStatus.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getTwoPasscodeStatus.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/index.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/requestRecoveryEmail.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/requestRecoveryEmail.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/setSetting.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/setSetting.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/setupTwoStepVerification.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/setupTwoStepVerification.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/terminateOtherSessions.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/terminateOtherSessions.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/terminateSession.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/terminateSession.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/turnOffTwoStep.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/turnOffTwoStep.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/updateProfile.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/updateProfile.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/updateUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/updateUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/verifyRecoveryEmail.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/verifyRecoveryEmail.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/actionOnStickerSet.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/actionOnStickerSet.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getMyStickerSets.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getMyStickerSets.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickerSetByID.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickerSetByID.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickersByEmoji.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickersByEmoji.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickersBySetIds.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickersBySetIds.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getTrendStickerSets.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getTrendStickerSets.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/index.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/searchStickers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/searchStickers.js +0 -0
- /package/lib/core/{methods → client/methods}/users/checkUserUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/checkUserUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/users/deleteUserChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/deleteUserChat.js +0 -0
- /package/lib/core/{methods → client/methods}/users/getMe.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/getMe.js +0 -0
- /package/lib/core/{methods → client/methods}/users/getUserInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/getUserInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/users/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/index.js +0 -0
- /package/lib/core/{methods → client/methods}/users/setBlockUser.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/setBlockUser.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/requestSendFile.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/requestSendFile.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/run.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/run.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/start.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/thumbnail.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/thumbnail.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/usePlugin.js +0 -0
- /package/lib/core/{parser.d.ts → client/parser.d.ts} +0 -0
- /package/lib/core/{parser.js → client/parser.js} +0 -0
- /package/lib/{types/decorators.type.js → core/client/types/client.type.js} +0 -0
- /package/lib/{types → core/client/types}/decorators.type.d.ts +0 -0
- /package/lib/{types/network.type.js → core/client/types/decorators.type.js} +0 -0
- /package/lib/{types → core/client/types}/network.type.d.ts +0 -0
- /package/lib/{types/session.type.js → core/client/types/network.type.js} +0 -0
- /package/lib/{core → utils}/utils.d.ts +0 -0
- /package/lib/{core → utils}/utils.js +0 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
import Network from './network';
|
2
|
+
import Methods from './methods';
|
3
|
+
import SessionManager from '../../utils/session';
|
4
|
+
import Message from './contexts/message.type';
|
5
|
+
import { ClientTypes } from './types/index.type';
|
6
|
+
import { ContextMap, Handler } from './types/client.type';
|
7
|
+
export default class Client extends Methods {
|
8
|
+
private session;
|
9
|
+
platform: ClientTypes.PlatformType;
|
10
|
+
timeout: number;
|
11
|
+
initialize: boolean;
|
12
|
+
key?: Buffer<ArrayBuffer>;
|
13
|
+
privateKey?: string;
|
14
|
+
decode_auth?: string;
|
15
|
+
auth?: string;
|
16
|
+
sessionDb: SessionManager;
|
17
|
+
network: Network;
|
18
|
+
plugins: ClientTypes.RubPlugin[];
|
19
|
+
errorMiddlewares: ClientTypes.ErrorMiddleware[];
|
20
|
+
userGuid?: string;
|
21
|
+
handlers: {
|
22
|
+
[K in keyof ContextMap]: Handler<ContextMap[K]>[];
|
23
|
+
};
|
24
|
+
constructor(session: ClientTypes.SessionType, platform?: ClientTypes.PlatformType, timeout?: number);
|
25
|
+
on<T extends keyof typeof this.handlers>(type: T, handler: (ctx: ContextMap[T]) => Promise<void>): void;
|
26
|
+
on<T extends keyof typeof this.handlers>(type: T, filters: Array<(ctx: ContextMap[T]) => boolean | Promise<boolean>>, handler: (ctx: ContextMap[T]) => Promise<void>): void;
|
27
|
+
command(prefix: string | RegExp, handler: (ctx: Message) => Promise<void>): void;
|
28
|
+
command(prefix: string | RegExp, filters: Array<(ctx: Message) => boolean | Promise<boolean>>, handler: (ctx: Message) => Promise<void>): void;
|
29
|
+
}
|
@@ -0,0 +1,65 @@
|
|
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 network_1 = __importDefault(require("./network"));
|
7
|
+
const methods_1 = __importDefault(require("./methods"));
|
8
|
+
const session_1 = __importDefault(require("../../utils/session"));
|
9
|
+
class Client extends methods_1.default {
|
10
|
+
constructor(session, platform = 'Web', timeout = 5000) {
|
11
|
+
super();
|
12
|
+
this.session = session;
|
13
|
+
this.platform = platform;
|
14
|
+
this.timeout = timeout;
|
15
|
+
this.initialize = false;
|
16
|
+
this.plugins = [];
|
17
|
+
this.errorMiddlewares = [];
|
18
|
+
this.handlers = {
|
19
|
+
chat: [],
|
20
|
+
message: [],
|
21
|
+
activities: [],
|
22
|
+
notifications: [],
|
23
|
+
};
|
24
|
+
this.sessionDb = new session_1.default(this.session, undefined, "CLIENT");
|
25
|
+
this.network = new network_1.default(this);
|
26
|
+
this.start();
|
27
|
+
}
|
28
|
+
on(type, filtersOrHandler, maybeHandler) {
|
29
|
+
if (typeof filtersOrHandler === 'function') {
|
30
|
+
this.handlers[type].push({
|
31
|
+
filters: [],
|
32
|
+
handler: filtersOrHandler,
|
33
|
+
});
|
34
|
+
}
|
35
|
+
else if (Array.isArray(filtersOrHandler) && maybeHandler) {
|
36
|
+
this.handlers[type].push({
|
37
|
+
filters: filtersOrHandler,
|
38
|
+
handler: maybeHandler,
|
39
|
+
});
|
40
|
+
}
|
41
|
+
else {
|
42
|
+
throw new Error('Invalid arguments for on()');
|
43
|
+
}
|
44
|
+
}
|
45
|
+
command(prefix, filtersOrHandler, maybeHandler) {
|
46
|
+
if (typeof filtersOrHandler === 'function') {
|
47
|
+
this.handlers['message'].push({
|
48
|
+
filters: [],
|
49
|
+
handler: filtersOrHandler,
|
50
|
+
prefix,
|
51
|
+
});
|
52
|
+
}
|
53
|
+
else if (Array.isArray(filtersOrHandler) && maybeHandler) {
|
54
|
+
this.handlers['message'].push({
|
55
|
+
filters: filtersOrHandler,
|
56
|
+
handler: maybeHandler,
|
57
|
+
prefix,
|
58
|
+
});
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
throw new Error('Invalid arguments for command()');
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
exports.default = Client;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Client } from '
|
2
|
-
import { DecoratorsTypes } from '
|
1
|
+
import { Client } from '../../..';
|
2
|
+
import { DecoratorsTypes } from '../types/index.type';
|
3
3
|
declare class Activities implements DecoratorsTypes.ShowActivities {
|
4
4
|
type: string;
|
5
5
|
object_guid: string;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Client } from '
|
2
|
-
import { DecoratorsTypes } from '
|
1
|
+
import { Client } from '../../..';
|
2
|
+
import { DecoratorsTypes } from '../types/index.type';
|
3
3
|
declare class Chat implements DecoratorsTypes.ChatUpdates {
|
4
4
|
object_guid: string;
|
5
5
|
action: string;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import Activities from './activities.type';
|
2
|
+
import Chat from './chat.type';
|
3
|
+
import Message from './message.type';
|
4
|
+
import Notifications from './notifications.type';
|
5
|
+
export declare const ContextConstructors: {
|
6
|
+
message: typeof Message;
|
7
|
+
chat: typeof Chat;
|
8
|
+
activities: typeof Activities;
|
9
|
+
notifications: typeof Notifications;
|
10
|
+
};
|
@@ -0,0 +1,16 @@
|
|
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.ContextConstructors = void 0;
|
7
|
+
const activities_type_1 = __importDefault(require("./activities.type"));
|
8
|
+
const chat_type_1 = __importDefault(require("./chat.type"));
|
9
|
+
const message_type_1 = __importDefault(require("./message.type"));
|
10
|
+
const notifications_type_1 = __importDefault(require("./notifications.type"));
|
11
|
+
exports.ContextConstructors = {
|
12
|
+
message: message_type_1.default,
|
13
|
+
chat: chat_type_1.default,
|
14
|
+
activities: activities_type_1.default,
|
15
|
+
notifications: notifications_type_1.default,
|
16
|
+
};
|
@@ -0,0 +1,14 @@
|
|
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.Notifications = exports.Message = exports.Chat = exports.Activities = void 0;
|
7
|
+
const activities_type_1 = __importDefault(require("./activities.type"));
|
8
|
+
exports.Activities = activities_type_1.default;
|
9
|
+
const chat_type_1 = __importDefault(require("./chat.type"));
|
10
|
+
exports.Chat = chat_type_1.default;
|
11
|
+
const message_type_1 = __importDefault(require("./message.type"));
|
12
|
+
exports.Message = message_type_1.default;
|
13
|
+
const notifications_type_1 = __importDefault(require("./notifications.type"));
|
14
|
+
exports.Notifications = notifications_type_1.default;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Client } from '
|
2
|
-
import { DecoratorsTypes } from '
|
1
|
+
import { Client } from '../../..';
|
2
|
+
import { DecoratorsTypes } from '../types/index.type';
|
3
3
|
declare class Message implements DecoratorsTypes.MessageUpdate {
|
4
4
|
message_id: string;
|
5
5
|
action: string;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Client } from '
|
2
|
-
import { DecoratorsTypes } from '
|
1
|
+
import { Client } from '../../..';
|
2
|
+
import { DecoratorsTypes } from '../types/index.type';
|
3
3
|
declare class Notifications implements DecoratorsTypes.ShowNotifications {
|
4
4
|
notification_id: string;
|
5
5
|
type: string;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { MessageUpdate, FileInline } from "
|
2
|
-
declare class
|
1
|
+
import { MessageUpdate, FileInline } from "./types/decorators.type";
|
2
|
+
declare class ClientFilters {
|
3
3
|
static findKey(message: any, key: string): any;
|
4
4
|
static guidType(message: MessageUpdate, startWith: string): boolean;
|
5
5
|
static isMention(message: MessageUpdate): boolean;
|
@@ -30,4 +30,4 @@ declare class Filters {
|
|
30
30
|
static startsWithCommand(text: string, object_guid?: string, length?: number): (message: MessageUpdate) => boolean | undefined;
|
31
31
|
static equalCommand(text: string, object_guid?: string): (message: MessageUpdate) => boolean | undefined;
|
32
32
|
}
|
33
|
-
export default
|
33
|
+
export default ClientFilters;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
class
|
3
|
+
class ClientFilters {
|
4
4
|
static findKey(message, key) {
|
5
5
|
if (!message || typeof message !== "object") {
|
6
6
|
return undefined;
|
@@ -14,14 +14,14 @@ class Filters {
|
|
14
14
|
if (Array.isArray(value)) {
|
15
15
|
for (const item of value) {
|
16
16
|
if (typeof item === "object") {
|
17
|
-
const found =
|
17
|
+
const found = ClientFilters.findKey(item, key);
|
18
18
|
if (found !== undefined)
|
19
19
|
return found;
|
20
20
|
}
|
21
21
|
}
|
22
22
|
}
|
23
23
|
if (typeof value === "object") {
|
24
|
-
const found =
|
24
|
+
const found = ClientFilters.findKey(value, key);
|
25
25
|
if (found !== undefined)
|
26
26
|
return found;
|
27
27
|
}
|
@@ -29,23 +29,23 @@ class Filters {
|
|
29
29
|
return undefined;
|
30
30
|
}
|
31
31
|
static guidType(message, startWith) {
|
32
|
-
const result =
|
32
|
+
const result = ClientFilters.findKey(message, "object_guid");
|
33
33
|
return result?.startsWith(startWith) ?? false;
|
34
34
|
}
|
35
35
|
static isMention(message) {
|
36
|
-
return !!
|
36
|
+
return !!ClientFilters.findKey(message.message?.metadata?.meta_data_parts, "link");
|
37
37
|
}
|
38
38
|
static isMarkdown(message) {
|
39
|
-
return !!
|
39
|
+
return !!ClientFilters.findKey(message.message, "metadata");
|
40
40
|
}
|
41
41
|
static isReply(message) {
|
42
|
-
return !!
|
42
|
+
return !!ClientFilters.findKey(message, "reply_to_message_id");
|
43
43
|
}
|
44
44
|
static isEdited(message) {
|
45
|
-
return !!
|
45
|
+
return !!ClientFilters.findKey(message, "is_edited");
|
46
46
|
}
|
47
47
|
static isLink(message) {
|
48
|
-
const link =
|
48
|
+
const link = ClientFilters.findKey(message, "text");
|
49
49
|
if (!link)
|
50
50
|
return false;
|
51
51
|
const RUBIKA_LINK_PATTERN = /\brubika\.ir\b/;
|
@@ -55,19 +55,19 @@ class Filters {
|
|
55
55
|
USERNAME_PATTERN.test(link));
|
56
56
|
}
|
57
57
|
static isText(message) {
|
58
|
-
return !!
|
58
|
+
return !!ClientFilters.findKey(message, "text");
|
59
59
|
}
|
60
60
|
static isGroup(message) {
|
61
|
-
return
|
61
|
+
return ClientFilters.guidType(message, "g0");
|
62
62
|
}
|
63
63
|
static isChannel(message) {
|
64
|
-
return
|
64
|
+
return ClientFilters.guidType(message, "c0");
|
65
65
|
}
|
66
66
|
static isPrivate(message) {
|
67
|
-
return
|
67
|
+
return ClientFilters.guidType(message, "u0");
|
68
68
|
}
|
69
69
|
static isForward(message) {
|
70
|
-
return !!
|
70
|
+
return !!ClientFilters.findKey(message, "forwarded_from");
|
71
71
|
}
|
72
72
|
static fileInline(message) {
|
73
73
|
return message.message?.file_inline;
|
@@ -76,40 +76,40 @@ class Filters {
|
|
76
76
|
return ["FileInline", "FileInlineCaption"].includes(message.message?.type);
|
77
77
|
}
|
78
78
|
static isFile(message) {
|
79
|
-
return
|
79
|
+
return ClientFilters.fileInline(message)?.type === "File";
|
80
80
|
}
|
81
81
|
static isPhoto(message) {
|
82
|
-
return
|
82
|
+
return ClientFilters.fileInline(message)?.type === "Image";
|
83
83
|
}
|
84
84
|
static isSticker(message) {
|
85
|
-
return
|
85
|
+
return ClientFilters.fileInline(message)?.type === "Sticker";
|
86
86
|
}
|
87
87
|
static isVideo(message) {
|
88
|
-
return
|
88
|
+
return ClientFilters.fileInline(message)?.type === "Video";
|
89
89
|
}
|
90
90
|
static isVoice(message) {
|
91
|
-
return
|
91
|
+
return ClientFilters.fileInline(message)?.type === "Voice";
|
92
92
|
}
|
93
93
|
static isGif(message) {
|
94
|
-
return
|
94
|
+
return ClientFilters.fileInline(message)?.type === "Gif";
|
95
95
|
}
|
96
96
|
static isMusic(message) {
|
97
|
-
return
|
97
|
+
return ClientFilters.fileInline(message)?.type === "Music";
|
98
98
|
}
|
99
99
|
static isLocation(message) {
|
100
|
-
return !!
|
100
|
+
return !!ClientFilters.findKey(message.message, "location");
|
101
101
|
}
|
102
102
|
static isContact(message) {
|
103
|
-
return !!
|
103
|
+
return !!ClientFilters.findKey(message.message, "contact_message");
|
104
104
|
}
|
105
105
|
static isPoll(message) {
|
106
|
-
return !!
|
106
|
+
return !!ClientFilters.findKey(message, "poll");
|
107
107
|
}
|
108
108
|
static isLive(message) {
|
109
|
-
return !!
|
109
|
+
return !!ClientFilters.findKey(message, "live_data");
|
110
110
|
}
|
111
111
|
static isEvent(message) {
|
112
|
-
return !!
|
112
|
+
return !!ClientFilters.findKey(message, "event_data");
|
113
113
|
}
|
114
114
|
static isLength(length, object_guid) {
|
115
115
|
return (message) => {
|
@@ -150,4 +150,4 @@ class Filters {
|
|
150
150
|
};
|
151
151
|
}
|
152
152
|
}
|
153
|
-
exports.default =
|
153
|
+
exports.default = ClientFilters;
|
@@ -0,0 +1,8 @@
|
|
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.builder = void 0;
|
7
|
+
const builder_1 = __importDefault(require("./builder"));
|
8
|
+
exports.builder = builder_1.default;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import Message from "
|
1
|
+
import Message from "../../contexts/message.type";
|
2
2
|
import Client from "../../client";
|
3
3
|
declare function onEditMessages(this: Client, object_guid: string, callback: (message: Message) => any): void;
|
4
4
|
export default onEditMessages;
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
async function joinGroup(link) {
|
4
4
|
if (link.includes('/'))
|
5
5
|
link = link.split('/').pop() || '';
|
6
|
-
console.log(link);
|
7
6
|
return await this.builder('joinGroup', { hash_link: link });
|
8
7
|
}
|
9
8
|
exports.default = joinGroup;
|
@@ -4,7 +4,7 @@ import * as Auth from './auth';
|
|
4
4
|
import * as Channels from './channels';
|
5
5
|
import * as Chats from './chats';
|
6
6
|
import * as Contacts from './contacts';
|
7
|
-
import * as Extras from
|
7
|
+
import * as Extras from './extras';
|
8
8
|
import * as Gif from './gif';
|
9
9
|
import * as Groups from './groups';
|
10
10
|
import * as Messages from './messages';
|
@@ -83,6 +83,7 @@ export default class Methods {
|
|
83
83
|
getProfileLinkItems(this: Client, ...args: Parameters<typeof Extras.getProfileLinkItems>): Promise<any>;
|
84
84
|
getRelatedObjects(this: Client, ...args: Parameters<typeof Extras.getRelatedObjects>): Promise<any>;
|
85
85
|
getTranscription(this: Client, ...args: Parameters<typeof Extras.getTranscription>): Promise<any>;
|
86
|
+
onEditMessages(this: Client, ...args: Parameters<typeof Extras.onEditMessages>): Promise<any>;
|
86
87
|
join(this: Client, ...args: Parameters<typeof Extras.join>): Promise<any>;
|
87
88
|
leaveChat(this: Client, ...args: Parameters<typeof Extras.leaveChat>): Promise<any>;
|
88
89
|
reportObject(this: Client, ...args: Parameters<typeof Extras.reportObject>): Promise<any>;
|
@@ -179,9 +180,9 @@ export default class Methods {
|
|
179
180
|
getMe(this: Client, ...args: Parameters<typeof Users.getMe>): Promise<any>;
|
180
181
|
getUserInfo(this: Client, ...args: Parameters<typeof Users.getUserInfo>): Promise<any>;
|
181
182
|
setBlockUser(this: Client, ...args: Parameters<typeof Users.setBlockUser>): Promise<any>;
|
182
|
-
|
183
|
+
download(this: Client, ...args: Parameters<typeof Utilities.download>): Promise<any>;
|
184
|
+
downloadProfilePicture(this: Client, ...args: Parameters<typeof Utilities.downloadProfilePicture>): Promise<any>;
|
183
185
|
usePlugin(this: Client, ...args: Parameters<typeof Utilities.usePlugin>): Promise<any>;
|
184
|
-
useError(this: Client, ...args: Parameters<typeof Utilities.useError>): Promise<any>;
|
185
186
|
run(this: Client, ...args: Parameters<typeof Utilities.run>): Promise<any>;
|
186
187
|
requestSendFile(this: Client, ...args: Parameters<typeof Utilities.requestSendFile>): Promise<any>;
|
187
188
|
start(this: Client, ...args: Parameters<typeof Utilities.start>): Promise<any>;
|
@@ -263,6 +263,9 @@ class Methods {
|
|
263
263
|
async getTranscription(...args) {
|
264
264
|
return Extras.getTranscription.apply(this, args);
|
265
265
|
}
|
266
|
+
async onEditMessages(...args) {
|
267
|
+
return Extras.onEditMessages.apply(this, args);
|
268
|
+
}
|
266
269
|
async join(...args) {
|
267
270
|
return Extras.join.apply(this, args);
|
268
271
|
}
|
@@ -564,27 +567,15 @@ class Methods {
|
|
564
567
|
return Users.setBlockUser.apply(this, args);
|
565
568
|
}
|
566
569
|
// // utilities
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
// }
|
573
|
-
// async downloadProfilePicture(
|
574
|
-
// this: Client,
|
575
|
-
// ...args: Parameters<typeof Utilities.downloadProfilePicture>
|
576
|
-
// ): Promise<any> {
|
577
|
-
// return Utilities.downloadProfilePicture.apply(this, args);
|
578
|
-
// }
|
579
|
-
async runErrorMiddlewares(...args) {
|
580
|
-
return Utilities.runErrorMiddlewares.apply(this, args);
|
570
|
+
async download(...args) {
|
571
|
+
return Utilities.download.apply(this, args);
|
572
|
+
}
|
573
|
+
async downloadProfilePicture(...args) {
|
574
|
+
return Utilities.downloadProfilePicture.apply(this, args);
|
581
575
|
}
|
582
576
|
async usePlugin(...args) {
|
583
577
|
return Utilities.usePlugin.apply(this, args);
|
584
578
|
}
|
585
|
-
async useError(...args) {
|
586
|
-
return Utilities.useError.apply(this, args);
|
587
|
-
}
|
588
579
|
async run(...args) {
|
589
580
|
return Utilities.run.apply(this, args);
|
590
581
|
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
async function download(file_inline, chunk = 1054768) {
|
4
|
+
return await this.network.download(file_inline.dc_id, file_inline.file_id, file_inline.access_hash_rec, file_inline.size, chunk);
|
5
|
+
}
|
6
|
+
exports.default = download;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const undici_1 = require("undici");
|
4
|
+
const buffer_1 = require("buffer");
|
5
|
+
async function downloadProfilePicture(object_guid) {
|
6
|
+
const avatarsInfo = await this.getAvatars(object_guid);
|
7
|
+
if (!avatarsInfo || !avatarsInfo.avatars?.[0]?.main)
|
8
|
+
return null;
|
9
|
+
const avatar = avatarsInfo.avatars[0].main;
|
10
|
+
const url = `https://messenger${avatar.dc_id}.iranlms.ir/InternFile.ashx?id=${avatar.file_id}&ach=${avatar.access_hash_rec}`;
|
11
|
+
try {
|
12
|
+
const { statusCode, body } = await (0, undici_1.request)(url, {
|
13
|
+
method: "GET",
|
14
|
+
});
|
15
|
+
if (statusCode !== 200 || !body)
|
16
|
+
return null;
|
17
|
+
const chunks = [];
|
18
|
+
for await (const chunk of body) {
|
19
|
+
chunks.push(typeof chunk === "string" ? buffer_1.Buffer.from(chunk) : chunk);
|
20
|
+
}
|
21
|
+
return buffer_1.Buffer.concat(chunks);
|
22
|
+
}
|
23
|
+
catch (err) {
|
24
|
+
console.error("Failed to download profile picture:", err);
|
25
|
+
return null;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
exports.default = downloadProfilePicture;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import run from './run';
|
2
|
+
import requestSendFile from './requestSendFile';
|
3
|
+
import start from './start';
|
4
|
+
import thumbnail from './thumbnail';
|
5
|
+
import usePlugin from './usePlugin';
|
6
|
+
import download from './download';
|
7
|
+
import downloadProfilePicture from './downloadProfilePicture';
|
8
|
+
export { run, start, download, thumbnail, usePlugin, requestSendFile, downloadProfilePicture };
|
@@ -3,7 +3,7 @@ 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.
|
6
|
+
exports.downloadProfilePicture = exports.requestSendFile = exports.usePlugin = exports.thumbnail = exports.download = exports.start = exports.run = void 0;
|
7
7
|
const run_1 = __importDefault(require("./run"));
|
8
8
|
exports.run = run_1.default;
|
9
9
|
const requestSendFile_1 = __importDefault(require("./requestSendFile"));
|
@@ -12,9 +12,9 @@ const start_1 = __importDefault(require("./start"));
|
|
12
12
|
exports.start = start_1.default;
|
13
13
|
const thumbnail_1 = __importDefault(require("./thumbnail"));
|
14
14
|
exports.thumbnail = thumbnail_1.default;
|
15
|
-
const useError_1 = __importDefault(require("./useError"));
|
16
|
-
exports.useError = useError_1.default;
|
17
15
|
const usePlugin_1 = __importDefault(require("./usePlugin"));
|
18
16
|
exports.usePlugin = usePlugin_1.default;
|
19
|
-
const
|
20
|
-
exports.
|
17
|
+
const download_1 = __importDefault(require("./download"));
|
18
|
+
exports.download = download_1.default;
|
19
|
+
const downloadProfilePicture_1 = __importDefault(require("./downloadProfilePicture"));
|
20
|
+
exports.downloadProfilePicture = downloadProfilePicture_1.default;
|
@@ -3,12 +3,12 @@ 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
|
-
const prompt_1 = __importDefault(require("
|
6
|
+
const prompt_1 = __importDefault(require("../../../../utils/prompt"));
|
7
7
|
const crypto_1 = __importDefault(require("../../crypto"));
|
8
8
|
async function start() {
|
9
9
|
const DBInformation = this.sessionDb.getSession();
|
10
10
|
if (DBInformation) {
|
11
|
-
this.auth = DBInformation
|
11
|
+
this.auth = DBInformation?.auth;
|
12
12
|
this.userGuid = DBInformation.guid;
|
13
13
|
this.privateKey = DBInformation.private_key;
|
14
14
|
if (typeof DBInformation.agent === 'string')
|
@@ -36,7 +36,6 @@ async function start() {
|
|
36
36
|
}
|
37
37
|
}
|
38
38
|
let result = await this.sendCode(phone_number);
|
39
|
-
console.log(result);
|
40
39
|
if (result.status == 'SendPassKey') {
|
41
40
|
while (true) {
|
42
41
|
let pass_key = await (0, prompt_1.default)(`Password [${result.hint_pass_key}] > `);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Network from '.';
|
2
|
+
interface SendPayloadInputs {
|
3
|
+
input?: Record<string, any>;
|
4
|
+
method?: string;
|
5
|
+
tmp_session: boolean;
|
6
|
+
}
|
7
|
+
/**
|
8
|
+
* Retrieves API and WSS server URLs
|
9
|
+
*/
|
10
|
+
export declare function getDcs(network: Network): Promise<boolean>;
|
11
|
+
/**
|
12
|
+
* Sends a POST request with retry logic and enhanced error reporting
|
13
|
+
*/
|
14
|
+
export declare function sendRequest(network: Network, url: string, data: any): Promise<unknown>;
|
15
|
+
export declare function sendPayload(network: Network, datas: SendPayloadInputs): Promise<any>;
|
16
|
+
export {};
|