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

15 lines
430 B
TypeScript
Raw Normal View History

2023-06-25 02:32:56 +00:00
import { AutocompleteInteraction, CacheType } from 'discord.js';
2023-07-11 19:54:57 +00:00
import { commands } from '..';
2023-06-25 02:32:56 +00:00
export default 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);
}