aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/command/superUser.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors/command/superUser.ts')
-rw-r--r--src/inhibitors/command/superUser.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/inhibitors/command/superUser.ts b/src/inhibitors/command/superUser.ts
new file mode 100644
index 0000000..28674ea
--- /dev/null
+++ b/src/inhibitors/command/superUser.ts
@@ -0,0 +1,21 @@
+import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib';
+
+export default class SuperUserInhibitor extends BushInhibitor {
+ public constructor() {
+ super('superUser', {
+ reason: 'superUser',
+ category: 'command',
+ type: 'post',
+ priority: 99
+ });
+ }
+
+ public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ if (command.superUserOnly) {
+ if (!client.isSuperUser(message.author)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}