rubjs 3.0.1 → 3.1.2
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 +26 -5
- package/lib/clients/loginClient.js +3 -3
- package/lib/clients/network_login.js +1 -1
- package/lib/core/bot/bot.d.ts +25 -0
- package/lib/core/bot/bot.js +57 -0
- package/lib/core/bot/contexts/inline.context.d.ts +16 -0
- package/lib/core/bot/contexts/inline.context.js +27 -0
- package/lib/core/bot/contexts/message.context.d.ts +17 -0
- package/lib/core/bot/contexts/message.context.js +39 -0
- package/lib/core/bot/filters.d.ts +14 -0
- package/lib/core/bot/filters.js +45 -0
- package/lib/core/bot/methods/advanced/builder.d.ts +3 -0
- package/lib/core/bot/methods/advanced/builder.js +15 -0
- package/lib/core/bot/methods/bot/getMe.d.ts +3 -0
- package/lib/core/bot/methods/bot/getMe.js +6 -0
- package/lib/core/bot/methods/bot/index.d.ts +2 -0
- package/lib/core/bot/methods/bot/index.js +8 -0
- package/lib/core/bot/methods/chat/getChat.d.ts +3 -0
- package/lib/core/bot/methods/chat/getChat.js +6 -0
- package/lib/core/bot/methods/chat/index.d.ts +2 -0
- package/lib/core/bot/methods/chat/index.js +8 -0
- package/lib/core/bot/methods/files/getFile.d.ts +3 -0
- package/lib/core/bot/methods/files/getFile.js +6 -0
- package/lib/core/bot/methods/files/index.d.ts +4 -0
- package/lib/core/bot/methods/files/index.js +12 -0
- package/lib/core/bot/methods/files/requestSendFile.d.ts +4 -0
- package/lib/core/bot/methods/files/requestSendFile.js +6 -0
- package/lib/core/bot/methods/files/uploadFile.d.ts +3 -0
- package/lib/core/bot/methods/files/uploadFile.js +32 -0
- package/lib/core/bot/methods/index.d.ts +34 -0
- package/lib/core/bot/methods/index.js +116 -0
- package/lib/core/bot/methods/messages/deleteMessage.d.ts +3 -0
- package/lib/core/bot/methods/messages/deleteMessage.js +9 -0
- package/lib/core/bot/methods/messages/editChatKeypad.d.ts +4 -0
- package/lib/core/bot/methods/messages/editChatKeypad.js +12 -0
- package/lib/core/bot/methods/messages/editMessageKeypad.d.ts +4 -0
- package/lib/core/bot/methods/messages/editMessageKeypad.js +11 -0
- package/lib/core/bot/methods/messages/editMessageText.d.ts +3 -0
- package/lib/core/bot/methods/messages/editMessageText.js +10 -0
- package/lib/core/bot/methods/messages/forwardMessage.d.ts +3 -0
- package/lib/core/bot/methods/messages/forwardMessage.js +11 -0
- package/lib/core/bot/methods/messages/index.d.ts +10 -0
- package/lib/core/bot/methods/messages/index.js +24 -0
- package/lib/core/bot/methods/messages/sendContact.d.ts +4 -0
- package/lib/core/bot/methods/messages/sendContact.js +24 -0
- package/lib/core/bot/methods/messages/sendLocation.d.ts +4 -0
- package/lib/core/bot/methods/messages/sendLocation.js +23 -0
- package/lib/core/bot/methods/messages/sendMessage.d.ts +4 -0
- package/lib/core/bot/methods/messages/sendMessage.js +22 -0
- package/lib/core/bot/methods/messages/sendPoll.d.ts +3 -0
- package/lib/core/bot/methods/messages/sendPoll.js +6 -0
- package/lib/core/bot/methods/settings/index.d.ts +3 -0
- package/lib/core/bot/methods/settings/index.js +10 -0
- package/lib/core/bot/methods/settings/setCommands.d.ts +4 -0
- package/lib/core/bot/methods/settings/setCommands.js +6 -0
- package/lib/core/bot/methods/settings/updateBotEndpoints.d.ts +4 -0
- package/lib/core/bot/methods/settings/updateBotEndpoints.js +9 -0
- package/lib/core/bot/methods/utilities/getUpdates.d.ts +3 -0
- package/lib/core/bot/methods/utilities/getUpdates.js +6 -0
- package/lib/core/bot/methods/utilities/handleUpdates.d.ts +4 -0
- package/lib/core/bot/methods/utilities/handleUpdates.js +41 -0
- package/lib/core/bot/methods/utilities/index.d.ts +5 -0
- package/lib/core/bot/methods/utilities/index.js +14 -0
- package/lib/core/bot/methods/utilities/run.d.ts +4 -0
- package/lib/core/bot/methods/utilities/run.js +13 -0
- package/lib/core/bot/methods/utilities/start.d.ts +3 -0
- package/lib/core/bot/methods/utilities/start.js +27 -0
- package/lib/core/bot/methods/utilities/webhook.d.ts +4 -0
- package/lib/core/bot/methods/utilities/webhook.js +57 -0
- package/lib/core/bot/network/index.d.ts +9 -0
- package/lib/core/bot/network/index.js +49 -0
- package/lib/core/bot/network/polling.d.ts +0 -0
- package/lib/core/bot/network/polling.js +44 -0
- package/lib/core/bot/types/bot.type.d.ts +28 -0
- package/lib/core/bot/types/models.d.ts +303 -0
- package/lib/core/bot/types/models.js +131 -0
- package/lib/core/{client.d.ts → client/client.d.ts} +4 -4
- package/lib/core/{client.js → client/client.js} +2 -2
- package/lib/core/{context → client/contexts}/activities.type.d.ts +2 -2
- package/lib/core/{context → client/contexts}/chat.type.d.ts +2 -2
- package/lib/core/{context → client/contexts}/message.type.d.ts +2 -2
- package/lib/core/{context → client/contexts}/notifications.type.d.ts +2 -2
- package/lib/core/{filters.d.ts → client/filters.d.ts} +3 -3
- package/lib/core/{filters.js → client/filters.js} +27 -27
- package/lib/core/client/methods/advanced/index.d.ts +2 -0
- package/lib/core/client/methods/advanced/index.js +8 -0
- package/lib/core/{methods → client/methods}/extras/onEditMessages.d.ts +1 -1
- package/lib/core/{methods → client/methods}/utilities/download.d.ts +1 -1
- package/lib/core/{methods → client/methods}/utilities/start.js +2 -2
- package/lib/core/{methods → client/methods}/utilities/usePlugin.d.ts +1 -1
- package/lib/core/{network → client/network}/index.d.ts +1 -1
- package/lib/core/{network → client/network}/websocket.js +13 -29
- package/lib/{types → core/client/types}/client.type.d.ts +5 -5
- package/lib/core/client/types/session.type.d.ts +11 -0
- package/lib/core/client/types/session.type.js +2 -0
- package/lib/exceptions/index.d.ts +6 -0
- package/lib/exceptions/index.js +16 -0
- package/lib/index.d.ts +11 -9
- package/lib/index.js +11 -5
- package/lib/utils/checkFilters.d.ts +1 -0
- package/lib/utils/checkFilters.js +20 -0
- package/lib/{core → utils}/session.d.ts +4 -2
- package/lib/{core → utils}/session.js +27 -11
- package/package.json +54 -43
- package/lib/types/session.type.d.ts +0 -7
- /package/lib/core/{methods → bot/methods}/advanced/index.d.ts +0 -0
- /package/lib/core/{methods → bot/methods}/advanced/index.js +0 -0
- /package/lib/{types/client.type.js → core/bot/types/bot.type.js} +0 -0
- /package/lib/core/{context → client/contexts}/activities.type.js +0 -0
- /package/lib/core/{context → client/contexts}/chat.type.js +0 -0
- /package/lib/core/{context → client/contexts}/contextConstructors.d.ts +0 -0
- /package/lib/core/{context → client/contexts}/contextConstructors.js +0 -0
- /package/lib/core/{context → client/contexts}/index.d.ts +0 -0
- /package/lib/core/{context → client/contexts}/index.js +0 -0
- /package/lib/core/{context → client/contexts}/message.type.js +0 -0
- /package/lib/core/{context → client/contexts}/notifications.type.js +0 -0
- /package/lib/core/{crypto.d.ts → client/crypto.d.ts} +0 -0
- /package/lib/core/{crypto.js → client/crypto.js} +0 -0
- /package/lib/core/{methods → client/methods}/advanced/builder.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/advanced/builder.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/index.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/logout.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/logout.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/registerDevice.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/registerDevice.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/sendCode.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/sendCode.js +0 -0
- /package/lib/core/{methods → client/methods}/auth/signIn.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/auth/signIn.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/addChannel.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/addChannel.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/addChannelMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/addChannelMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/banChannelMember.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/banChannelMember.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/cancelChangeObjectOwner.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/cancelChangeObjectOwner.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/channelPreviewByJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/channelPreviewByJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/checkChannelUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/checkChannelUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/createChannelVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/createChannelVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/discardChannelVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/discardChannelVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/editChannelInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/editChannelInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getBannedChannelMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getBannedChannelMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAdminAccessList.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAdminAccessList.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAdminMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAdminMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAllMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelAllMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getChannelLink.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/getPendingObjectOwner.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/getPendingObjectOwner.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/index.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/joinChannelAction.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/joinChannelAction.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/joinChannelByLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/joinChannelByLink.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/leaveChannelVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/leaveChannelVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/removeChannel.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/removeChannel.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/requestChangeObjectOwner.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/requestChangeObjectOwner.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/seenChannelMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/seenChannelMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/setChannelLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/setChannelLink.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/setChannelVoiceChatSetting.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/setChannelVoiceChatSetting.js +0 -0
- /package/lib/core/{methods → client/methods}/channels/updateChannelUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/channels/updateChannelUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/actionOnJoinRequest.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/actionOnJoinRequest.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/addLiveComment.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/addLiveComment.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/clickMessageUrl.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/clickMessageUrl.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/createJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/createJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/deleteAvatar.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/deleteAvatar.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/deleteChatHistory.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/deleteChatHistory.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/editJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/editJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getAbsObjects.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getAbsObjects.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getAvatars.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getAvatars.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChatReaction.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChatReaction.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChats.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChats.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChatsUpdates.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getChatsUpdates.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getJoinLinks.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getJoinLinks.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getJoinRequests.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getJoinRequests.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLinkFromAppUrl.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLinkFromAppUrl.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLiveComments.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLiveComments.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLivePlayUrl.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLivePlayUrl.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLiveStatus.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getLiveStatus.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getObjectInfoByUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getObjectInfoByUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/getTopChatUsers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/getTopChatUsers.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/index.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/removeFromTopChatUsers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/removeFromTopChatUsers.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/removeJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/removeJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/searchChatMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/searchChatMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/searchGlobalMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/searchGlobalMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/seenChats.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/seenChats.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/sendChatActivity.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/sendChatActivity.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/sendLive.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/sendLive.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/setActionChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/setActionChat.js +0 -0
- /package/lib/core/{methods → client/methods}/chats/uploadAvatar.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/chats/uploadAvatar.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/addAddressBook.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/addAddressBook.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/deleteContact.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/deleteContact.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContacts.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContacts.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContactsLastOnline.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContactsLastOnline.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContactsUpdates.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/getContactsUpdates.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/index.js +0 -0
- /package/lib/core/{methods → client/methods}/contacts/resetContacts.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/contacts/resetContacts.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/banMember.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/banMember.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/deleteMessagebyCount.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/deleteMessagebyCount.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getObjectByUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getObjectByUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getProfileLinkItems.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getProfileLinkItems.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getRelatedObjects.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getRelatedObjects.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/getTranscription.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/getTranscription.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/index.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/join.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/join.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/joinVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/joinVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/leaveChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/leaveChat.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/onEditMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/reportObject.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/reportObject.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/searchGlobalObjects.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/searchGlobalObjects.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/sendVoiceChatActivity.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/sendVoiceChatActivity.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/setVoiceChatState.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/setVoiceChatState.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/transcribeVoice.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/transcribeVoice.js +0 -0
- /package/lib/core/{methods → client/methods}/extras/userIsAdmin.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/extras/userIsAdmin.js +0 -0
- /package/lib/core/{methods → client/methods}/gif/addToMyGifSet.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/gif/addToMyGifSet.js +0 -0
- /package/lib/core/{methods → client/methods}/gif/getMyGifSet.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/gif/getMyGifSet.js +0 -0
- /package/lib/core/{methods → client/methods}/gif/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/gif/index.js +0 -0
- /package/lib/core/{methods → client/methods}/gif/removeFromMyGifSet.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/gif/removeFromMyGifSet.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/addGroup.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/addGroup.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/addGroupMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/addGroupMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/banGroupMember.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/banGroupMember.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/createGroupVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/createGroupVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/deleteNoAccessGroupChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/deleteNoAccessGroupChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/discardGroupVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/discardGroupVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/editGroupInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/editGroupInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getBannedGroupMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getBannedGroupMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAdminAccessList.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAdminAccessList.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAdminMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAdminMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAllMembers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupAllMembers.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupDefaultAccess.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupDefaultAccess.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupLink.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupMentionList.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupMentionList.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupOnlineCount.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupOnlineCount.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatParticipants.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatParticipants.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatUpdates.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/getGroupVoiceChatUpdates.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/groupPreviewByJoinLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/groupPreviewByJoinLink.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/index.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/joinGroup.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/joinGroup.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/joinGroupVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/joinGroupVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/leaveGroup.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/leaveGroup.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/leaveGroupVoiceChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/leaveGroupVoiceChat.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/removeGroup.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/removeGroup.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/seenGroupMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/seenGroupMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupAdmin.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupAdmin.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupDefaultAccess.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupDefaultAccess.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupLink.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupLink.js +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupVoiceChatSetting.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/groups/setGroupVoiceChatSetting.js +0 -0
- /package/lib/core/{methods → client/methods}/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/index.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/actionOnMessageReaction.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/actionOnMessageReaction.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/createPoll.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/createPoll.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/deleteMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/deleteMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/editMessage.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/editMessage.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/forwardMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/forwardMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessageShareUrl.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessageShareUrl.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessages.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessages.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesByID.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesByID.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesInterval.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesInterval.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesUpdates.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getMessagesUpdates.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getPollOptionVoters.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getPollOptionVoters.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/getPollStatus.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/getPollStatus.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/index.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendDocument.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendDocument.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendFileInline.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendFileInline.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendGif.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendGif.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendMessage.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendMessage.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendMusic.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendMusic.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendPhoto.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendPhoto.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendSticker.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendSticker.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendText.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendText.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVideo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVideo.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVideoMessage.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVideoMessage.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVoice.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/sendVoice.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/setPinMessage.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/setPinMessage.js +0 -0
- /package/lib/core/{methods → client/methods}/messages/votePoll.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/messages/votePoll.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/changePassword.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/changePassword.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/checkTwoStepPasscode.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/checkTwoStepPasscode.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/deleteFolder.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/deleteFolder.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getBlockedUsers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getBlockedUsers.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getFolders.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getFolders.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getMySessions.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getMySessions.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getPrivacySetting.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getPrivacySetting.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getSuggestedFolders.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getSuggestedFolders.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/getTwoPasscodeStatus.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/getTwoPasscodeStatus.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/index.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/requestRecoveryEmail.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/requestRecoveryEmail.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/setSetting.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/setSetting.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/setupTwoStepVerification.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/setupTwoStepVerification.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/terminateOtherSessions.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/terminateOtherSessions.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/terminateSession.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/terminateSession.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/turnOffTwoStep.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/turnOffTwoStep.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/updateProfile.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/updateProfile.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/updateUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/updateUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/settings/verifyRecoveryEmail.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/settings/verifyRecoveryEmail.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/actionOnStickerSet.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/actionOnStickerSet.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getMyStickerSets.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getMyStickerSets.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickerSetByID.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickerSetByID.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickersByEmoji.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickersByEmoji.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickersBySetIds.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getStickersBySetIds.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getTrendStickerSets.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/getTrendStickerSets.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/index.js +0 -0
- /package/lib/core/{methods → client/methods}/stickers/searchStickers.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/stickers/searchStickers.js +0 -0
- /package/lib/core/{methods → client/methods}/users/checkUserUsername.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/checkUserUsername.js +0 -0
- /package/lib/core/{methods → client/methods}/users/deleteUserChat.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/deleteUserChat.js +0 -0
- /package/lib/core/{methods → client/methods}/users/getMe.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/getMe.js +0 -0
- /package/lib/core/{methods → client/methods}/users/getUserInfo.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/getUserInfo.js +0 -0
- /package/lib/core/{methods → client/methods}/users/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/index.js +0 -0
- /package/lib/core/{methods → client/methods}/users/setBlockUser.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/users/setBlockUser.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/download.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/downloadProfilePicture.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/downloadProfilePicture.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/index.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/index.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/requestSendFile.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/requestSendFile.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/run.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/run.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/start.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/thumbnail.d.ts +0 -0
- /package/lib/core/{methods → client/methods}/utilities/thumbnail.js +0 -0
- /package/lib/core/{methods → client/methods}/utilities/usePlugin.js +0 -0
- /package/lib/core/{network → client/network}/api.d.ts +0 -0
- /package/lib/core/{network → client/network}/api.js +0 -0
- /package/lib/core/{network → client/network}/file.d.ts +0 -0
- /package/lib/core/{network → client/network}/file.js +0 -0
- /package/lib/core/{network → client/network}/index.js +0 -0
- /package/lib/core/{network → client/network}/utils.d.ts +0 -0
- /package/lib/core/{network → client/network}/utils.js +0 -0
- /package/lib/core/{network → client/network}/websocket.d.ts +0 -0
- /package/lib/core/{parser.d.ts → client/parser.d.ts} +0 -0
- /package/lib/core/{parser.js → client/parser.js} +0 -0
- /package/lib/{types/decorators.type.js → core/client/types/client.type.js} +0 -0
- /package/lib/{types → core/client/types}/decorators.type.d.ts +0 -0
- /package/lib/{types/network.type.js → core/client/types/decorators.type.js} +0 -0
- /package/lib/{types → core/client/types}/index.type.d.ts +0 -0
- /package/lib/{types → core/client/types}/index.type.js +0 -0
- /package/lib/{types → core/client/types}/network.type.d.ts +0 -0
- /package/lib/{types/session.type.js → core/client/types/network.type.js} +0 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const models_1 = require("../../types/models");
|
4
|
+
async function editChatKeypad(chat_id, chat_keypad, chat_keypad_type = models_1.ChatKeypadTypeEnum.New) {
|
5
|
+
const data = {
|
6
|
+
chat_id,
|
7
|
+
chat_keypad,
|
8
|
+
chat_keypad_type,
|
9
|
+
};
|
10
|
+
return await this.builder('editChatKeypad', data);
|
11
|
+
}
|
12
|
+
exports.default = editChatKeypad;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
async function editMessageKeypad(chat_id, message_id, inline_keypad) {
|
4
|
+
const data = {
|
5
|
+
chat_id,
|
6
|
+
message_id,
|
7
|
+
inline_keypad,
|
8
|
+
};
|
9
|
+
return await this.builder('editMessageKeypad', data);
|
10
|
+
}
|
11
|
+
exports.default = editMessageKeypad;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
async function editMessageText(chat_id, text, message_id) {
|
4
|
+
return await this.builder('editMessageText', {
|
5
|
+
chat_id,
|
6
|
+
message_id,
|
7
|
+
text,
|
8
|
+
});
|
9
|
+
}
|
10
|
+
exports.default = editMessageText;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
async function forwardMessage(from_chat_id, message_id, to_chat_id, disable_notification = false) {
|
4
|
+
return await this.builder('forwardMessage', {
|
5
|
+
from_chat_id,
|
6
|
+
message_id,
|
7
|
+
to_chat_id,
|
8
|
+
disable_notification,
|
9
|
+
});
|
10
|
+
}
|
11
|
+
exports.default = forwardMessage;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import deleteMessage from './deleteMessage';
|
2
|
+
import editChatKeypad from './editChatKeypad';
|
3
|
+
import editMessageKeypad from './editMessageKeypad';
|
4
|
+
import editMessageText from './editMessageText';
|
5
|
+
import forwardMessage from './forwardMessage';
|
6
|
+
import sendContact from './sendContact';
|
7
|
+
import sendLocation from './sendLocation';
|
8
|
+
import sendMessage from './sendMessage';
|
9
|
+
import sendPoll from './sendPoll';
|
10
|
+
export { sendMessage, sendPoll, sendLocation, sendContact, forwardMessage, editMessageText, deleteMessage, editMessageKeypad, editChatKeypad, };
|
@@ -0,0 +1,24 @@
|
|
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.editChatKeypad = exports.editMessageKeypad = exports.deleteMessage = exports.editMessageText = exports.forwardMessage = exports.sendContact = exports.sendLocation = exports.sendPoll = exports.sendMessage = void 0;
|
7
|
+
const deleteMessage_1 = __importDefault(require("./deleteMessage"));
|
8
|
+
exports.deleteMessage = deleteMessage_1.default;
|
9
|
+
const editChatKeypad_1 = __importDefault(require("./editChatKeypad"));
|
10
|
+
exports.editChatKeypad = editChatKeypad_1.default;
|
11
|
+
const editMessageKeypad_1 = __importDefault(require("./editMessageKeypad"));
|
12
|
+
exports.editMessageKeypad = editMessageKeypad_1.default;
|
13
|
+
const editMessageText_1 = __importDefault(require("./editMessageText"));
|
14
|
+
exports.editMessageText = editMessageText_1.default;
|
15
|
+
const forwardMessage_1 = __importDefault(require("./forwardMessage"));
|
16
|
+
exports.forwardMessage = forwardMessage_1.default;
|
17
|
+
const sendContact_1 = __importDefault(require("./sendContact"));
|
18
|
+
exports.sendContact = sendContact_1.default;
|
19
|
+
const sendLocation_1 = __importDefault(require("./sendLocation"));
|
20
|
+
exports.sendLocation = sendLocation_1.default;
|
21
|
+
const sendMessage_1 = __importDefault(require("./sendMessage"));
|
22
|
+
exports.sendMessage = sendMessage_1.default;
|
23
|
+
const sendPoll_1 = __importDefault(require("./sendPoll"));
|
24
|
+
exports.sendPoll = sendPoll_1.default;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import Bot from '../../bot';
|
2
|
+
import { ChatKeypadTypeEnum, Keypad } from '../../types/models';
|
3
|
+
declare function sendContact(this: Bot, chat_id: string, first_name: string, last_name: string, phone_number: string, chat_keypad: Keypad, inline_keypad: Keypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<any>;
|
4
|
+
export default sendContact;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const models_1 = require("../../types/models");
|
4
|
+
async function sendContact(chat_id, first_name, last_name, phone_number, chat_keypad, inline_keypad, disable_notification = false, reply_to_message_id, chat_keypad_type) {
|
5
|
+
const data = {
|
6
|
+
chat_id,
|
7
|
+
first_name,
|
8
|
+
last_name,
|
9
|
+
phone_number,
|
10
|
+
chat_keypad,
|
11
|
+
inline_keypad,
|
12
|
+
disable_notification,
|
13
|
+
reply_to_message_id,
|
14
|
+
chat_keypad_type,
|
15
|
+
};
|
16
|
+
if (chat_keypad && !chat_keypad_type) {
|
17
|
+
data.chat_keypad_type = models_1.ChatKeypadTypeEnum.New;
|
18
|
+
}
|
19
|
+
if (inline_keypad && chat_keypad_type) {
|
20
|
+
data.chat_keypad_type = models_1.ChatKeypadTypeEnum.None;
|
21
|
+
}
|
22
|
+
return await this.builder('sendContact', data);
|
23
|
+
}
|
24
|
+
exports.default = sendContact;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import Bot from '../../bot';
|
2
|
+
import { ChatKeypadTypeEnum, Keypad } from '../../types/models';
|
3
|
+
declare function sendLocation(this: Bot, chat_id: string, latitude: string, longitude: string, chat_keypad: Keypad, inline_keypad: Keypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<any>;
|
4
|
+
export default sendLocation;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const models_1 = require("../../types/models");
|
4
|
+
async function sendLocation(chat_id, latitude, longitude, chat_keypad, inline_keypad, disable_notification = false, reply_to_message_id, chat_keypad_type) {
|
5
|
+
const data = {
|
6
|
+
chat_id,
|
7
|
+
latitude,
|
8
|
+
longitude,
|
9
|
+
chat_keypad,
|
10
|
+
inline_keypad,
|
11
|
+
disable_notification,
|
12
|
+
reply_to_message_id,
|
13
|
+
chat_keypad_type,
|
14
|
+
};
|
15
|
+
if (chat_keypad && !chat_keypad_type) {
|
16
|
+
data.chat_keypad_type = models_1.ChatKeypadTypeEnum.New;
|
17
|
+
}
|
18
|
+
if (inline_keypad && chat_keypad_type) {
|
19
|
+
data.chat_keypad_type = models_1.ChatKeypadTypeEnum.None;
|
20
|
+
}
|
21
|
+
return await this.builder('sendLocation', data);
|
22
|
+
}
|
23
|
+
exports.default = sendLocation;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import Bot from '../../bot';
|
2
|
+
import { ChatKeypadTypeEnum, InlineKeypad, Keypad } from '../../types/models';
|
3
|
+
declare function sendMessage(this: Bot, chat_id: string, text: string, chat_keypad?: Keypad, inline_keypad?: InlineKeypad, disable_notification?: boolean, reply_to_message_id?: string, chat_keypad_type?: ChatKeypadTypeEnum): Promise<any>;
|
4
|
+
export default sendMessage;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const models_1 = require("../../types/models");
|
4
|
+
async function sendMessage(chat_id, text, chat_keypad, inline_keypad, disable_notification = false, reply_to_message_id, chat_keypad_type) {
|
5
|
+
const data = {
|
6
|
+
chat_id,
|
7
|
+
text,
|
8
|
+
chat_keypad,
|
9
|
+
inline_keypad,
|
10
|
+
disable_notification,
|
11
|
+
reply_to_message_id,
|
12
|
+
chat_keypad_type,
|
13
|
+
};
|
14
|
+
if (chat_keypad && !chat_keypad_type) {
|
15
|
+
data.chat_keypad_type = models_1.ChatKeypadTypeEnum.New;
|
16
|
+
}
|
17
|
+
if (inline_keypad && chat_keypad_type) {
|
18
|
+
data.chat_keypad_type = models_1.ChatKeypadTypeEnum.None;
|
19
|
+
}
|
20
|
+
return await this.builder('sendMessage', data);
|
21
|
+
}
|
22
|
+
exports.default = sendMessage;
|
@@ -0,0 +1,10 @@
|
|
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.updateBotEndpoints = exports.setCommands = void 0;
|
7
|
+
const setCommands_1 = __importDefault(require("./setCommands"));
|
8
|
+
exports.setCommands = setCommands_1.default;
|
9
|
+
const updateBotEndpoints_1 = __importDefault(require("./updateBotEndpoints"));
|
10
|
+
exports.updateBotEndpoints = updateBotEndpoints_1.default;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
async function updateBotEndpoints(url, endpoint_type) {
|
4
|
+
return await this.builder('updateBotEndpoints', {
|
5
|
+
url,
|
6
|
+
type: endpoint_type,
|
7
|
+
});
|
8
|
+
}
|
9
|
+
exports.default = updateBotEndpoints;
|
@@ -0,0 +1,41 @@
|
|
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 message_context_1 = __importDefault(require("../../contexts/message.context"));
|
7
|
+
const inline_context_1 = __importDefault(require("../../contexts/inline.context"));
|
8
|
+
const models_1 = require("../../types/models");
|
9
|
+
const checkFilters_1 = require("../../../../utils/checkFilters");
|
10
|
+
const checkTypes = [models_1.UpdateTypeEnum.UpdatedMessage, models_1.UpdateTypeEnum.NewMessage];
|
11
|
+
async function handleUpdates(req, res) {
|
12
|
+
const data = req.body;
|
13
|
+
if (data?.update) {
|
14
|
+
for (let { prefix, filters, handler } of this.handlers.message) {
|
15
|
+
const ctx = new message_context_1.default(this, data.update);
|
16
|
+
const passed = await (0, checkFilters_1.checkFilters)(ctx, filters);
|
17
|
+
if (passed) {
|
18
|
+
if (prefix) {
|
19
|
+
if (!checkTypes.includes(ctx.type))
|
20
|
+
continue;
|
21
|
+
const text = ctx.updated_message?.text || ctx.new_message?.text || '';
|
22
|
+
if (typeof prefix === 'string' && text !== prefix)
|
23
|
+
continue;
|
24
|
+
if (prefix instanceof RegExp && !prefix.test(text))
|
25
|
+
continue;
|
26
|
+
}
|
27
|
+
await handler(ctx);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
else if (data?.inline_message) {
|
32
|
+
for (let { filters, handler } of this.handlers.inline) {
|
33
|
+
const ctx = new inline_context_1.default(this, data.inline_message);
|
34
|
+
const passed = await (0, checkFilters_1.checkFilters)(ctx, filters);
|
35
|
+
if (passed)
|
36
|
+
await handler(ctx);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return res.code(200).send({ status: 'OK' });
|
40
|
+
}
|
41
|
+
exports.default = handleUpdates;
|
@@ -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.setupWebhook = exports.getUpdates = exports.start = exports.run = void 0;
|
7
|
+
const run_1 = __importDefault(require("./run"));
|
8
|
+
exports.run = run_1.default;
|
9
|
+
const start_1 = __importDefault(require("./start"));
|
10
|
+
exports.start = start_1.default;
|
11
|
+
const getUpdates_1 = __importDefault(require("./getUpdates"));
|
12
|
+
exports.getUpdates = getUpdates_1.default;
|
13
|
+
const webhook_1 = __importDefault(require("./webhook"));
|
14
|
+
exports.setupWebhook = webhook_1.default;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const models_1 = require("../../types/models");
|
4
|
+
async function run(url, host, port = 3000, updates = [
|
5
|
+
models_1.UpdateEndpointTypeEnum.ReceiveInlineMessage,
|
6
|
+
models_1.UpdateEndpointTypeEnum.ReceiveUpdate,
|
7
|
+
]) {
|
8
|
+
while (!this.initialize) {
|
9
|
+
await this.network.delay(2000);
|
10
|
+
}
|
11
|
+
await this.setupWebhook(url, host, port, updates);
|
12
|
+
}
|
13
|
+
exports.default = run;
|
@@ -0,0 +1,27 @@
|
|
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 prompt_1 = __importDefault(require("../../../../utils/prompt"));
|
7
|
+
async function start(token) {
|
8
|
+
if (!token) {
|
9
|
+
const DB = this.sessionDB.getSession();
|
10
|
+
if (DB) {
|
11
|
+
this.sendToken = DB.token;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
else {
|
15
|
+
this.sendToken = token;
|
16
|
+
}
|
17
|
+
try {
|
18
|
+
const res = await this.getMe();
|
19
|
+
this.bot = res.bot;
|
20
|
+
}
|
21
|
+
catch {
|
22
|
+
const token = await (0, prompt_1.default)('[start] Please enter your bot token: ');
|
23
|
+
await this.start(token);
|
24
|
+
}
|
25
|
+
this.initialize = true;
|
26
|
+
}
|
27
|
+
exports.default = start;
|
@@ -0,0 +1,57 @@
|
|
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 json_bigint_1 = __importDefault(require("json-bigint"));
|
7
|
+
const handleUpdates_1 = __importDefault(require("./handleUpdates"));
|
8
|
+
const localtunnel_1 = __importDefault(require("localtunnel"));
|
9
|
+
const JSONbig = (0, json_bigint_1.default)({ storeAsString: true });
|
10
|
+
function handleParser(_, body, done) {
|
11
|
+
try {
|
12
|
+
const json = JSONbig.parse(body.toString());
|
13
|
+
done(null, JSON.parse(JSON.stringify(json)));
|
14
|
+
}
|
15
|
+
catch (err) {
|
16
|
+
done(err, undefined);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
async function manageTunnelWithWebhook(port, updates, url) {
|
20
|
+
const setEndpoints = async (url) => {
|
21
|
+
for (let update of updates) {
|
22
|
+
const res = await this.updateBotEndpoints(url, update);
|
23
|
+
if (res.status != 'Done')
|
24
|
+
console.error(`[ manageTunnelWithWebhook ] status updateBotEndpoints is ${res.status} for update: ${update}`);
|
25
|
+
}
|
26
|
+
console.log('start robot...');
|
27
|
+
};
|
28
|
+
if (url) {
|
29
|
+
return await setEndpoints(url);
|
30
|
+
}
|
31
|
+
while (true) {
|
32
|
+
try {
|
33
|
+
const tunnel = await (0, localtunnel_1.default)({ port });
|
34
|
+
await setEndpoints(tunnel.url);
|
35
|
+
await new Promise((resolve) => tunnel.on('close', resolve));
|
36
|
+
console.warn('🚪 Tunnel closed. Reconnecting...');
|
37
|
+
}
|
38
|
+
catch (err) {
|
39
|
+
console.error('❌ Tunnel failed:', err);
|
40
|
+
await new Promise((r) => setTimeout(r, 3000));
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
function lowerFirstChar(str) {
|
45
|
+
return str.charAt(0).toLowerCase() + str.slice(1);
|
46
|
+
}
|
47
|
+
async function setupWebhook(url, host = '0.0.0.0', port = 3000, updates = []) {
|
48
|
+
this.server.addContentTypeParser('application/json', { parseAs: 'string' }, handleParser);
|
49
|
+
this.server.get('/', handleUpdates_1.default.bind(this));
|
50
|
+
this.server.post('/', handleUpdates_1.default.bind(this));
|
51
|
+
for (let update of updates) {
|
52
|
+
this.server.post(`/${lowerFirstChar(update)}`, handleUpdates_1.default.bind(this));
|
53
|
+
}
|
54
|
+
await this.server.listen({ port, host });
|
55
|
+
await manageTunnelWithWebhook.bind(this)(port, updates, url);
|
56
|
+
}
|
57
|
+
exports.default = setupWebhook;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const undici_1 = require("undici");
|
7
|
+
const json_bigint_1 = __importDefault(require("json-bigint"));
|
8
|
+
const JSONbig = (0, json_bigint_1.default)({ storeAsString: true });
|
9
|
+
class Network {
|
10
|
+
constructor(bot) {
|
11
|
+
this.bot = bot;
|
12
|
+
this.agent = new undici_1.Agent({
|
13
|
+
connect: { rejectUnauthorized: false },
|
14
|
+
});
|
15
|
+
}
|
16
|
+
async request(method, data) {
|
17
|
+
const MAX_ATTEMPTS = 3;
|
18
|
+
for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
|
19
|
+
try {
|
20
|
+
const res = await (0, undici_1.request)(`${this.bot.BASE_URL}/${this.bot.sendToken}/${method}`, {
|
21
|
+
method: 'POST',
|
22
|
+
headers: {
|
23
|
+
'content-type': 'application/json',
|
24
|
+
},
|
25
|
+
body: JSON.stringify(data),
|
26
|
+
dispatcher: this.agent,
|
27
|
+
});
|
28
|
+
if (res.statusCode === 200) {
|
29
|
+
const responseData = await res.body.text();
|
30
|
+
const data = JSONbig.parse(responseData);
|
31
|
+
console.log(data);
|
32
|
+
return JSON.parse(JSON.stringify(data));
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
console.warn(`[request] Attempt ${attempt}: Unexpected status ${res.statusCode}`);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
catch (error) {
|
39
|
+
console.error(`[request] Attempt ${attempt} failed:`, error);
|
40
|
+
}
|
41
|
+
await this.delay(1000);
|
42
|
+
}
|
43
|
+
throw new Error(`[request] Failed after ${MAX_ATTEMPTS} attempts: ${method}`);
|
44
|
+
}
|
45
|
+
delay(ms) {
|
46
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
47
|
+
}
|
48
|
+
}
|
49
|
+
exports.default = Network;
|
File without changes
|
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
// import fs from 'fs';
|
3
|
+
// import Network from '.';
|
4
|
+
// import Message from '../contexts/message.context';
|
5
|
+
// export default async function polling(network: Network) {
|
6
|
+
// console.log('start robot with polling mode...');
|
7
|
+
// let next_offset_id: string | undefined = loadOffset();
|
8
|
+
// setInterval(async () => {
|
9
|
+
// try {
|
10
|
+
// const res = await network.bot.getUpdates(next_offset_id);
|
11
|
+
// for (let m of res.updates) {
|
12
|
+
// if (isNaN(m.new_message?.time || m.updated_message?.time)) continue;
|
13
|
+
// const messageTime =
|
14
|
+
// Number(m.new_message?.time || m.updated_message?.time) | 0;
|
15
|
+
// const nowTime = Math.floor(Date.now() / 1000);
|
16
|
+
// if (nowTime - messageTime < 5) {
|
17
|
+
// m = new Message(network.bot, m);
|
18
|
+
// for (let handler of network.bot.handlers) {
|
19
|
+
// if (
|
20
|
+
// handler.filters.length === 0 ||
|
21
|
+
// handler.filters.every((filter) => filter(m))
|
22
|
+
// ) {
|
23
|
+
// await handler.handler(m);
|
24
|
+
// }
|
25
|
+
// }
|
26
|
+
// }
|
27
|
+
// }
|
28
|
+
// if (res.next_offset_id) {
|
29
|
+
// next_offset_id = res.next_offset_id;
|
30
|
+
// saveOffset(next_offset_id as string);
|
31
|
+
// }
|
32
|
+
// } catch (e) {
|
33
|
+
// console.error('Error occurred while polling:', e);
|
34
|
+
// }
|
35
|
+
// }, 1000);
|
36
|
+
// }
|
37
|
+
// function saveOffset(offset: string) {
|
38
|
+
// fs.writeFileSync('offset.json', JSON.stringify({ offset }));
|
39
|
+
// }
|
40
|
+
// function loadOffset(): string | undefined {
|
41
|
+
// if (!fs.existsSync('offset.json')) return undefined;
|
42
|
+
// const data = fs.readFileSync('offset.json', 'utf8');
|
43
|
+
// return JSON.parse(data).offset;
|
44
|
+
// }
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import InlineMessage from '../contexts/inline.context';
|
2
|
+
import Message from '../contexts/message.context';
|
3
|
+
export interface Session {
|
4
|
+
iv: string;
|
5
|
+
enData: string;
|
6
|
+
}
|
7
|
+
export type SessionType = string | Session;
|
8
|
+
export interface BotType {
|
9
|
+
bot_id: string;
|
10
|
+
bot_title: string;
|
11
|
+
avatar: {
|
12
|
+
file_id: string;
|
13
|
+
};
|
14
|
+
description: string;
|
15
|
+
username: string;
|
16
|
+
start_message: string;
|
17
|
+
}
|
18
|
+
export interface ContextMap {
|
19
|
+
message: Message;
|
20
|
+
inline: InlineMessage;
|
21
|
+
}
|
22
|
+
export type FilterFn<T> = (ctx: T) => boolean | Promise<boolean>;
|
23
|
+
export type NestedFilter<T> = Array<FilterFn<T> | FilterFn<T>[]>;
|
24
|
+
export type Handler<T> = {
|
25
|
+
filters: NestedFilter<T>;
|
26
|
+
handler: (ctx: T) => Promise<void>;
|
27
|
+
prefix?: string | RegExp;
|
28
|
+
};
|