Merge pull request #632 from L0SER8228/patch-2

feat: trackEnd event
This commit is contained in:
Andromeda 2021-07-31 13:02:30 +05:45 committed by GitHub
commit 83bb1405f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -169,6 +169,8 @@ class Queue<T = unknown> {
this._streamTime = 0;
if (resource && resource.metadata) this.previousTracks.push(resource.metadata);
this.player.emit("trackEnd", this, resource.metadata);
if (!this.tracks.length && this.repeatMode === QueueRepeatMode.OFF) {
if (this.options.leaveOnEnd) this.destroy();
this.player.emit("queueEnd", this);