diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-23 20:17:13 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-23 20:17:13 -0400 |
commit | 5d33e1aa43444850084b4794b7d870e67dbb474e (patch) | |
tree | 3c98cbb49ce896d0ca3e65b13c5cded0f8580359 /src/inhibitors/command/restrictedChannel.ts | |
parent | fa9e2fea668f0f1aaa766288599393e6816c58bc (diff) | |
download | tanzanite-5d33e1aa43444850084b4794b7d870e67dbb474e.tar.gz tanzanite-5d33e1aa43444850084b4794b7d870e67dbb474e.tar.bz2 tanzanite-5d33e1aa43444850084b4794b7d870e67dbb474e.zip |
bunch of shit
Diffstat (limited to 'src/inhibitors/command/restrictedChannel.ts')
-rw-r--r-- | src/inhibitors/command/restrictedChannel.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/inhibitors/command/restrictedChannel.ts b/src/inhibitors/command/restrictedChannel.ts new file mode 100644 index 0000000..4578d95 --- /dev/null +++ b/src/inhibitors/command/restrictedChannel.ts @@ -0,0 +1,21 @@ +import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; + +export default class RestrictedChannelInhibitor extends BushInhibitor { + public constructor() { + super('restrictedChannel', { + reason: 'restrictedChannel', + category: 'command', + type: 'post', + priority: 10 + }); + } + + public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> { + if (command.restrictedChannels?.length && message.channel) { + if (!command.restrictedChannels.includes(message.channel.id)) { + return true; + } + } + return false; + } +} |