1. New bot, new block

Now that we have planned the Leadzy bot, we know what we want to build. It’s time to open Chatlayer and get our hands dirty!

To get started, you need a Chatlayer account. Don't have an account yet? Create a trial account here. You're having a problem with your account? Contact our support team at support@chatlayer.ai.

In this chapter we will build the very start of the conversation.

Step 1: Create a new bot

To create a new bot:

  1. Go to app.chatlayer.ai and log in using your credentials.

  2. On the upper right corner of the screen, click on the New bot button.

  3. Enter Leadzy as a name, so that you can easily find it again.

  4. Select English as your primary language.

The primary language is the language that your bot will use. If you’d like your bot to be multilingual, you’ll be able to change that later.

  1. Click on Create.

Your bot opens up, showing:

  • Your bot canvas in the middle of the screen, which is a visual representation of your chatbot architecture. A bunch of default blocks of conversation appear on this canvas, but let’s not worry about that now.

  • The Flows of conversation on the left.

  • The general menu of your chatbot on the very left.

To navigate the screen, you can zoom in or out by using the scrolling wheel, or with your trackpad. You can also click and drag to move through the blocks tree.

Flows are a way to group blocks that are about the same topic or use case. Learn more about them here.

Your chatbot has been successfully created!

Step 2: Edit a Message block

Now, it’s time to make your chatbot say something.

A Message block is a type of message where your bot will prompt something to the user. Learn more about blocks here.

Edit the Introduction block

To begin, let’s modify your introduction block.

The Introduction block is a default block that serves as the first message that your users will see. It is where your bot introduces itself and explains its functionalities. Introductions are crucial for setting appropriate expectations for the bot.

To edit the Introduction block:

  1. From your canvas, click on the Introduction block.

  1. The block opens up on the right-hand side of the screen. Under Text message, delete the default message and replace it with:

Hi there! Lucky you, today we have 15% off the whole selection! Are you interested to receive a discount code by email?

  1. Click Save.

Your Introduction block is now modified and you can see it from your canvas.

Add alternative messages

To make the conversation natural, we would like to have different ways of conveying the same introduction message.

An alternative message is a text message that will be randomly alternated with another one so that the conversation feels more human-like.

To add alternative messages to a bot message:

  1. Open your Introduction block by clicking on it.

  2. Under Text message, click on + Add alternative message, and paste the following message:

    Hey there! Good news! We're currently offering a 15% discount on our entire selection! Would you like to receive a code via email?

  3. Do the same for another alternative message:

    Exciting news! We currently have a special offer of 15% off on our entire selection! Would you be interested in receiving a discount code via email?

  1. Click Save.

Let’s now see how we can test that the bot behaves as expected.

Step 3: Test your bot

Chatlayer offers a simple way to test your bot every time you make a modification.

Run tests in the Emulator

To test your bot:

  1. Click on the play button at the top right corner of your bot canvas.

  1. A Test your bot window pops up on the right-hand side. It automatically starts the conversation, which means that the bot will prompt its Introduction block. From there, type something as a response, for instance ‘Yes I’d love to have a discount code’.

  2. Press Enter on your keyboard to send your message.

  1. The bot didn’t understand you — and that’s absolutely normal! For now, all we taught our bot is to say a greeting.

  2. Click on the Restart conversation button at the top-right corner of the test window.

  1. Notice that the Introduction message displayed is now different. This is because added alternative messages to it, and those are displayed in a random way.

You just ran a successful test: your bot has the expected behavior!

Run tests in the WhatsApp sandbox

Given the high demand for WhatsApp among our customers, Chatlayer provides an easy method to test your conversations directly on the platform.

Why running tests in a WhatsApp sandbox? Each channel has its limitations, therefore you want to make sure that your tests run smoothly in the channels that you’re choosing.

To run tests within the WhatsApp sandbox:

  1. Open your Test your bot window.

  2. At the top-left corner of the Test window, select WhatsApp sandbox.

  1. A QR code is displayed on the screen, with a link underneath. Either:

    • Scan the QR code with your phone, so that your WhatsApp phone app opens.

    • Click on the link below the QR code, so that you can open the WhatsApp web app.

  2. Whatever you choose, click on Continue to chat.

  3. Send the message starting with ‘join’ that is pre-filled in the text field.

  4. You’ll get a confirmation that you’re all set in the sandbox. Say something to the bot to start the conversation as you designed it.

Our bot is also working on WhatsApp, hurray!

Lesson 1 recap

Congratulations, you just made your first steps! In this lesson, you’ve learned how to:

Coming next

Next, we will teach your bot how to understand user responses.

page2. Understand your users

💬 Feedback

Your feedback on the tutorial means the world to us! Please, let us know what you think through this short form.

Last updated