UNPKG

commandbot

Version:

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

61 lines (60 loc) 2.14 kB
import { CommandManager } from "../../structures/CommandManager.js"; import { GuildCommand } from "./GuildCommand.js"; import { PermissionCommand, PermissionCommandInit } from "./PermissionCommand.js"; import { CommandType } from "../commandsTypes.js"; import { InputManager } from "../../structures/InputManager.js"; /** * Initialization options of base guild-scoped command with attached permisisions * @interface * @extends {PermissionCommandInit} */ export interface PermissionGuildCommandInit extends PermissionCommandInit { /** * 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 with permissions attached * @class * @extends {PermissionCommand} * @implements {GuildCommand} */ export declare class PermissionGuildCommand extends PermissionCommand implements GuildCommand { /** * 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, executable, permissions command constructor * @constructor * @param {CommandManager} manager - command manager attached to this command * @param {CommandType} type - command type * @param {PermissionGuildCommandInit} options - command initialization options */ constructor(manager: CommandManager, type: CommandType, options: PermissionGuildCommandInit); /** * Invoke the command * @param {InputManager} input - input data * @returns {Promise<void>} * @public * @async */ start(input: InputManager): Promise<void>; }