import { ISlashCommand, SlashCommandContext } from 'temporary-rocketlets-ts-definition/slashcommands'; import { IRocketletCommandBridge } from '../bridges/IRocketletCommandBridge'; import { RocketletAccessorManager } from './RocketletAccessorManager'; /** * The command manager for the Rocketlets. * * A Rocketlet will add commands during their `initialize` method. * Then once a Rocketlet's `onEnable` is called and it returns true, * only then will that Rocketlet's commands be enabled. */ export declare class RocketletSlashCommandManager { private readonly bridge; private readonly accessors; private rlCommands; private commands; private commandMappingToRocketlet; constructor(bridge: IRocketletCommandBridge, accessors: RocketletAccessorManager); /** * Adds a command to be registered. This will not register it with the * bridged system yet as this is only called on a Rocketlet's * `initialize` method which the Rocketlet might not be enabled. * * @param rocketletId the rocketlet's id which the command belongs to * @param command the command to add to the system */ addCommand(rocketletId: string, command: ISlashCommand): void; /** * Modifies an existing command. The command must either be your Rocketlet's * own command or a system command. One Rocketlet can not modify another * Rocketlet's command. * * @param rocketletId the rocketlet's id of the command to modify * @param command the modified command to replace the current one with */ modifyCommand(rocketletId: string, command: ISlashCommand): void; enableCommand(rocketletId: string, command: string): void; /** * Renders an existing slash command un-usable. * * @param rocketletId the rocketlet's id which is disabling the command * @param command the command to disable in the bridged system */ disableCommand(rocketletId: string, command: string): void; /** * Registers all of the commands for the provided rocketlet inside * of the bridged system which then enables them. * * @param rocketletId The rocketlet's id of which to register it's commands with the bridged system */ registerCommands(rocketletId: string): void; unregisterCommands(rocketletId: string): void; /** * Executes a Rocketlet's command. * * @param command the command to execute * @param context the context in which the command was entered */ executeCommand(command: string, context: SlashCommandContext): void; private registerCommand(rocketletId, info); /** * Determines whether the provided command is already defined in the Rocketlet system or not. * * @param command the command to check if it exists or not */ private isAlreadyDefined(command); private getRocketletCommand(rocketletId, command); }