# Command Handler

A command handler is an instance which, when instantiated, loads all the files from the specified path (which should be files that export classes that extend BaseCommand), and puts them into a store which is accessible through CommandHandler#commands. Which have also been binded to an instance of AbrevioClient; for example, a client property on CommandHandler.

There are various properties that can be passed into the constructor, or properties that aren't constructable. Aswell as various methods which will interact with the set options; load them, handle them, find various elements from strings, etc.

# Example of how to construct a CommandHandler instance correctly

(TS)

// your main file, for example 'main.ts'

import { AbrevioClient, CommandHandler } from "abrevio";

const client: AbrevioClient = new AbrevioClient();

const handler: CommandHandler = new CommandHandler(client, {
    path: `${__dirname}/commands`, // Specified to the command directory located in a dir that 'main.ts' belongs to. For example, src/main.ts; __dirname is 'src'
    overrideDefaults: false,
    handleEdits: true,
    ignorePermissions: ["ADMINISTRATOR", "BAN_MEMBERS"],
    fetchMembers: true,
    blockBots: true,
    blockClient: true,
    prefixes: ["?", "!"]
})

(JS)

// your main file, for example 'main.js'

const { AbrevioClient, CommandHandler } = require("abrevio")

const client = new AbrevioClient();

const handler = new CommandHandler(client, {
    path: `${__dirname}/commands`, // Specified to the command directory located in a dir that 'main.js' belongs to. For example, src/main.js; __dirname is 'src'
    overrideDefaults: false,
    handleEdits: true,
    ignorePermissions: ["ADMINISTRATOR", "BAN_MEMBERS"],
    fetchMembers: true,
    blockBots: true,
    blockClient: true,
    prefixes: ["?", "!"]
})