How to build a chatbot rich in functionality