mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 21:26:08 +01:00
15 lines
439 B
TypeScript
15 lines
439 B
TypeScript
import { AutocompleteInteraction, CacheType } from 'discord.js';
|
|||
|
|
import { commands } from '../index.js';
|
||
|
|
|
||
|
|
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);
|
||
|
|
}
|