FastLink 2.3.5
Classes | Functions
index.js File Reference

Classes

class  Player
 

Functions

function connectNodes (nodes, config)
 
function anyNodeAvailable ()
 
function getPlayers (node)
 
function getInfo (node)
 
function getStats (node)
 
function getVersion (node)
 
function getRouterPlannerStatus (node)
 
function unmarkFailedAddress (node, address)
 
function unmarkAllFailedAddresses (node)
 
function handleRaw (data)
 

Detailed Description

Author
PerformanC perfo.nosp@m.rman.nosp@m.corg@.nosp@m.gmai.nosp@m.l.com

Function Documentation

◆ anyNodeAvailable()

function anyNodeAvailable ( )

Checks if any node is connected.

Returns
The boolean if any node is connected or not.

◆ connectNodes()

function connectNodes (   nodes,
  config 
)

Connects node's WebSocket server for communication.

Parameters
nodesAn array of node objects containing connection details.
configConfiguration object containing botId, shards, queue, and debug options.
Exceptions
ErrorIf nodes or config is not provided or not in the expected format.
Returns
Event emitter for listening to LavaLink events.

◆ getInfo()

function getInfo (   node)

Retrieves the info for a given node.

Parameters
nodeThe node to retrieve info from.
Exceptions
ErrorIf no node is provided or if node is not a string.
Returns
A Promise that resolves to the retrieved info data.

◆ getPlayers()

function getPlayers (   node)

Retrieves the players for a given node.

Parameters
nodeThe node to retrieve players from.
Exceptions
ErrorIf no node is provided or if node is not a string.
Returns
A Promise that resolves to the retrieved player data.

◆ getRouterPlannerStatus()

function getRouterPlannerStatus (   node)

Retrieves the router planner status for a given node.

Parameters
nodeThe node to retrieve router planner status from.
Exceptions
ErrorIf no node is provided or if node is not a string.
Returns
A Promise that resolves to the retrieved router planner status data.

◆ getStats()

function getStats (   node)

Retrieves the stats for a given node.

Parameters
nodeThe node to retrieve stats from.
Exceptions
ErrorIf no node is provided or if node is not a string.
Returns
A Promise that resolves to the retrieved stats data.

◆ getVersion()

function getVersion (   node)

Retrieves the version for a given node.

Parameters
nodeThe node to retrieve version from.
Exceptions
ErrorIf no node is provided or if node is not a string.
Returns
A Promise that resolves to the retrieved version data.

◆ handleRaw()

function handleRaw (   data)

Handles raw data received from an external source.

Parameters
dataThe raw data from Discord to handle.
Exceptions
ErrorIf data is not provided or if data is not an object.

◆ unmarkAllFailedAddresses()

function unmarkAllFailedAddresses (   node)

Unmarks all failed addresses for a given node.

Parameters
nodeThe node to unmark failed addresses from.
Exceptions
ErrorIf no node is provided or if node is not a string.
Returns
A Promise that resolves when the request is complete.

◆ unmarkFailedAddress()

function unmarkFailedAddress (   node,
  address 
)

Unmarks a failed address for a given node.

Parameters
nodeThe node to unmark failed address from.
addressThe address to unmark.
Exceptions
ErrorIf no node is provided or if node is not a string.
Returns
A Promise that resolves when the request is complete.