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 endpointstring 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 guildIdstring as Guild.idThe 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 endpointstring 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 endpointstring The endpoint to send the PUT request to. bodyunknown 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 sessionIdstring The session ID to set.
updatePlayer(options)โ
async functionSends a PATCH request to update player related data.
Return: Promise<unknown>
Parameter Type Description Optional optionsplayOptions{}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 resumingboolean Indicates whether the session should be set to resuming. timeoutnumber The timeout duration for the session resume.