diff options
Diffstat (limited to 'src/inhibitors/noCache.ts')
-rw-r--r-- | src/inhibitors/noCache.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/inhibitors/noCache.ts b/src/inhibitors/noCache.ts new file mode 100644 index 0000000..61f0b3e --- /dev/null +++ b/src/inhibitors/noCache.ts @@ -0,0 +1,21 @@ +import { BushInhibitor } from '../lib/extensions/BushInhibitor'; +import { BushSlashMessage } from '../lib/extensions/BushInteractionMessage'; +import { BushMessage } from '../lib/extensions/BushMessage'; + +export default class noCacheInhibitor extends BushInhibitor { + constructor() { + super('noCache', { + reason: 'noCache', + type: 'all', + priority: 100 + }); + } + + public async exec(message: BushMessage | BushSlashMessage): Promise<boolean> { + if (this.client.isOwner(message.author)) return false; + for (const property in this.client.cache) { + if (property === undefined || property === null) return true; + } + return false; + } +} |