default amount for prune
This commit is contained in:
parent
707fd3bb84
commit
76b44e1b71
@ -2,7 +2,7 @@ import { TextChannel } from 'discord.js';
|
||||
import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js';
|
||||
import DiscordClient from '../../../DiscordClient.js';
|
||||
import { Prune } from '../../../infractions/index.js';
|
||||
import { CommandError, ModerationCommand } from '../../../interfaces/index.js';
|
||||
import { ModerationCommand } from '../../../interfaces/index.js';
|
||||
import InvokerWrapper from '../../wrappers/InvokerWrapper.js';
|
||||
|
||||
const flag = true,
|
||||
@ -135,14 +135,14 @@ class PruneCommand extends ModerationCommand
|
||||
|
||||
// if (!channels) throw new CommandError(interaction, { index: 'MODERATION_MISSING_CHANNELS' });
|
||||
|
||||
if (!amount)
|
||||
throw new CommandError(invoker, { index: 'COMMAND_PRUNE_MISSING_AMOUNT' });
|
||||
// if (!amount)
|
||||
// throw new CommandError(invoker, { index: 'COMMAND_PRUNE_MISSING_AMOUNT' });
|
||||
|
||||
// const wrappers = await Promise.all(channels.asChannels.map(channel => this.client.getChannelWrapper(channel)));
|
||||
return this.client.moderation.handleInfraction(Prune, invoker, {
|
||||
targets: channels?.asChannels as TextChannel[] || [ invoker.channel ],
|
||||
data: {
|
||||
amount: amount.asString
|
||||
amount: amount?.asNumber ?? 100
|
||||
},
|
||||
args
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user