Files
blitzkit/packages/bot/src/events/interactionCreate/handlers/autocomplete.ts
T
2024-09-08 10:11:24 -05:00

16 lines
436 B
TypeScript

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