rubjs 1.1.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +1 -1
- package/rubjs/client.d.ts +1 -0
- package/rubjs/client.js +3 -2
- package/rubjs/index.d.ts +5 -2
- package/rubjs/index.js +41 -1
- package/rubjs/methods/auth/index.d.ts +5 -4
- package/rubjs/methods/auth/index.js +9 -7
- package/rubjs/methods/auth/logout.d.ts +3 -0
- package/rubjs/methods/{messages/send_text.js → auth/logout.js} +3 -3
- package/rubjs/methods/auth/registerDevice.d.ts +3 -0
- package/rubjs/methods/auth/{register_device.js → registerDevice.js} +2 -2
- package/rubjs/methods/auth/sendCode.d.ts +3 -0
- package/rubjs/methods/auth/{send_code.js → sendCode.js} +2 -2
- package/rubjs/methods/auth/signIn.d.ts +3 -0
- package/rubjs/methods/auth/{sign_in.js → signIn.js} +2 -2
- package/rubjs/methods/channels/addChannel.d.ts +3 -0
- package/rubjs/methods/channels/addChannel.js +26 -0
- package/rubjs/methods/channels/addChannelMembers.d.ts +3 -0
- package/rubjs/methods/channels/addChannelMembers.js +22 -0
- package/rubjs/methods/channels/banChannelMember.d.ts +3 -0
- package/rubjs/methods/channels/banChannelMember.js +23 -0
- package/rubjs/methods/channels/cancelChangeObjectOwner.d.ts +3 -0
- package/rubjs/methods/channels/cancelChangeObjectOwner.js +17 -0
- package/rubjs/methods/channels/channelPreviewByJoinLink.d.ts +3 -0
- package/rubjs/methods/{messages/send_photo.js → channels/channelPreviewByJoinLink.js} +5 -3
- package/rubjs/methods/channels/checkChannelUsername.d.ts +3 -0
- package/rubjs/methods/channels/checkChannelUsername.js +19 -0
- package/rubjs/methods/channels/createChannelVoiceChat.d.ts +3 -0
- package/rubjs/methods/channels/createChannelVoiceChat.js +17 -0
- package/rubjs/methods/channels/discardChannelVoiceChat.d.ts +3 -0
- package/rubjs/methods/channels/discardChannelVoiceChat.js +20 -0
- package/rubjs/methods/channels/editChannelInfo.d.ts +4 -0
- package/rubjs/methods/channels/editChannelInfo.js +48 -0
- package/rubjs/methods/channels/getBannedChannelMembers.d.ts +3 -0
- package/rubjs/methods/channels/getBannedChannelMembers.js +20 -0
- package/rubjs/methods/channels/getChannelAdminAccessList.d.ts +3 -0
- package/rubjs/methods/channels/getChannelAdminAccessList.js +20 -0
- package/rubjs/methods/channels/getChannelAdminMembers.d.ts +3 -0
- package/rubjs/methods/channels/getChannelAdminMembers.js +20 -0
- package/rubjs/methods/channels/getChannelAllMembers.d.ts +3 -0
- package/rubjs/methods/channels/getChannelAllMembers.js +21 -0
- package/rubjs/methods/channels/getChannelInfo.d.ts +3 -0
- package/rubjs/methods/channels/getChannelInfo.js +17 -0
- package/rubjs/methods/channels/getChannelLink.d.ts +3 -0
- package/rubjs/methods/channels/getChannelLink.js +17 -0
- package/rubjs/methods/channels/getPendingObjectOwner.d.ts +3 -0
- package/rubjs/methods/channels/getPendingObjectOwner.js +17 -0
- package/rubjs/methods/channels/index.d.ts +26 -0
- package/rubjs/methods/channels/index.js +56 -0
- package/rubjs/methods/channels/joinChannelAction.d.ts +3 -0
- package/rubjs/methods/channels/joinChannelAction.js +19 -0
- package/rubjs/methods/channels/joinChannelByLink.d.ts +3 -0
- package/rubjs/methods/channels/joinChannelByLink.js +19 -0
- package/rubjs/methods/channels/leaveChannelVoiceChat.d.ts +3 -0
- package/rubjs/methods/channels/leaveChannelVoiceChat.js +20 -0
- package/rubjs/methods/channels/removeChannel.d.ts +3 -0
- package/rubjs/methods/channels/removeChannel.js +17 -0
- package/rubjs/methods/channels/requestChangeObjectOwner.d.ts +3 -0
- package/rubjs/methods/{messages/edit_message.js → channels/requestChangeObjectOwner.js} +5 -7
- package/rubjs/methods/channels/seenChannelMessages.d.ts +3 -0
- package/rubjs/methods/channels/seenChannelMessages.js +21 -0
- package/rubjs/methods/channels/setChannelLink.d.ts +3 -0
- package/rubjs/methods/channels/setChannelLink.js +17 -0
- package/rubjs/methods/channels/setChannelVoiceChatSetting.d.ts +3 -0
- package/rubjs/methods/channels/setChannelVoiceChatSetting.js +26 -0
- package/rubjs/methods/channels/updateChannelUsername.d.ts +3 -0
- package/rubjs/methods/channels/updateChannelUsername.js +20 -0
- package/rubjs/methods/chats/actionOnJoinRequest.d.ts +3 -0
- package/rubjs/methods/chats/actionOnJoinRequest.js +22 -0
- package/rubjs/methods/chats/addLiveComment.d.ts +3 -0
- package/rubjs/methods/chats/addLiveComment.js +17 -0
- package/rubjs/methods/chats/clickMessageUrl.d.ts +3 -0
- package/rubjs/methods/chats/clickMessageUrl.js +17 -0
- package/rubjs/methods/chats/createJoinLink.d.ts +3 -0
- package/rubjs/methods/chats/createJoinLink.js +23 -0
- package/rubjs/methods/chats/deleteAvatar.d.ts +3 -0
- package/rubjs/methods/chats/deleteAvatar.js +17 -0
- package/rubjs/methods/chats/deleteChatHistory.d.ts +3 -0
- package/rubjs/methods/chats/deleteChatHistory.js +20 -0
- package/rubjs/methods/chats/editJoinLink.d.ts +3 -0
- package/rubjs/methods/chats/editJoinLink.js +34 -0
- package/rubjs/methods/chats/getAbsObjects.d.ts +3 -0
- package/rubjs/methods/chats/getAbsObjects.js +19 -0
- package/rubjs/methods/chats/getAvatars.d.ts +3 -0
- package/rubjs/methods/chats/getAvatars.js +17 -0
- package/rubjs/methods/chats/getChatReaction.d.ts +3 -0
- package/rubjs/methods/chats/getChatReaction.js +17 -0
- package/rubjs/methods/chats/getChats.d.ts +3 -0
- package/rubjs/methods/chats/getChats.js +17 -0
- package/rubjs/methods/chats/getChatsUpdates.d.ts +3 -0
- package/rubjs/methods/chats/getChatsUpdates.js +17 -0
- package/rubjs/methods/chats/getJoinLinks.d.ts +3 -0
- package/rubjs/methods/chats/getJoinLinks.js +17 -0
- package/rubjs/methods/chats/getJoinRequests.d.ts +3 -0
- package/rubjs/methods/chats/getJoinRequests.js +17 -0
- package/rubjs/methods/chats/getLinkFromAppUrl.d.ts +3 -0
- package/rubjs/methods/chats/getLinkFromAppUrl.js +17 -0
- package/rubjs/methods/chats/getLiveComments.d.ts +3 -0
- package/rubjs/methods/chats/getLiveComments.js +17 -0
- package/rubjs/methods/chats/getLivePlayUrl.d.ts +3 -0
- package/rubjs/methods/chats/getLivePlayUrl.js +17 -0
- package/rubjs/methods/chats/getLiveStatus.d.ts +3 -0
- package/rubjs/methods/chats/getLiveStatus.js +17 -0
- package/rubjs/methods/chats/getObjectInfoByUsername.d.ts +3 -0
- package/rubjs/methods/chats/getObjectInfoByUsername.js +19 -0
- package/rubjs/methods/chats/getTopChatUsers.d.ts +3 -0
- package/rubjs/methods/chats/getTopChatUsers.js +18 -0
- package/rubjs/methods/chats/index.d.ts +29 -0
- package/rubjs/methods/chats/index.js +62 -0
- package/rubjs/methods/chats/removeFromTopChatUsers.d.ts +3 -0
- package/rubjs/methods/chats/removeFromTopChatUsers.js +17 -0
- package/rubjs/methods/chats/removeJoinLink.d.ts +3 -0
- package/rubjs/methods/chats/removeJoinLink.js +19 -0
- package/rubjs/methods/chats/searchChatMessages.d.ts +3 -0
- package/rubjs/methods/chats/searchChatMessages.js +23 -0
- package/rubjs/methods/chats/searchGlobalMessages.d.ts +3 -0
- package/rubjs/methods/chats/searchGlobalMessages.js +17 -0
- package/rubjs/methods/chats/seenChats.d.ts +3 -0
- package/rubjs/methods/chats/seenChats.js +17 -0
- package/rubjs/methods/chats/sendChatActivity.d.ts +3 -0
- package/rubjs/methods/chats/sendChatActivity.js +19 -0
- package/rubjs/methods/chats/sendLive.d.ts +3 -0
- package/rubjs/methods/chats/sendLive.js +28 -0
- package/rubjs/methods/chats/setActionChat.d.ts +3 -0
- package/rubjs/methods/chats/setActionChat.js +19 -0
- package/rubjs/methods/chats/uploadAvatar.d.ts +3 -0
- package/rubjs/methods/chats/uploadAvatar.js +29 -0
- package/rubjs/methods/contacts/addAddressBook.d.ts +3 -0
- package/rubjs/methods/contacts/addAddressBook.js +17 -0
- package/rubjs/methods/contacts/deleteContact.d.ts +3 -0
- package/rubjs/methods/contacts/deleteContact.js +17 -0
- package/rubjs/methods/contacts/getContacts.d.ts +3 -0
- package/rubjs/methods/contacts/getContacts.js +17 -0
- package/rubjs/methods/contacts/getContactsLastOnline.d.ts +3 -0
- package/rubjs/methods/contacts/getContactsLastOnline.js +17 -0
- package/rubjs/methods/contacts/getContactsUpdates.d.ts +3 -0
- package/rubjs/methods/contacts/getContactsUpdates.js +17 -0
- package/rubjs/methods/contacts/index.d.ts +7 -0
- package/rubjs/methods/contacts/index.js +18 -0
- package/rubjs/methods/contacts/resetContacts.d.ts +3 -0
- package/rubjs/methods/contacts/resetContacts.js +18 -0
- package/rubjs/methods/extras/banMember.d.ts +3 -0
- package/rubjs/methods/extras/banMember.js +20 -0
- package/rubjs/methods/extras/getInfo.d.ts +3 -0
- package/rubjs/methods/extras/getInfo.js +26 -0
- package/rubjs/methods/extras/getObjectByUsername.d.ts +3 -0
- package/rubjs/methods/extras/getObjectByUsername.js +19 -0
- package/rubjs/methods/extras/getProfileLinkItems.d.ts +3 -0
- package/rubjs/methods/extras/getProfileLinkItems.js +17 -0
- package/rubjs/methods/extras/getRelatedObjects.d.ts +3 -0
- package/rubjs/methods/extras/getRelatedObjects.js +17 -0
- package/rubjs/methods/extras/getTranscription.d.ts +3 -0
- package/rubjs/methods/extras/getTranscription.js +20 -0
- package/rubjs/methods/extras/index.d.ts +13 -0
- package/rubjs/methods/extras/index.js +30 -0
- package/rubjs/methods/extras/join.d.ts +3 -0
- package/rubjs/methods/extras/join.js +22 -0
- package/rubjs/methods/extras/leaveChat.d.ts +3 -0
- package/rubjs/methods/extras/leaveChat.js +20 -0
- package/rubjs/methods/extras/reportObject.d.ts +14 -0
- package/rubjs/methods/extras/reportObject.js +32 -0
- package/rubjs/methods/extras/searchGlobalObjects.d.ts +3 -0
- package/rubjs/methods/extras/searchGlobalObjects.js +17 -0
- package/rubjs/methods/extras/transcribeVoice.d.ts +3 -0
- package/rubjs/methods/extras/transcribeVoice.js +17 -0
- package/rubjs/methods/extras/userIsAdmin.d.ts +3 -0
- package/rubjs/methods/extras/userIsAdmin.js +29 -0
- package/rubjs/methods/gif/addToMyGifSet.d.ts +3 -0
- package/rubjs/methods/gif/addToMyGifSet.js +17 -0
- package/rubjs/methods/gif/getMyGifSet.d.ts +3 -0
- package/rubjs/methods/gif/getMyGifSet.js +17 -0
- package/rubjs/methods/gif/index.d.ts +4 -0
- package/rubjs/methods/gif/index.js +12 -0
- package/rubjs/methods/gif/removeFromMyGifSet.d.ts +3 -0
- package/rubjs/methods/gif/removeFromMyGifSet.js +17 -0
- package/rubjs/methods/groups/addGroup.d.ts +3 -0
- package/rubjs/methods/groups/addGroup.js +19 -0
- package/rubjs/methods/groups/addGroupMembers.d.ts +3 -0
- package/rubjs/methods/groups/addGroupMembers.js +19 -0
- package/rubjs/methods/groups/banGroupMember.d.ts +3 -0
- package/rubjs/methods/groups/banGroupMember.js +23 -0
- package/rubjs/methods/groups/createGroupVoiceChat.d.ts +3 -0
- package/rubjs/methods/groups/createGroupVoiceChat.js +17 -0
- package/rubjs/methods/groups/deleteNoAccessGroupChat.d.ts +3 -0
- package/rubjs/methods/groups/deleteNoAccessGroupChat.js +17 -0
- package/rubjs/methods/groups/discardGroupVoiceChat.d.ts +3 -0
- package/rubjs/methods/groups/discardGroupVoiceChat.js +20 -0
- package/rubjs/methods/groups/editGroupInfo.d.ts +6 -0
- package/rubjs/methods/groups/editGroupInfo.js +51 -0
- package/rubjs/methods/groups/getBannedGroupMembers.d.ts +3 -0
- package/rubjs/methods/groups/getBannedGroupMembers.js +17 -0
- package/rubjs/methods/groups/getGroupAdminAccessList.d.ts +3 -0
- package/rubjs/methods/groups/getGroupAdminAccessList.js +20 -0
- package/rubjs/methods/groups/getGroupAdminMembers.d.ts +3 -0
- package/rubjs/methods/groups/getGroupAdminMembers.js +17 -0
- package/rubjs/methods/groups/getGroupAllMembers.d.ts +3 -0
- package/rubjs/methods/groups/getGroupAllMembers.js +21 -0
- package/rubjs/methods/groups/getGroupDefaultAccess.d.ts +3 -0
- package/rubjs/methods/groups/getGroupDefaultAccess.js +17 -0
- package/rubjs/methods/groups/getGroupInfo.d.ts +3 -0
- package/rubjs/methods/groups/getGroupInfo.js +17 -0
- package/rubjs/methods/groups/getGroupLink.d.ts +3 -0
- package/rubjs/methods/groups/getGroupLink.js +17 -0
- package/rubjs/methods/groups/getGroupMentionList.d.ts +3 -0
- package/rubjs/methods/groups/getGroupMentionList.js +20 -0
- package/rubjs/methods/groups/getGroupOnlineCount.d.ts +3 -0
- package/rubjs/methods/groups/getGroupOnlineCount.js +17 -0
- package/rubjs/methods/groups/getGroupVoiceChatUpdates.d.ts +3 -0
- package/rubjs/methods/groups/getGroupVoiceChatUpdates.js +21 -0
- package/rubjs/methods/groups/groupPreviewByJoinLink.d.ts +3 -0
- package/rubjs/methods/groups/groupPreviewByJoinLink.js +19 -0
- package/rubjs/methods/groups/index.d.ts +28 -0
- package/rubjs/methods/groups/index.js +60 -0
- package/rubjs/methods/groups/joinGroup.d.ts +3 -0
- package/rubjs/methods/groups/joinGroup.js +19 -0
- package/rubjs/methods/groups/leaveGroup.d.ts +3 -0
- package/rubjs/methods/groups/leaveGroup.js +17 -0
- package/rubjs/methods/groups/leaveGroupVoiceChat.d.ts +3 -0
- package/rubjs/methods/groups/leaveGroupVoiceChat.js +20 -0
- package/rubjs/methods/groups/removeGroup.d.ts +3 -0
- package/rubjs/methods/groups/removeGroup.js +17 -0
- package/rubjs/methods/groups/seenGroupMessages.d.ts +3 -0
- package/rubjs/methods/groups/seenGroupMessages.js +21 -0
- package/rubjs/methods/groups/setGroupAdmin.d.ts +5 -0
- package/rubjs/methods/groups/setGroupAdmin.js +26 -0
- package/rubjs/methods/groups/setGroupDefaultAccess.d.ts +4 -0
- package/rubjs/methods/groups/setGroupDefaultAccess.js +22 -0
- package/rubjs/methods/groups/setGroupLink.d.ts +3 -0
- package/rubjs/methods/groups/setGroupLink.js +17 -0
- package/rubjs/methods/groups/setGroupVoiceChatSetting.d.ts +3 -0
- package/rubjs/methods/groups/setGroupVoiceChatSetting.js +26 -0
- package/rubjs/methods/index.d.ts +190 -41
- package/rubjs/methods/index.js +827 -57
- package/rubjs/methods/messages/actionOnMessageReaction.d.ts +3 -0
- package/rubjs/methods/messages/{action_on_message_reaction.js → actionOnMessageReaction.js} +2 -2
- package/rubjs/methods/messages/createPoll.d.ts +3 -0
- package/rubjs/methods/messages/{create_poll.js → createPoll.js} +2 -2
- package/rubjs/methods/messages/deleteMessages.d.ts +3 -0
- package/rubjs/methods/messages/{delete_messages.js → deleteMessages.js} +2 -2
- package/rubjs/methods/messages/editMessage.d.ts +3 -0
- package/rubjs/methods/messages/editMessage.js +23 -0
- package/rubjs/methods/messages/forwardMessages.d.ts +3 -0
- package/rubjs/methods/messages/{forward_messages.js → forwardMessages.js} +2 -2
- package/rubjs/methods/messages/getMessageShareUrl.d.ts +3 -0
- package/rubjs/methods/messages/{get_message_share_url.js → getMessageShareUrl.js} +2 -2
- package/rubjs/methods/messages/getMessages.d.ts +3 -0
- package/rubjs/methods/messages/getMessages.js +23 -0
- package/rubjs/methods/messages/getMessagesByID.d.ts +3 -0
- package/rubjs/methods/messages/{get_messages_by_id.js → getMessagesByID.js} +2 -2
- package/rubjs/methods/messages/getMessagesInterval.d.ts +3 -0
- package/rubjs/methods/messages/{get_messages_interval.js → getMessagesInterval.js} +2 -2
- package/rubjs/methods/messages/getMessagesUpdates.d.ts +3 -0
- package/rubjs/methods/messages/{get_messages_updates.js → getMessagesUpdates.js} +2 -2
- package/rubjs/methods/messages/getPollOptionVoters.d.ts +3 -0
- package/rubjs/methods/messages/{get_poll_option_voters.js → getPollOptionVoters.js} +2 -2
- package/rubjs/methods/messages/getPollStatus.d.ts +3 -0
- package/rubjs/methods/messages/{get_poll_status.js → getPollStatus.js} +2 -2
- package/rubjs/methods/messages/index.d.ts +26 -17
- package/rubjs/methods/messages/index.js +51 -33
- package/rubjs/methods/messages/requestSendFile.d.ts +4 -0
- package/rubjs/methods/{utilities/request_send_file.js → messages/requestSendFile.js} +2 -2
- package/rubjs/methods/messages/sendDocument.d.ts +3 -0
- package/rubjs/methods/messages/sendDocument.js +17 -0
- package/rubjs/methods/messages/sendGif.d.ts +3 -0
- package/rubjs/methods/messages/sendGif.js +17 -0
- package/rubjs/methods/messages/sendMessage.d.ts +3 -0
- package/rubjs/methods/messages/{send_message.js → sendMessage.js} +32 -20
- package/rubjs/methods/messages/sendMusic.d.ts +3 -0
- package/rubjs/methods/messages/sendMusic.js +17 -0
- package/rubjs/methods/messages/sendPhoto.d.ts +3 -0
- package/rubjs/methods/messages/sendPhoto.js +17 -0
- package/rubjs/methods/messages/sendSticker.d.ts +3 -0
- package/rubjs/methods/messages/sendSticker.js +17 -0
- package/rubjs/methods/messages/sendText.d.ts +3 -0
- package/rubjs/methods/messages/sendText.js +17 -0
- package/rubjs/methods/messages/sendVideo.d.ts +3 -0
- package/rubjs/methods/messages/sendVideo.js +17 -0
- package/rubjs/methods/messages/sendVideoMessage.d.ts +3 -0
- package/rubjs/methods/messages/sendVideoMessage.js +17 -0
- package/rubjs/methods/messages/sendVoice.d.ts +3 -0
- package/rubjs/methods/messages/sendVoice.js +17 -0
- package/rubjs/methods/messages/setPinMessage.d.ts +3 -0
- package/rubjs/methods/messages/{set_pin_message.js → setPinMessage.js} +2 -2
- package/rubjs/methods/messages/votePoll.d.ts +3 -0
- package/rubjs/methods/messages/{vote_poll.js → votePoll.js} +2 -2
- package/rubjs/methods/settings/changePassword.d.ts +3 -0
- package/rubjs/methods/settings/changePassword.js +17 -0
- package/rubjs/methods/settings/checkTwoStepPasscode.d.ts +3 -0
- package/rubjs/methods/settings/checkTwoStepPasscode.js +17 -0
- package/rubjs/methods/settings/deleteFolder.d.ts +3 -0
- package/rubjs/methods/settings/deleteFolder.js +17 -0
- package/rubjs/methods/settings/getBlockedUsers.d.ts +3 -0
- package/rubjs/methods/settings/getBlockedUsers.js +17 -0
- package/rubjs/methods/settings/getFolders.d.ts +3 -0
- package/rubjs/methods/settings/getFolders.js +17 -0
- package/rubjs/methods/settings/getMySessions.d.ts +3 -0
- package/rubjs/methods/settings/getMySessions.js +17 -0
- package/rubjs/methods/settings/getPrivacySetting.d.ts +3 -0
- package/rubjs/methods/settings/getPrivacySetting.js +17 -0
- package/rubjs/methods/settings/getSuggestedFolders.d.ts +3 -0
- package/rubjs/methods/settings/getSuggestedFolders.js +17 -0
- package/rubjs/methods/settings/getTwoPasscodeStatus.d.ts +3 -0
- package/rubjs/methods/settings/getTwoPasscodeStatus.js +17 -0
- package/rubjs/methods/settings/index.d.ts +19 -0
- package/rubjs/methods/settings/index.js +42 -0
- package/rubjs/methods/settings/requestRecoveryEmail.d.ts +3 -0
- package/rubjs/methods/settings/requestRecoveryEmail.js +20 -0
- package/rubjs/methods/settings/setSetting.d.ts +5 -0
- package/rubjs/methods/settings/setSetting.js +50 -0
- package/rubjs/methods/settings/setupTwoStepVerification.d.ts +3 -0
- package/rubjs/methods/settings/setupTwoStepVerification.js +21 -0
- package/rubjs/methods/settings/terminateOtherSessions.d.ts +3 -0
- package/rubjs/methods/settings/terminateOtherSessions.js +18 -0
- package/rubjs/methods/settings/terminateSession.d.ts +3 -0
- package/rubjs/methods/settings/terminateSession.js +17 -0
- package/rubjs/methods/settings/turnOffTwoStep.d.ts +3 -0
- package/rubjs/methods/settings/turnOffTwoStep.js +18 -0
- package/rubjs/methods/settings/updateProfile.d.ts +3 -0
- package/rubjs/methods/settings/updateProfile.js +30 -0
- package/rubjs/methods/settings/updateUsername.d.ts +3 -0
- package/rubjs/methods/settings/updateUsername.js +17 -0
- package/rubjs/methods/settings/verifyRecoveryEmail.d.ts +3 -0
- package/rubjs/methods/settings/verifyRecoveryEmail.js +17 -0
- package/rubjs/methods/stickers/actionOnStickerSet.d.ts +3 -0
- package/rubjs/methods/stickers/actionOnStickerSet.js +19 -0
- package/rubjs/methods/stickers/getMyStickerSets.d.ts +3 -0
- package/rubjs/methods/stickers/getMyStickerSets.js +17 -0
- package/rubjs/methods/stickers/getStickerSetByID.d.ts +3 -0
- package/rubjs/methods/stickers/getStickerSetByID.js +17 -0
- package/rubjs/methods/stickers/getStickersByEmoji.d.ts +3 -0
- package/rubjs/methods/stickers/getStickersByEmoji.js +17 -0
- package/rubjs/methods/stickers/getStickersBySetIds.d.ts +3 -0
- package/rubjs/methods/stickers/getStickersBySetIds.js +19 -0
- package/rubjs/methods/stickers/getTrendStickerSets.d.ts +3 -0
- package/rubjs/methods/stickers/getTrendStickerSets.js +17 -0
- package/rubjs/methods/stickers/index.d.ts +8 -0
- package/rubjs/methods/stickers/index.js +20 -0
- package/rubjs/methods/stickers/searchStickers.d.ts +3 -0
- package/rubjs/methods/stickers/searchStickers.js +17 -0
- package/rubjs/methods/users/checkUserUsername.d.ts +3 -0
- package/rubjs/methods/users/checkUserUsername.js +17 -0
- package/rubjs/methods/users/deleteUserChat.d.ts +3 -0
- package/rubjs/methods/users/deleteUserChat.js +20 -0
- package/rubjs/methods/users/getMe.d.ts +3 -0
- package/rubjs/methods/users/getMe.js +17 -0
- package/rubjs/methods/users/getUserInfo.d.ts +4 -0
- package/rubjs/methods/users/{get_user_info.js → getUserInfo.js} +2 -2
- package/rubjs/methods/users/index.d.ts +6 -2
- package/rubjs/methods/users/index.js +11 -3
- package/rubjs/methods/users/setBlockUser.d.ts +3 -0
- package/rubjs/methods/users/setBlockUser.js +19 -0
- package/rubjs/methods/utilities/download.d.ts +4 -0
- package/rubjs/methods/utilities/download.js +17 -0
- package/rubjs/methods/utilities/downloadProfilePicture.d.ts +3 -0
- package/rubjs/methods/utilities/downloadProfilePicture.js +27 -0
- package/rubjs/methods/utilities/get.d.ts +4 -0
- package/rubjs/methods/utilities/get.js +21 -0
- package/rubjs/methods/utilities/index.d.ts +7 -3
- package/rubjs/methods/utilities/index.js +13 -5
- package/rubjs/methods/utilities/post.d.ts +4 -0
- package/rubjs/methods/utilities/post.js +21 -0
- package/rubjs/methods/utilities/run.js +8 -1
- package/rubjs/methods/utilities/start.js +8 -7
- package/rubjs/methods/utilities/thumbnail.d.ts +1 -0
- package/rubjs/methods/utilities/thumbnail.js +15 -1
- package/rubjs/network/index.d.ts +4 -3
- package/rubjs/network/index.js +77 -21
- package/rubjs/parser/index.d.ts +25 -0
- package/rubjs/parser/index.js +112 -0
- package/rubjs/session/index.js +1 -1
- package/rubjs/{methods/auth/types/sign_in.d.ts → types/auth.d.ts} +11 -1
- package/rubjs/types/chats.d.ts +79 -0
- package/rubjs/{methods/types/message_update.d.ts → types/decorators.d.ts} +56 -0
- package/rubjs/types/groups.d.ts +129 -0
- package/rubjs/types/index.d.ts +8 -0
- package/rubjs/types/index.js +53 -0
- package/rubjs/types/message.d.ts +25 -0
- package/rubjs/types/message.js +61 -0
- package/rubjs/types/messages.d.ts +176 -0
- package/rubjs/{methods/users/types/get_user_info.d.ts → types/users.d.ts} +1 -0
- package/rubjs/utils/filters.d.ts +28 -16
- package/rubjs/utils/filters.js +90 -31
- package/rubjs/utils/index.d.ts +2 -1
- package/rubjs/utils/index.js +3 -1
- package/rubjs/utils/utils.d.ts +10 -0
- package/rubjs/utils/utils.js +12 -0
- package/rubjs/methods/auth/register_device.d.ts +0 -3
- package/rubjs/methods/auth/send_code.d.ts +0 -4
- package/rubjs/methods/auth/sign_in.d.ts +0 -4
- package/rubjs/methods/auth/types/index.d.ts +0 -3
- package/rubjs/methods/auth/types/send_code.d.ts +0 -10
- package/rubjs/methods/messages/action_on_message_reaction.d.ts +0 -4
- package/rubjs/methods/messages/create_poll.d.ts +0 -4
- package/rubjs/methods/messages/delete_messages.d.ts +0 -4
- package/rubjs/methods/messages/edit_message.d.ts +0 -4
- package/rubjs/methods/messages/forward_messages.d.ts +0 -4
- package/rubjs/methods/messages/get_message_share_url.d.ts +0 -4
- package/rubjs/methods/messages/get_messages_by_id.d.ts +0 -4
- package/rubjs/methods/messages/get_messages_interval.d.ts +0 -4
- package/rubjs/methods/messages/get_messages_updates.d.ts +0 -4
- package/rubjs/methods/messages/get_poll_option_voters.d.ts +0 -4
- package/rubjs/methods/messages/get_poll_status.d.ts +0 -4
- package/rubjs/methods/messages/send_message.d.ts +0 -4
- package/rubjs/methods/messages/send_photo.d.ts +0 -4
- package/rubjs/methods/messages/send_text.d.ts +0 -4
- package/rubjs/methods/messages/set_pin_message.d.ts +0 -4
- package/rubjs/methods/messages/types/action_on_message_reaction.d.ts +0 -10
- package/rubjs/methods/messages/types/delete_message.d.ts +0 -34
- package/rubjs/methods/messages/types/edit_message.d.ts +0 -38
- package/rubjs/methods/messages/types/forward_messages.d.ts +0 -7
- package/rubjs/methods/messages/types/forward_messages.js +0 -2
- package/rubjs/methods/messages/types/get_messages_by_id.d.ts +0 -14
- package/rubjs/methods/messages/types/get_messages_by_id.js +0 -2
- package/rubjs/methods/messages/types/get_messages_interval.d.ts +0 -43
- package/rubjs/methods/messages/types/get_messages_interval.js +0 -2
- package/rubjs/methods/messages/types/get_messages_updates.d.ts +0 -29
- package/rubjs/methods/messages/types/get_messages_updates.js +0 -2
- package/rubjs/methods/messages/types/get_poll_option_voters.d.ts +0 -19
- package/rubjs/methods/messages/types/get_poll_option_voters.js +0 -2
- package/rubjs/methods/messages/types/get_poll_status.d.ts +0 -13
- package/rubjs/methods/messages/types/get_poll_status.js +0 -2
- package/rubjs/methods/messages/types/index.d.ts +0 -13
- package/rubjs/methods/messages/types/index.js +0 -2
- package/rubjs/methods/messages/types/message_result.d.ts +0 -7
- package/rubjs/methods/messages/types/message_result.js +0 -2
- package/rubjs/methods/messages/types/mini_typs.d.ts +0 -5
- package/rubjs/methods/messages/types/mini_typs.js +0 -2
- package/rubjs/methods/messages/types/set_pin_message.d.ts +0 -15
- package/rubjs/methods/messages/types/set_pin_message.js +0 -2
- package/rubjs/methods/messages/vote_poll.d.ts +0 -4
- package/rubjs/methods/types/chat_updates.d.ts +0 -26
- package/rubjs/methods/types/chat_updates.js +0 -2
- package/rubjs/methods/types/index.d.ts +0 -5
- package/rubjs/methods/types/index.js +0 -2
- package/rubjs/methods/types/message_update.js +0 -2
- package/rubjs/methods/types/show_activities.d.ts +0 -7
- package/rubjs/methods/types/show_activities.js +0 -2
- package/rubjs/methods/types/show_notifications.d.ts +0 -14
- package/rubjs/methods/types/show_notifications.js +0 -2
- package/rubjs/methods/users/get_user_info.d.ts +0 -4
- package/rubjs/methods/users/types/get_user_info.js +0 -2
- package/rubjs/methods/users/types/index.d.ts +0 -2
- package/rubjs/methods/users/types/index.js +0 -2
- package/rubjs/methods/utilities/request_send_file.d.ts +0 -4
- package/rubjs/methods/utilities/types/index.d.ts +0 -2
- package/rubjs/methods/utilities/types/index.js +0 -2
- package/rubjs/methods/utilities/types/request_send_file.d.ts +0 -7
- package/rubjs/methods/utilities/types/request_send_file.js +0 -2
- /package/rubjs/{methods/auth/types/index.js → types/auth.js} +0 -0
- /package/rubjs/{methods/auth/types/send_code.js → types/chats.js} +0 -0
- /package/rubjs/{methods/auth/types/sign_in.js → types/decorators.js} +0 -0
- /package/rubjs/{methods/messages/types/action_on_message_reaction.js → types/groups.js} +0 -0
- /package/rubjs/{methods/messages/types/delete_message.js → types/messages.js} +0 -0
- /package/rubjs/{methods/messages/types/edit_message.js → types/users.js} +0 -0
@@ -0,0 +1,129 @@
|
|
1
|
+
import MessageUpdate, { ChatUpdates } from "./decorators";
|
2
|
+
interface ChatReactionSetting {
|
3
|
+
reaction_type: string;
|
4
|
+
}
|
5
|
+
interface Group {
|
6
|
+
group_guid: string;
|
7
|
+
group_title: string;
|
8
|
+
count_members: number;
|
9
|
+
is_deleted: boolean;
|
10
|
+
is_verified: boolean;
|
11
|
+
slow_mode: number;
|
12
|
+
chat_history_for_new_members: string;
|
13
|
+
event_messages: boolean;
|
14
|
+
chat_reaction_setting: ChatReactionSetting;
|
15
|
+
is_restricted_content: boolean;
|
16
|
+
}
|
17
|
+
interface Chat {
|
18
|
+
object_guid: string;
|
19
|
+
access: string[];
|
20
|
+
count_unseen: number;
|
21
|
+
is_mute: boolean;
|
22
|
+
is_pinned: boolean;
|
23
|
+
time_string: string;
|
24
|
+
last_message: {
|
25
|
+
message_id: string;
|
26
|
+
type: string;
|
27
|
+
text: string;
|
28
|
+
};
|
29
|
+
last_seen_my_mid: string;
|
30
|
+
last_seen_peer_mid: string;
|
31
|
+
status: string;
|
32
|
+
time: number;
|
33
|
+
abs_object: {
|
34
|
+
object_guid: string;
|
35
|
+
type: string;
|
36
|
+
title: string;
|
37
|
+
is_verified: boolean;
|
38
|
+
is_deleted: boolean;
|
39
|
+
};
|
40
|
+
is_blocked: boolean;
|
41
|
+
last_message_id: string;
|
42
|
+
last_deleted_mid: string;
|
43
|
+
slow_mode_duration: number;
|
44
|
+
}
|
45
|
+
interface ChatUpdate {
|
46
|
+
object_guid: string;
|
47
|
+
action: string;
|
48
|
+
updated_parameters: [];
|
49
|
+
timestamp: string;
|
50
|
+
type: string;
|
51
|
+
chat?: Chat;
|
52
|
+
}
|
53
|
+
interface GroupVoiceChat {
|
54
|
+
voice_chat_id: string;
|
55
|
+
state: string;
|
56
|
+
join_muted: boolean;
|
57
|
+
participant_count: number;
|
58
|
+
title: string;
|
59
|
+
version: number;
|
60
|
+
}
|
61
|
+
interface GroupVoiceChatUpdate {
|
62
|
+
voice_chat_id: string;
|
63
|
+
group_guid: string;
|
64
|
+
action: string;
|
65
|
+
group_voice_chat: GroupVoiceChat;
|
66
|
+
updated_parameters: [];
|
67
|
+
timestamp: string;
|
68
|
+
chat_guid_type: {
|
69
|
+
type: string;
|
70
|
+
object_guid: string;
|
71
|
+
};
|
72
|
+
}
|
73
|
+
interface GroupMember {
|
74
|
+
member_type: string;
|
75
|
+
member_guid: string;
|
76
|
+
first_name: string;
|
77
|
+
last_name: string;
|
78
|
+
avatar_thumbnail: {
|
79
|
+
file_id: string;
|
80
|
+
mime: string;
|
81
|
+
dc_id: string;
|
82
|
+
access_hash_rec: string;
|
83
|
+
};
|
84
|
+
is_verified: boolean;
|
85
|
+
is_deleted: boolean;
|
86
|
+
last_online: number;
|
87
|
+
join_type: string;
|
88
|
+
username: string;
|
89
|
+
online_time: {
|
90
|
+
type: string;
|
91
|
+
exact_time: number;
|
92
|
+
};
|
93
|
+
}
|
94
|
+
interface AddGroup {
|
95
|
+
group: Group;
|
96
|
+
chat_update: ChatUpdate;
|
97
|
+
message_update: MessageUpdate;
|
98
|
+
timestamp: string;
|
99
|
+
}
|
100
|
+
interface DeleteNoAccessGroupChat {
|
101
|
+
chat_update: ChatUpdate;
|
102
|
+
status: string;
|
103
|
+
}
|
104
|
+
interface CreateGroupVoiceChat {
|
105
|
+
status: string;
|
106
|
+
chat_update: ChatUpdates;
|
107
|
+
message_update: MessageUpdate;
|
108
|
+
group_voice_chat_update: GroupVoiceChatUpdate;
|
109
|
+
}
|
110
|
+
interface AddGroupMembers {
|
111
|
+
chat_update: ChatUpdates;
|
112
|
+
message_update: MessageUpdate;
|
113
|
+
added_in_chat_members: GroupMember[];
|
114
|
+
timestamp: string;
|
115
|
+
group: Group;
|
116
|
+
}
|
117
|
+
interface BanGroupMember {
|
118
|
+
chat_update: ChatUpdates;
|
119
|
+
message_update: MessageUpdate;
|
120
|
+
timestamp: string;
|
121
|
+
group: Group;
|
122
|
+
}
|
123
|
+
interface GetBannedGroupMembers {
|
124
|
+
in_chat_members: GroupMember[];
|
125
|
+
next_start_id: "67b0e8bc1b50d7bec6fc950b";
|
126
|
+
has_continue: false;
|
127
|
+
timestamp: "1739888215";
|
128
|
+
}
|
129
|
+
export { AddGroup, DeleteNoAccessGroupChat, CreateGroupVoiceChat, AddGroupMembers, BanGroupMember, GetBannedGroupMembers };
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import * as DecoratorsTypes from "./decorators";
|
2
|
+
import * as UserTypes from "./users";
|
3
|
+
import * as AuthTypes from "./auth";
|
4
|
+
import * as MessagesTypes from "./messages";
|
5
|
+
import * as GroupTypes from "./groups";
|
6
|
+
import * as ChatTypes from "./chats";
|
7
|
+
import Message from "./message";
|
8
|
+
export { DecoratorsTypes, UserTypes, MessagesTypes, AuthTypes, GroupTypes, ChatTypes, Message, };
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
37
|
+
};
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
39
|
+
exports.Message = exports.ChatTypes = exports.GroupTypes = exports.AuthTypes = exports.MessagesTypes = exports.UserTypes = exports.DecoratorsTypes = void 0;
|
40
|
+
const DecoratorsTypes = __importStar(require("./decorators"));
|
41
|
+
exports.DecoratorsTypes = DecoratorsTypes;
|
42
|
+
const UserTypes = __importStar(require("./users"));
|
43
|
+
exports.UserTypes = UserTypes;
|
44
|
+
const AuthTypes = __importStar(require("./auth"));
|
45
|
+
exports.AuthTypes = AuthTypes;
|
46
|
+
const MessagesTypes = __importStar(require("./messages"));
|
47
|
+
exports.MessagesTypes = MessagesTypes;
|
48
|
+
const GroupTypes = __importStar(require("./groups"));
|
49
|
+
exports.GroupTypes = GroupTypes;
|
50
|
+
const ChatTypes = __importStar(require("./chats"));
|
51
|
+
exports.ChatTypes = ChatTypes;
|
52
|
+
const message_1 = __importDefault(require("./message"));
|
53
|
+
exports.Message = message_1.default;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import Client from "..";
|
2
|
+
import { MessageUpdate, Message as MessageType } from "./decorators";
|
3
|
+
declare class Message implements MessageUpdate {
|
4
|
+
message_id: string;
|
5
|
+
action: string;
|
6
|
+
message: MessageType;
|
7
|
+
updated_parameters: any[];
|
8
|
+
timestamp: string;
|
9
|
+
prev_message_id: string;
|
10
|
+
object_guid: string;
|
11
|
+
type: string;
|
12
|
+
state: string;
|
13
|
+
client: Client;
|
14
|
+
constructor(client: Client, update: MessageUpdate);
|
15
|
+
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<import("./messages").SendMessageResult>;
|
16
|
+
pin(object_guid?: string, message_id?: string, action?: "Pin" | "Unpin"): Promise<import("./messages").SetPinMessage>;
|
17
|
+
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<import("./messages").SendMessageResult>;
|
18
|
+
forward(to_object_guid: string): Promise<import("./messages").ForwardMessages>;
|
19
|
+
delete(): Promise<import("./messages").DeleteMessage>;
|
20
|
+
reaction(reaction_id: number, object_guid?: string, message_id?: string, action?: "Add" | "Remove"): Promise<{
|
21
|
+
reactions: import("./messages").Reaction[];
|
22
|
+
}>;
|
23
|
+
getReplyMessage(object_guid?: string, message_id?: string): Promise<import("./messages").Message>;
|
24
|
+
}
|
25
|
+
export default Message;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
class Message {
|
13
|
+
constructor(client, update) {
|
14
|
+
Object.assign(this, update);
|
15
|
+
Object.defineProperty(this, "client", {
|
16
|
+
value: client,
|
17
|
+
enumerable: false,
|
18
|
+
writable: true,
|
19
|
+
configurable: true,
|
20
|
+
});
|
21
|
+
}
|
22
|
+
reply(text, object_guid, message_id, auto_delete, file_inline, type, is_spoil, thumb, audio_info) {
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
24
|
+
return yield this.client.sendMessage(object_guid || this.object_guid, text, message_id || this.message_id, file_inline, type, is_spoil, thumb, audio_info, auto_delete);
|
25
|
+
});
|
26
|
+
}
|
27
|
+
pin(object_guid_1, message_id_1) {
|
28
|
+
return __awaiter(this, arguments, void 0, function* (object_guid, message_id, action = "Pin") {
|
29
|
+
return yield this.client.setPinMessage(object_guid || this.object_guid, message_id || this.message_id, action);
|
30
|
+
});
|
31
|
+
}
|
32
|
+
reply_photo(photo, caption, object_guid, auto_delete, reply_to_message_id, is_spoil, thumb) {
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
34
|
+
return yield this.reply(caption, object_guid, reply_to_message_id, auto_delete, photo, "Image", is_spoil, thumb);
|
35
|
+
});
|
36
|
+
}
|
37
|
+
forward(to_object_guid) {
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
39
|
+
return yield this.client.forwardMessages(this.object_guid, to_object_guid, [
|
40
|
+
this.message_id,
|
41
|
+
]);
|
42
|
+
});
|
43
|
+
}
|
44
|
+
delete() {
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
46
|
+
return yield this.client.deleteMessages(this.object_guid, [this.message_id]);
|
47
|
+
});
|
48
|
+
}
|
49
|
+
reaction(reaction_id_1, object_guid_1, message_id_1) {
|
50
|
+
return __awaiter(this, arguments, void 0, function* (reaction_id, object_guid, message_id, action = "Add") {
|
51
|
+
return yield this.client.actionOnMessageReaction(object_guid || this.object_guid, message_id || this.message_id, reaction_id, action);
|
52
|
+
});
|
53
|
+
}
|
54
|
+
getReplyMessage(object_guid, message_id) {
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
56
|
+
const result = yield this.client.getMessagesByID(object_guid || this.object_guid, message_id || [this.message_id]);
|
57
|
+
return result.messages[0];
|
58
|
+
});
|
59
|
+
}
|
60
|
+
}
|
61
|
+
exports.default = Message;
|
@@ -0,0 +1,176 @@
|
|
1
|
+
import MessageUpdate, { ChatUpdates } from "./decorators";
|
2
|
+
interface Reaction {
|
3
|
+
user_guids: string[];
|
4
|
+
reaction_count: number;
|
5
|
+
emoji_char: string;
|
6
|
+
reaction_id: number;
|
7
|
+
is_selected: boolean;
|
8
|
+
}
|
9
|
+
interface MetaData {
|
10
|
+
meta_data_parts: {
|
11
|
+
from_index: number;
|
12
|
+
length: number;
|
13
|
+
type: string;
|
14
|
+
link?: {
|
15
|
+
url: string;
|
16
|
+
};
|
17
|
+
}[];
|
18
|
+
}
|
19
|
+
interface Message {
|
20
|
+
message_id: string;
|
21
|
+
text: string;
|
22
|
+
time?: string;
|
23
|
+
is_edited?: boolean;
|
24
|
+
type: string;
|
25
|
+
author_type: string;
|
26
|
+
author_object_guid: string;
|
27
|
+
allow_transcription?: boolean;
|
28
|
+
reactions?: Reaction[];
|
29
|
+
metadata?: MetaData;
|
30
|
+
}
|
31
|
+
interface Chat {
|
32
|
+
object_guid: string;
|
33
|
+
action: string;
|
34
|
+
updated_parameters: string[];
|
35
|
+
timestamp: string;
|
36
|
+
type: string;
|
37
|
+
}
|
38
|
+
interface ChatWithLastMessage extends Chat {
|
39
|
+
chat: {
|
40
|
+
time_string?: string;
|
41
|
+
time?: number;
|
42
|
+
last_message_id: string;
|
43
|
+
last_message: Message & {
|
44
|
+
is_mine?: boolean;
|
45
|
+
author_title?: string;
|
46
|
+
};
|
47
|
+
};
|
48
|
+
}
|
49
|
+
interface ChatWithPin extends Chat {
|
50
|
+
chat: {
|
51
|
+
pinned_message_id: string;
|
52
|
+
pinned_message_ids: string[];
|
53
|
+
};
|
54
|
+
}
|
55
|
+
interface MessageUpdateBase {
|
56
|
+
message_id: string;
|
57
|
+
action: string;
|
58
|
+
updated_parameters: string[];
|
59
|
+
timestamp: string;
|
60
|
+
object_guid: string;
|
61
|
+
type: string;
|
62
|
+
state: string;
|
63
|
+
}
|
64
|
+
interface EditMessage {
|
65
|
+
message_update: MessageUpdateBase & {
|
66
|
+
message: {
|
67
|
+
text: string;
|
68
|
+
is_edited: boolean;
|
69
|
+
};
|
70
|
+
};
|
71
|
+
chat_update: ChatWithLastMessage;
|
72
|
+
}
|
73
|
+
interface DeleteMessage {
|
74
|
+
chat_update: ChatWithLastMessage;
|
75
|
+
message_updates: MessageUpdateBase[];
|
76
|
+
}
|
77
|
+
interface ForwardMessages {
|
78
|
+
message_updates: MessageUpdate[];
|
79
|
+
status: string;
|
80
|
+
chat_update: ChatUpdates;
|
81
|
+
}
|
82
|
+
interface GetBannedGroupMembers {
|
83
|
+
in_chat_members: {
|
84
|
+
member_type: string;
|
85
|
+
member_guid: string;
|
86
|
+
first_name: string;
|
87
|
+
last_name: string;
|
88
|
+
avatar_thumbnail: {
|
89
|
+
file_id: string;
|
90
|
+
mime: string;
|
91
|
+
dc_id: string;
|
92
|
+
access_hash_rec: string;
|
93
|
+
};
|
94
|
+
is_verified: boolean;
|
95
|
+
is_deleted: boolean;
|
96
|
+
last_online: number;
|
97
|
+
removed_by_object_guid: string;
|
98
|
+
removed_by_object_type: string;
|
99
|
+
join_type: string;
|
100
|
+
username: string;
|
101
|
+
online_time: {
|
102
|
+
type: string;
|
103
|
+
exact_time: number;
|
104
|
+
};
|
105
|
+
}[];
|
106
|
+
next_start_id: string;
|
107
|
+
has_continue: boolean;
|
108
|
+
timestamp: string;
|
109
|
+
}
|
110
|
+
interface GetMessagesBase {
|
111
|
+
messages: Message[];
|
112
|
+
timestamp: string;
|
113
|
+
}
|
114
|
+
interface GetMessagesInterval extends GetMessagesBase {
|
115
|
+
state: string;
|
116
|
+
new_has_continue: boolean;
|
117
|
+
old_has_continue: boolean;
|
118
|
+
new_min_id: number;
|
119
|
+
old_max_id: number;
|
120
|
+
}
|
121
|
+
interface GetMessagesUpdates {
|
122
|
+
updated_messages: MessageUpdateBase[];
|
123
|
+
new_state: number;
|
124
|
+
status: string;
|
125
|
+
}
|
126
|
+
interface PollVoter {
|
127
|
+
object_guid: string;
|
128
|
+
type: string;
|
129
|
+
first_name: string;
|
130
|
+
last_name: string;
|
131
|
+
avatar_thumbnail: {
|
132
|
+
file_id: string;
|
133
|
+
mime: string;
|
134
|
+
dc_id: string;
|
135
|
+
access_hash_rec: string;
|
136
|
+
};
|
137
|
+
is_verified: boolean;
|
138
|
+
is_deleted: boolean;
|
139
|
+
}
|
140
|
+
interface GetPollOptionVoters {
|
141
|
+
voters_abs_objects: PollVoter[];
|
142
|
+
has_continue: boolean;
|
143
|
+
next_start_id: string;
|
144
|
+
}
|
145
|
+
interface GetPollStatus {
|
146
|
+
poll_status: {
|
147
|
+
state: string;
|
148
|
+
selection_index: number;
|
149
|
+
percent_vote_options: number[];
|
150
|
+
total_vote: number;
|
151
|
+
show_total_votes: boolean;
|
152
|
+
voters_object_guids: string[];
|
153
|
+
correct_option_index: number;
|
154
|
+
explanation: string;
|
155
|
+
};
|
156
|
+
}
|
157
|
+
interface SendMessageResult {
|
158
|
+
message_update: MessageUpdate;
|
159
|
+
status: string;
|
160
|
+
chat_update: ChatUpdates;
|
161
|
+
}
|
162
|
+
interface SetPinMessage {
|
163
|
+
chat_update: ChatWithPin;
|
164
|
+
status: string;
|
165
|
+
}
|
166
|
+
interface RequestSendFile {
|
167
|
+
id: string;
|
168
|
+
dc_id: string;
|
169
|
+
access_hash_send: string;
|
170
|
+
upload_url: string;
|
171
|
+
}
|
172
|
+
interface GetMessageShareUrl {
|
173
|
+
share_url?: string;
|
174
|
+
has_share_url: boolean;
|
175
|
+
}
|
176
|
+
export { Reaction, Message, Chat, ChatWithLastMessage, ChatWithPin, MessageUpdateBase, EditMessage, DeleteMessage, ForwardMessages, GetBannedGroupMembers, GetMessagesBase, GetMessagesInterval, GetMessagesUpdates, GetPollOptionVoters, GetPollStatus, SendMessageResult, SetPinMessage, RequestSendFile, GetMessageShareUrl };
|
package/rubjs/utils/filters.d.ts
CHANGED
@@ -1,17 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
import { MessageUpdate, FileInline } from "../types/decorators";
|
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 isReply(message: MessageUpdate): boolean;
|
7
|
+
static isEdited(message: MessageUpdate): boolean;
|
8
|
+
static isLink(message: MessageUpdate): boolean;
|
9
|
+
static isText(message: MessageUpdate): boolean;
|
10
|
+
static isGroup(message: MessageUpdate): boolean;
|
11
|
+
static isChannel(message: MessageUpdate): boolean;
|
12
|
+
static isPrivate(message: MessageUpdate): boolean;
|
13
|
+
static isForward(message: MessageUpdate): boolean;
|
14
|
+
static fileInline(message: MessageUpdate): FileInline | undefined;
|
15
|
+
static isFileInline(message: MessageUpdate): boolean;
|
16
|
+
static isFile(message: MessageUpdate): boolean;
|
17
|
+
static isPhoto(message: MessageUpdate): boolean;
|
18
|
+
static isSticker(message: MessageUpdate): boolean;
|
19
|
+
static isVideo(message: MessageUpdate): boolean;
|
20
|
+
static isVoice(message: MessageUpdate): boolean;
|
21
|
+
static isGif(message: MessageUpdate): boolean;
|
22
|
+
static isMusic(message: MessageUpdate): boolean;
|
23
|
+
static isLocation(message: MessageUpdate): boolean;
|
24
|
+
static isContact(message: MessageUpdate): boolean;
|
25
|
+
static isPoll(message: MessageUpdate): boolean;
|
26
|
+
static isLive(message: MessageUpdate): boolean;
|
27
|
+
static isEvent(message: MessageUpdate): boolean;
|
28
|
+
}
|
17
29
|
export default Filters;
|
package/rubjs/utils/filters.js
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
|
4
|
-
findKey
|
3
|
+
class Filters {
|
4
|
+
static findKey(message, key) {
|
5
|
+
if (!message || typeof message !== "object") {
|
6
|
+
return undefined;
|
7
|
+
}
|
5
8
|
const messageKeys = Object.keys(message);
|
6
9
|
if (messageKeys.includes(key)) {
|
7
10
|
return message[key];
|
@@ -24,15 +27,23 @@ const Filters = {
|
|
24
27
|
}
|
25
28
|
}
|
26
29
|
return undefined;
|
27
|
-
}
|
28
|
-
guidType
|
29
|
-
|
30
|
-
const
|
31
|
-
return
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
}
|
31
|
+
static guidType(message, startWith) {
|
32
|
+
var _a;
|
33
|
+
const result = Filters.findKey(message, "object_guid");
|
34
|
+
return (_a = result === null || result === void 0 ? void 0 : result.startsWith(startWith)) !== null && _a !== void 0 ? _a : false;
|
35
|
+
}
|
36
|
+
static isMention(message) {
|
37
|
+
var _a, _b;
|
38
|
+
return !!Filters.findKey((_b = (_a = message.message) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.meta_data_parts, "link");
|
39
|
+
}
|
40
|
+
static isReply(message) {
|
41
|
+
return !!Filters.findKey(message, "reply_to_message_id");
|
42
|
+
}
|
43
|
+
static isEdited(message) {
|
44
|
+
return !!Filters.findKey(message, "is_edited");
|
45
|
+
}
|
46
|
+
static isLink(message) {
|
36
47
|
const link = Filters.findKey(message, "text");
|
37
48
|
if (!link)
|
38
49
|
return false;
|
@@ -41,24 +52,72 @@ const Filters = {
|
|
41
52
|
return (link.includes("http") ||
|
42
53
|
RUBIKA_LINK_PATTERN.test(link) ||
|
43
54
|
USERNAME_PATTERN.test(link));
|
44
|
-
}
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
}
|
55
|
+
}
|
56
|
+
static isText(message) {
|
57
|
+
return !!Filters.findKey(message, "text");
|
58
|
+
}
|
59
|
+
static isGroup(message) {
|
60
|
+
return Filters.guidType(message, "g0");
|
61
|
+
}
|
62
|
+
static isChannel(message) {
|
63
|
+
return Filters.guidType(message, "c0");
|
64
|
+
}
|
65
|
+
static isPrivate(message) {
|
66
|
+
return Filters.guidType(message, "u0");
|
67
|
+
}
|
68
|
+
static isForward(message) {
|
69
|
+
return !!Filters.findKey(message, "forwarded_from");
|
70
|
+
}
|
71
|
+
static fileInline(message) {
|
72
|
+
var _a;
|
73
|
+
return (_a = message.message) === null || _a === void 0 ? void 0 : _a.file_inline;
|
74
|
+
}
|
75
|
+
static isFileInline(message) {
|
76
|
+
var _a;
|
77
|
+
return ["FileInline", "FileInlineCaption"].includes((_a = message.message) === null || _a === void 0 ? void 0 : _a.type);
|
78
|
+
}
|
79
|
+
static isFile(message) {
|
80
|
+
var _a;
|
81
|
+
return ((_a = Filters.fileInline(message)) === null || _a === void 0 ? void 0 : _a.type) === "File";
|
82
|
+
}
|
83
|
+
static isPhoto(message) {
|
84
|
+
var _a;
|
85
|
+
return ((_a = Filters.fileInline(message)) === null || _a === void 0 ? void 0 : _a.type) === "Image";
|
86
|
+
}
|
87
|
+
static isSticker(message) {
|
88
|
+
var _a;
|
89
|
+
return ((_a = Filters.fileInline(message)) === null || _a === void 0 ? void 0 : _a.type) === "Sticker";
|
90
|
+
}
|
91
|
+
static isVideo(message) {
|
92
|
+
var _a;
|
93
|
+
return ((_a = Filters.fileInline(message)) === null || _a === void 0 ? void 0 : _a.type) === "Video";
|
94
|
+
}
|
95
|
+
static isVoice(message) {
|
96
|
+
var _a;
|
97
|
+
return ((_a = Filters.fileInline(message)) === null || _a === void 0 ? void 0 : _a.type) === "Voice";
|
98
|
+
}
|
99
|
+
static isGif(message) {
|
100
|
+
var _a;
|
101
|
+
return ((_a = Filters.fileInline(message)) === null || _a === void 0 ? void 0 : _a.type) === "Gif";
|
102
|
+
}
|
103
|
+
static isMusic(message) {
|
104
|
+
var _a;
|
105
|
+
return ((_a = Filters.fileInline(message)) === null || _a === void 0 ? void 0 : _a.type) === "Music";
|
106
|
+
}
|
107
|
+
static isLocation(message) {
|
108
|
+
return !!Filters.findKey(message.message, "location");
|
109
|
+
}
|
110
|
+
static isContact(message) {
|
111
|
+
return !!Filters.findKey(message.message, "contact_message");
|
112
|
+
}
|
113
|
+
static isPoll(message) {
|
114
|
+
return !!Filters.findKey(message, "poll");
|
115
|
+
}
|
116
|
+
static isLive(message) {
|
117
|
+
return !!Filters.findKey(message, "live_data");
|
118
|
+
}
|
119
|
+
static isEvent(message) {
|
120
|
+
return !!Filters.findKey(message, "event_data");
|
121
|
+
}
|
122
|
+
}
|
64
123
|
exports.default = Filters;
|
package/rubjs/utils/index.d.ts
CHANGED
package/rubjs/utils/index.js
CHANGED
@@ -3,6 +3,8 @@ 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.Filters = void 0;
|
6
|
+
exports.Utils = exports.Filters = void 0;
|
7
7
|
const filters_1 = __importDefault(require("./filters"));
|
8
8
|
exports.Filters = filters_1.default;
|
9
|
+
const utils_1 = __importDefault(require("./utils"));
|
10
|
+
exports.Utils = utils_1.default;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
declare class Utils {
|
2
|
+
static Code: (text: string) => string;
|
3
|
+
static Bold: (text: string) => string;
|
4
|
+
static Italic: (text: string) => string;
|
5
|
+
static Spoiler: (text: string) => string;
|
6
|
+
static Strike: (text: string) => string;
|
7
|
+
static Underline: (text: string) => string;
|
8
|
+
static HyperLink: (text: string, link: string) => string;
|
9
|
+
}
|
10
|
+
export default Utils;
|