Constructor
new PlayerManager(client, nodes, optionsopt)
- Source:
Properties:
Name |
Type |
Description |
baseObject |
Player
|
The player class used to create new players |
client |
object
|
The discord.js client |
defaultRegions |
object
|
The default region config |
regions |
object
|
The region config being used |
PlayerManager constructor
Parameters:
Name |
Type |
Attributes |
Description |
client |
Client
|
|
Eris client |
nodes |
Array.<Object>
|
|
The Lavalink nodes to connect to |
options |
Object
|
<optional>
|
Setup options
Properties
Name |
Type |
Attributes |
Default |
Description |
defaultRegion |
string
|
<optional>
|
|
The default region |
failoverRate |
Number
|
<optional>
|
250
|
Failover rate in ms |
failoverLimit |
Number
|
<optional>
|
1
|
Number of connections to failover per rate limit |
player |
Object
|
<optional>
|
|
Optional Player class to replace the default Player |
reconnectThreshold |
Number
|
<optional>
|
2000
|
The amount of time to skip ahead in a song when reconnecting in ms |
regions |
Object
|
<optional>
|
|
Region mapping object |
|
Extends
Methods
createNode(options)
- Source:
Create a Lavalink node
Parameters:
Name |
Type |
Description |
options |
Object
|
Lavalink node options
Properties
Name |
Type |
Description |
host |
string
|
The hostname to connect to |
port |
string
|
The port to connect with |
region |
string
|
The region of the node |
numShards |
Number
|
The number of shards the bot is running |
userId |
string
|
The user id of the bot |
password |
string
|
The password for the Lavalink node |
|
(async) join(guildId, channelId, options, playeropt) → {Promise.<Player>}
- Source:
Join a voice channel
Parameters:
Name |
Type |
Attributes |
Description |
guildId |
string
|
|
The guild ID |
channelId |
string
|
|
The channel ID |
options |
Object
|
|
Join options |
player |
Player
|
<optional>
|
Optionally pass an existing player |
Returns:
-
Type
-
Promise.<Player>
(async) leave(guildId)
- Source:
Leave a voice channel
Parameters:
Name |
Type |
Description |
guildId |
string
|
The guild ID |
removeNode(host)
- Source:
Remove a Lavalink node
Parameters:
Name |
Type |
Description |
host |
string
|
The hostname of the node |
switchNode(player, leave)
- Source:
Switch the voice node of a player
Parameters:
Name |
Type |
Description |
player |
Player
|
The Player instance |
leave |
boolean
|
Whether to leave the channel or not on our side |