commandbot
Version:
A framework that helps you create your own Discord bot easier.
59 lines (58 loc) • 1.9 kB
TypeScript
import { CommandManager } from "../../structures/CommandManager.js";
import { FunctionCommand, FunctionCommandInit } from "./FunctionCommand.js";
import { CommandType } from "../commandsTypes.js";
import { InputManager } from "../../structures/InputManager.js";
/**
* Initialization options of base guild-scoped command
* @interface
* @extends {FunctionCommandInit}
*/
export interface GuildCommandInit extends FunctionCommandInit {
/**
* Whether this command should be callable using private messages with bot
* @type {?boolean}
*/
dm?: boolean;
/**
* List of Guild IDs in which the command can be called
* @type {?Array<string>}
*/
guilds?: string[];
}
/**
* Guild-scoped executable command
* @class
* @extends {FunctionCommand}
*/
export declare class GuildCommand extends FunctionCommand {
/**
* List of Discord guild (server) IDs in which this command can be used
* @type {?Array<string>}
* @public
* @readonly
*/
readonly guilds?: string[];
/**
* If set to *false*, all interactions that get invoked from private/direct conversations (outside a guild) will result a PermissionError
* @type {boolean}
* @public
* @readonly
*/
readonly dm: boolean;
/**
* Guild-scoped command constructor
* @constructor
* @param {CommandManager} manager - command manager attached to this command
* @param {CommandType} type - command type
* @param {GuildCommandInit} options - command initialization options
*/
constructor(manager: CommandManager, type: CommandType, options: GuildCommandInit);
/**
* Invoke the command
* @param {InputManager} input - input data
* @returns {Promise<void>}
* @public
* @async
*/
start(input: InputManager): Promise<void>;
}