Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
achiragaming committed Nov 24, 2024
1 parent 43bfebd commit ccc2204
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "damonjs",
"version": "2.1.6",
"version": "2.1.7",
"preview": false,
"description": "A modified Shoukaku wrapper with enhanced queue support.",
"main": "dist/Index.js",
Expand Down
6 changes: 5 additions & 1 deletion src/Managers/DamonJsPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ export class DamonJsPlayer {
trackSkip: async (trackId: number) => {
await this.handleTrackSkip(trackId);
},
playerDestroy: async () => {
await this.handlePlayerDestroy();
},
};
const shoukakuEvents = ['start', 'end', 'closed', 'exception', 'update', 'stuck', 'resumed'] as const;
shoukakuEvents.forEach((event) => {
Expand All @@ -198,6 +201,7 @@ export class DamonJsPlayer {
'resolveError',
'trackPlay',
'trackSkip',
'playerDestroy',
] as const;
damonjsEvents.forEach((event) => {
this.events.on(event, (data) => eventHandlers[event](data));
Expand Down Expand Up @@ -331,7 +335,7 @@ export class DamonJsPlayer {
this.stats.skipAttemptData.destroyTriggers = destroyTriggers;
if (destroyTriggers.length >= this.damonjs.skipSpam.destroy.maxhits) {
this.emit(Events.Debug, this, `Player ${this.guildId} skipped too many times, destroying`);
await this.destroy();
this.events.emit('playerDestroy');
return this;
}
this.emit(
Expand Down

0 comments on commit ccc2204

Please sign in to comment.