Currently the hooks exported by discord-player operate on the first instance of Player. This PR adds a new function called bindHook which allows users to bind hooks to other instance of player.
import { bindHook, useMainPlayer, Player } from 'discord-player'
// create player instance
const player = new Player(client, {...});
// bind hooks to 'player'
bindHook(player);
useMainPlayer() // this equals to 'player' above
This by default uses first instance for compatibility reasons.
Status
[x] These changes have been tested and formatted properly.
[ ] This PR includes only documentation changes, no code change.
Changes
Currently the hooks exported by discord-player operate on the first instance of
Player
. This PR adds a new function calledbindHook
which allows users to bind hooks to other instance of player.Status