feat: tracksAdd event
This commit is contained in:
parent
e611143f58
commit
02d77264d7
2 changed files with 3 additions and 1 deletions
|
@ -67,12 +67,13 @@ class Queue<T = unknown> {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue