UNPKG

commandbot

Version:

A framework that helps you create your own Discord bot easier.

68 lines (67 loc) 1.9 kB
import { SubCommandGroupObject } from "../structures/apiTypes.js"; import { APICommandInit, Command } from "./base/Command.js"; import { ChatCommand } from "./ChatCommand.js"; import { SubCommand, SubCommandInit } from "./SubCommand.js"; /** * Intialization options of subcommand group * @interface * @extends {APICommandInit} */ export interface SubCommandGroupInit extends APICommandInit { /** * Command description * @type {?string} */ description?: string; } /** * Group of subcommands * @class */ export declare class SubCommandGroup extends Command { /** * Group members (children) * @type {Array<SubCommand>} * @private * @readonly */ private readonly _children; /** * Group parent command * @type {ChatCommand} * @public * @readonly */ readonly parent: ChatCommand; /** * Group description (default: "No description") * @type {string} * @public * @readonly */ readonly description: string; /** * @constructor Group constructor * @param {ChatCommand} parent - group parent command * @param {SubCommandGroupInit} options - initialization options */ constructor(parent: ChatCommand, options: SubCommandGroupInit); /** * List of subcommands attached to this group * @type {Array<SubCommand>} * @readonly */ get children(): readonly SubCommand[]; /** * Attach a subcommand to this group * @param {SubCommandInit} options - subcommand initialization options * @returns {SubCommand} A computed {@link SubCommand} object * @public */ append(options: SubCommandInit): SubCommand; /** * @returns {SubCommandGroupObject} Discord API object * @public */ toObject(): SubCommandGroupObject; }