Update loaders, handlers, and BotClient to use centralized logger: - CommandLoader.ts and EventLoader.ts - AutocompleteHandler.ts, CommandHandler.ts, ComponentInteractionHandler.ts - BotClient.ts Provides consistent formatting across all core library logging.
23 lines
683 B
TypeScript
23 lines
683 B
TypeScript
import { AutocompleteInteraction } from "discord.js";
|
|
import { AuroraClient } from "@/lib/BotClient";
|
|
import { logger } from "@lib/logger";
|
|
|
|
/**
|
|
* Handles autocomplete interactions for slash commands
|
|
*/
|
|
export class AutocompleteHandler {
|
|
static async handle(interaction: AutocompleteInteraction): Promise<void> {
|
|
const command = AuroraClient.commands.get(interaction.commandName);
|
|
|
|
if (!command || !command.autocomplete) {
|
|
return;
|
|
}
|
|
|
|
try {
|
|
await command.autocomplete(interaction);
|
|
} catch (error) {
|
|
logger.error(`Error handling autocomplete for ${interaction.commandName}:`, error);
|
|
}
|
|
}
|
|
}
|