import { Collection } from 'discord.js'; import { Command } from '../command/Command'; import { Client } from '../client/Client'; /** * @classdesc Stores loaded Commands in a Collection keyed by each Command's `name` property * @class CommandRegistry * @extends {external:Collection} */ export declare class CommandRegistry = Command> extends Collection { private readonly client; constructor(client: T); /** * Complete registration of a command and add to the parent * collection, erroring on duplicate names and aliases. * This is an internal method and should not be used. Use * `registerExternal()` instead * @private */ _registerInternal(command: V, reload?: boolean, external?: boolean): void; /** * Run the `init()` method of all loaded commands. * This is an internal method and should not be used * @private */ _initCommands(): Promise; /** * Register an external command and add it to the `.commands` * [collection]{@link external:Collection}, erroring on duplicate * names and aliases. External commands will be preserved when the * `reload` command is called. * * >**Note:** This is intended for Plugins to use to register external * commands with the Client instance. Under normal circumstances * commands should be added by placing them in the directory passed * to the `commandsDir` YAMDBF Client option * @param {Client} client YAMDBF Client instance * @param {Command} command The Command instance to be registered * @returns {void} */ registerExternal(command: Command): void; /** * Contains all [Command groups]{@link Command#group} * @type {string[]} */ readonly groups: string[]; /** * Finds a command by [name]{@link Command#name} or [alias]{@link Command#aliases} * @param {string} text The name or alias of the Command * @returns {Command} */ findByNameOrAlias(text: string): V; }