Skip to content

Commit

Permalink
fix : queueEnd event
Browse files Browse the repository at this point in the history
When autoLeave is set to true, it ensures that queueEnd operates properly as well.
  • Loading branch information
PiscesXD committed Jan 3, 2025
1 parent 999ead9 commit 6434f66
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/entities/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,25 @@ export class Node {
player,
player.current,
)

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

this.manager.emit(
"debug",
"Moonlink.js > Player " +
player.guildId +
" has been destroyed because of autoLeave.",
);
return;
}
if (!player.queue.size) {
player.current = null;
player.queue.clear();

this.manager.emit(
"queueEnd",
player,
Expand Down

0 comments on commit 6434f66

Please sign in to comment.