nhandler
Version:
The easy to use, all-in-one command, event and component handler.
20 lines (19 loc) • 977 B
TypeScript
import { Component } from "../interfaces/Component";
import { AnyComponentInteraction } from "../util";
import { BaseHandler } from "./BaseHandler";
export declare class ComponentHandler extends BaseHandler {
components: Component[];
protected componentExists(name: string): boolean;
register(...components: Component[]): ComponentHandler;
/**
* registerFromDir automatically loads files & creates class instances in the directory specified.
* If recurse is true, it will also load commands from subdirectories.
* Auto-load commands need to have a __default__ export. Otherwise they will be ignored.
* @param dir The directory to load files from.
* @param recurse Whether to load files from subdirectories.
* */
registerFromDir(dir: string, recurse?: boolean): ComponentHandler;
private static isInstanceOfComponent;
runComponent(event: AnyComponentInteraction, metadata?: any): void;
private callErrorIfPresent;
}