@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
29 lines (28 loc) • 665 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommandHandler = void 0;
const util_1 = require("../util");
/**
* The command handler.
*/
class CommandHandler {
/**
* The directory of the commands.
*/
dir;
/**
* Creates a new instance of the command handler.
* @param dir The directory of the commands.
*/
constructor(dir) {
this.dir = dir;
}
/**
* Load the commands.
* @returns The loaded commands.
*/
async load() {
return (await (0, util_1.loadFiles)(this.dir)).map((x) => x.default ?? x);
}
}
exports.CommandHandler = CommandHandler;