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/slowmode.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/slowmode.ts')
-rw-r--r-- | src/commands/moderation/slowmode.ts | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/commands/moderation/slowmode.ts b/src/commands/moderation/slowmode.ts index e657b76..641f88e 100644 --- a/src/commands/moderation/slowmode.ts +++ b/src/commands/moderation/slowmode.ts @@ -1,4 +1,15 @@ -import { BushCommand, type CommandMessage, type OptArgType, type SlashMessage } from '#lib'; +import { + Arg, + BushCommand, + clientSendAndPermCheck, + emojis, + format, + humanizeDuration, + userGuildPermCheck, + type CommandMessage, + type OptArgType, + type SlashMessage +} from '#lib'; import assert from 'assert'; import { Argument } from 'discord-akairo'; import { ApplicationCommandOptionType, ChannelType, PermissionFlagsBits } from 'discord.js'; @@ -36,8 +47,8 @@ export default class SlowmodeCommand extends BushCommand { slash: true, channel: 'guild', clientPermissions: (m) => - util.clientSendAndPermCheck(m, [PermissionFlagsBits.ManageChannels, PermissionFlagsBits.EmbedLinks], true), - userPermissions: (m) => util.userGuildPermCheck(m, [PermissionFlagsBits.ManageMessages]) + clientSendAndPermCheck(m, [PermissionFlagsBits.ManageChannels, PermissionFlagsBits.EmbedLinks], true), + userPermissions: (m) => userGuildPermCheck(m, [PermissionFlagsBits.ManageMessages]) }); } @@ -58,11 +69,11 @@ export default class SlowmodeCommand extends BushCommand { args.channel.type !== ChannelType.GuildVoice && !args.channel.isThread() ) - return await message.util.reply(`${util.emojis.error} <#${args.channel.id}> is not a text or thread channel.`); + return await message.util.reply(`${emojis.error} <#${args.channel.id}> is not a text or thread channel.`); args.length = typeof args.length === 'string' && !(['off', 'none', 'disable'] as const).includes(args.length) - ? await util.arg.cast('duration', message, args.length) + ? await Arg.cast('duration', message, args.length) : args.length; const length2: number = (['off', 'none', 'disable'] as const).includes(args.length) || args.length === null ? 0 : args.length; @@ -71,11 +82,11 @@ export default class SlowmodeCommand extends BushCommand { .setRateLimitPerUser(length2 / 1000, `Changed by ${message.author.tag} (${message.author.id}).`) .catch(() => {}); if (!setSlowmode) - return await message.util.reply(`${util.emojis.error} There was an error changing the slowmode of <#${args.channel.id}>.`); + return await message.util.reply(`${emojis.error} There was an error changing the slowmode of <#${args.channel.id}>.`); else return await message.util.reply( - `${util.emojis.success} Successfully changed the slowmode of <#${args.channel.id}> ${ - length2 ? `to ${util.format.input(util.humanizeDuration(length2))}` : '**off**' + `${emojis.success} Successfully changed the slowmode of <#${args.channel.id}> ${ + length2 ? `to ${format.input(humanizeDuration(length2))}` : '**off**' }.` ); } |