diff --git a/src/interactions/components/filters-disable-button.ts b/src/interactions/components/filters-disable-button.ts index 4772a38..8502645 100644 --- a/src/interactions/components/filters-disable-button.ts +++ b/src/interactions/components/filters-disable-button.ts @@ -8,12 +8,6 @@ import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validati class FiltersDisableButtonComponent extends BaseComponentInteraction { constructor() { super('filters-disable-button'); - - this.validators = [ - (args) => checkInVoiceChannel(args), - (args) => checkSameVoiceChannel(args), - (args) => checkQueueExists(args) - ]; } async execute(params: BaseComponentParams): BaseComponentReturnType { @@ -22,7 +16,11 @@ class FiltersDisableButtonComponent extends BaseComponentInteraction { const queue: GuildQueue = useQueue(interaction.guild!.id)!; - await this.runValidators({ interaction, queue, executionId }); + await this.runValidators({ interaction, queue, executionId }, [ + checkInVoiceChannel, + checkSameVoiceChannel, + checkQueueExists + ]); // Reset filters before enabling provided filters if (queue.filters.ffmpeg.filters.length > 0) { diff --git a/src/interactions/components/filters-select-menu.ts b/src/interactions/components/filters-select-menu.ts index d256d3a..dad6dbd 100644 --- a/src/interactions/components/filters-select-menu.ts +++ b/src/interactions/components/filters-select-menu.ts @@ -12,12 +12,6 @@ const ffmpegFilterOptions: FFmpegFilterOptions = config.get('ffmpegFilterOptions class FiltersSelectMenuComponent extends BaseComponentInteraction { constructor() { super('filters-select-menu'); - - this.validators = [ - (args) => checkInVoiceChannel(args), - (args) => checkSameVoiceChannel(args), - (args) => checkQueueExists(args) - ]; } async execute(params: BaseComponentParams): BaseComponentReturnType { @@ -29,7 +23,11 @@ class FiltersSelectMenuComponent extends BaseComponentInteraction { const selectMenuInteraction: StringSelectMenuInteraction = interaction as StringSelectMenuInteraction; const queue: GuildQueue = useQueue(interaction.guild!.id)!; - await this.runValidators({ interaction, queue, executionId }); + await this.runValidators({ interaction, queue, executionId }, [ + checkInVoiceChannel, + checkSameVoiceChannel, + checkQueueExists + ]); queue.filters.ffmpeg.setInputArgs([ '-threads', diff --git a/src/interactions/components/nowplaying-skip-button.ts b/src/interactions/components/nowplaying-skip-button.ts index a5a3a64..f64fd7f 100644 --- a/src/interactions/components/nowplaying-skip-button.ts +++ b/src/interactions/components/nowplaying-skip-button.ts @@ -8,13 +8,6 @@ import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validati class NowplayingSkipButton extends BaseComponentInteraction { constructor() { super('nowplaying-skip-button'); - - this.validators = [ - (args) => checkInVoiceChannel(args), - (args) => checkSameVoiceChannel(args), - (args) => checkQueueExists(args), - (args) => checkQueueCurrentTrack(args) - ]; } async execute(params: BaseComponentParams): BaseComponentReturnType { @@ -23,7 +16,12 @@ class NowplayingSkipButton extends BaseComponentInteraction { const queue: GuildQueue = useQueue(interaction.guild!.id)!; - await this.runValidators({ interaction, queue, executionId }); + await this.runValidators({ interaction, queue, executionId }, [ + checkInVoiceChannel, + checkSameVoiceChannel, + checkQueueExists, + checkQueueCurrentTrack + ]); if (!queue || (queue.tracks.data.length === 0 && !queue.currentTrack)) { logger.debug('Tried skipping track but there was no queue.');