From 6b672625ca5c01bac02256cd54a9b9c670199df0 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 11 Mar 2023 08:01:09 +0100 Subject: [PATCH] WIP: add interaction handling --- src/events/interactions/interactionCreate.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/events/interactions/interactionCreate.ts b/src/events/interactions/interactionCreate.ts index 1e1e5b5..41c9fe9 100644 --- a/src/events/interactions/interactionCreate.ts +++ b/src/events/interactions/interactionCreate.ts @@ -29,6 +29,15 @@ export default (interaction: Interaction, client: Client) => { return modal.interaction(interaction, client); } + case InteractionType.ApplicationCommandAutocomplete: { + const command = client.commands.list.get(interaction.commandName); + if (!command) { + return console.error(loc.get("e_interacreate_no_command")); + } + + return command.autocomplete(interaction); + } + default: break; }