Topics

Organize your dialogue into logical sections with topics. For example, your bot may have faq, onboarding, and welcome topics. Some important rules about your users and topics:

Add new topics by hitting the button and giving it a name:

Creating and renaming a topic

You write triggers inside this topic as you normally would. Triggers and responses that you write within this topic will only get matched by your bot if your user is inside the topic already. Which leads us to…

Transitioning Between Topics

Just like how triggers cause the bot to send a response, triggers can also cause a user to move from being inside of one topic to another—called a transition. A transition looks like {topic=next-topic-name} and belongs at the end of a response:

+ help
- How can I help you? {topic=help}

In the example above, the next time somebody sends a message to the bot, it will look for triggers in the "help" topic.

The Default Topic

Every bot starts with a default topic that cannot be removed. This topic is special for two reasons:

  1. this is where every new user of your bot starts
  2. if your user is in another topic but there is no matching trigger, the bot looks inside the default topic for a matching trigger

This makes the default topic the best place to put triggers for hi/hello/help, as well as a catch-all trigger with a broad, generic response.

We recommend most simple bots stick with just using the default topic.
To delete an unnecessary topic, hover over the topic name until you see a icon. The default topic cannot be deleted. Be careful when deleting topics, this can’t be undone!

Topic Redirects with Trigger Redirects

A common paradigm to use in your botscript is to combine a topic redirect with a trigger redirect.

+ (monday|tuesday|wednesday|thursday|friday)
- You selected <star> this week. {topic=week} {@ weekday}
 
+ (saturday|sunday)
- You selected <star> this week. {topic=week} {@ weekend}

In this scenario when the user types "Monday", we will match against the "monday" trigger in the current topic.

This prompts us to redirect to the "week" topic, find a trigger called "weekday" in the "week" topic and concatenate that response to the end of You selected <star> this week to create the final message the user receives back from the bot. The user will remain in the week topic.