From 6ad8fd1039c87e5a965df09a0ce83d25e88d72ca Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 11 Mar 2023 11:23:18 +0100 Subject: [PATCH] add type --- src/events/interactions/interactionCreate.ts | 6 +++++- src/modules/client.ts | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/events/interactions/interactionCreate.ts b/src/events/interactions/interactionCreate.ts index 41c9fe9..b2c0878 100644 --- a/src/events/interactions/interactionCreate.ts +++ b/src/events/interactions/interactionCreate.ts @@ -35,7 +35,11 @@ export default (interaction: Interaction, client: Client) => { return console.error(loc.get("e_interacreate_no_command")); } - return command.autocomplete(interaction); + if (command.autocomplete) { + return command.autocomplete(interaction); + } + + return; } default: diff --git a/src/modules/client.ts b/src/modules/client.ts index 34ec00c..769687f 100644 --- a/src/modules/client.ts +++ b/src/modules/client.ts @@ -79,6 +79,8 @@ declare module "discord.js" { data: SlashCommandBuilder; /** How the command interact */ interaction: (interaction: CommandInteraction, client: Client) => unknown; + /** Autocomplete logic */ + autocomplete: undefined | ((interaction: AutocompleteInteraction) => unknown); } >; };