diff options
Diffstat (limited to 'src/inhibitors/command/owner.ts')
-rw-r--r-- | src/inhibitors/command/owner.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/inhibitors/command/owner.ts b/src/inhibitors/command/owner.ts new file mode 100644 index 0000000..22ac913 --- /dev/null +++ b/src/inhibitors/command/owner.ts @@ -0,0 +1,21 @@ +import { BushCommand, BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; + +export default class OwnerInhibitor extends BushInhibitor { + public constructor() { + super('owner', { + reason: 'owner', + category: 'command', + type: 'post', + priority: 100 + }); + } + + public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> { + if (command.ownerOnly) { + if (!client.isOwner(message.author)) { + return true; + } + } + return false; + } +} |