Files
blitzkit/packages/bot/src/events/interactionCreate/handlers/autocomplete.ts
T
2026-02-18 16:36:12 -06:00

16 lines
428 B
TypeScript

import { AutocompleteInteraction, CacheType } from "discord.js";
import { commands } from "..";
export async function handleAutocomplete(
interaction: AutocompleteInteraction<CacheType>,
) {
const command = commands[interaction.commandName];
if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}
if (command.autocomplete) command.autocomplete(interaction);
}