Skip to content

Commit

Permalink
chore(discord-player): release 6.6.10
Browse files Browse the repository at this point in the history
  • Loading branch information
twlite committed Jun 9, 2024
1 parent 08cf2b0 commit fad0a10
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 93 deletions.
4 changes: 2 additions & 2 deletions packages/discord-player/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-player",
"version": "6.6.9",
"version": "6.6.10",
"description": "Complete framework to facilitate music commands using discord.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -78,4 +78,4 @@
"readmeFile": "./README.md",
"tsconfig": "./tsconfig.json"
}
}
}
14 changes: 8 additions & 6 deletions packages/discord-player/src/Player.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FFmpeg } from '@discord-player/ffmpeg';
import { Client, SnowflakeUtil, VoiceState, IntentsBitField, User, GuildVoiceChannelResolvable, version as djsVersion } from 'discord.js';
import { Client, SnowflakeUtil, VoiceState, IntentsBitField, User, GuildVoiceChannelResolvable, version as djsVersion, Events } from 'discord.js';
import { Playlist, Track, SearchResult } from './fabric';
import { GuildQueueEvents, VoiceConnectConfig, GuildNodeCreateOptions, GuildNodeManager, GuildQueue, ResourcePlayOptions, GuildQueueEvent } from './queue';
import { VoiceUtils } from './VoiceInterface/VoiceUtils';
import { PlayerEvents, QueryType, SearchOptions, PlayerInitOptions, PlaylistInitData, SearchQueryType } from './types/types';
import { PlayerEvents, QueryType, SearchOptions, PlayerInitOptions, PlaylistInitData, SearchQueryType, PlayerEvent } from './types/types';
import { QueryResolver, ResolvedQuery } from './utils/QueryResolver';
import { Util } from './utils/Util';
import { generateDependencyReport, version as dVoiceVersion } from 'discord-voip';
Expand Down Expand Up @@ -79,7 +79,7 @@ export class Player extends PlayerEventsEmitter<PlayerEvents> {
/**
* The player events channel
*/
public events = new PlayerEventsEmitter<GuildQueueEvents>(['error', 'playerError']);
public events = new PlayerEventsEmitter<GuildQueueEvents>([GuildQueueEvent.Error, GuildQueueEvent.PlayerError]);
/**
* The route planner
*/
Expand All @@ -102,7 +102,7 @@ export class Player extends PlayerEventsEmitter<PlayerEvents> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (!options.ignoreInstance && kSingleton in Player) return (<any>Player)[kSingleton] as Player;

super(['error']);
super([PlayerEvent.Error]);

/**
* The discord.js client
Expand Down Expand Up @@ -144,7 +144,8 @@ export class Player extends PlayerEventsEmitter<PlayerEvents> {
}
} as PlayerInitOptions;

this.client.on('voiceStateUpdate', this.#voiceStateUpdateListener);
this.client.setMaxListeners(this.client.getMaxListeners() + 1);
this.client.on(Events.VoiceStateUpdate, this.#voiceStateUpdateListener);

if (typeof this.options.lagMonitor === 'number' && this.options.lagMonitor > 0) {
this.#lagMonitorInterval = setInterval(() => {
Expand Down Expand Up @@ -295,7 +296,8 @@ export class Player extends PlayerEventsEmitter<PlayerEvents> {
*/
public async destroy() {
this.nodes.cache.forEach((node) => node.delete());
this.client.off('voiceStateUpdate', this.#voiceStateUpdateListener);
this.client.off(Events.VoiceStateUpdate, this.#voiceStateUpdateListener);
this.client.setMaxListeners(this.client.getMaxListeners() - 1);
this.removeAllListeners();
this.events.removeAllListeners();
await this.extractors.unregisterAll();
Expand Down
Loading

0 comments on commit fad0a10

Please sign in to comment.