# Base Command

BaseCommand is the very basis of Abrevio, it's an example of how a command should look like when it's been loaded by the CommandHandler.

There are various methods and properties that belong to it. The properties show what the command instance should look like once it's been constructed.

# Example of how to construct a BaseCommand correctly

(TS)

import { BaseCommand, AbrevioClient, AbrevioMessage } from "abrevio";

export default class extends BaseCommand {

    constructor(client: AbrevioClient) {

        super(client, {
            name: "test",
            aliases: ["t", "tst"],
            editable: true,
            description: "Tests new features!",
            usage: "?test",
            group: "utility",
            userPerms: ["MANAGE_MESSAGES"],
            clientPerms: ["ADMINISTRATOR"],
            adminOnly: false,
            ownerOnly: false,
            allUser: true,
            allClient: false,
            nsfw: false,
            enabled: true,
            cooldown: 3000, // 3000ms is 3 seconds
            typing: true
        });
    }

    public async exec(message: AbrevioMessage, { args, flags }) {

        message.util!.send("Works!");
    }
}

(JS)

const { BaseCommand } = require("abrevio");

module.exports = class TestCommand extends BaseCommand {

    constructor(client) {

        super(client, {
            name: "test",
            aliases: ["t", "tst"],
            editable: true,
            description: "Tests new features!",
            usage: "?test",
            group: "utility",
            userPerms: ["MANAGE_MESSAGES"],
            clientPerms: ["ADMINISTRATOR"],
            adminOnly: false,
            ownerOnly: false,
            allUser: true,
            allClient: false,
            nsfw: false,
            enabled: true,
            cooldown: 3000, // 3000ms is 3 seconds
            typing: true
        });
    }

    async exec(message, { args, flags }) {

        message.util.send("Works!");
    }
}