From 46c2bb9dc61d6573f039a54cf83aee786cefe8e5 Mon Sep 17 00:00:00 2001 From: Androz2091 Date: Thu, 13 Aug 2020 23:54:11 +0200 Subject: [PATCH] :sparkles: Rename events and always emit trackStart event --- src/Player.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Player.js b/src/Player.js index e6809cb..0f68a82 100644 --- a/src/Player.js +++ b/src/Player.js @@ -543,10 +543,10 @@ class Player extends EventEmitter { this.queues.delete(queue.guildID) // Emit stop event if (queue.stopped) { - return queue.emit('stop') + return queue.emit('musicStopped') } // Emit end event - return queue.emit('end') + return queue.emit('queueEnded') } // if the track needs to be the next one if (!queue.repeatMode && !firstPlay) queue.tracks.shift() @@ -554,10 +554,7 @@ class Player extends EventEmitter { // Reset lastSkipped state queue.lastSkipped = false this._playYTDLStream(track, queue, false).then(() => { - // Emit trackChanged event - if (!firstPlay) { - queue.emit('trackStart', queue.firstMessage, track, queue) - } + this.emit('trackStart', queue.firstMessage, track, queue) }) } };