diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-29 21:16:30 -0400 |
|---|---|---|
| committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-29 21:16:30 -0400 |
| commit | 1c6d451ffd63f9805b978e8565807e8a6b528681 (patch) | |
| tree | 97ae6b3746b42ed21eb0fc3a3888bbfca36a1806 /src/commands/moderation | |
| parent | 7990abdb511eeec2a114b124a3628b10bfefc342 (diff) | |
| download | tanzanite-1c6d451ffd63f9805b978e8565807e8a6b528681.tar.gz tanzanite-1c6d451ffd63f9805b978e8565807e8a6b528681.tar.bz2 tanzanite-1c6d451ffd63f9805b978e8565807e8a6b528681.zip | |
added a rudimentary automod, fixed a bunch of stuff, added some more listeners
Diffstat (limited to 'src/commands/moderation')
| -rw-r--r-- | src/commands/moderation/slowmode.ts | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/commands/moderation/slowmode.ts b/src/commands/moderation/slowmode.ts index f9ffbab..9b0d300 100644 --- a/src/commands/moderation/slowmode.ts +++ b/src/commands/moderation/slowmode.ts @@ -1,6 +1,6 @@ -import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { Argument, Constants } from 'discord-akairo'; -import { TextChannel, ThreadChannel } from 'discord.js'; +import { BushCommand, BushMessage, BushNewsChannel, BushSlashMessage, BushTextChannel, BushThreadChannel } from '@lib'; +import { Argument } from 'discord-akairo'; +import { NewsChannel, TextChannel, ThreadChannel } from 'discord.js'; export default class SlowModeCommand extends BushCommand { public constructor() { @@ -25,8 +25,7 @@ export default class SlowModeCommand extends BushCommand { }, { id: 'channel', - type: Constants.ArgumentTypes.CHANNEL, - match: Constants.ArgumentMatches.PHRASE, + type: 'channel', prompt: { start: 'What channel would you like to change?', retry: '{error} Choose a valid channel.', @@ -51,12 +50,18 @@ export default class SlowModeCommand extends BushCommand { public async exec( message: BushMessage | BushSlashMessage, - { length, channel }: { length: number | 'off' | 'none' | 'disable'; channel: TextChannel | ThreadChannel } + { + length, + channel + }: { + length: number | 'off' | 'none' | 'disable'; + channel: TextChannel | ThreadChannel | BushTextChannel | BushNewsChannel | BushThreadChannel | NewsChannel; + } ): Promise<unknown> { if (message.channel.type === 'DM') return await message.util.reply(`${util.emojis.error} This command cannot be run in dms.`); - if (!channel) channel = message.channel as ThreadChannel | TextChannel; - if (!(channel instanceof TextChannel) || !(channel instanceof ThreadChannel)) + if (!channel) channel = message.channel; + if (!(channel instanceof TextChannel) && !(channel instanceof ThreadChannel)) return await message.util.reply(`${util.emojis.error} <#${channel.id}> is not a text or thread channel.`); if (length) { length = |
