aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/command/restrictedGuild.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors/command/restrictedGuild.ts')
-rw-r--r--src/inhibitors/command/restrictedGuild.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/inhibitors/command/restrictedGuild.ts b/src/inhibitors/command/restrictedGuild.ts
new file mode 100644
index 0000000..7ec6926
--- /dev/null
+++ b/src/inhibitors/command/restrictedGuild.ts
@@ -0,0 +1,21 @@
+import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib';
+
+export default class RestrictedGuildInhibitor extends BushInhibitor {
+ public constructor() {
+ super('restrictedGuild', {
+ reason: 'restrictedGuild',
+ category: 'command',
+ type: 'post',
+ priority: 5
+ });
+ }
+
+ 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;
+ }
+}