diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-16 14:32:18 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-16 14:32:18 -0400 |
commit | 0e87bbd3940d89defcb04926587b35c8f4d1947f (patch) | |
tree | e50860d4dc25a11d4c3977b583284c4bcad1b077 /src/commands/moderation/purge.ts | |
parent | 661e4c9935aeb8760dafc7ced4bbec6cc356a033 (diff) | |
download | tanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.tar.gz tanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.tar.bz2 tanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.zip |
remove util classes, move config out of src
Diffstat (limited to 'src/commands/moderation/purge.ts')
-rw-r--r-- | src/commands/moderation/purge.ts | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/commands/moderation/purge.ts b/src/commands/moderation/purge.ts index 1652f6f..acf3897 100644 --- a/src/commands/moderation/purge.ts +++ b/src/commands/moderation/purge.ts @@ -1,4 +1,13 @@ -import { BushCommand, OptArgType, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; +import { + Arg, + BushCommand, + clientSendAndPermCheck, + emojis, + OptArgType, + type ArgType, + type CommandMessage, + type SlashMessage +} from '#lib'; import assert from 'assert'; import { ApplicationCommandOptionType, Collection, PermissionFlagsBits, type Message } from 'discord.js'; @@ -14,7 +23,7 @@ export default class PurgeCommand extends BushCommand { { id: 'amount', description: 'The amount of messages to purge.', - type: util.arg.range('integer', 1, 100, true), + type: Arg.range('integer', 1, 100, true), readableType: 'integer', prompt: 'How many messages would you like to purge?', retry: '{error} Please pick a number between 1 and 100.', @@ -43,7 +52,7 @@ export default class PurgeCommand extends BushCommand { ], slash: true, clientPermissions: (m) => - util.clientSendAndPermCheck(m, [PermissionFlagsBits.ManageMessages, PermissionFlagsBits.EmbedLinks], true), + clientSendAndPermCheck(m, [PermissionFlagsBits.ManageMessages, PermissionFlagsBits.EmbedLinks], true), userPermissions: [PermissionFlagsBits.ManageMessages], channel: 'guild' }); @@ -55,7 +64,7 @@ export default class PurgeCommand extends BushCommand { ) { assert(message.inGuild()); - if (args.amount > 100 || args.amount < 1) return message.util.reply(`${util.emojis.error} `); + if (args.amount > 100 || args.amount < 1) return message.util.reply(`${emojis.error} `); const messageFilter = (filterMessage: Message): boolean => { const shouldFilter: boolean[] = []; @@ -72,13 +81,13 @@ export default class PurgeCommand extends BushCommand { ); const purged = await message.channel!.bulkDelete(messages, true).catch(() => null); - if (!purged) return message.util.reply(`${util.emojis.error} Failed to purge messages.`).catch(() => null); + if (!purged) return message.util.reply(`${emojis.error} Failed to purge messages.`).catch(() => null); else { client.emit('bushPurge', message.author, message.guild, message.channel!, messages); - await message.util.send(`${util.emojis.success} Successfully purged **${purged.size}** messages.`); + await message.util.send(`${emojis.success} Successfully purged **${purged.size}** messages.`); /* .then(async (purgeMessage) => { if (!message.util.isSlashMessage(message)) { - await util.sleep(5); + await sleep(5); await purgeMessage.delete().catch(() => {}); } }); */ |