Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Using Drop-Down Prompts with API?

1477450490

Edited 1477450612
I'm trying to call a dropdown prompt using the API. Is this possible or only limited to macros and normal chat commands? Here what I'm trying right now, but it only outputs the string to chat: sendChat(msg.who, '?{Name of Query|Option1|Option2|Option3|Option4|Option5}'); Any tips would be appreciated. Thanks! Note: I'm using the character replacement for the ?, but it changed to the question mark when I posted.
1477450989

Edited 1477451183
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Not straight from an API message, you can output an API command button that will pop-up the roll query when clicked tho. Take a look at the outputConfig function in  easyexperience for an example. I'd actually post an example, but on my phone. Edit: alternatively, outputting a menu of command buttons may do what you want as well.
Thanks, Scott! That worked for me.
1477461018
Lithl
Pro
Sheet Author
API Scripter
If you think about it, it makes perfect sense that queries don't work with sendChat. The message being sent is being sent by the API, not by a user. It would be a little bit silly to try and give a prompt to the API itself. =)
1477483727

Edited 1477484433
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Happy to help Catlin. And, yeah it does Brian  Vince . It's still disappointing as there are many things that could be streamlined if you could. It'd be nice if you could specify a player ID as the "from" part of sendchat to make the message actually come from a given person, but I doubt that'll ever happen. Edit: thanks to The Aaron for pointing out (out of forum) that I somehow can't read names on the forums. This is what I get for forum checking right out of bed.