diff --git a/src/handlers/index.ts b/src/handlers/index.ts index 2dd7bc73..78c38a3c 100644 --- a/src/handlers/index.ts +++ b/src/handlers/index.ts @@ -2,11 +2,13 @@ import { Manager } from '../manager.js' import { Checker } from './loadCheck.js' import { CommandAndButtonLoader } from './loadCommand.js' import { ClientEventsLoader } from './loadEvents.js' -import { PlayerLoader } from './loadPlayer.js' +import { PlayerEventLoader } from './loadPlayerEvents.js' +import { PlayerLoader } from './loadSetup.js' export class initHandler { constructor(client: Manager) { if (client.config.utilities.AUTOFIX_LAVALINK.enable) new Checker(client) + new PlayerEventLoader(client) new ClientEventsLoader(client) new PlayerLoader(client) new CommandAndButtonLoader(client) diff --git a/src/handlers/loadPlayer.ts b/src/handlers/loadPlayer.ts deleted file mode 100644 index 12b0cdaa..00000000 --- a/src/handlers/loadPlayer.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Manager } from '../manager.js' -import { PlayerContentLoader } from './Player/loadContent.js' -import { PlayerEventLoader } from './Player/loadEvent.js' -import { PlayerUpdateLoader } from './Player/loadUpdate.js' - -export class PlayerLoader { - constructor(client: Manager) { - new PlayerEventLoader(client) - new PlayerContentLoader(client) - new PlayerUpdateLoader(client) - } -} diff --git a/src/handlers/Player/loadEvent.ts b/src/handlers/loadPlayerEvents.ts similarity index 97% rename from src/handlers/Player/loadEvent.ts rename to src/handlers/loadPlayerEvents.ts index d224a07c..28a3f818 100644 --- a/src/handlers/Player/loadEvent.ts +++ b/src/handlers/loadPlayerEvents.ts @@ -3,7 +3,7 @@ import readdirRecursive from 'recursive-readdir' import { resolve } from 'path' import { join, dirname } from 'path' import { fileURLToPath, pathToFileURL } from 'url' -import { Manager } from '../../manager.js' +import { Manager } from '../manager.js' import { RainlinkEventsInterface } from 'rainlink' const __dirname = dirname(fileURLToPath(import.meta.url)) diff --git a/src/handlers/loadSetup.ts b/src/handlers/loadSetup.ts new file mode 100644 index 00000000..49b0a8ee --- /dev/null +++ b/src/handlers/loadSetup.ts @@ -0,0 +1,10 @@ +import { Manager } from '../manager.js' +import { ChannelHandler } from '../setup/ChannelHandler.js' +import { ChannelUpdater } from '../setup/ChannelUpdater.js' + +export class PlayerLoader { + constructor(client: Manager) { + new ChannelHandler(client) + new ChannelUpdater(client) + } +} diff --git a/src/handlers/Player/loadContent.ts b/src/setup/ChannelHandler.ts similarity index 96% rename from src/handlers/Player/loadContent.ts rename to src/setup/ChannelHandler.ts index 96f02960..6b340b7b 100644 --- a/src/handlers/Player/loadContent.ts +++ b/src/setup/ChannelHandler.ts @@ -1,4 +1,4 @@ -import { Manager } from '../../manager.js' +import { Manager } from '../manager.js' import { EmbedBuilder, Message, @@ -6,11 +6,11 @@ import { TextChannel, StringSelectMenuInteraction, } from 'discord.js' -import { GlobalInteraction } from '../../@types/Interaction.js' +import { GlobalInteraction } from '../@types/Interaction.js' import { RateLimitManager } from '@sapphire/ratelimits' -import { convertTime } from '../../utilities/ConvertTime.js' -import { getTitle } from '../../utilities/GetTitle.js' -import { BlacklistService } from '../../services/BlacklistService.js' +import { convertTime } from '../utilities/ConvertTime.js' +import { getTitle } from '../utilities/GetTitle.js' +import { BlacklistService } from '../services/BlacklistService.js' import { RainlinkFilterMode } from 'rainlink' const rateLimitManager = new RateLimitManager(2000) @@ -18,7 +18,7 @@ const rateLimitManager = new RateLimitManager(2000) * @param {Client} client */ -export class PlayerContentLoader { +export class ChannelHandler { client: Manager constructor(client: Manager) { this.client = client @@ -30,7 +30,7 @@ export class PlayerContentLoader { this.client.on('interactionCreate', (interaction) => this.interaction(interaction)) this.client.on('messageCreate', (message) => this.message(message)) } catch (err) { - this.client.logger.error(PlayerContentLoader.name, err) + this.client.logger.error(ChannelHandler.name, err) } } diff --git a/src/handlers/Player/loadUpdate.ts b/src/setup/ChannelUpdater.ts similarity index 94% rename from src/handlers/Player/loadUpdate.ts rename to src/setup/ChannelUpdater.ts index 86fe2e77..057f6421 100644 --- a/src/handlers/Player/loadUpdate.ts +++ b/src/setup/ChannelUpdater.ts @@ -1,11 +1,11 @@ -import { Manager } from '../../manager.js' +import { Manager } from '../manager.js' import { EmbedBuilder, TextChannel } from 'discord.js' -import { formatDuration } from '../../utilities/FormatDuration.js' +import { formatDuration } from '../utilities/FormatDuration.js' import { RainlinkPlayer } from 'rainlink' -import { getTitle } from '../../utilities/GetTitle.js' -import { filterSelect, playerRowOne, playerRowTwo } from '../../utilities/PlayerControlButton.js' +import { getTitle } from '../utilities/GetTitle.js' +import { filterSelect, playerRowOne, playerRowTwo } from '../utilities/PlayerControlButton.js' -export class PlayerUpdateLoader { +export class ChannelUpdater { client: Manager constructor(client: Manager) { this.client = client