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