-
-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Message collector to object "wizard" #1794
Comments
@AmiterCodes this would be greatly enhanced by the latest version's ability to send buttons. |
I wonder if there's a simple way we can implement the dialogtemplate to create decision trees, implement buttons/list message and grab media while we're at it. I checked out survey.js but it's designed to be more visual and there's a lot of limitations here that don't exist there. So far I can see the following types that can be implemented:
|
r.e validation: There can be multiple layers of validation, and even multiple regex validations so maybe best to make that an array of validators |
https://github.com/TomFrost/jexl https://www.npmjs.com/package/object-quiz |
Some progress on this: |
I think to get started on this (albeit a year late) it's best to limit the scope to whatever can be responded to via buttons (i.e not taking in media, location, contacts, etc.) as that would require maintaining state of the quiz between restarts |
basically a feature that should probably in a utils file that abstracts dialog with a user and automatic command handling,
it would look like this:
User: "#startPoll"
Bot: "What drink is your favorite?
options are: Coca Cola, Water, Pepsi
please reply with your requested option"
User (replying): "Coca Cola"
Bot: "I see you like Coca Cola, Please pick your favorite artist from the options below
options: Eminem, Cardi, Kanye
default: 'Eminem', use , to skip"
User (replying): ","
Bot: "Please reply with your email"
User (replying): "something@something"
Bot: "that email is not valid
Please reply with your email"
User (replying): "something@something.com"
Bot: "I've seen enough, thanks for your cooperation"
at the end of the conversation it will return a map object that looks like this:
{
"favDrink": "Coca Cola",
"favArtist": "Eminem",
"Email": "something@something.com"
}
it will be used like the following:
The text was updated successfully, but these errors were encountered: