/** * Command Manager - Handles slash command registration and execution * * Registers commands per-bot (as application commands) and handles * command interactions by routing them to the appropriate handler. */ import { type AutocompleteInteraction, type ChatInputCommandInteraction } from "discord.js"; import type { CommandManagerOptions, ICommandManager, SlashCommand } from "./types.js"; /** * CommandManager handles slash command registration and execution. * * Commands are registered per-bot using Discord's REST API. Each agent's * bot has its own set of commands. * * @example * ```typescript * const commandManager = new CommandManager({ * agentName: 'my-agent', * client: discordClient, * botToken: process.env.BOT_TOKEN, * sessionManager, * getConnectorState: () => connector.getState(), * }); * * // Register commands after client is ready * await commandManager.registerCommands(); * * // Handle interactions in your interaction handler * client.on('interactionCreate', async (interaction) => { * if (interaction.isChatInputCommand()) { * await commandManager.handleInteraction(interaction); * } * }); * ``` */ export declare class CommandManager implements ICommandManager { private readonly agentName; private readonly client; private readonly botToken; private readonly sessionManager; private readonly getConnectorState; private readonly logger; private readonly commands; private readonly errorHandler; private readonly commandActions?; private readonly commandRegistration; constructor(options: CommandManagerOptions); /** * Register all commands with Discord * * Uses the Discord REST API to register application commands. * Commands are registered globally for the bot application. * Includes retry logic for transient failures. */ registerCommands(): Promise; /** * Handle an incoming command interaction * * Routes the interaction to the appropriate command handler. * Provides user-friendly error messages on failure. */ handleInteraction(interaction: ChatInputCommandInteraction): Promise; handleAutocomplete(interaction: AutocompleteInteraction): Promise; /** * Get all registered commands */ getCommands(): ReadonlyMap; } //# sourceMappingURL=command-manager.d.ts.map