Shoukaku
Main Shoukaku class
Extends
Constructors
new Shoukaku()
Parameters
Parameter | Type | Description |
---|---|---|
connector | Connector | A Discord library connector |
nodes | NodeOption [] | An array that conforms to the NodeOption type that specifies nodes to connect to |
options | ShoukakuOptions | Options to pass to create this Shoukaku instance |
Returns
Overrides
TypedEventEmitter<ShoukakuEvents>.constructor
Defined in
Properties
connections
Voice connections being handled
Defined in
connector
Discord library connector
Defined in
id
Shoukaku instance identifier
Defined in
nodes
Connected Lavalink nodes
Defined in
options
Shoukaku options
Defined in
players
Players being handled
Defined in
Methods
addNode()
Add a Lavalink node to the pool of available nodes
Parameters
Parameter | Type |
---|---|
options | NodeOption |
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 | ShoukakuEvents [Extract <K , string >] |
Returns
boolean
Inherited from
Since
v0.1.26
Defined in
getIdealNode()
Gets an ideal node based on the nodeResolver you provided
Parameters
Parameter | Type | Description |
---|---|---|
connection ? | Connection | Optional connection class for ideal node selection, if you use it |
Returns
undefined
| Node
An ideal node for you to do things with
Defined in
joinVoiceChannel()
Joins a voice channel
Parameters
Parameter | Type |
---|---|
options | VoiceChannelOptions |
Returns
Promise
<Player
>
The created player
Defined in
leaveVoiceChannel()
Leaves a voice channel
Parameters
Parameter | Type | Description |
---|---|---|
guildId | string | The id of the guild you want to delete |
Returns
Promise
<void
>
The destroyed / disconnected player or undefined if none
Defined in
off()
Alias for emitter.removeListener()
.
Type Parameters
Type Parameter |
---|
K extends symbol | keyof ShoukakuEvents |
Parameters
Parameter | Type |
---|---|
eventName | K |
listener | (…args : ShoukakuEvents [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 : ShoukakuEvents [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 : ShoukakuEvents [Extract <K , string >]) => void | The callback function |
Returns
this
Inherited from
Since
v0.3.0
Defined in
removeNode()
Remove a Lavalink node from the pool of available nodes
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
name | string | undefined | Name of the node |
reason | string | 'Remove node executed' | Reason of removing the node |
Returns
void