Loading slash choices from file
Hello, I want to create a bot that can load a big number of slash command choices from a JSON or CSV file, add them into a collection and automatically add them to a slash command on run. How can I achieve something like that? So far I've only seeing people hard-coding choices in their bots, so if this is possible then I'd like to know how.
6 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
discord.js 14.7.1 and node 19.6.0
I'll check this out, thanks
Do you know how can I truncate my list of choices to display based on what text the user has entered into the command so far?
so it would actually be autocomplete
oh true, sorry
do you know how to prevent the app from crashing when no text was entered yet? because then it just crashes since it pulls the whole list and crashes since it's over 25
Array.prototype.slice()
The slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the index of items in that array. The original array will not be modified.
ohhh, thank you
sorry for needing help with such basic stuff, i've been rusty