Walkthrough Level: Beginner
People can’t get enough of celebrities these days -- we read the flashy tabloids, watch entertainment TV, and follow our favorite stars on social media. Now, with bots, we can even talk to them! ... or bot-versions of them, at least.
In this Character Bot walkthrough, we’ll share how to make a bot for everyone’s favorite Science Guy, Bill Nye!
With this walkthrough, which you can access through the "Character Bot" theme when you click + New Bot, we’ll be covering different trigger variations we’ve seen used successfully within our bots:
The Catch-All Trigger:
The first trigger we see is the catch-all (
*), which we use to capture all user input that does not match other triggers.
[Dexter Error] This bot couldn’t figure out how to respond.
As a general rule of thumb, we want to make sure that any catch-all response will help guide the user back to a stream of conversation that your bot can handle. That's why we’ve also included the buttons shortcode after introducing Bill Nye Bot:
We will create three triggers to match the button labels in the shortcode:
^buttons(Is climate change real?, Why do you love science?, Do we only use 10% of our brain?)
Stars in Triggers:
Just like with the catch-all asterisk above, when we use this
* wildcard symbol in a trigger, we expect the user input to have text whenever the asterisk symbol appears. This is true for every appearance of the asterisk symbol. That means that this trigger will not be matched when a user that has typed
10% brain, but will match against the following types of user inputs:
- Do we only use 10% of our brain?
- Why do we only use 10% of our brain?
- I don’t think I use 10% of my brain.
- You definitely use more than 10% of your brain.
Optional Brackets in Triggers:
In this trigger, we combine the
* concept from above with a new
[ ] bracket syntax for optional text. When a trigger includes optional text, the user input may or may not include the text inside the brackets. For example, the trigger will match the following user inputs:
- Is climate change real?
- Tell me if climate change is real.
- Are you sure climate change is real?
- I don’t believe climate change is real.
Alternatives in Triggers:
For this trigger, we make use of parentheses
( ) and pipes
| to introduce the concept of alternatives choices. Here, user input is required to have at least one of the words separated by pipes between the parentheses -- in this case:
like, love, support, defend, or
promote. The trigger will match any of the following user inputs:
- Why do you like science?
- Why do you love science?
- Why do you support science?
Wildcards with Stars in Triggers
Now, let’s combine a couple of the concepts we’ve addressed above, namely the
[ ] optional brackets and the
* wildcard asterisk to create an optional catch-all.
This is a popular paradigm we’ve seen used to handle any user input that contains a specific word or phrase, like the word
science as shown in this example. This example trigger will handle user input like:
- I love science!
- Tell me more about science.
- Science is my favorite subject!
Getting Into Character
Character bots can be fun ways for brands to engage with customers. They can help provide your brand with a viral marketing boost, improve brand awareness, or even help sell products through the chatbot dialogue. Consider making a character bot for a mascot or character associated with your brand, but don’t forget to create responses that show off your brand’s unique personality!
If you’ve made a unique character bot, whether for a brand initiative or for your own personal enjoyment, send it over to us! We’d love to get to know your bot.