Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LavalinkNode

The class for handling everything to do with connecting to Lavalink

Hierarchy

  • LavalinkNode

Index

Constructors

constructor

Properties

host

host: string = "localhost"

The host of the LavalinkNode, this could be a ip or domain.

id

id: string

The id of the LavalinkNode so Nodes are better organized

manager

manager: Manager

The manager that created the LavalinkNode

password

password: string = "youshallnotpass"

The password of the lavalink node

port

port: number | string = 2333

The port of the LavalinkNode

reconnectInterval

reconnectInterval: number = 10000

The interval that the node will try to reconnect to lavalink at in milliseconds

Optional resumeKey

resumeKey: undefined | string

The resume key to send to the LavalinkNode so you can resume properly

resumeTimeout

resumeTimeout: number = 120

The resume timeout

Optional state

state: any

Extra info attached to your node, not required and is not sent to lavalink, purely for you.

stats

The statistics of the LavalinkNode

ws

ws: WebSocket | null = null

The WebSocket instance for this LavalinkNode

Accessors

connected

  • get connected(): boolean

Methods

configureResuming

  • configureResuming(key: string, timeout?: number): Promise<boolean>
  • Configures the resuming key for the LavalinkNode

    Parameters

    • key: string

      the actual key to send to lavalink to resume with

    • Default value timeout: number = this.resumeTimeout

      how long before the key invalidates and lavalinknode will stop expecting you to resume

    Returns Promise<boolean>

connect

  • connect(): Promise<WebSocket | boolean>

destroy

  • destroy(): boolean

send

  • send(msg: object): Promise<boolean>
  • Sends data to lavalink or puts it in a queue if not connected yet

    Parameters

    • msg: object

      Data you want to send to lavalink

    Returns Promise<boolean>

Generated using TypeDoc