diff --git a/src/client/components/commands/moderation/Prune.ts b/src/client/components/commands/moderation/Prune.ts index 57fee7d..ab525f9 100644 --- a/src/client/components/commands/moderation/Prune.ts +++ b/src/client/components/commands/moderation/Prune.ts @@ -22,7 +22,7 @@ class PruneCommand extends ModerationCommand options: [ { name: 'channels', - type: CommandOptionType.CHANNELS, + type: CommandOptionType.TEXT_CHANNELS, description: 'The channels to prune' }, { name: 'users', diff --git a/src/client/interfaces/CommandOption.ts b/src/client/interfaces/CommandOption.ts index 0700f56..0e7806e 100644 --- a/src/client/interfaces/CommandOption.ts +++ b/src/client/interfaces/CommandOption.ts @@ -428,7 +428,7 @@ class CommandOption throw new Error('Invalid rawValue'); for (const arg of this.#rawValue) { - const channel = await this.#guild.resolveChannel(arg, this.strict, (ch) => ch.type === ChannelType.GuildText); + const channel = await this.#guild.resolveChannel(arg, this.strict, (ch) => ch.isTextBased()); if (channel) { channels.push(channel); @@ -455,7 +455,7 @@ class CommandOption { const channel = await this.#guild.resolveChannel( arg, this.strict, - (ch) => ch.type === ChannelType.GuildVoice + (ch) => ch.isVoiceBased() ); if (channel) { @@ -645,7 +645,7 @@ class CommandOption if (typeof this.#rawValue !== 'string') throw new Error('Invalid rawValue'); const channel = await this.#guild.resolveChannel(this.#rawValue); - if (!channel || channel.type !== ChannelType.GuildText) + if (!channel || !channel.isTextBased()) return { error: true }; return { value: channel, removed: [ this.#rawValue ] }; }, @@ -658,7 +658,7 @@ class CommandOption if (typeof this.#rawValue !== 'string') throw new Error('Invalid rawValue'); const channel = await this.#guild.resolveChannel(this.#rawValue); - if (!channel || channel.type !== ChannelType.GuildVoice) + if (!channel || !channel.isVoiceBased()) return { error: true }; return { value: channel, removed: [ this.#rawValue ] }; },