Skip to content
Advertisement

Cannot figure out how to respond to choices with embeds

JavaScript

Basically, what I am trying to do is provide people with a guide of what to do with my bot but I cant figure out how to use choices and how to respond to a certain choice that gets selected (for example, someone selects β€˜data’ and gets a guide about their data)

Advertisement

Answer

Most of what you have typed in is correct actually. There’s just two mistakes. When you declare choices for an option, you have to give it a name property and a value property. The name property tells what the choice would look like on the app and the value property is what you would receive if the user selected the option. You also seem to have misunderstood that choices are not another option by itself. It just gives a few hardcoded choices for the user to select from if the command had a string option. So, there isn’t anything called as getChoice() So, your fixed code would look like this:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement