lavacord / Lavacord

A easy to use Lavalink client that can be used with any discord api wrapper
Apache License 2.0
79 stars 21 forks source link

Player State incorrect when specifying volume in play method #84

Closed Skye-31 closed 3 years ago

Skye-31 commented 4 years ago

I realise what a horrible title that is but I couldn't really word it any other way. When using the play method, shown below, you are able to set player options, including volume. This however does not modify the state of the player that keeps track of the current volume. If I used <Player>.play('LavalinkTrack', { volume: 50 }), when the volume was initially 100, the state will then show the incorrect volume.

public async play(track: string, options: PlayerPlayOptions = {}): Promise<boolean> {
        const d = await this.send("play", { ...options, track });
        this.track = track;
        this.playing = true;
        this.timestamp = Date.now();
        return d;
    }