superscriptjs / superscript

A dialogue engine for creating chat bots
http://superscriptjs.com
MIT License
1.65k stars 209 forks source link

let bot say first #353

Closed zwj277567959 closed 7 years ago

zwj277567959 commented 7 years ago

how can I make my bot say something as soon as I jump into a new topic

loganwilliams commented 7 years ago

I'm also interested in how to do this. It's been referenced in a few previous issues, but the answers haven't. #24 #109

mariusursache commented 7 years ago

You can init the bot with something that sends a __open__ first message to user (or do that in pre topic. Then, here's an example of self-started conversation:

// Learn user's first name
> topic:system:keep onboarding_01_id_name

  + __open__
  - What is your first name?

    + [my] [first] [name] [is] *1
    - <cap1>... That's a nice name. ^save(firstName,<cap1>)

< topic
zwj277567959 commented 7 years ago

thank you