mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
16 lines
428 B
TypeScript
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);
|
|
}
|