Autocomplete
Anyone knows how can i do this ? in my autocomplete im limited to 25 choices and if the user dont type anything theres just an error
20 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
mine
Because you don't response if user didn't type anything
why in that command that i showed it does?
is there anything i can do to make it like that?
Response to autocomplete interaction
If you need help with your code then show it
last one is interactioncreate.js
You should splice first 25 elements
Sorry, splice
all good
after i splice it , how do i proceed?
kk , so i gotta do
choices.splice(0, 24)
?
ok , thxdidnt work
To do
array.filter().splice(25)
?oh , sorry
tested the splice but only the options after 25th showed up, then tested slice and only the choices before 25 showed up
used only 1 of them
but i did it
look at the screenshot
i mean , im trynna gett an option that is after the position of 25 in the array but i cant
not an option , a choice
like this ?
const filtered = choices.filter(choice => choice.startsWith(focusedValue).toLowerCase()).slice(0, 25);
any example of it ? i didnt get it
focusedValue.toLowerCase()
?
idk if the error is cause of the case sensitiveeven with L didnt work
y but not even with the Caps L ist working