RocketChat / hubot-natural

Natural Language Processing Chatbot for RocketChat
https://open.rocket.chat/channel/hubot-natural
MIT License
144 stars 44 forks source link

Collect Form Data #16

Open diegodorgam opened 6 years ago

diegodorgam commented 6 years ago

THe bot must be able to collect information through the chat, like if the user was filling a form, but the data must come trough the chat, and be validated by the bot, befores is saved or sent somewhere. Eg:

user > Hi I want to register
bot > What's is your name?
user > my name is John Doe
bot > thanks mr. John Doe. What is your e-mail address?
user > is john@doe.com
bot > Sorry John Doe, that's not a valid e-mail address. Please answer with a valid e-mail address or type 'cancel'
user > my e-mail is johndoe@gmail.com
bot > thank's Mr. John Doe, you registered into our newsletter with the e-mail address 
johndoe@gmail.com. Please confirm your e-mail by clicking in the link I sent you.

Validation must come to all sorts of fields, text, date, e-mail and stuff. One good way to do this is to identify the information inside the message and run it against a RegExp pattern.