Conversations with Bot Template Framework.

In part 2 of our series of articles about the Bot Template Framework, we created a menu in which you need to ask the user to provide feedback about the studio (menu button – “What you think”).

Therefore, in this article, we will consider the so-called “ask” block.

Ask block

This is a block that allows you to get information from the user and then save it to a variable. A distinctive feature of the block is its ability to receive text information that the user can send to the chat. The Ask block remembers the last question and waits for input from the user for the time that is set by the “conversation_cache_time” parameter in the Botman settings, in other words, the ask block uses the Conversation mechanism (you can read about it on the official Botman site).

And so, here is our ask block, which is executed when you click on the “What you think” button.

As you can see, we subscribe to the “feedback” keyword, send the message “Please type your feedback here” making it clear that the chatbot is waiting for text input from the user, and then saves the result to a variable under the same name “{{feedback}}” (variable is stored in userStorage).
Obviously, we need to thank the user for their efforts so we will add another text block and the “next” field in the “ask” block.

Bot Template Framework. Работа ask блока

Conclusion

Bot Template Framework offers a faster and more elegant solution for creating conversational scripts, in contrast to the Botman’s Conversation mechanism.

In the next article, we will consider in more detail the capabilities of the “ask” block.

The full chatbot script at the end of the third part:

 

Leave a Reply

Your email address will not be published. Required fields are marked *