PlayerManager

PlayerManager

Player Manager

Constructor

new PlayerManager(client, nodes, optionsopt)

Source:
Properties:
Name Type Description
baseObject Player The player class used to create new players
client object The eris 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

  • Map

Methods

createNode(options) → {void}

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
Returns:
Type
void

(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) → {void}

Source:
Leave a voice channel
Parameters:
Name Type Description
guildId string The guild ID
Returns:
Type
void

removeNode(host) → {void}

Source:
Remove a Lavalink node
Parameters:
Name Type Description
host string The hostname of the node
Returns:
Type
void

switchNode(player, leave) → {void}

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
Returns:
Type
void