basic remove auto complete differentiation

This commit is contained in:
Baipyrus 2024-04-04 20:29:01 +02:00
parent 1bfd25626a
commit 37343d25b8

View File

@ -26,9 +26,6 @@ async function listResponse(interaction) {}
/** @param {ChatInputCommandInteraction} interaction */ /** @param {ChatInputCommandInteraction} interaction */
async function infoResponse(interaction) {} async function infoResponse(interaction) {}
/** @param {AutocompleteInteraction} interaction */
async function removeAutocomplete(interaction) {}
/** /**
* @param {string} guildId * @param {string} guildId
* @param {string} focused * @param {string} focused
@ -50,6 +47,24 @@ async function keywordAutocomplete(guildId, focused) {
} }
/** @param {AutocompleteInteraction} interaction */ /** @param {AutocompleteInteraction} interaction */
async function removeAutocomplete(interaction) {
const { options } = interaction;
const type = options.getString('type');
switch (type) {
case 'keyword':
await keywordAutocomplete(interaction.guildId, options.getFocused());
break;
case 'response':
await responseAutocomplete(
interaction.guildId,
options.getFocused(),
options.getString('keyword')
);
break;
}
}
export const data = new SlashCommandBuilder() export const data = new SlashCommandBuilder()
.setName('response') .setName('response')