import { ZenithClient } from '../Client'; import * as path from 'path'; export class BaseModule { public client: ZenithClient; public options: any; public directory: string; public file: string; public handler: any; public name: string; public disabled: boolean; constructor(client, handler, file, directory, options) { this.client = client; this.options = options; this.directory = directory; this.file = file; this.handler = handler; this.disabled = options.disabled || false; this.name = options.Name; } get path() { return path.join(this.directory, ...this.file); } async reload() { const module = this.handler.load(this.directory, this.file); await module.init(); return module; } async delete() { await this.handler.delete(this); } async enable() { this.disabled = false; } }