Update Queue.ts

This commit is contained in:
L0SER 2021-07-26 09:14:21 +05:30 committed by GitHub
parent 399105eec9
commit 30ccaeaa12
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);