refactor(*): update RPC #89
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes and changes alot of the RPC functions as they have been (presumably) removed, or the API has changed (docs reference)
resolves #71
resolves #76
This is most definetly a semver: major change, version has been bumped to 4.0.0
This PR will be a draft for the time being, there are still some things that need tweaking slightly
A full list of changes
typescript^4.0.2
as a dev-dependencyRPCClient#accessToken
to non-enurmerableRPCClient#config
as a private objectRPCClient#apiURL
as a public getterRPCClient#cdnURL
as a public getterRPCClient#fetch
path
parameter has been changed to longer require a leading/
RPCClient#connect
RPCClient#request
cmd
tocommand
evt
toevent
RPCClient#_onRpcClose
to handle rpc closeRPCClient#_onRpcMessage
message
parameterRPCClient#_subscriptions
RPCClient#authorize
RPCClient#authorize
to be an async functionRPCClient#get*
functions to be asyncgetChannel
,getChannels
,getGuild
,getUser
to use newChannel
, andGuild
structures respectivelyGuild
Channel
User
UserFlags
ClientApplication
RPCClient#setCertifiedDevices
RPCClient#setActivity
RPCClient#clearActivity
RPCClient#sendJoinInvite
RPCClient#closeJoinRequest
RPCClient#sendJoinRequest
as it doesn't seem to be documented anymore - not sure on that so if someone could confirm thatRPCClient#setUserVoiceSettings
to use less linesRPCClient#select*
to be async and use the newChannel
structureRPCClient#selectTextChannel
no longer has aforce
parameter, as its no longer effectedRPCClient#selectTextChannel
no longer takes an object as its second parameterRPCClient#getVoiceSettings
andRPCClient#setVoiceSettings
use a private function to resolve the data returned by the RPC APIRPCClient#captureShortcut
RPCClient#setActivity
(general refactor)RPCClient#createLobby
RPCClient#updateLobby
RPCClient#deleteLobby
RPCClient#connectToLobby
RPCClient#sendToLobby
RPCClient#disconnectFromLobby
RPCClient#getLobbyMember
RPCClient#getRelationships
RPCClient#subscribe
RPCClient#_subscriptions
and instead attaches an event listenerRPCEvent
on the clientunsubscrbibe
RPCClient#destroy
is no longer asyncAPI_BASE_URL
,CDN_URL
,UserFlags
, andChannelTypes
into constantsLobbyTypes
RelationshipTypes
IPCTransport
to emit an error on the client if it encounters an (what would've been) an unhandled promise rejectionnew Websocket(...)
inWebSocketTransport
, intellisense showed that it wasnt the correct type? can't test this due to whitelist-only featurerpc.js