Multiple answer to a question - Chatbot | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Multiple answer to a question - Chatbot

The code by https://code.sololearn.com/WusW8nU0IBwA/#js. Line 111 '(smsg="Hello your assistant is here", k=smsg)'. How to add more than one message? For the return to be random, multiple answer to a question... Ex: >isInArray(hello, lastmsg)==true?(smsg="Hello your assistant is here", "Hello2" , "Hello3" , k=smsg): After> user: Hi bot: Hello your assistant is here user: Hi bot: Hello2 user: Hi bot: Hello3 loop Thanks!

27th Dec 2017, 5:32 AM
Will.R
Will.R - avatar
1 Answer
+ 1
modified code, just a basic example right in place, not a fancy and integrated solution but that's the way you can adapt it easily https://code.sololearn.com/WA2jarL6d97b/#javascript Update: changed the code to be more generic
28th Dec 2017, 3:09 PM
thex
thex - avatar