mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 09:42:22 +00:00
fix(StreamDispatcher): emit volumeChange event when the volume changes (#2349)
This commit is contained in:
parent
dc6bce1f82
commit
c25ea45866
1 changed files with 7 additions and 0 deletions
|
|
@ -278,6 +278,13 @@ class StreamDispatcher extends Writable {
|
||||||
|
|
||||||
setVolume(value) {
|
setVolume(value) {
|
||||||
if (!this.streams.volume) return false;
|
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);
|
this.streams.volume.setVolume(value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue