From 0df17b16349b0ffb49df8674a8c9df268de08af7 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sat, 7 Jan 2017 21:39:12 +0000 Subject: [PATCH] Add broadcast.destroy(); --- src/client/voice/VoiceBroadcast.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/voice/VoiceBroadcast.js b/src/client/voice/VoiceBroadcast.js index 003da16b9..c977dda28 100644 --- a/src/client/voice/VoiceBroadcast.js +++ b/src/client/voice/VoiceBroadcast.js @@ -339,10 +339,17 @@ class VoiceBroadcast extends EventEmitter { } /** - * End the current broadcast, all subscribed dispatchers will also end + * Stop the current stream from playing without unsubscribing dispatchers. */ end() { this.killCurrentTranscoder(); + } + + /** + * End the current broadcast, all subscribed dispatchers will also end + */ + destroy() { + this.end(); for (const container of this._dispatchers.values()) { for (const dispatcher of container.values()) { dispatcher.destroy('end', 'broadcast ended');