Rest
Constructor
- Rest : options
Table of contents
Properties | Methods |
---|---|
manager | delete() |
password | destroyPlayer() |
node | get() |
url | getAllPlayers() |
sessionId | patch() |
post() | |
put() | |
setSessionId() | |
updatePlayer() | |
updateSession() |
Properties
manager
The Manager instance.
Return:
Manager
password
Password of the node.
Return: string
node
The node for the Rest.
Return:
Node
url
The url of the node.
Return: string
sessionId
The sessionId of the Node.
Return: string
Methods
delete(endpoint)
async functionSends a DELETE request to the server to destroy the player.
Return: Promise<unknown>
Parameter Type Description Optional endpoint
string The endpoint to send the DELETE request to.
destroyPlayer(guildId)
async functionSends a DELETE request to the server to destroy the player.
Return: Promise<unknown>
Parameter Type Description Optional guildId
string as Guild.id
The guild ID of the player to destroy.
get(endpoint)
async functionSends a GET request to the specified endpoint and returns the response data.
Return: Promise<unknown>
Parameter Type Description Optional endpoint
string The endpoint to send the GET request to.
getAllPlayers()
async functionRetrieves all the players that are currently running on the node.
Return: Promise<unknown>
put(endpoint, body)
async functionSends a PUT request to the specified endpoint and returns the response data.
Return: Promise<unknown>
Parameter Type Description Optional endpoint
string The endpoint to send the PUT request to. body
unknown The data to send in the request body.
setSessionId(sessionId)
async functionSets the session ID.
This method is used to set the session ID after a resume operation is done.Return: string
Parameter Type Description Optional sessionId
string The session ID to set.
updatePlayer(options)
async functionSends a PATCH request to update player related data.
Return: Promise<unknown>
Parameter Type Description Optional options
playOptions{}
The options to update the player with.
updateSession(resuming, timeout)
async functionUpdates the session status for resuming.
This method sends a PATCH request to update the session's resuming status and timeout.Return: Promise<unknown>
Parameter Type Description Optional resuming
boolean Indicates whether the session should be set to resuming. timeout
number The timeout duration for the session resume.