rubjs 2.9.3 → 3.0.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 -25
- package/lib/clients/VoiceChatClient.d.ts +31 -0
- package/lib/clients/VoiceChatClient.js +147 -0
- package/lib/clients/index.d.ts +3 -0
- package/lib/clients/index.js +10 -0
- package/lib/clients/loginClient.d.ts +47 -0
- package/lib/clients/loginClient.js +108 -0
- package/lib/clients/network_login.d.ts +47 -0
- package/lib/clients/network_login.js +137 -0
- package/lib/core/client.d.ts +29 -0
- package/lib/core/client.js +65 -0
- package/lib/core/context/activities.type.d.ts +12 -0
- package/lib/core/context/activities.type.js +18 -0
- package/lib/core/context/chat.type.d.ts +14 -0
- package/lib/core/context/chat.type.js +20 -0
- package/lib/core/context/contextConstructors.d.ts +10 -0
- package/lib/core/context/contextConstructors.js +16 -0
- package/lib/core/context/index.d.ts +5 -0
- package/lib/core/context/index.js +14 -0
- package/lib/core/context/message.type.d.ts +26 -0
- package/lib/core/context/message.type.js +72 -0
- package/lib/core/context/notifications.type.d.ts +14 -0
- package/lib/core/context/notifications.type.js +20 -0
- package/lib/core/crypto.d.ts +12 -0
- package/lib/core/crypto.js +95 -0
- package/lib/core/filters.d.ts +33 -0
- package/lib/core/filters.js +153 -0
- package/lib/core/methods/advanced/builder.d.ts +3 -0
- package/lib/core/methods/advanced/builder.js +30 -0
- package/lib/core/methods/auth/logout.d.ts +3 -0
- package/lib/core/methods/auth/logout.js +6 -0
- package/lib/core/methods/auth/registerDevice.d.ts +3 -0
- package/lib/core/methods/auth/registerDevice.js +47 -0
- package/lib/core/methods/auth/sendCode.d.ts +3 -0
- package/lib/core/methods/auth/sendCode.js +16 -0
- package/lib/core/methods/auth/signIn.d.ts +3 -0
- package/lib/core/methods/auth/signIn.js +13 -0
- package/lib/core/methods/channels/addChannel.d.ts +3 -0
- package/lib/core/methods/channels/addChannel.js +15 -0
- package/lib/core/methods/channels/addChannelMembers.d.ts +3 -0
- package/lib/core/methods/channels/addChannelMembers.js +11 -0
- package/lib/core/methods/channels/banChannelMember.d.ts +3 -0
- package/lib/core/methods/channels/banChannelMember.js +14 -0
- package/lib/core/methods/channels/cancelChangeObjectOwner.d.ts +3 -0
- package/lib/core/methods/channels/cancelChangeObjectOwner.js +6 -0
- package/lib/core/methods/channels/channelPreviewByJoinLink.d.ts +3 -0
- package/lib/core/methods/channels/channelPreviewByJoinLink.js +8 -0
- package/lib/core/methods/channels/checkChannelUsername.d.ts +3 -0
- package/lib/core/methods/channels/checkChannelUsername.js +8 -0
- package/lib/core/methods/channels/createChannelVoiceChat.d.ts +3 -0
- package/lib/core/methods/channels/createChannelVoiceChat.js +6 -0
- package/lib/core/methods/channels/discardChannelVoiceChat.d.ts +3 -0
- package/lib/core/methods/channels/discardChannelVoiceChat.js +9 -0
- package/lib/core/methods/channels/editChannelInfo.d.ts +4 -0
- package/lib/core/methods/channels/editChannelInfo.js +39 -0
- package/lib/core/methods/channels/getBannedChannelMembers.d.ts +3 -0
- package/lib/core/methods/channels/getBannedChannelMembers.js +9 -0
- package/lib/core/methods/channels/getChannelAdminAccessList.d.ts +3 -0
- package/lib/core/methods/channels/getChannelAdminAccessList.js +9 -0
- package/lib/core/methods/channels/getChannelAdminMembers.d.ts +3 -0
- package/lib/core/methods/channels/getChannelAdminMembers.js +9 -0
- package/lib/core/methods/channels/getChannelAllMembers.d.ts +3 -0
- package/lib/core/methods/channels/getChannelAllMembers.js +10 -0
- package/lib/core/methods/channels/getChannelInfo.d.ts +3 -0
- package/lib/core/methods/channels/getChannelInfo.js +6 -0
- package/lib/core/methods/channels/getChannelLink.d.ts +3 -0
- package/lib/core/methods/channels/getChannelLink.js +6 -0
- package/lib/core/methods/channels/getPendingObjectOwner.d.ts +3 -0
- package/lib/core/methods/channels/getPendingObjectOwner.js +6 -0
- package/lib/core/methods/channels/joinChannelAction.d.ts +3 -0
- package/lib/core/methods/channels/joinChannelAction.js +10 -0
- package/lib/core/methods/channels/joinChannelByLink.d.ts +3 -0
- package/lib/core/methods/channels/joinChannelByLink.js +8 -0
- package/lib/core/methods/channels/leaveChannelVoiceChat.d.ts +3 -0
- package/lib/core/methods/channels/leaveChannelVoiceChat.js +9 -0
- package/lib/core/methods/channels/removeChannel.d.ts +3 -0
- package/lib/core/methods/channels/removeChannel.js +6 -0
- package/lib/core/methods/channels/requestChangeObjectOwner.d.ts +3 -0
- package/lib/core/methods/channels/requestChangeObjectOwner.js +9 -0
- package/lib/core/methods/channels/seenChannelMessages.d.ts +3 -0
- package/lib/core/methods/channels/seenChannelMessages.js +10 -0
- package/lib/core/methods/channels/setChannelLink.d.ts +3 -0
- package/lib/core/methods/channels/setChannelLink.js +6 -0
- package/lib/core/methods/channels/setChannelVoiceChatSetting.d.ts +3 -0
- package/lib/core/methods/channels/setChannelVoiceChatSetting.js +15 -0
- package/lib/core/methods/channels/updateChannelUsername.d.ts +3 -0
- package/lib/core/methods/channels/updateChannelUsername.js +9 -0
- package/lib/core/methods/chats/actionOnJoinRequest.d.ts +3 -0
- package/lib/core/methods/chats/actionOnJoinRequest.js +11 -0
- package/lib/core/methods/chats/addLiveComment.d.ts +3 -0
- package/lib/core/methods/chats/addLiveComment.js +6 -0
- package/lib/core/methods/chats/clickMessageUrl.d.ts +3 -0
- package/lib/core/methods/chats/clickMessageUrl.js +6 -0
- package/lib/core/methods/chats/createJoinLink.d.ts +3 -0
- package/lib/core/methods/chats/createJoinLink.js +12 -0
- package/lib/core/methods/chats/deleteAvatar.d.ts +3 -0
- package/lib/core/methods/chats/deleteAvatar.js +6 -0
- package/lib/core/methods/chats/deleteChatHistory.d.ts +3 -0
- package/lib/core/methods/chats/deleteChatHistory.js +9 -0
- package/lib/core/methods/chats/editJoinLink.d.ts +3 -0
- package/lib/core/methods/chats/editJoinLink.js +23 -0
- package/lib/core/methods/chats/getAbsObjects.d.ts +3 -0
- package/lib/core/methods/chats/getAbsObjects.js +8 -0
- package/lib/core/methods/chats/getAvatars.d.ts +3 -0
- package/lib/core/methods/chats/getAvatars.js +6 -0
- package/lib/core/methods/chats/getChatReaction.d.ts +3 -0
- package/lib/core/methods/chats/getChatReaction.js +6 -0
- package/lib/core/methods/chats/getChats.d.ts +3 -0
- package/lib/core/methods/chats/getChats.js +6 -0
- package/lib/core/methods/chats/getChatsUpdates.d.ts +3 -0
- package/lib/core/methods/chats/getChatsUpdates.js +6 -0
- package/lib/core/methods/chats/getJoinLinks.d.ts +3 -0
- package/lib/core/methods/chats/getJoinLinks.js +6 -0
- package/lib/core/methods/chats/getJoinRequests.d.ts +3 -0
- package/lib/core/methods/chats/getJoinRequests.js +6 -0
- package/lib/core/methods/chats/getLinkFromAppUrl.d.ts +3 -0
- package/lib/core/methods/chats/getLinkFromAppUrl.js +6 -0
- package/lib/core/methods/chats/getLiveComments.d.ts +3 -0
- package/lib/core/methods/chats/getLiveComments.js +6 -0
- package/lib/core/methods/chats/getLivePlayUrl.d.ts +3 -0
- package/lib/core/methods/chats/getLivePlayUrl.js +6 -0
- package/lib/core/methods/chats/getLiveStatus.d.ts +3 -0
- package/lib/core/methods/chats/getLiveStatus.js +6 -0
- package/lib/core/methods/chats/getObjectInfoByUsername.d.ts +3 -0
- package/lib/core/methods/chats/getObjectInfoByUsername.js +8 -0
- package/lib/core/methods/chats/getTopChatUsers.d.ts +3 -0
- package/lib/core/methods/chats/getTopChatUsers.js +7 -0
- package/lib/core/methods/chats/removeFromTopChatUsers.d.ts +3 -0
- package/lib/core/methods/chats/removeFromTopChatUsers.js +6 -0
- package/lib/core/methods/chats/removeJoinLink.d.ts +3 -0
- package/lib/core/methods/chats/removeJoinLink.js +8 -0
- package/lib/core/methods/chats/searchChatMessages.d.ts +3 -0
- package/lib/core/methods/chats/searchChatMessages.js +14 -0
- package/lib/core/methods/chats/searchGlobalMessages.d.ts +3 -0
- package/lib/core/methods/chats/searchGlobalMessages.js +6 -0
- package/lib/core/methods/chats/seenChats.d.ts +3 -0
- package/lib/core/methods/chats/seenChats.js +6 -0
- package/lib/core/methods/chats/sendChatActivity.d.ts +3 -0
- package/lib/core/methods/chats/sendChatActivity.js +10 -0
- package/lib/core/methods/chats/sendLive.d.ts +3 -0
- package/lib/core/methods/chats/sendLive.js +17 -0
- package/lib/core/methods/chats/setActionChat.d.ts +3 -0
- package/lib/core/methods/chats/setActionChat.js +10 -0
- package/lib/core/methods/chats/uploadAvatar.d.ts +3 -0
- package/lib/core/methods/chats/uploadAvatar.js +14 -0
- package/lib/core/methods/contacts/addAddressBook.d.ts +3 -0
- package/lib/core/methods/contacts/addAddressBook.js +6 -0
- package/lib/core/methods/contacts/deleteContact.d.ts +3 -0
- package/lib/core/methods/contacts/deleteContact.js +6 -0
- package/lib/core/methods/contacts/getContacts.d.ts +3 -0
- package/lib/core/methods/contacts/getContacts.js +6 -0
- package/lib/core/methods/contacts/getContactsLastOnline.d.ts +3 -0
- package/lib/core/methods/contacts/getContactsLastOnline.js +6 -0
- package/lib/core/methods/contacts/getContactsUpdates.d.ts +3 -0
- package/lib/core/methods/contacts/getContactsUpdates.js +6 -0
- package/lib/core/methods/contacts/resetContacts.d.ts +3 -0
- package/lib/core/methods/contacts/resetContacts.js +7 -0
- package/lib/core/methods/extras/banMember.d.ts +3 -0
- package/lib/core/methods/extras/banMember.js +9 -0
- package/lib/core/methods/extras/deleteMessagebyCount.d.ts +3 -0
- package/lib/core/methods/extras/deleteMessagebyCount.js +19 -0
- package/lib/core/methods/extras/getInfo.d.ts +3 -0
- package/lib/core/methods/extras/getInfo.js +15 -0
- package/lib/core/methods/extras/getObjectByUsername.d.ts +3 -0
- package/lib/core/methods/extras/getObjectByUsername.js +8 -0
- package/lib/core/methods/extras/getProfileLinkItems.d.ts +3 -0
- package/lib/core/methods/extras/getProfileLinkItems.js +6 -0
- package/lib/core/methods/extras/getRelatedObjects.d.ts +3 -0
- package/lib/core/methods/extras/getRelatedObjects.js +6 -0
- package/lib/core/methods/extras/getTranscription.d.ts +3 -0
- package/lib/core/methods/extras/getTranscription.js +9 -0
- package/lib/core/methods/extras/join.d.ts +3 -0
- package/lib/core/methods/extras/join.js +11 -0
- package/lib/core/methods/extras/joinVoiceChat.d.ts +3 -0
- package/lib/core/methods/extras/joinVoiceChat.js +11 -0
- package/lib/core/methods/extras/leaveChat.d.ts +3 -0
- package/lib/core/methods/extras/leaveChat.js +9 -0
- package/lib/core/methods/extras/onEditMessages.d.ts +4 -0
- package/lib/core/methods/extras/onEditMessages.js +32 -0
- package/lib/core/methods/extras/reportObject.d.ts +14 -0
- package/lib/core/methods/extras/reportObject.js +21 -0
- package/lib/core/methods/extras/searchGlobalObjects.d.ts +3 -0
- package/lib/core/methods/extras/searchGlobalObjects.js +6 -0
- package/lib/core/methods/extras/sendVoiceChatActivity.d.ts +3 -0
- package/lib/core/methods/extras/sendVoiceChatActivity.js +13 -0
- package/lib/core/methods/extras/setVoiceChatState.d.ts +3 -0
- package/lib/core/methods/extras/setVoiceChatState.js +14 -0
- package/lib/core/methods/extras/transcribeVoice.d.ts +3 -0
- package/lib/core/methods/extras/transcribeVoice.js +6 -0
- package/lib/core/methods/extras/userIsAdmin.d.ts +3 -0
- package/lib/core/methods/extras/userIsAdmin.js +18 -0
- package/lib/core/methods/gif/addToMyGifSet.d.ts +3 -0
- package/lib/core/methods/gif/addToMyGifSet.js +6 -0
- package/lib/core/methods/gif/getMyGifSet.d.ts +3 -0
- package/lib/core/methods/gif/getMyGifSet.js +6 -0
- package/lib/core/methods/gif/removeFromMyGifSet.d.ts +3 -0
- package/lib/core/methods/gif/removeFromMyGifSet.js +6 -0
- package/lib/core/methods/groups/addGroup.d.ts +3 -0
- package/lib/core/methods/groups/addGroup.js +8 -0
- package/lib/core/methods/groups/addGroupMembers.d.ts +3 -0
- package/lib/core/methods/groups/addGroupMembers.js +8 -0
- package/lib/core/methods/groups/banGroupMember.d.ts +3 -0
- package/lib/core/methods/groups/banGroupMember.js +14 -0
- package/lib/core/methods/groups/createGroupVoiceChat.d.ts +3 -0
- package/lib/core/methods/groups/createGroupVoiceChat.js +6 -0
- package/lib/core/methods/groups/deleteNoAccessGroupChat.d.ts +3 -0
- package/lib/core/methods/groups/deleteNoAccessGroupChat.js +6 -0
- package/lib/core/methods/groups/discardGroupVoiceChat.d.ts +3 -0
- package/lib/core/methods/groups/discardGroupVoiceChat.js +9 -0
- package/lib/core/methods/groups/editGroupInfo.d.ts +6 -0
- package/lib/core/methods/groups/editGroupInfo.js +41 -0
- package/lib/core/methods/groups/getBannedGroupMembers.d.ts +3 -0
- package/lib/core/methods/groups/getBannedGroupMembers.js +6 -0
- package/lib/core/methods/groups/getGroupAdminAccessList.d.ts +3 -0
- package/lib/core/methods/groups/getGroupAdminAccessList.js +9 -0
- package/lib/core/methods/groups/getGroupAdminMembers.d.ts +3 -0
- package/lib/core/methods/groups/getGroupAdminMembers.js +6 -0
- package/lib/core/methods/groups/getGroupAllMembers.d.ts +3 -0
- package/lib/core/methods/groups/getGroupAllMembers.js +10 -0
- package/lib/core/methods/groups/getGroupDefaultAccess.d.ts +3 -0
- package/lib/core/methods/groups/getGroupDefaultAccess.js +6 -0
- package/lib/core/methods/groups/getGroupInfo.d.ts +3 -0
- package/lib/core/methods/groups/getGroupInfo.js +6 -0
- package/lib/core/methods/groups/getGroupLink.d.ts +3 -0
- package/lib/core/methods/groups/getGroupLink.js +6 -0
- package/lib/core/methods/groups/getGroupMentionList.d.ts +3 -0
- package/lib/core/methods/groups/getGroupMentionList.js +9 -0
- package/lib/core/methods/groups/getGroupOnlineCount.d.ts +3 -0
- package/lib/core/methods/groups/getGroupOnlineCount.js +6 -0
- package/lib/core/methods/groups/getGroupVoiceChatParticipants.d.ts +3 -0
- package/lib/core/methods/groups/getGroupVoiceChatParticipants.js +7 -0
- package/lib/core/methods/groups/getGroupVoiceChatUpdates.d.ts +3 -0
- package/lib/core/methods/groups/getGroupVoiceChatUpdates.js +10 -0
- package/lib/core/methods/groups/groupPreviewByJoinLink.d.ts +3 -0
- package/lib/core/methods/groups/groupPreviewByJoinLink.js +8 -0
- package/lib/core/methods/groups/joinGroup.d.ts +3 -0
- package/lib/core/methods/groups/joinGroup.js +8 -0
- package/lib/core/methods/groups/joinGroupVoiceChat.d.ts +3 -0
- package/lib/core/methods/groups/joinGroupVoiceChat.js +11 -0
- package/lib/core/methods/groups/leaveGroup.d.ts +3 -0
- package/lib/core/methods/groups/leaveGroup.js +6 -0
- package/lib/core/methods/groups/leaveGroupVoiceChat.d.ts +3 -0
- package/lib/core/methods/groups/leaveGroupVoiceChat.js +9 -0
- package/lib/core/methods/groups/removeGroup.d.ts +3 -0
- package/lib/core/methods/groups/removeGroup.js +6 -0
- package/lib/core/methods/groups/seenGroupMessages.d.ts +3 -0
- package/lib/core/methods/groups/seenGroupMessages.js +10 -0
- package/lib/core/methods/groups/setGroupAdmin.d.ts +5 -0
- package/lib/core/methods/groups/setGroupAdmin.js +17 -0
- package/lib/core/methods/groups/setGroupDefaultAccess.d.ts +4 -0
- package/lib/core/methods/groups/setGroupDefaultAccess.js +11 -0
- package/lib/core/methods/groups/setGroupLink.d.ts +3 -0
- package/lib/core/methods/groups/setGroupLink.js +6 -0
- package/lib/core/methods/groups/setGroupVoiceChatSetting.d.ts +3 -0
- package/lib/core/methods/groups/setGroupVoiceChatSetting.js +15 -0
- package/lib/core/methods/index.d.ts +189 -0
- package/lib/core/methods/index.js +589 -0
- package/lib/core/methods/messages/actionOnMessageReaction.d.ts +3 -0
- package/lib/core/methods/messages/actionOnMessageReaction.js +14 -0
- package/lib/core/methods/messages/createPoll.d.ts +3 -0
- package/lib/core/methods/messages/createPoll.js +26 -0
- package/lib/core/methods/messages/deleteMessages.d.ts +3 -0
- package/lib/core/methods/messages/deleteMessages.js +17 -0
- package/lib/core/methods/messages/editMessage.d.ts +3 -0
- package/lib/core/methods/messages/editMessage.js +15 -0
- package/lib/core/methods/messages/forwardMessages.d.ts +3 -0
- package/lib/core/methods/messages/forwardMessages.js +22 -0
- package/lib/core/methods/messages/getMessageShareUrl.d.ts +3 -0
- package/lib/core/methods/messages/getMessageShareUrl.js +6 -0
- package/lib/core/methods/messages/getMessages.d.ts +3 -0
- package/lib/core/methods/messages/getMessages.js +12 -0
- package/lib/core/methods/messages/getMessagesByID.d.ts +3 -0
- package/lib/core/methods/messages/getMessagesByID.js +11 -0
- package/lib/core/methods/messages/getMessagesInterval.d.ts +3 -0
- package/lib/core/methods/messages/getMessagesInterval.js +9 -0
- package/lib/core/methods/messages/getMessagesUpdates.d.ts +3 -0
- package/lib/core/methods/messages/getMessagesUpdates.js +6 -0
- package/lib/core/methods/messages/getPollOptionVoters.d.ts +3 -0
- package/lib/core/methods/messages/getPollOptionVoters.js +10 -0
- package/lib/core/methods/messages/getPollStatus.d.ts +3 -0
- package/lib/core/methods/messages/getPollStatus.js +6 -0
- package/lib/core/methods/messages/index.d.ts +26 -0
- package/lib/core/methods/messages/index.js +56 -0
- package/lib/core/methods/messages/sendDocument.d.ts +3 -0
- package/lib/core/methods/messages/sendDocument.js +6 -0
- package/lib/core/methods/messages/sendFileInline.d.ts +18 -0
- package/lib/core/methods/messages/sendFileInline.js +24 -0
- package/lib/core/methods/messages/sendGif.d.ts +3 -0
- package/lib/core/methods/messages/sendGif.js +6 -0
- package/lib/core/methods/messages/sendMessage.d.ts +3 -0
- package/lib/core/methods/messages/sendMessage.js +139 -0
- package/lib/core/methods/messages/sendMusic.d.ts +3 -0
- package/lib/core/methods/messages/sendMusic.js +6 -0
- package/lib/core/methods/messages/sendPhoto.d.ts +3 -0
- package/lib/core/methods/messages/sendPhoto.js +6 -0
- package/lib/core/methods/messages/sendSticker.d.ts +3 -0
- package/lib/core/methods/messages/sendSticker.js +6 -0
- package/lib/core/methods/messages/sendText.d.ts +3 -0
- package/lib/core/methods/messages/sendText.js +6 -0
- package/lib/core/methods/messages/sendVideo.d.ts +3 -0
- package/lib/core/methods/messages/sendVideo.js +6 -0
- package/lib/core/methods/messages/sendVideoMessage.d.ts +3 -0
- package/lib/core/methods/messages/sendVideoMessage.js +6 -0
- package/lib/core/methods/messages/sendVoice.d.ts +3 -0
- package/lib/core/methods/messages/sendVoice.js +6 -0
- package/lib/core/methods/messages/setPinMessage.d.ts +3 -0
- package/lib/core/methods/messages/setPinMessage.js +14 -0
- package/lib/core/methods/messages/votePoll.d.ts +3 -0
- package/lib/core/methods/messages/votePoll.js +6 -0
- package/lib/core/methods/settings/changePassword.d.ts +3 -0
- package/lib/core/methods/settings/changePassword.js +6 -0
- package/lib/core/methods/settings/checkTwoStepPasscode.d.ts +3 -0
- package/lib/core/methods/settings/checkTwoStepPasscode.js +6 -0
- package/lib/core/methods/settings/deleteFolder.d.ts +3 -0
- package/lib/core/methods/settings/deleteFolder.js +6 -0
- package/lib/core/methods/settings/getBlockedUsers.d.ts +3 -0
- package/lib/core/methods/settings/getBlockedUsers.js +6 -0
- package/lib/core/methods/settings/getFolders.d.ts +3 -0
- package/lib/core/methods/settings/getFolders.js +6 -0
- package/lib/core/methods/settings/getMySessions.d.ts +3 -0
- package/lib/core/methods/settings/getMySessions.js +6 -0
- package/lib/core/methods/settings/getPrivacySetting.d.ts +3 -0
- package/lib/core/methods/settings/getPrivacySetting.js +6 -0
- package/lib/core/methods/settings/getSuggestedFolders.d.ts +3 -0
- package/lib/core/methods/settings/getSuggestedFolders.js +6 -0
- package/lib/core/methods/settings/getTwoPasscodeStatus.d.ts +3 -0
- package/lib/core/methods/settings/getTwoPasscodeStatus.js +6 -0
- package/lib/core/methods/settings/requestRecoveryEmail.d.ts +3 -0
- package/lib/core/methods/settings/requestRecoveryEmail.js +9 -0
- package/lib/core/methods/settings/setSetting.d.ts +5 -0
- package/lib/core/methods/settings/setSetting.js +51 -0
- package/lib/core/methods/settings/setupTwoStepVerification.d.ts +3 -0
- package/lib/core/methods/settings/setupTwoStepVerification.js +10 -0
- package/lib/core/methods/settings/terminateOtherSessions.d.ts +3 -0
- package/lib/core/methods/settings/terminateOtherSessions.js +7 -0
- package/lib/core/methods/settings/terminateSession.d.ts +3 -0
- package/lib/core/methods/settings/terminateSession.js +6 -0
- package/lib/core/methods/settings/turnOffTwoStep.d.ts +3 -0
- package/lib/core/methods/settings/turnOffTwoStep.js +7 -0
- package/lib/core/methods/settings/updateProfile.d.ts +3 -0
- package/lib/core/methods/settings/updateProfile.js +21 -0
- package/lib/core/methods/settings/updateUsername.d.ts +3 -0
- package/lib/core/methods/settings/updateUsername.js +6 -0
- package/lib/core/methods/settings/verifyRecoveryEmail.d.ts +3 -0
- package/lib/core/methods/settings/verifyRecoveryEmail.js +6 -0
- package/lib/core/methods/stickers/actionOnStickerSet.d.ts +3 -0
- package/lib/core/methods/stickers/actionOnStickerSet.js +10 -0
- package/lib/core/methods/stickers/getMyStickerSets.d.ts +3 -0
- package/lib/core/methods/stickers/getMyStickerSets.js +6 -0
- package/lib/core/methods/stickers/getStickerSetByID.d.ts +3 -0
- package/lib/core/methods/stickers/getStickerSetByID.js +6 -0
- package/lib/core/methods/stickers/getStickersByEmoji.d.ts +3 -0
- package/lib/core/methods/stickers/getStickersByEmoji.js +6 -0
- package/lib/core/methods/stickers/getStickersBySetIds.d.ts +3 -0
- package/lib/core/methods/stickers/getStickersBySetIds.js +8 -0
- package/lib/core/methods/stickers/getTrendStickerSets.d.ts +3 -0
- package/lib/core/methods/stickers/getTrendStickerSets.js +6 -0
- package/lib/core/methods/stickers/searchStickers.d.ts +3 -0
- package/lib/core/methods/stickers/searchStickers.js +6 -0
- package/lib/core/methods/users/checkUserUsername.d.ts +3 -0
- package/lib/core/methods/users/checkUserUsername.js +6 -0
- package/lib/core/methods/users/deleteUserChat.d.ts +3 -0
- package/lib/core/methods/users/deleteUserChat.js +9 -0
- package/lib/core/methods/users/getMe.d.ts +3 -0
- package/lib/core/methods/users/getMe.js +6 -0
- package/lib/core/methods/users/getUserInfo.d.ts +3 -0
- package/lib/core/methods/users/getUserInfo.js +7 -0
- package/lib/core/methods/users/setBlockUser.d.ts +3 -0
- package/lib/core/methods/users/setBlockUser.js +9 -0
- package/lib/core/methods/utilities/download.d.ts +4 -0
- package/lib/core/methods/utilities/download.js +6 -0
- package/lib/core/methods/utilities/downloadProfilePicture.d.ts +4 -0
- package/lib/core/methods/utilities/downloadProfilePicture.js +28 -0
- package/lib/core/methods/utilities/index.d.ts +8 -0
- package/lib/core/methods/utilities/index.js +20 -0
- package/lib/core/methods/utilities/requestSendFile.d.ts +3 -0
- package/lib/core/methods/utilities/requestSendFile.js +11 -0
- package/lib/core/methods/utilities/run.d.ts +3 -0
- package/lib/core/methods/utilities/run.js +9 -0
- package/lib/core/methods/utilities/start.d.ts +3 -0
- package/lib/core/methods/utilities/start.js +71 -0
- package/lib/core/methods/utilities/thumbnail.js +70 -0
- package/lib/core/methods/utilities/usePlugin.d.ts +4 -0
- package/lib/core/methods/utilities/usePlugin.js +25 -0
- package/lib/core/network/api.d.ts +16 -0
- package/lib/core/network/api.js +95 -0
- package/lib/core/network/file.d.ts +3 -0
- package/lib/core/network/file.js +117 -0
- package/lib/core/network/index.d.ts +25 -0
- package/lib/core/network/index.js +31 -0
- package/lib/core/network/utils.d.ts +9 -0
- package/lib/core/network/utils.js +34 -0
- package/lib/core/network/websocket.d.ts +3 -0
- package/lib/core/network/websocket.js +190 -0
- package/lib/core/session.d.ts +12 -0
- package/lib/core/session.js +65 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +48 -0
- package/lib/types/client.type.d.ts +31 -0
- package/lib/types/decorators.type.d.ts +173 -0
- package/lib/types/index.type.d.ts +5 -0
- package/lib/types/index.type.js +44 -0
- package/lib/types/network.type.d.ts +7 -0
- package/lib/types/session.type.d.ts +7 -0
- package/lib/utils/prompt.d.ts +1 -0
- package/lib/utils/prompt.js +17 -0
- package/package.json +45 -43
- package/rubjs/client.d.ts +0 -41
- package/rubjs/client.js +0 -40
- package/rubjs/clients/VoiceChatClient.d.ts +0 -30
- package/rubjs/clients/VoiceChatClient.js +0 -183
- package/rubjs/clients/index.d.ts +0 -4
- package/rubjs/clients/index.js +0 -12
- package/rubjs/clients/loginClient.d.ts +0 -47
- package/rubjs/clients/loginClient.js +0 -122
- package/rubjs/clients/sendLiveClient.d.ts +0 -25
- package/rubjs/clients/sendLiveClient.js +0 -146
- package/rubjs/crypto/index.d.ts +0 -12
- package/rubjs/crypto/index.js +0 -95
- package/rubjs/index.d.ts +0 -7
- package/rubjs/index.js +0 -53
- package/rubjs/methods/advanced/builder.d.ts +0 -3
- package/rubjs/methods/advanced/builder.js +0 -41
- package/rubjs/methods/auth/logout.d.ts +0 -3
- package/rubjs/methods/auth/logout.js +0 -17
- package/rubjs/methods/auth/registerDevice.d.ts +0 -3
- package/rubjs/methods/auth/registerDevice.js +0 -61
- package/rubjs/methods/auth/sendCode.d.ts +0 -3
- package/rubjs/methods/auth/sendCode.js +0 -27
- package/rubjs/methods/auth/signIn.d.ts +0 -3
- package/rubjs/methods/auth/signIn.js +0 -24
- package/rubjs/methods/channels/addChannel.d.ts +0 -3
- package/rubjs/methods/channels/addChannel.js +0 -26
- package/rubjs/methods/channels/addChannelMembers.d.ts +0 -3
- package/rubjs/methods/channels/addChannelMembers.js +0 -22
- package/rubjs/methods/channels/banChannelMember.d.ts +0 -3
- package/rubjs/methods/channels/banChannelMember.js +0 -25
- package/rubjs/methods/channels/cancelChangeObjectOwner.d.ts +0 -3
- package/rubjs/methods/channels/cancelChangeObjectOwner.js +0 -17
- package/rubjs/methods/channels/channelPreviewByJoinLink.d.ts +0 -3
- package/rubjs/methods/channels/channelPreviewByJoinLink.js +0 -19
- package/rubjs/methods/channels/checkChannelUsername.d.ts +0 -3
- package/rubjs/methods/channels/checkChannelUsername.js +0 -19
- package/rubjs/methods/channels/createChannelVoiceChat.d.ts +0 -3
- package/rubjs/methods/channels/createChannelVoiceChat.js +0 -17
- package/rubjs/methods/channels/discardChannelVoiceChat.d.ts +0 -3
- package/rubjs/methods/channels/discardChannelVoiceChat.js +0 -20
- package/rubjs/methods/channels/editChannelInfo.d.ts +0 -4
- package/rubjs/methods/channels/editChannelInfo.js +0 -50
- package/rubjs/methods/channels/getBannedChannelMembers.d.ts +0 -3
- package/rubjs/methods/channels/getBannedChannelMembers.js +0 -20
- package/rubjs/methods/channels/getChannelAdminAccessList.d.ts +0 -3
- package/rubjs/methods/channels/getChannelAdminAccessList.js +0 -20
- package/rubjs/methods/channels/getChannelAdminMembers.d.ts +0 -3
- package/rubjs/methods/channels/getChannelAdminMembers.js +0 -20
- package/rubjs/methods/channels/getChannelAllMembers.d.ts +0 -3
- package/rubjs/methods/channels/getChannelAllMembers.js +0 -21
- package/rubjs/methods/channels/getChannelInfo.d.ts +0 -3
- package/rubjs/methods/channels/getChannelInfo.js +0 -17
- package/rubjs/methods/channels/getChannelLink.d.ts +0 -3
- package/rubjs/methods/channels/getChannelLink.js +0 -17
- package/rubjs/methods/channels/getPendingObjectOwner.d.ts +0 -3
- package/rubjs/methods/channels/getPendingObjectOwner.js +0 -17
- package/rubjs/methods/channels/joinChannelAction.d.ts +0 -3
- package/rubjs/methods/channels/joinChannelAction.js +0 -21
- package/rubjs/methods/channels/joinChannelByLink.d.ts +0 -3
- package/rubjs/methods/channels/joinChannelByLink.js +0 -19
- package/rubjs/methods/channels/leaveChannelVoiceChat.d.ts +0 -3
- package/rubjs/methods/channels/leaveChannelVoiceChat.js +0 -20
- package/rubjs/methods/channels/removeChannel.d.ts +0 -3
- package/rubjs/methods/channels/removeChannel.js +0 -17
- package/rubjs/methods/channels/requestChangeObjectOwner.d.ts +0 -3
- package/rubjs/methods/channels/requestChangeObjectOwner.js +0 -20
- package/rubjs/methods/channels/seenChannelMessages.d.ts +0 -3
- package/rubjs/methods/channels/seenChannelMessages.js +0 -21
- package/rubjs/methods/channels/setChannelLink.d.ts +0 -3
- package/rubjs/methods/channels/setChannelLink.js +0 -17
- package/rubjs/methods/channels/setChannelVoiceChatSetting.d.ts +0 -3
- package/rubjs/methods/channels/setChannelVoiceChatSetting.js +0 -26
- package/rubjs/methods/channels/updateChannelUsername.d.ts +0 -3
- package/rubjs/methods/channels/updateChannelUsername.js +0 -20
- package/rubjs/methods/chats/actionOnJoinRequest.d.ts +0 -3
- package/rubjs/methods/chats/actionOnJoinRequest.js +0 -22
- package/rubjs/methods/chats/addLiveComment.d.ts +0 -3
- package/rubjs/methods/chats/addLiveComment.js +0 -17
- package/rubjs/methods/chats/clickMessageUrl.d.ts +0 -3
- package/rubjs/methods/chats/clickMessageUrl.js +0 -17
- package/rubjs/methods/chats/createJoinLink.d.ts +0 -3
- package/rubjs/methods/chats/createJoinLink.js +0 -23
- package/rubjs/methods/chats/deleteAvatar.d.ts +0 -3
- package/rubjs/methods/chats/deleteAvatar.js +0 -17
- package/rubjs/methods/chats/deleteChatHistory.d.ts +0 -3
- package/rubjs/methods/chats/deleteChatHistory.js +0 -20
- package/rubjs/methods/chats/editJoinLink.d.ts +0 -3
- package/rubjs/methods/chats/editJoinLink.js +0 -34
- package/rubjs/methods/chats/getAbsObjects.d.ts +0 -3
- package/rubjs/methods/chats/getAbsObjects.js +0 -19
- package/rubjs/methods/chats/getAvatars.d.ts +0 -3
- package/rubjs/methods/chats/getAvatars.js +0 -17
- package/rubjs/methods/chats/getChatReaction.d.ts +0 -3
- package/rubjs/methods/chats/getChatReaction.js +0 -17
- package/rubjs/methods/chats/getChats.d.ts +0 -3
- package/rubjs/methods/chats/getChats.js +0 -17
- package/rubjs/methods/chats/getChatsUpdates.d.ts +0 -3
- package/rubjs/methods/chats/getChatsUpdates.js +0 -17
- package/rubjs/methods/chats/getJoinLinks.d.ts +0 -3
- package/rubjs/methods/chats/getJoinLinks.js +0 -17
- package/rubjs/methods/chats/getJoinRequests.d.ts +0 -3
- package/rubjs/methods/chats/getJoinRequests.js +0 -17
- package/rubjs/methods/chats/getLinkFromAppUrl.d.ts +0 -3
- package/rubjs/methods/chats/getLinkFromAppUrl.js +0 -17
- package/rubjs/methods/chats/getLiveComments.d.ts +0 -3
- package/rubjs/methods/chats/getLiveComments.js +0 -17
- package/rubjs/methods/chats/getLivePlayUrl.d.ts +0 -3
- package/rubjs/methods/chats/getLivePlayUrl.js +0 -17
- package/rubjs/methods/chats/getLiveStatus.d.ts +0 -3
- package/rubjs/methods/chats/getLiveStatus.js +0 -17
- package/rubjs/methods/chats/getObjectInfoByUsername.d.ts +0 -3
- package/rubjs/methods/chats/getObjectInfoByUsername.js +0 -19
- package/rubjs/methods/chats/getTopChatUsers.d.ts +0 -3
- package/rubjs/methods/chats/getTopChatUsers.js +0 -18
- package/rubjs/methods/chats/removeFromTopChatUsers.d.ts +0 -3
- package/rubjs/methods/chats/removeFromTopChatUsers.js +0 -17
- package/rubjs/methods/chats/removeJoinLink.d.ts +0 -3
- package/rubjs/methods/chats/removeJoinLink.js +0 -19
- package/rubjs/methods/chats/searchChatMessages.d.ts +0 -3
- package/rubjs/methods/chats/searchChatMessages.js +0 -25
- package/rubjs/methods/chats/searchGlobalMessages.d.ts +0 -3
- package/rubjs/methods/chats/searchGlobalMessages.js +0 -17
- package/rubjs/methods/chats/seenChats.d.ts +0 -3
- package/rubjs/methods/chats/seenChats.js +0 -17
- package/rubjs/methods/chats/sendChatActivity.d.ts +0 -3
- package/rubjs/methods/chats/sendChatActivity.js +0 -21
- package/rubjs/methods/chats/sendLive.d.ts +0 -3
- package/rubjs/methods/chats/sendLive.js +0 -28
- package/rubjs/methods/chats/setActionChat.d.ts +0 -3
- package/rubjs/methods/chats/setActionChat.js +0 -21
- package/rubjs/methods/chats/uploadAvatar.d.ts +0 -3
- package/rubjs/methods/chats/uploadAvatar.js +0 -29
- package/rubjs/methods/contacts/addAddressBook.d.ts +0 -3
- package/rubjs/methods/contacts/addAddressBook.js +0 -17
- package/rubjs/methods/contacts/deleteContact.d.ts +0 -3
- package/rubjs/methods/contacts/deleteContact.js +0 -17
- package/rubjs/methods/contacts/getContacts.d.ts +0 -3
- package/rubjs/methods/contacts/getContacts.js +0 -17
- package/rubjs/methods/contacts/getContactsLastOnline.d.ts +0 -3
- package/rubjs/methods/contacts/getContactsLastOnline.js +0 -17
- package/rubjs/methods/contacts/getContactsUpdates.d.ts +0 -3
- package/rubjs/methods/contacts/getContactsUpdates.js +0 -17
- package/rubjs/methods/contacts/resetContacts.d.ts +0 -3
- package/rubjs/methods/contacts/resetContacts.js +0 -18
- package/rubjs/methods/extras/banMember.d.ts +0 -3
- package/rubjs/methods/extras/banMember.js +0 -20
- package/rubjs/methods/extras/deleteMessagebyCount.d.ts +0 -3
- package/rubjs/methods/extras/deleteMessagebyCount.js +0 -30
- package/rubjs/methods/extras/getInfo.d.ts +0 -3
- package/rubjs/methods/extras/getInfo.js +0 -26
- package/rubjs/methods/extras/getObjectByUsername.d.ts +0 -3
- package/rubjs/methods/extras/getObjectByUsername.js +0 -19
- package/rubjs/methods/extras/getProfileLinkItems.d.ts +0 -3
- package/rubjs/methods/extras/getProfileLinkItems.js +0 -17
- package/rubjs/methods/extras/getRelatedObjects.d.ts +0 -3
- package/rubjs/methods/extras/getRelatedObjects.js +0 -17
- package/rubjs/methods/extras/getTranscription.d.ts +0 -3
- package/rubjs/methods/extras/getTranscription.js +0 -20
- package/rubjs/methods/extras/join.d.ts +0 -3
- package/rubjs/methods/extras/join.js +0 -22
- package/rubjs/methods/extras/joinVoiceChat.d.ts +0 -3
- package/rubjs/methods/extras/joinVoiceChat.js +0 -22
- package/rubjs/methods/extras/leaveChat.d.ts +0 -3
- package/rubjs/methods/extras/leaveChat.js +0 -20
- package/rubjs/methods/extras/onEditMessages.d.ts +0 -3
- package/rubjs/methods/extras/onEditMessages.js +0 -41
- package/rubjs/methods/extras/reportObject.d.ts +0 -14
- package/rubjs/methods/extras/reportObject.js +0 -32
- package/rubjs/methods/extras/searchGlobalObjects.d.ts +0 -3
- package/rubjs/methods/extras/searchGlobalObjects.js +0 -17
- package/rubjs/methods/extras/sendVoiceChatActivity.d.ts +0 -3
- package/rubjs/methods/extras/sendVoiceChatActivity.js +0 -24
- package/rubjs/methods/extras/setVoiceChatState.d.ts +0 -3
- package/rubjs/methods/extras/setVoiceChatState.js +0 -25
- package/rubjs/methods/extras/transcribeVoice.d.ts +0 -3
- package/rubjs/methods/extras/transcribeVoice.js +0 -17
- package/rubjs/methods/extras/userIsAdmin.d.ts +0 -3
- package/rubjs/methods/extras/userIsAdmin.js +0 -29
- package/rubjs/methods/gif/addToMyGifSet.d.ts +0 -3
- package/rubjs/methods/gif/addToMyGifSet.js +0 -17
- package/rubjs/methods/gif/getMyGifSet.d.ts +0 -3
- package/rubjs/methods/gif/getMyGifSet.js +0 -17
- package/rubjs/methods/gif/removeFromMyGifSet.d.ts +0 -3
- package/rubjs/methods/gif/removeFromMyGifSet.js +0 -17
- package/rubjs/methods/groups/addGroup.d.ts +0 -3
- package/rubjs/methods/groups/addGroup.js +0 -19
- package/rubjs/methods/groups/addGroupMembers.d.ts +0 -3
- package/rubjs/methods/groups/addGroupMembers.js +0 -19
- package/rubjs/methods/groups/banGroupMember.d.ts +0 -3
- package/rubjs/methods/groups/banGroupMember.js +0 -25
- package/rubjs/methods/groups/createGroupVoiceChat.d.ts +0 -3
- package/rubjs/methods/groups/createGroupVoiceChat.js +0 -17
- package/rubjs/methods/groups/deleteNoAccessGroupChat.d.ts +0 -3
- package/rubjs/methods/groups/deleteNoAccessGroupChat.js +0 -17
- package/rubjs/methods/groups/discardGroupVoiceChat.d.ts +0 -3
- package/rubjs/methods/groups/discardGroupVoiceChat.js +0 -20
- package/rubjs/methods/groups/editGroupInfo.d.ts +0 -6
- package/rubjs/methods/groups/editGroupInfo.js +0 -52
- package/rubjs/methods/groups/getBannedGroupMembers.d.ts +0 -3
- package/rubjs/methods/groups/getBannedGroupMembers.js +0 -17
- package/rubjs/methods/groups/getGroupAdminAccessList.d.ts +0 -3
- package/rubjs/methods/groups/getGroupAdminAccessList.js +0 -20
- package/rubjs/methods/groups/getGroupAdminMembers.d.ts +0 -3
- package/rubjs/methods/groups/getGroupAdminMembers.js +0 -17
- package/rubjs/methods/groups/getGroupAllMembers.d.ts +0 -3
- package/rubjs/methods/groups/getGroupAllMembers.js +0 -21
- package/rubjs/methods/groups/getGroupDefaultAccess.d.ts +0 -3
- package/rubjs/methods/groups/getGroupDefaultAccess.js +0 -17
- package/rubjs/methods/groups/getGroupInfo.d.ts +0 -3
- package/rubjs/methods/groups/getGroupInfo.js +0 -17
- package/rubjs/methods/groups/getGroupLink.d.ts +0 -3
- package/rubjs/methods/groups/getGroupLink.js +0 -17
- package/rubjs/methods/groups/getGroupMentionList.d.ts +0 -3
- package/rubjs/methods/groups/getGroupMentionList.js +0 -20
- package/rubjs/methods/groups/getGroupOnlineCount.d.ts +0 -3
- package/rubjs/methods/groups/getGroupOnlineCount.js +0 -17
- package/rubjs/methods/groups/getGroupVoiceChatParticipants.d.ts +0 -3
- package/rubjs/methods/groups/getGroupVoiceChatParticipants.js +0 -18
- package/rubjs/methods/groups/getGroupVoiceChatUpdates.d.ts +0 -3
- package/rubjs/methods/groups/getGroupVoiceChatUpdates.js +0 -21
- package/rubjs/methods/groups/groupPreviewByJoinLink.d.ts +0 -3
- package/rubjs/methods/groups/groupPreviewByJoinLink.js +0 -19
- package/rubjs/methods/groups/joinGroup.d.ts +0 -3
- package/rubjs/methods/groups/joinGroup.js +0 -19
- package/rubjs/methods/groups/joinGroupVoiceChat.d.ts +0 -3
- package/rubjs/methods/groups/joinGroupVoiceChat.js +0 -22
- package/rubjs/methods/groups/leaveGroup.d.ts +0 -3
- package/rubjs/methods/groups/leaveGroup.js +0 -17
- package/rubjs/methods/groups/leaveGroupVoiceChat.d.ts +0 -3
- package/rubjs/methods/groups/leaveGroupVoiceChat.js +0 -20
- package/rubjs/methods/groups/removeGroup.d.ts +0 -3
- package/rubjs/methods/groups/removeGroup.js +0 -17
- package/rubjs/methods/groups/seenGroupMessages.d.ts +0 -3
- package/rubjs/methods/groups/seenGroupMessages.js +0 -21
- package/rubjs/methods/groups/setGroupAdmin.d.ts +0 -5
- package/rubjs/methods/groups/setGroupAdmin.js +0 -28
- package/rubjs/methods/groups/setGroupDefaultAccess.d.ts +0 -4
- package/rubjs/methods/groups/setGroupDefaultAccess.js +0 -22
- package/rubjs/methods/groups/setGroupLink.d.ts +0 -3
- package/rubjs/methods/groups/setGroupLink.js +0 -17
- package/rubjs/methods/groups/setGroupVoiceChatSetting.d.ts +0 -3
- package/rubjs/methods/groups/setGroupVoiceChatSetting.js +0 -26
- package/rubjs/methods/index.d.ts +0 -203
- package/rubjs/methods/index.js +0 -967
- package/rubjs/methods/messages/actionOnMessageReaction.d.ts +0 -3
- package/rubjs/methods/messages/actionOnMessageReaction.js +0 -25
- package/rubjs/methods/messages/createPoll.d.ts +0 -3
- package/rubjs/methods/messages/createPoll.js +0 -37
- package/rubjs/methods/messages/deleteMessages.d.ts +0 -3
- package/rubjs/methods/messages/deleteMessages.js +0 -28
- package/rubjs/methods/messages/editMessage.d.ts +0 -3
- package/rubjs/methods/messages/editMessage.js +0 -23
- package/rubjs/methods/messages/forwardMessages.d.ts +0 -3
- package/rubjs/methods/messages/forwardMessages.js +0 -31
- package/rubjs/methods/messages/getMessageShareUrl.d.ts +0 -3
- package/rubjs/methods/messages/getMessageShareUrl.js +0 -17
- package/rubjs/methods/messages/getMessages.d.ts +0 -3
- package/rubjs/methods/messages/getMessages.js +0 -23
- package/rubjs/methods/messages/getMessagesByID.d.ts +0 -3
- package/rubjs/methods/messages/getMessagesByID.js +0 -22
- package/rubjs/methods/messages/getMessagesInterval.d.ts +0 -3
- package/rubjs/methods/messages/getMessagesInterval.js +0 -20
- package/rubjs/methods/messages/getMessagesUpdates.d.ts +0 -3
- package/rubjs/methods/messages/getMessagesUpdates.js +0 -17
- package/rubjs/methods/messages/getPollOptionVoters.d.ts +0 -3
- package/rubjs/methods/messages/getPollOptionVoters.js +0 -21
- package/rubjs/methods/messages/getPollStatus.d.ts +0 -3
- package/rubjs/methods/messages/getPollStatus.js +0 -17
- package/rubjs/methods/messages/index.d.ts +0 -27
- package/rubjs/methods/messages/index.js +0 -58
- package/rubjs/methods/messages/requestSendFile.d.ts +0 -4
- package/rubjs/methods/messages/requestSendFile.js +0 -22
- package/rubjs/methods/messages/sendDocument.d.ts +0 -3
- package/rubjs/methods/messages/sendDocument.js +0 -17
- package/rubjs/methods/messages/sendFileInline.d.ts +0 -18
- package/rubjs/methods/messages/sendFileInline.js +0 -35
- package/rubjs/methods/messages/sendGif.d.ts +0 -3
- package/rubjs/methods/messages/sendGif.js +0 -17
- package/rubjs/methods/messages/sendMessage.d.ts +0 -3
- package/rubjs/methods/messages/sendMessage.js +0 -149
- package/rubjs/methods/messages/sendMusic.d.ts +0 -3
- package/rubjs/methods/messages/sendMusic.js +0 -17
- package/rubjs/methods/messages/sendPhoto.d.ts +0 -3
- package/rubjs/methods/messages/sendPhoto.js +0 -17
- package/rubjs/methods/messages/sendSticker.d.ts +0 -3
- package/rubjs/methods/messages/sendSticker.js +0 -17
- package/rubjs/methods/messages/sendText.d.ts +0 -3
- package/rubjs/methods/messages/sendText.js +0 -17
- package/rubjs/methods/messages/sendVideo.d.ts +0 -3
- package/rubjs/methods/messages/sendVideo.js +0 -17
- package/rubjs/methods/messages/sendVideoMessage.d.ts +0 -3
- package/rubjs/methods/messages/sendVideoMessage.js +0 -17
- package/rubjs/methods/messages/sendVoice.d.ts +0 -3
- package/rubjs/methods/messages/sendVoice.js +0 -17
- package/rubjs/methods/messages/setPinMessage.d.ts +0 -3
- package/rubjs/methods/messages/setPinMessage.js +0 -25
- package/rubjs/methods/messages/votePoll.d.ts +0 -3
- package/rubjs/methods/messages/votePoll.js +0 -17
- package/rubjs/methods/settings/changePassword.d.ts +0 -3
- package/rubjs/methods/settings/changePassword.js +0 -17
- package/rubjs/methods/settings/checkTwoStepPasscode.d.ts +0 -3
- package/rubjs/methods/settings/checkTwoStepPasscode.js +0 -17
- package/rubjs/methods/settings/deleteFolder.d.ts +0 -3
- package/rubjs/methods/settings/deleteFolder.js +0 -17
- package/rubjs/methods/settings/getBlockedUsers.d.ts +0 -3
- package/rubjs/methods/settings/getBlockedUsers.js +0 -17
- package/rubjs/methods/settings/getFolders.d.ts +0 -3
- package/rubjs/methods/settings/getFolders.js +0 -17
- package/rubjs/methods/settings/getMySessions.d.ts +0 -3
- package/rubjs/methods/settings/getMySessions.js +0 -17
- package/rubjs/methods/settings/getPrivacySetting.d.ts +0 -3
- package/rubjs/methods/settings/getPrivacySetting.js +0 -17
- package/rubjs/methods/settings/getSuggestedFolders.d.ts +0 -3
- package/rubjs/methods/settings/getSuggestedFolders.js +0 -17
- package/rubjs/methods/settings/getTwoPasscodeStatus.d.ts +0 -3
- package/rubjs/methods/settings/getTwoPasscodeStatus.js +0 -17
- package/rubjs/methods/settings/requestRecoveryEmail.d.ts +0 -3
- package/rubjs/methods/settings/requestRecoveryEmail.js +0 -20
- package/rubjs/methods/settings/setSetting.d.ts +0 -5
- package/rubjs/methods/settings/setSetting.js +0 -60
- package/rubjs/methods/settings/setupTwoStepVerification.d.ts +0 -3
- package/rubjs/methods/settings/setupTwoStepVerification.js +0 -21
- package/rubjs/methods/settings/terminateOtherSessions.d.ts +0 -3
- package/rubjs/methods/settings/terminateOtherSessions.js +0 -18
- package/rubjs/methods/settings/terminateSession.d.ts +0 -3
- package/rubjs/methods/settings/terminateSession.js +0 -17
- package/rubjs/methods/settings/turnOffTwoStep.d.ts +0 -3
- package/rubjs/methods/settings/turnOffTwoStep.js +0 -18
- package/rubjs/methods/settings/updateProfile.d.ts +0 -3
- package/rubjs/methods/settings/updateProfile.js +0 -30
- package/rubjs/methods/settings/updateUsername.d.ts +0 -3
- package/rubjs/methods/settings/updateUsername.js +0 -17
- package/rubjs/methods/settings/verifyRecoveryEmail.d.ts +0 -3
- package/rubjs/methods/settings/verifyRecoveryEmail.js +0 -17
- package/rubjs/methods/stickers/actionOnStickerSet.d.ts +0 -3
- package/rubjs/methods/stickers/actionOnStickerSet.js +0 -21
- package/rubjs/methods/stickers/getMyStickerSets.d.ts +0 -3
- package/rubjs/methods/stickers/getMyStickerSets.js +0 -17
- package/rubjs/methods/stickers/getStickerSetByID.d.ts +0 -3
- package/rubjs/methods/stickers/getStickerSetByID.js +0 -17
- package/rubjs/methods/stickers/getStickersByEmoji.d.ts +0 -3
- package/rubjs/methods/stickers/getStickersByEmoji.js +0 -17
- package/rubjs/methods/stickers/getStickersBySetIds.d.ts +0 -3
- package/rubjs/methods/stickers/getStickersBySetIds.js +0 -19
- package/rubjs/methods/stickers/getTrendStickerSets.d.ts +0 -3
- package/rubjs/methods/stickers/getTrendStickerSets.js +0 -17
- package/rubjs/methods/stickers/searchStickers.d.ts +0 -3
- package/rubjs/methods/stickers/searchStickers.js +0 -17
- package/rubjs/methods/users/checkUserUsername.d.ts +0 -3
- package/rubjs/methods/users/checkUserUsername.js +0 -17
- package/rubjs/methods/users/deleteUserChat.d.ts +0 -3
- package/rubjs/methods/users/deleteUserChat.js +0 -20
- package/rubjs/methods/users/getMe.d.ts +0 -3
- package/rubjs/methods/users/getMe.js +0 -17
- package/rubjs/methods/users/getUserInfo.d.ts +0 -4
- package/rubjs/methods/users/getUserInfo.js +0 -18
- package/rubjs/methods/users/setBlockUser.d.ts +0 -3
- package/rubjs/methods/users/setBlockUser.js +0 -20
- package/rubjs/methods/utilities/download.d.ts +0 -4
- package/rubjs/methods/utilities/download.js +0 -17
- package/rubjs/methods/utilities/downloadProfilePicture.d.ts +0 -3
- package/rubjs/methods/utilities/downloadProfilePicture.js +0 -27
- package/rubjs/methods/utilities/get.d.ts +0 -4
- package/rubjs/methods/utilities/get.js +0 -21
- package/rubjs/methods/utilities/index.d.ts +0 -8
- package/rubjs/methods/utilities/index.js +0 -20
- package/rubjs/methods/utilities/post.d.ts +0 -4
- package/rubjs/methods/utilities/post.js +0 -21
- package/rubjs/methods/utilities/run.d.ts +0 -3
- package/rubjs/methods/utilities/run.js +0 -24
- package/rubjs/methods/utilities/start.d.ts +0 -3
- package/rubjs/methods/utilities/start.js +0 -82
- package/rubjs/methods/utilities/thumbnail.js +0 -85
- package/rubjs/network/index.d.ts +0 -37
- package/rubjs/network/index.js +0 -405
- package/rubjs/network/loginNetwork.d.ts +0 -39
- package/rubjs/network/loginNetwork.js +0 -122
- package/rubjs/session/index.d.ts +0 -23
- package/rubjs/session/index.js +0 -65
- package/rubjs/types/auth.d.ts +0 -40
- package/rubjs/types/chats.d.ts +0 -79
- package/rubjs/types/decorators.d.ts +0 -170
- package/rubjs/types/groups.d.ts +0 -155
- package/rubjs/types/index.d.ts +0 -8
- package/rubjs/types/index.js +0 -53
- package/rubjs/types/message.d.ts +0 -26
- package/rubjs/types/message.js +0 -81
- package/rubjs/types/messages.d.ts +0 -178
- package/rubjs/types/messages.js +0 -2
- package/rubjs/types/users.d.ts +0 -64
- package/rubjs/types/users.js +0 -2
- package/rubjs/utils/filters.d.ts +0 -33
- package/rubjs/utils/filters.js +0 -167
- package/rubjs/utils/index.d.ts +0 -3
- package/rubjs/utils/index.js +0 -10
- /package/{rubjs → lib/core}/methods/advanced/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/advanced/index.js +0 -0
- /package/{rubjs → lib/core}/methods/auth/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/auth/index.js +0 -0
- /package/{rubjs → lib/core}/methods/channels/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/channels/index.js +0 -0
- /package/{rubjs → lib/core}/methods/chats/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/chats/index.js +0 -0
- /package/{rubjs → lib/core}/methods/contacts/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/contacts/index.js +0 -0
- /package/{rubjs → lib/core}/methods/extras/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/extras/index.js +0 -0
- /package/{rubjs → lib/core}/methods/gif/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/gif/index.js +0 -0
- /package/{rubjs → lib/core}/methods/groups/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/groups/index.js +0 -0
- /package/{rubjs → lib/core}/methods/settings/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/settings/index.js +0 -0
- /package/{rubjs → lib/core}/methods/stickers/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/stickers/index.js +0 -0
- /package/{rubjs → lib/core}/methods/users/index.d.ts +0 -0
- /package/{rubjs → lib/core}/methods/users/index.js +0 -0
- /package/{rubjs → lib/core}/methods/utilities/thumbnail.d.ts +0 -0
- /package/{rubjs/parser/index.d.ts → lib/core/parser.d.ts} +0 -0
- /package/{rubjs/parser/index.js → lib/core/parser.js} +0 -0
- /package/{rubjs/types/auth.js → lib/types/client.type.js} +0 -0
- /package/{rubjs/types/chats.js → lib/types/decorators.type.js} +0 -0
- /package/{rubjs/types/decorators.js → lib/types/network.type.js} +0 -0
- /package/{rubjs/types/groups.js → lib/types/session.type.js} +0 -0
- /package/{rubjs → lib}/utils/utils.d.ts +0 -0
- /package/{rubjs → lib}/utils/utils.js +0 -0
@@ -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("./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);
|
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;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Client } from '../..';
|
2
|
+
import { DecoratorsTypes } from '../../types/index.type';
|
3
|
+
declare class Activities implements DecoratorsTypes.ShowActivities {
|
4
|
+
type: string;
|
5
|
+
object_guid: string;
|
6
|
+
object_type: string;
|
7
|
+
user_activity_guid: string;
|
8
|
+
store: Record<string, any>;
|
9
|
+
client: Client;
|
10
|
+
constructor(client: Client, update: DecoratorsTypes.ShowActivities);
|
11
|
+
}
|
12
|
+
export default Activities;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
class Activities {
|
4
|
+
constructor(client, update) {
|
5
|
+
this.store = {};
|
6
|
+
Object.defineProperty(this, 'client', {
|
7
|
+
value: client,
|
8
|
+
enumerable: false,
|
9
|
+
writable: true,
|
10
|
+
configurable: true,
|
11
|
+
});
|
12
|
+
this.type = update.type;
|
13
|
+
this.object_guid = update.object_guid;
|
14
|
+
this.object_type = update.object_type;
|
15
|
+
this.user_activity_guid = update.user_activity_guid;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
exports.default = Activities;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client } from '../..';
|
2
|
+
import { DecoratorsTypes } from '../../types/index.type';
|
3
|
+
declare class Chat implements DecoratorsTypes.ChatUpdates {
|
4
|
+
object_guid: string;
|
5
|
+
action: string;
|
6
|
+
chat: DecoratorsTypes.Chat;
|
7
|
+
updated_parameters: string[];
|
8
|
+
timestamp: string;
|
9
|
+
type: string;
|
10
|
+
store: Record<string, any>;
|
11
|
+
client: Client;
|
12
|
+
constructor(client: Client, update: DecoratorsTypes.ChatUpdates);
|
13
|
+
}
|
14
|
+
export default Chat;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
class Chat {
|
4
|
+
constructor(client, update) {
|
5
|
+
this.store = {};
|
6
|
+
Object.defineProperty(this, 'client', {
|
7
|
+
value: client,
|
8
|
+
enumerable: false,
|
9
|
+
writable: true,
|
10
|
+
configurable: true,
|
11
|
+
});
|
12
|
+
this.object_guid = update.object_guid;
|
13
|
+
this.action = update.action;
|
14
|
+
this.chat = update.chat;
|
15
|
+
this.updated_parameters = update.updated_parameters;
|
16
|
+
this.timestamp = update.timestamp;
|
17
|
+
this.type = update.type;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.default = Chat;
|
@@ -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;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Client } from '../..';
|
2
|
+
import { DecoratorsTypes } from '../../types/index.type';
|
3
|
+
declare class Message implements DecoratorsTypes.MessageUpdate {
|
4
|
+
message_id: string;
|
5
|
+
action: string;
|
6
|
+
message: DecoratorsTypes.Message;
|
7
|
+
updated_parameters: any[];
|
8
|
+
timestamp: string;
|
9
|
+
prev_message_id: string;
|
10
|
+
object_guid: string;
|
11
|
+
type: string;
|
12
|
+
state: string;
|
13
|
+
client_guid: string;
|
14
|
+
store: Record<string, any>;
|
15
|
+
client: Client;
|
16
|
+
originalType: string;
|
17
|
+
constructor(client: Client, update: DecoratorsTypes.MessageUpdate);
|
18
|
+
reply(text?: string, object_guid?: string, message_id?: string, auto_delete?: number, file_inline?: string | Buffer<ArrayBufferLike>, type?: string, is_spoil?: boolean, thumb?: string, audio_info?: boolean): Promise<any>;
|
19
|
+
pin(object_guid?: string, message_id?: string, action?: 'Pin' | 'Unpin'): Promise<any>;
|
20
|
+
reply_photo(photo: string | Buffer<ArrayBufferLike>, caption?: string, object_guid?: string, auto_delete?: number, reply_to_message_id?: string, is_spoil?: boolean, thumb?: string): Promise<any>;
|
21
|
+
forward(to_object_guid: string): Promise<any>;
|
22
|
+
delete(): Promise<any>;
|
23
|
+
reaction(reaction_id: number, object_guid?: string, message_id?: string, action?: 'Add' | 'Remove'): Promise<any>;
|
24
|
+
getReplyMessage(object_guid?: string, message_id?: string): Promise<any>;
|
25
|
+
}
|
26
|
+
export default Message;
|
@@ -0,0 +1,72 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const getOriginalType = (message) => {
|
4
|
+
try {
|
5
|
+
if (!message?.message?.type)
|
6
|
+
return 'Delete';
|
7
|
+
if (message.message.type.includes('FileInline')) {
|
8
|
+
return message.message.file_inline?.type;
|
9
|
+
}
|
10
|
+
if (message.message.type === 'Event') {
|
11
|
+
return message.message.event_data.type;
|
12
|
+
}
|
13
|
+
return message.message.type;
|
14
|
+
}
|
15
|
+
catch (e) {
|
16
|
+
console.log(e, message);
|
17
|
+
}
|
18
|
+
};
|
19
|
+
class Message {
|
20
|
+
constructor(client, update) {
|
21
|
+
this.store = {};
|
22
|
+
Object.defineProperty(this, 'client', {
|
23
|
+
value: client,
|
24
|
+
enumerable: false,
|
25
|
+
writable: true,
|
26
|
+
configurable: true,
|
27
|
+
});
|
28
|
+
Object.defineProperty(this, 'originalType', {
|
29
|
+
value: getOriginalType(update),
|
30
|
+
enumerable: false,
|
31
|
+
writable: true,
|
32
|
+
configurable: true,
|
33
|
+
});
|
34
|
+
this.client_guid = update.client_guid;
|
35
|
+
this.message_id = update.message_id;
|
36
|
+
this.action = update.action;
|
37
|
+
this.message = update.message;
|
38
|
+
this.updated_parameters = update.updated_parameters;
|
39
|
+
this.timestamp = update.timestamp;
|
40
|
+
this.prev_message_id = update.prev_message_id;
|
41
|
+
this.object_guid = update.object_guid;
|
42
|
+
this.type = update.type;
|
43
|
+
this.state = update.state;
|
44
|
+
}
|
45
|
+
async reply(text, object_guid, message_id, auto_delete, file_inline, type, is_spoil, thumb, audio_info) {
|
46
|
+
return await this.client.sendMessage(object_guid || this.object_guid, text, message_id || this.message_id, file_inline, type, is_spoil, thumb, audio_info, auto_delete);
|
47
|
+
}
|
48
|
+
async pin(object_guid, message_id, action = 'Pin') {
|
49
|
+
return await this.client.setPinMessage(object_guid || this.object_guid, message_id || this.message_id, action);
|
50
|
+
}
|
51
|
+
async reply_photo(photo, caption, object_guid, auto_delete, reply_to_message_id, is_spoil, thumb) {
|
52
|
+
return await this.reply(caption, object_guid, reply_to_message_id, auto_delete, photo, 'Image', is_spoil, thumb);
|
53
|
+
}
|
54
|
+
async forward(to_object_guid) {
|
55
|
+
return await this.client.forwardMessages(this.object_guid, to_object_guid, [
|
56
|
+
this.message_id,
|
57
|
+
]);
|
58
|
+
}
|
59
|
+
async delete() {
|
60
|
+
return await this.client.deleteMessages(this.object_guid, [
|
61
|
+
this.message_id,
|
62
|
+
]);
|
63
|
+
}
|
64
|
+
async reaction(reaction_id, object_guid, message_id, action = 'Add') {
|
65
|
+
return await this.client.actionOnMessageReaction(object_guid || this.object_guid, message_id || this.message_id, reaction_id, action);
|
66
|
+
}
|
67
|
+
async getReplyMessage(object_guid, message_id) {
|
68
|
+
const result = await this.client.getMessagesByID(object_guid || this.object_guid, message_id || [this.message.reply_to_message_id]);
|
69
|
+
return result.messages[0];
|
70
|
+
}
|
71
|
+
}
|
72
|
+
exports.default = Message;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Client } from '../..';
|
2
|
+
import { DecoratorsTypes } from '../../types/index.type';
|
3
|
+
declare class Notifications implements DecoratorsTypes.ShowNotifications {
|
4
|
+
notification_id: string;
|
5
|
+
type: string;
|
6
|
+
title: string;
|
7
|
+
text: string;
|
8
|
+
image_file_id?: number;
|
9
|
+
message_data: DecoratorsTypes.MessageData;
|
10
|
+
store: Record<string, any>;
|
11
|
+
client: Client;
|
12
|
+
constructor(client: Client, update: DecoratorsTypes.ShowNotifications);
|
13
|
+
}
|
14
|
+
export default Notifications;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
class Notifications {
|
4
|
+
constructor(client, update) {
|
5
|
+
this.store = {};
|
6
|
+
Object.defineProperty(this, 'client', {
|
7
|
+
value: client,
|
8
|
+
enumerable: false,
|
9
|
+
writable: true,
|
10
|
+
configurable: true,
|
11
|
+
});
|
12
|
+
this.notification_id = update.notification_id;
|
13
|
+
this.type = update.type;
|
14
|
+
this.title = update.title;
|
15
|
+
this.text = update.text;
|
16
|
+
this.image_file_id = update.image_file_id;
|
17
|
+
this.message_data = update.message_data;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.default = Notifications;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
declare class Crypto {
|
2
|
+
static AES_IV: Buffer<ArrayBuffer>;
|
3
|
+
static decode_auth: (auth: string) => string;
|
4
|
+
static passphrase(auth: string): string;
|
5
|
+
static secret(length: number): string;
|
6
|
+
static decrypt(data_enc: string, key: Buffer<ArrayBufferLike>): string;
|
7
|
+
static encrypt(data: string, key: Buffer<ArrayBufferLike>): string;
|
8
|
+
static sign(data_enc: string, privateKey: string): string;
|
9
|
+
static createKeys(): string[];
|
10
|
+
static decrypt_RSA_OAEP(private_key: string, data: string): string;
|
11
|
+
}
|
12
|
+
export default Crypto;
|
@@ -0,0 +1,95 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const node_rsa_1 = __importDefault(require("node-rsa"));
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
8
|
+
class Crypto {
|
9
|
+
static passphrase(auth) {
|
10
|
+
if (auth.length !== 32) {
|
11
|
+
throw new Error('auth length should be 32 digits');
|
12
|
+
}
|
13
|
+
const resultList = [];
|
14
|
+
const chunks = auth.match(/.{8}/g);
|
15
|
+
if (!chunks || chunks.length !== 4) {
|
16
|
+
throw new Error('Invalid auth format');
|
17
|
+
}
|
18
|
+
const combined = chunks[2] + chunks[0] + chunks[3] + chunks[1];
|
19
|
+
for (const character of combined) {
|
20
|
+
const newChar = String.fromCharCode(((character.charCodeAt(0) - 97 + 9) % 26) + 97);
|
21
|
+
resultList.push(newChar);
|
22
|
+
}
|
23
|
+
return resultList.join('');
|
24
|
+
}
|
25
|
+
static secret(length) {
|
26
|
+
if (length <= 0 || !Number.isInteger(length)) {
|
27
|
+
throw new Error('Length must be a positive integer');
|
28
|
+
}
|
29
|
+
const characters = 'abcdefghijklmnopqrstuvwxyz';
|
30
|
+
let secret = '';
|
31
|
+
for (let i = 0; i < length; i++) {
|
32
|
+
const randomIndex = Math.floor(Math.random() * characters.length);
|
33
|
+
secret += characters[randomIndex];
|
34
|
+
}
|
35
|
+
return secret;
|
36
|
+
}
|
37
|
+
static decrypt(data_enc, key) {
|
38
|
+
const decipher = crypto_1.default.createDecipheriv('aes-256-cbc', key, this.AES_IV);
|
39
|
+
let decrypted = decipher.update(data_enc, 'base64', 'utf8');
|
40
|
+
decrypted += decipher.final('utf8');
|
41
|
+
return decrypted;
|
42
|
+
}
|
43
|
+
static encrypt(data, key) {
|
44
|
+
const cipher = crypto_1.default.createCipheriv('aes-256-cbc', key, this.AES_IV);
|
45
|
+
let encrypted = cipher.update(data, 'utf8', 'base64');
|
46
|
+
encrypted += cipher.final('base64');
|
47
|
+
return encrypted;
|
48
|
+
}
|
49
|
+
static sign(data_enc, privateKey) {
|
50
|
+
if (!privateKey) {
|
51
|
+
throw new Error('Private key is not defined');
|
52
|
+
}
|
53
|
+
const sign = crypto_1.default.createSign('SHA256');
|
54
|
+
sign.update(data_enc);
|
55
|
+
sign.end();
|
56
|
+
const signature = sign.sign(privateKey, 'base64');
|
57
|
+
return signature;
|
58
|
+
}
|
59
|
+
static createKeys() {
|
60
|
+
const keyPair = new node_rsa_1.default({
|
61
|
+
b: 1024,
|
62
|
+
});
|
63
|
+
let publicKey = Crypto.decode_auth(Buffer.from(keyPair.exportKey('pkcs1-public-pem'), 'binary').toString('base64'));
|
64
|
+
let privateKey = keyPair.exportKey('pkcs1-private-pem');
|
65
|
+
return [publicKey, privateKey];
|
66
|
+
}
|
67
|
+
static decrypt_RSA_OAEP(private_key, data) {
|
68
|
+
const keyPair = new node_rsa_1.default(private_key);
|
69
|
+
const decrypted = keyPair.decrypt(data, 'utf8');
|
70
|
+
return decrypted;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
Crypto.AES_IV = Buffer.alloc(16, 0);
|
74
|
+
Crypto.decode_auth = (auth) => {
|
75
|
+
let n = '';
|
76
|
+
const lowercase = 'abcdefghijklmnopqrstuvwxyz';
|
77
|
+
const uppercase = lowercase.toUpperCase();
|
78
|
+
const digits = '0123456789';
|
79
|
+
for (const s of auth) {
|
80
|
+
if (lowercase.includes(s)) {
|
81
|
+
n += String.fromCharCode(((32 - (s.charCodeAt(0) - 97)) % 26) + 97);
|
82
|
+
}
|
83
|
+
else if (uppercase.includes(s)) {
|
84
|
+
n += String.fromCharCode(((29 - (s.charCodeAt(0) - 65)) % 26) + 65);
|
85
|
+
}
|
86
|
+
else if (digits.includes(s)) {
|
87
|
+
n += String.fromCharCode(((13 - (s.charCodeAt(0) - 48)) % 10) + 48);
|
88
|
+
}
|
89
|
+
else {
|
90
|
+
n += s;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
return n;
|
94
|
+
};
|
95
|
+
exports.default = Crypto;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { MessageUpdate, FileInline } from "../types/decorators.type";
|
2
|
+
declare class Filters {
|
3
|
+
static findKey(message: any, key: string): any;
|
4
|
+
static guidType(message: MessageUpdate, startWith: string): boolean;
|
5
|
+
static isMention(message: MessageUpdate): boolean;
|
6
|
+
static isMarkdown(message: MessageUpdate): boolean;
|
7
|
+
static isReply(message: MessageUpdate): boolean;
|
8
|
+
static isEdited(message: MessageUpdate): boolean;
|
9
|
+
static isLink(message: MessageUpdate): boolean;
|
10
|
+
static isText(message: MessageUpdate): boolean;
|
11
|
+
static isGroup(message: MessageUpdate): boolean;
|
12
|
+
static isChannel(message: MessageUpdate): boolean;
|
13
|
+
static isPrivate(message: MessageUpdate): boolean;
|
14
|
+
static isForward(message: MessageUpdate): boolean;
|
15
|
+
static fileInline(message: MessageUpdate): FileInline | undefined;
|
16
|
+
static isFileInline(message: MessageUpdate): boolean;
|
17
|
+
static isFile(message: MessageUpdate): boolean;
|
18
|
+
static isPhoto(message: MessageUpdate): boolean;
|
19
|
+
static isSticker(message: MessageUpdate): boolean;
|
20
|
+
static isVideo(message: MessageUpdate): boolean;
|
21
|
+
static isVoice(message: MessageUpdate): boolean;
|
22
|
+
static isGif(message: MessageUpdate): boolean;
|
23
|
+
static isMusic(message: MessageUpdate): boolean;
|
24
|
+
static isLocation(message: MessageUpdate): boolean;
|
25
|
+
static isContact(message: MessageUpdate): boolean;
|
26
|
+
static isPoll(message: MessageUpdate): boolean;
|
27
|
+
static isLive(message: MessageUpdate): boolean;
|
28
|
+
static isEvent(message: MessageUpdate): boolean;
|
29
|
+
static isLength(length: number, object_guid?: string): (message: MessageUpdate) => boolean;
|
30
|
+
static startsWithCommand(text: string, object_guid?: string, length?: number): (message: MessageUpdate) => boolean | undefined;
|
31
|
+
static equalCommand(text: string, object_guid?: string): (message: MessageUpdate) => boolean | undefined;
|
32
|
+
}
|
33
|
+
export default Filters;
|
@@ -0,0 +1,153 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
class Filters {
|
4
|
+
static findKey(message, key) {
|
5
|
+
if (!message || typeof message !== "object") {
|
6
|
+
return undefined;
|
7
|
+
}
|
8
|
+
const messageKeys = Object.keys(message);
|
9
|
+
if (messageKeys.includes(key)) {
|
10
|
+
return message[key];
|
11
|
+
}
|
12
|
+
for (const messageKey of messageKeys) {
|
13
|
+
const value = message[messageKey];
|
14
|
+
if (Array.isArray(value)) {
|
15
|
+
for (const item of value) {
|
16
|
+
if (typeof item === "object") {
|
17
|
+
const found = Filters.findKey(item, key);
|
18
|
+
if (found !== undefined)
|
19
|
+
return found;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
if (typeof value === "object") {
|
24
|
+
const found = Filters.findKey(value, key);
|
25
|
+
if (found !== undefined)
|
26
|
+
return found;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
return undefined;
|
30
|
+
}
|
31
|
+
static guidType(message, startWith) {
|
32
|
+
const result = Filters.findKey(message, "object_guid");
|
33
|
+
return result?.startsWith(startWith) ?? false;
|
34
|
+
}
|
35
|
+
static isMention(message) {
|
36
|
+
return !!Filters.findKey(message.message?.metadata?.meta_data_parts, "link");
|
37
|
+
}
|
38
|
+
static isMarkdown(message) {
|
39
|
+
return !!Filters.findKey(message.message, "metadata");
|
40
|
+
}
|
41
|
+
static isReply(message) {
|
42
|
+
return !!Filters.findKey(message, "reply_to_message_id");
|
43
|
+
}
|
44
|
+
static isEdited(message) {
|
45
|
+
return !!Filters.findKey(message, "is_edited");
|
46
|
+
}
|
47
|
+
static isLink(message) {
|
48
|
+
const link = Filters.findKey(message, "text");
|
49
|
+
if (!link)
|
50
|
+
return false;
|
51
|
+
const RUBIKA_LINK_PATTERN = /\brubika\.ir\b/;
|
52
|
+
const USERNAME_PATTERN = /@([a-zA-Z0-9_]{3,32})/;
|
53
|
+
return (link.includes("http") ||
|
54
|
+
RUBIKA_LINK_PATTERN.test(link) ||
|
55
|
+
USERNAME_PATTERN.test(link));
|
56
|
+
}
|
57
|
+
static isText(message) {
|
58
|
+
return !!Filters.findKey(message, "text");
|
59
|
+
}
|
60
|
+
static isGroup(message) {
|
61
|
+
return Filters.guidType(message, "g0");
|
62
|
+
}
|
63
|
+
static isChannel(message) {
|
64
|
+
return Filters.guidType(message, "c0");
|
65
|
+
}
|
66
|
+
static isPrivate(message) {
|
67
|
+
return Filters.guidType(message, "u0");
|
68
|
+
}
|
69
|
+
static isForward(message) {
|
70
|
+
return !!Filters.findKey(message, "forwarded_from");
|
71
|
+
}
|
72
|
+
static fileInline(message) {
|
73
|
+
return message.message?.file_inline;
|
74
|
+
}
|
75
|
+
static isFileInline(message) {
|
76
|
+
return ["FileInline", "FileInlineCaption"].includes(message.message?.type);
|
77
|
+
}
|
78
|
+
static isFile(message) {
|
79
|
+
return Filters.fileInline(message)?.type === "File";
|
80
|
+
}
|
81
|
+
static isPhoto(message) {
|
82
|
+
return Filters.fileInline(message)?.type === "Image";
|
83
|
+
}
|
84
|
+
static isSticker(message) {
|
85
|
+
return Filters.fileInline(message)?.type === "Sticker";
|
86
|
+
}
|
87
|
+
static isVideo(message) {
|
88
|
+
return Filters.fileInline(message)?.type === "Video";
|
89
|
+
}
|
90
|
+
static isVoice(message) {
|
91
|
+
return Filters.fileInline(message)?.type === "Voice";
|
92
|
+
}
|
93
|
+
static isGif(message) {
|
94
|
+
return Filters.fileInline(message)?.type === "Gif";
|
95
|
+
}
|
96
|
+
static isMusic(message) {
|
97
|
+
return Filters.fileInline(message)?.type === "Music";
|
98
|
+
}
|
99
|
+
static isLocation(message) {
|
100
|
+
return !!Filters.findKey(message.message, "location");
|
101
|
+
}
|
102
|
+
static isContact(message) {
|
103
|
+
return !!Filters.findKey(message.message, "contact_message");
|
104
|
+
}
|
105
|
+
static isPoll(message) {
|
106
|
+
return !!Filters.findKey(message, "poll");
|
107
|
+
}
|
108
|
+
static isLive(message) {
|
109
|
+
return !!Filters.findKey(message, "live_data");
|
110
|
+
}
|
111
|
+
static isEvent(message) {
|
112
|
+
return !!Filters.findKey(message, "event_data");
|
113
|
+
}
|
114
|
+
static isLength(length, object_guid) {
|
115
|
+
return (message) => {
|
116
|
+
if (object_guid) {
|
117
|
+
if (object_guid !== message.object_guid)
|
118
|
+
return false;
|
119
|
+
}
|
120
|
+
if (message?.message?.text) {
|
121
|
+
return message?.message?.text.length === length;
|
122
|
+
}
|
123
|
+
return false;
|
124
|
+
};
|
125
|
+
}
|
126
|
+
static startsWithCommand(text, object_guid, length) {
|
127
|
+
return (message) => {
|
128
|
+
if (object_guid) {
|
129
|
+
if (object_guid !== message.object_guid)
|
130
|
+
return false;
|
131
|
+
}
|
132
|
+
if (message?.message?.text) {
|
133
|
+
if (length) {
|
134
|
+
if (message?.message?.text.length !== length)
|
135
|
+
return false;
|
136
|
+
}
|
137
|
+
return message.message.text.startsWith(text);
|
138
|
+
}
|
139
|
+
};
|
140
|
+
}
|
141
|
+
static equalCommand(text, object_guid) {
|
142
|
+
return (message) => {
|
143
|
+
if (object_guid) {
|
144
|
+
if (object_guid !== message.object_guid)
|
145
|
+
return false;
|
146
|
+
}
|
147
|
+
if (message?.message?.text) {
|
148
|
+
return message.message.text === text;
|
149
|
+
}
|
150
|
+
};
|
151
|
+
}
|
152
|
+
}
|
153
|
+
exports.default = Filters;
|
@@ -0,0 +1,30 @@
|
|
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 crypto_1 = __importDefault(require("../../crypto"));
|
7
|
+
async function builder(name, input, tmp_session = false) {
|
8
|
+
if (!this.auth)
|
9
|
+
this.auth = crypto_1.default.secret(32);
|
10
|
+
if (!this.key)
|
11
|
+
this.key = Buffer.from(crypto_1.default.passphrase(this.auth), 'utf8');
|
12
|
+
let result = await this.network.send({
|
13
|
+
input,
|
14
|
+
tmp_session,
|
15
|
+
method: name,
|
16
|
+
});
|
17
|
+
if (result) {
|
18
|
+
const data_enc = result.data_enc;
|
19
|
+
if (data_enc) {
|
20
|
+
const decrypted = crypto_1.default.decrypt(data_enc, this.key);
|
21
|
+
result = JSON.parse(decrypted);
|
22
|
+
}
|
23
|
+
const status = result.status;
|
24
|
+
const status_det = result.status_det;
|
25
|
+
if (status == 'OK' && status_det == 'OK') {
|
26
|
+
return result.data;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
exports.default = builder;
|