Node
Represents a Lavalink node
Extends
Constructors
new Node()
Parameters
Parameter | Type | Description |
---|---|---|
manager | Shoukaku | Shoukaku instance |
options | NodeOption | Options on creating this node |
Returns
Overrides
TypedEventEmitter<NodeEvents>.constructor
Defined in
Properties
group?
Group in which this node is contained
Defined in
info
Information about lavalink node
Defined in
manager
Shoukaku class
Defined in
name
Name of this node
Defined in
reconnects
The number of reconnects to Lavalink
Defined in
rest
Lavalink rest API
Defined in
sessionId
SessionId of this Lavalink connection (not to be confused with Discord SessionId)
Defined in
state
The state of this connection
Defined in
stats
Statistics from Lavalink
Defined in
ws
Websocket instance
Defined in
Methods
connect()
Connect to Lavalink
Returns
void
Defined in
disconnect()
Disconnect from Lavalink
Parameters
Parameter | Type | Description |
---|---|---|
code | number | Status code |
reason ? | string | Reason for disconnect |
Returns
void
Defined in
emit()
Synchronously calls each of the listeners registered for the event named eventName
, in the order they were registered, passing the supplied arguments
to each.
Returns true
if the event had listeners, false
otherwise.
Type Parameters
Type Parameter |
---|
K extends symbol | keyof ShoukakuEvents |
Parameters
Parameter | Type |
---|---|
eventName | K |
…args | NodeEvents [Extract <K , string >] |
Returns
boolean
Inherited from
Since
v0.1.26
Defined in
error()
To emit error events easily
Parameters
Parameter | Type | Description |
---|---|---|
error | Error | error message |
Returns
void
Defined in
off()
Alias for emitter.removeListener()
.
Type Parameters
Type Parameter |
---|
K extends symbol | keyof ShoukakuEvents |
Parameters
Parameter | Type |
---|---|
eventName | K |
listener | (…args : NodeEvents [Extract <K , string >]) => void |
Returns
this
Inherited from
Since
v10.0.0
Defined in
on()
Adds the listener
function to the end of the listeners array for the event
named eventName
. No checks are made to see if the listener
has already
been added. Multiple calls passing the same combination of eventName
and
listener
will result in the listener
being added, and called, multiple times.
Returns a reference to the EventEmitter
, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The emitter.prependListener()
method can be used as an alternative to add the
event listener to the beginning of the listeners array.
Type Parameters
Type Parameter |
---|
K extends symbol | keyof ShoukakuEvents |
Parameters
Parameter | Type | Description |
---|---|---|
eventName | K | The name of the event. |
listener | (…args : NodeEvents [Extract <K , string >]) => void | The callback function |
Returns
this
Inherited from
Since
v0.1.101
Defined in
once()
Adds a one-time listener
function for the event named eventName
. The
next time eventName
is triggered, this listener is removed and then invoked.
Returns a reference to the EventEmitter
, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The emitter.prependOnceListener()
method can be used as an alternative to add the
event listener to the beginning of the listeners array.
Type Parameters
Type Parameter |
---|
K extends symbol | keyof ShoukakuEvents |
Parameters
Parameter | Type | Description |
---|---|---|
eventName | K | The name of the event. |
listener | (…args : NodeEvents [Extract <K , string >]) => void | The callback function |
Returns
this
Inherited from
Since
v0.3.0