#How can i automaticly create a choice on a command option when a new variable is created ?

37 messages · Page 1 of 1 (latest)

pastel plinth
#

.

hollow mist
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

midnight cedar
#

are you talking about autocomplete?
example:

#

and by "new variable created", do you mean an element being added to an array?

paper pumiceBOT
pastel plinth
#

and then const test is created

#

and then an option in /set is created with the name of test

#

does it apply to autocomplete?

midnight cedar
#

wdym /create test?

#

Is that a command in your bot?

pastel plinth
#

just an example of an command

#

yep

#

/command test = creates variable test

#

and then the variable test turns into an option at /command1

midnight cedar
#

I don't really get what your question

pastel plinth
#

lemme do it again

midnight cedar
#

So you want to update it?

pastel plinth
#

wait

#

/create is a command

#

alr?

midnight cedar
#

yes

pastel plinth
#

and then with that command

#

i type /create test

#

and then the test turns into an variable

young ore
#

/create test should be adding something to an array, if I'm understanding correctly
Not making some variable, it makes no sense

pastel plinth
#

and the variable test turns into an choice at /set

midnight cedar
#

Can you share your code?

paper pumiceBOT
#

To share long code snippets use a service like gist, sourcebin, starbin, or similar instead of posting them as large code blocks.

cosmic pivot
#

/create should add to an array somewhere, /set should read from that array for the autocomplete

#

if that's what you want

pastel plinth
#

did the array thin

#

thing

#

but when i try to add dinoname to the array it says its undefined