From 02d77264d74c6a2ca951f1dccd347140f798c48c Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Sun, 13 Jun 2021 14:02:50 +0545 Subject: [PATCH] feat: tracksAdd event --- src/Structures/Queue.ts | 3 ++- src/types/types.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Structures/Queue.ts b/src/Structures/Queue.ts index 8cca1cd..d8cfe2a 100644 --- a/src/Structures/Queue.ts +++ b/src/Structures/Queue.ts @@ -67,12 +67,13 @@ class Queue { } addTrack(track: Track) { - this.addTracks([track]); + this.tracks.push(track); this.player.emit("trackAdd", this, track); } addTracks(tracks: Track[]) { this.tracks.push(...tracks); + this.player.emit("tracksAdd", this, tracks); } setPaused(paused?: boolean) { diff --git a/src/types/types.ts b/src/types/types.ts index 815b0bd..3e06853 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -132,6 +132,7 @@ export interface PlayerEvents { searchInvalidResponse: () => any; searchResults: () => any; trackAdd: (queue: Queue, track: Track) => any; + tracksAdd: (queue: Queue, track: Track[]) => any; trackStart: (queue: Queue, track: Track) => any; }