Files
blitzkit/packages/bot/src/events/interactionCreate/handlers/autocomplete.ts
T

15 lines
428 B
TypeScript
Raw Normal View History

2026-02-18 16:36:12 -06:00
import { AutocompleteInteraction, CacheType } from "discord.js";
import { commands } from "..";
2023-06-25 02:32:56 +00:00
2024-09-08 10:11:24 -05:00
export async function handleAutocomplete(
2023-06-25 02:32:56 +00:00
interaction: AutocompleteInteraction<CacheType>,
) {
2026-02-18 16:36:12 -06:00
const command = commands[interaction.commandName];
2023-06-25 02:32:56 +00:00
if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}
if (command.autocomplete) command.autocomplete(interaction);
}