Skip to content

Commit

Permalink
fix : queueEnd event (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
1Lucas1apk authored Jan 3, 2025
2 parents 7637417 + 6434f66 commit 4dd2932
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/entities/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,13 @@ export class Node {
player,
player.current,
)

this.manager.emit(
"queueEnd",
player,
player.current
)

this.manager.emit(
"debug",
"Moonlink.js > Player " +
Expand All @@ -255,6 +262,12 @@ export class Node {
if (!player.queue.size) {
player.current = null;
player.queue.clear();

this.manager.emit(
"queueEnd",
player,
player.current
)

this.manager.emit(
"debug",
Expand Down
1 change: 1 addition & 0 deletions src/typings/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface IEvents {
) => void;
trackStuck: (player: Player, track: Track, threshold: number) => void;
trackException: (player: Player, track: Track, exception: any) => void;
queueEnd: (player: Player, track?: any) => void;
socketClosed: (
player: Player,
code: number,
Expand Down

0 comments on commit 4dd2932

Please sign in to comment.