export default class Command {
    constructor() {
        this.name = '';
        this.aliases = [];
        this.category = '';
        this.description = '';
        this.arguments = [];
        this.handler = null;
        this.async = false;
    }

    execute(args, context) {
        if (this.handler) {
            return this.handler(args, context);
        }
        throw new Error(`Command ${this.name} has no handler defined`);
    }

    getMetadata() {
        return {
            category: this.category,
            description: this.description,
            arguments: this.arguments,
            async: this.async
        };
    }

    getAllNames() {
        return [this.name, ...this.aliases];
    }
}