diff options
Diffstat (limited to 'src/inhibitors/checks/fatal.ts')
-rw-r--r-- | src/inhibitors/checks/fatal.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/inhibitors/checks/fatal.ts b/src/inhibitors/checks/fatal.ts new file mode 100644 index 0000000..6b62507 --- /dev/null +++ b/src/inhibitors/checks/fatal.ts @@ -0,0 +1,22 @@ +import { BushInhibitor, BushMessage, BushSlashMessage } from '@lib'; + +export default class FatalInhibitor extends BushInhibitor { + public constructor() { + super('fatal', { + reason: 'fatal', + type: 'all', + category: 'checks', + priority: 100 + }); + } + + public override async exec(message: BushMessage | BushSlashMessage): Promise<boolean> { + if (client.isOwner(message.author)) return false; + for (const property in client.cache.global) { + if (!client.cache.global[property as keyof typeof client.cache.global]) { + return true; + } + } + return false; + } +} |