Class: Node

Node(options)

Represents a Player that connects to a node and interacts with a guild's session.

Constructor

new Node(options)

Parameters:
Name Type Description
options Object Object that contains the options for the Node
Properties
Name Type Description
serverName string The name of the server
secure boolean Whether the connection is secure or not
host string Hostname
port number Port
pass string Password
userAgent string User-Agent
botId string Bot ID
Source:

Extends

  • EventEmitter

Members

botId :String

This Node's ID
Type:
  • String
Source:

fetchUrl :String

This Node's API URL
Type:
  • String
Source:

pass :String

This Node's password
Type:
  • String
Source:

players :Object

This Node's player
Type:
  • Object
Source:

sendPayload :function

This Node's function to send payload to Discord server
Type:
  • function
Source:

serverName :String

This Node's name
Type:
  • String
Source:

sessionId :String

This Node's session ID
Type:
  • String
Source:

stats :Object

This Node's stats
Type:
  • Object
Source:

url :String

This Node's WS URL
Type:
  • String
Source:

userAgent :String

Useragent used to connect this node
Type:
  • String
Source:

Methods

(async) decodeTrack(track) → {Object}

Decode a track
Parameters:
Name Type Description
track String Track to decode that is encoded to base64
Source:
Returns:
- Decoded track
Type
Object

(async) decodeTracks(tracks) → {Object}

Decode multiple tracks
Parameters:
Name Type Description
tracks Array Array of tracks to decode that are encoded to base64
Source:
Returns:
- Decoded tracks
Type
Object

destroy() → {Boolean}

Destroy this node
Source:
Returns:
- True if successful
Type
Boolean

getPlayer(guildId) → {Object}

Get player on specified guild
Parameters:
Name Type Description
guildId String Guild ID
Source:
Returns:
- The player for the guild
Type
Object

getPlayers() → {Object}

Get players
Source:
Returns:
- Players
Type
Object

(async) getStats() → {Object}

Get states
Source:
Returns:
- States
Type
Object

(async) joinVoiceChannel(options) → {Object}

Join voice channel
Parameters:
Name Type Description
options Object Object that contains the options for the voice channel
Properties
Name Type Description
guildId String Guild ID
channelId String Channel ID
options Object Options for the voice channel
Source:
Returns:
- Player instance
Type
Object

leaveVoiceChannel(guildId) → {Object}

Leave voice channel
Parameters:
Name Type Description
guildId String Guild ID
Source:
Returns:
- This node instance
Type
Object

(async) loadLyrics(track, lang) → {Object}

Load lyrics
Parameters:
Name Type Description
track String Track to load lyrics for
lang String Language to load lyrics in
Source:
Returns:
- Lyric
Type
Object

(async) loadTracks(data) → {Object}

Load tracks
Parameters:
Name Type Description
data String Data to load
Source:
Returns:
- Load results
Type
Object

startWs() → {Object}

Start WS with LavaLink server
Source:
Returns:
- This node instance
Type
Object