aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/massBan.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/moderation/massBan.ts')
-rw-r--r--src/commands/moderation/massBan.ts23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/commands/moderation/massBan.ts b/src/commands/moderation/massBan.ts
index a25c64f..ab9fbc8 100644
--- a/src/commands/moderation/massBan.ts
+++ b/src/commands/moderation/massBan.ts
@@ -1,7 +1,13 @@
import {
+ Arg,
BanResponse,
banResponse,
BushCommand,
+ clientSendAndPermCheck,
+ colors,
+ emojis,
+ overflowEmbed,
+ regex,
type ArgType,
type CommandMessage,
type OptArgType,
@@ -45,7 +51,7 @@ export default class MassBanCommand extends BushCommand {
match: 'option',
prompt: "How many days of the user's messages would you like to delete?",
retry: '{error} Choose between 0 and 7 days to delete messages from the user for.',
- type: util.arg.range('integer', 0, 7, true),
+ type: Arg.range('integer', 0, 7, true),
optional: true,
slashType: ApplicationCommandOptionType.Integer,
choices: [...Array(8).keys()].map((v) => ({ name: v.toString(), value: v }))
@@ -54,7 +60,7 @@ export default class MassBanCommand extends BushCommand {
quoted: true,
slash: true,
channel: 'guild',
- clientPermissions: (m) => util.clientSendAndPermCheck(m),
+ clientPermissions: (m) => clientSendAndPermCheck(m),
userPermissions: [PermissionFlagsBits.BanMembers],
lock: 'user'
});
@@ -69,14 +75,13 @@ export default class MassBanCommand extends BushCommand {
args.days ??= message.util.parsed?.alias?.includes('dban') ? 1 : 0;
const ids = args.users.split(/\n| /).filter((id) => id.length > 0);
- if (ids.length === 0) return message.util.send(`${util.emojis.error} You must provide at least one user id.`);
+ if (ids.length === 0) return message.util.send(`${emojis.error} You must provide at least one user id.`);
for (const id of ids) {
- if (!client.constants.regex.snowflake.test(id))
- return message.util.send(`${util.emojis.error} ${id} is not a valid snowflake.`);
+ if (!regex.snowflake.test(id)) return message.util.send(`${emojis.error} ${id} is not a valid snowflake.`);
}
if (!Number.isInteger(args.days) || args.days! < 0 || args.days! > 7) {
- return message.util.reply(`${util.emojis.error} The delete days must be an integer between 0 and 7.`);
+ return message.util.reply(`${emojis.error} The delete days must be an integer between 0 and 7.`);
}
const promises = ids.map((id) =>
@@ -99,13 +104,13 @@ export default class MassBanCommand extends BushCommand {
const id = ids[i];
const status = res[i];
const isSuccess = success(status);
- const emoji = isSuccess ? util.emojis.success : util.emojis.error;
+ const emoji = isSuccess ? emojis.success : emojis.error;
return `${emoji} ${id}${isSuccess ? '' : ` - ${status}`}`;
});
- const embeds = util.overflowEmbed(
+ const embeds = overflowEmbed(
{
- color: util.colors.DarkRed,
+ color: colors.DarkRed,
title: 'Mass Ban Results'
},
lines