Using simple chatbot skills to build complex conversations is one of the basic concepts behind Activechat. Skills make it much easier to split your bot into smaller parts, which can be engaged independently, depending on the conversation context and the value that you want to bring to your chatbot user.
Every skill has an event that triggers that skill. If you look into any of the pre-defined skills in any of our chatbot templates you will notice that every skill starts with a CATCH block. This block is “listening” to events happening in the bot, and when a specific event is caught, the skill will start running.
So, to trigger a skill you need to fire an event. This can be achieved in multiple different ways.
Triggering skills with a “slash” command
The easiest way to trigger an event is with a “slash” command. Just type “/” followed by the event name in the chatbot conversation and this event will be triggered immediately. This is exactly how commands on Telegram work – you can build complex bot menus just by grouping different commands, so we decided to bring that feature to every other messenger that Activechat supports.
So, if you want to re-start your bot conversation, just type “/start” – it will trigger the “start” event which in turn will run the “start” skill. Or, if you have the skill to make restaurant reservations, and the skill name is “reservation”, you (or even your customers!) can type “/reservation” to start that skill.
Triggering skills with a SEND block
You can also send events that will trigger specific skills right from your bot conversation. This can come handy if you need to trigger the same skill multiple times from various parts of a complex conversation. Imagine a lead generation skill, for example, collecting data like user’s email or phone number and sending it to bot admin – definitely, there can be multiple situations in your conversation when this skill should be activated.
To trigger an event (and pass the conversation control to another skill) you can use the SEND block. It will generate the event with the specified name, and if there is a CATCH block somewhere in your bot that is “listening” to that event, it will obtain the control and start the skill.
Triggering skills with event buttons
For button-driven bots, Activechat makes it easy to start any skill right from the click of a button. There’s a specific button type ( we call it “event buttons”) that you can add to any TEXT, IMAGE or GALLERY block. When the user clicks this button, an event will be generated in Activechat, and the skill that starts with that event will get control over the conversation.
In the example above (taken from our Marketing agency chatbot template) the “start” skill contains a simple gallery-based menu, which is using event buttons to trigger specific chatbot skills.
Triggering skills with natural language intents
When you use NLP block to understand natural language, it will send the user’s message to the external NLP engine like Dialogflow. NLP block itself does not have any exits – instead, it will trigger one of the events, so that the conversation will continue from the skill that can handle that specific user’s intent. More on that in Natural language chatbots, though.
Triggering skills externally
There are specific skills that can be triggered by various external and internal events. For example, “_page_visit” skill will be triggered when you have Activechat tracking pixel installed on your website and one of your chatbot users is visiting a specific page on your website. Or, “_error” skill will be triggered when there’s an unhandled error in one of your blocks like JSON or Google Sheets.
For external events, consider changing order status in the e-commerce backend. When properly configured, this will trigger an “order_updated” event in Activechat, and your chatbot will be able to update the user about the current order status.
Triggering skills through the API
Advanced users can trigger events (and thus skills) in their chatbot through Activechat API. This feature is in closed beta now, contact us to apply.