mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
fix(StreamDispatcher): emit volumeChange event when the volume changes (#2349)
This commit is contained in:
@@ -278,6 +278,13 @@ class StreamDispatcher extends Writable {
|
||||
|
||||
setVolume(value) {
|
||||
if (!this.streams.volume) return false;
|
||||
/**
|
||||
* Emitted when the volume of this dispatcher changes.
|
||||
* @event StreamDispatcher#volumeChange
|
||||
* @param {number} oldVolume The old volume of this dispatcher
|
||||
* @param {number} newVolume The new volume of this dispatcher
|
||||
*/
|
||||
this.emit('volumeChange', this.volume, value);
|
||||
this.streams.volume.setVolume(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user