aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors/commands')
-rw-r--r--src/inhibitors/commands/globalDisabledCommand.ts20
-rw-r--r--src/inhibitors/commands/guildDisabledCommand.ts22
2 files changed, 0 insertions, 42 deletions
diff --git a/src/inhibitors/commands/globalDisabledCommand.ts b/src/inhibitors/commands/globalDisabledCommand.ts
deleted file mode 100644
index 9a750cc..0000000
--- a/src/inhibitors/commands/globalDisabledCommand.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib';
-
-export default class DisabledGuildCommandInhibitor extends BushInhibitor {
- public constructor() {
- super('disabledGlobalCommand', {
- reason: 'disabledGlobal',
- type: 'pre',
- priority: 4
- });
- }
-
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
- if (message.author.isOwner()) return false;
- if (client.cache.global.disabledCommands?.includes(command?.id)) {
- client.console.debug(`disabledGlobalCommand blocked message.`);
- return true;
- }
- return false;
- }
-}
diff --git a/src/inhibitors/commands/guildDisabledCommand.ts b/src/inhibitors/commands/guildDisabledCommand.ts
deleted file mode 100644
index ee798e5..0000000
--- a/src/inhibitors/commands/guildDisabledCommand.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib';
-
-export default class DisabledGuildCommandInhibitor extends BushInhibitor {
- public constructor() {
- super('disabledGuildCommand', {
- reason: 'disabledGuild',
- type: 'pre',
- priority: 3
- });
- }
-
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
- if (!message.guild || !message.guild) return false;
- if (message.author.isOwner() || message.author.isSuperUser()) return false; // super users bypass guild disabled commands
-
- if ((await message.guild.getSetting('disabledCommands'))?.includes(command?.id)) {
- client.console.debug(`disabledGuildCommand blocked message.`);
- return true;
- }
- return false;
- }
-}