Files
discord-rpg-concept/bot/lib/handlers/AutocompleteHandler.ts
2026-01-08 16:09:26 +01:00

23 lines
648 B
TypeScript

import { AutocompleteInteraction } from "discord.js";
import { AuroraClient } from "@/lib/BotClient";
/**
* 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) {
console.error(`Error handling autocomplete for ${interaction.commandName}:`, error);
}
}
}