aboutsummaryrefslogtreecommitdiff
path: root/events/interaction.js
diff options
context:
space:
mode:
authorame <[email protected]>2024-05-06 16:16:27 -0500
committerame <[email protected]>2024-05-06 16:16:27 -0500
commit9c8c0fd8126d13b5e48cdfe9c06d738567de6e78 (patch)
tree081152b5ee28a2c491d15bfbc4ecd5b9aded5404 /events/interaction.js
parent2afa151657062ce8df30c6ff64878d798189d8ec (diff)
awa
Diffstat (limited to 'events/interaction.js')
-rw-r--r--events/interaction.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/events/interaction.js b/events/interaction.js
index e384dcc..571d8d0 100644
--- a/events/interaction.js
+++ b/events/interaction.js
@@ -43,7 +43,7 @@ module.exports = {
await command.command.s_main(client,Discord,interaction);
} else if (interaction.isAutocomplete()){
-
+ console.log(interaction.user.id)
const focused = interaction.options.getFocused(true);
let command = global.s_commands.find(o => o.name === interaction.commandName)
if(interaction.options._subcommand!=null){
@@ -57,9 +57,14 @@ module.exports = {
const filtered = autocomplete.filter(choice => choice.startsWith(focused.value));
if(filtered.length>25)
filtered.length=25
+ try{
await interaction.respond(
filtered.map(choice => ({ name: choice, value: choice })),
);
+ } catch(e) {
+ console.log(e)
+ console.log("failed to send autocomplete")
+ }
}
})