Rest
Constructorโ
- Rest : options
Table of contentsโ
| Properties | Methods |
|---|---|
| manager | delete() |
| destroyPlayer() | |
| get() | |
| getAllPlayers() | |
| patch() | |
| post() | |
| put() | |
| setSessionId() | |
| updatePlayer() | |
| updateSession() |
Propertiesโ
managerโ
The Manager instance.
Returns:
Manager
Methodsโ
delete()โ
Sends a DELETE request to the server to destroy the player.
Returns: Promise<unknown>
Parameter Type Description guildIdstring as GuildID The guild ID of the player to destroy.
destroyPlayer()โ
Sends a DELETE request to the server to destroy the player.
Returns: Promise<unknown>
Parameter Type Description guildIdstring as GuildID The guild ID of the player to destroy.
get()โ
Sends a GET request to the specified endpoint and returns the response data.
Returns: Promise<unknown>
Parameter Type Description endpointstring The endpoint to send the GET request to.
getAllPlayers()โ
Retrieves all the players that are currently running on the node.
Returns: Promise<unknown>
path()โ
Sends a PATCH request to update player related data.
Returns: Promise<unknown>
Parameter Type Description optionsplayOptions{}The options to update the player with.
put()โ
Sends a PUT request to the specified endpoint and returns the response data.
Returns: Promise<unknown>
Parameter Type Description endpointstring The endpoint to send the PUT request to. bodyunknown The data to send in the request body.
setSessionId()โ
Sets the session ID.
This method is used to set the session ID after a resume operation is done.Returns: string
Parameter Type Description sessionIdstring The session ID to set.
updatePlayer()โ
Sends a PATCH request to update player related data.
Returns: Promise<unknown>
Parameter Type Description optionsplayOptions{}The options to update the player with.
updateSession()โ
Updates the session status for resuming.
This method sends a PATCH request to update the session's resuming status and timeout.Returns: Promise<unknown>
Parameter Type Description resumingboolean Indicates whether the session should be set to resuming. timeoutnumber The timeout duration for the session resume.