Build a Facebook Messenger Chatbot in 5 Steps in Just 5 Minutes
Jan 17, 2018
Last year I wrote a post called “I Made a Facebook Chatbot (And You Can, Too)” where I laid out the case for chatbots as an outreach and engagement tool in international development. To recap, here’s why:
- 1.3 billion active users, a large and growing number of whom are in developing countries, as DAI’s Digital Insights work has highlighted. That’s hard to ignore.
- Low data usage puts the tool (and services riding on it) in a category of communication that’s even cheaper than texting in many instances, especially when users are connected to WiFi.
- Natural language and conversation may be easier for some people to use than a GUI interface (to take it a step further, this might be an argument in favor of IVR, but I digress).
- This one is new, but maybe the most relevant to you if you’re reading this: they’re super easy to build!
I also featured Siti, a very simple Facebook Messenger chatbot bot I built using Chatfuel, and gave readers some really bad directions for making their own bot. Since then I’ve upgraded my chatbot skills significantly: from Apprentice to Wizard, and I’m eager to share a bit of the magic with the world.
So, here’s how to make your own chatbot in five easy steps. Follow along and make your own.
1a. Have a Facebook Account
Admittedly, only 2.06 billion of the 7.6 billion people on Earth actually have a Facebook account so if you’re among the 27 percent who do, you’ve cleared the first hurdle. If you’re among the 63 percent without one and want to change that, point your browser to the following web site: Facebook.com. Assuming you’re among the 27 percent, the clock stays at 5:00 minutes.
1b. Make a Facebook Page to House Your Bot
(This doesn’t count as step 2 because it’s just an extension of the previous step.) If you’re on your newsfeed, see the ‘Create:Page’ button in the lower right, or just visit facebook.com/pages/create. Choose a page type, give your page a name. Also, choose a featured photo. It should only take about 30 seconds to get it up and running, so the clock’s at 4:30.
2. Launch Chatfuel
Go to Chafuel.com and login using your Facebook account. Select the option to ‘Create a new bot.’ This will open a new bot with a sample sequence in place. This also should only take you about 30 seconds, so we’re down to 4:00 on the clock.
3. Connect Bot to Your Facebook Page
You’ll see a button in the upper right to ‘Connect to Facebook.’ Click it, then select the page you just created. This gives the bot a home on Facebook, and you can use the Facebook page, but you don’t have to. Depending on how you’re using the bot, a user can access it directly from Messenger or through your new Facebook page. This probably takes 15 seconds, so there should still be about 3:45 on the clock.
4. Build Your Bot
On the right, you have a vertical menu of options. You’ll only need ‘Automate’ to start. The left half of the screen includes your blocks, groups of blocks, and sequences. The right side is the edit pane for the content of the active block or sequence. As of the writing of this post—on January 17, 2018—the bot comes equipped with a sample Welcome Message, Default Answer, Sequence, and Group of Content Blocks. These will change over time as features evolve, of course.
Look through each of the default blocks to get a sense of how they’re built and how they’re connected. Note that users of your bot will always begin with the Welcome Message, but unless you direct them back to this block, they’ll never see it again, so don’t put your main content here. Sequences are more complex, so initially stick with blocks (you can delete the default sequence).
If you choose the block you want to edit (Welcome Message, for example), you’ll see at the bottom of the edit pane a series of options: Text, Typing, Quick Reply, Image, Gallery, Go To Block, To Sequence, and a Plus sign to access other options. These are the basic components of the bot itself. Drag them into the edit pane of your blocks and edit them as appropriate. Be sure to link each block to another block so your users don’t get stuck.
Admittedly this step should take longer, but for the purposes of getting to the final step, only spend about 3 minutes on it for now, which brings you to 0:45 on the clock; just enough to customize the bot a bit and see how it looks once you’ve launched it in Messenger.
5. Test Your Bot
Click the blue ‘Test Bot’ button in the upper right to try your bot out. Run through every block, menu, and option to make sure they’re working and that your content is solid. If the bot is simple, it shouldn’t take more than about 45 seconds to get through it, but be aware that sometimes new blocks are a bit slow to load.
Now that you’ve spent 5 minutes getting to know the basics, experiment with your bot and think about how this can be useful for people in need. What do you know about your users and their challenges? How can customized information provided by a bot help? Is a bot the right solution? Do your users have mobile phones? Do they have Facebook Messenger? All good things to know as you think about how this tool can be useful in the context of a development project.
What will your bot actually do? That’s up to you. Check out WIRED’s Best Bots of 2017 for some ideas.
Next time: connecting your bot to a database so you can access & visualize data and tie in other web sites and web-based tools.