How to create a bot

icon picker
Creating a Simple Survey Bot

The article will guide you through the development of a simple push-button bot designed for employee surveys, starting from scratch. The bot’s purpose is to collect feedback from employees regarding their satisfaction with management, offering response options in the form of buttons.
⁠
⁠
⁠

Creating an Agent on the Platform

The first step is to log into the
@Platform
⁠
and create a new
@Agent
⁠
.
Register on the
@Platform
⁠
or log into an existing account using the link . Upon successful authentication, you will be directed to the Company
@Project
⁠
s page. For further information about registration and authorization please refer to: . ​
image.png
⁠
⁠
Create a new
@Project
⁠
by clicking Add project or open an existing one. Read more: . ​
image.png
⁠
⁠
Create a new
@Agent
⁠
within the
@Project
⁠
by clicking Add agent. Read more: . ​
image.png
⁠
⁠
Go to
@BotBuilder
⁠
by clicking Design. ​
image.png
⁠
⁠

Creating an Agent Script

Now proceed to create the
@Agent
⁠
@Script
⁠
.
In
@BotBuilder
⁠
, you will see the
@Agent
⁠
@Script
⁠
. Initially it has no
@Script Branch
⁠
es and consists only of the root
@Start
⁠
@Slot
⁠
. ​
image.png
⁠
⁠
First of all, create a
@Slot
⁠
enabling the
@Agent
⁠
to greet the
@Bot User
⁠
and suggest that they take a survey. Click on the + button and create a
@Text
⁠
@Slot
⁠
. To learn more about creating
@Slot
⁠
s see: . ​
image.png
⁠
⁠
In the Text List field, enter the text “Hello! Are you ready to take a management satisfaction survey?”. Save the
@Slot
⁠
by clicking the CREATE button. ​
image.png
⁠
⁠
Following the
@Text
⁠
@Slot
⁠
, proceed by adding a
@Button Menu
⁠
@Slot
⁠
to provide the
@Bot User
⁠
with selectable options for responding. Label the
@Slot
⁠
as "buttons 1" in the Name field. ​
image.png
⁠
⁠
When creating a
@Button Menu
⁠
@Slot
⁠
, a set of buttons consisting of two
@button
⁠
@Subslot
⁠
s and a
@fallback
⁠
@Subslot
⁠
are automatically generated. The button
@Subslot
⁠
s represent the buttons that will be displayed on the
@Bot User
⁠
’s screen, while the
@fallback
⁠
@Subslot
⁠
manages the part of the
@Script
⁠
that will be implemented if the
@Bot User
⁠
enters text instead of selecting a button. Read more: . ​
image.png
⁠
⁠
To change the text on the top button, double-click on the
@button
⁠
@Subslot
⁠
named Button 1. The Name field defines the
@Subslot
⁠
‘s name in the
@Script Tree
⁠
, while the Label field determines the text of the button that will be displayed on the
@Bot User
⁠
’s screen. Enter “Yes” in the Label field and clear the Name field. Thus, when saving a
@Subslot
⁠
as its name, the contents of the Label field will be displayed in the
@Script Tree
⁠
, making it easier for you to navigate the
@Script
⁠
. Save your changes by clicking the SAVE button. ​
image.png
⁠
⁠
Similarly, change the text on the second button by entering “No” in the Label field, and save the changes.
image.png
⁠
⁠
Next, let's move on to the part of the
@Script
⁠
that will be implemented if the
@Bot User
⁠
enters text instead of selecting a button. Add a
@Text
⁠
@Slot
⁠
with the text “Please click on one of the buttons.” after the
@fallback
⁠
@Subslot
⁠
. ​Important: if the
@Bot User
⁠
enters text matching the text on one of the buttons instead of pressing the button, the
@Conversation
⁠
will proceed in accordance with the
@Script Branch
⁠
following this button, even if the case of the
@Bot User
⁠
’s message and the text on the button do not match. ​
image.png
⁠
⁠
After the newly created
@Text
⁠
@Slot
⁠
, add a
@Jump
⁠
@Slot
⁠
. This
@Slot
⁠
enables transition to any
@Slot
⁠
within the
@Script
⁠
().
Each
@Slot
⁠
in the
@Script Tree
⁠
has its own number. ​
image.png
⁠
⁠
In the Destination field, you can search for the required
@Slot
⁠
s by their number by entering it entirely or partially in the search field. ​
image.png
⁠
⁠
In the Destination field, choose the "buttons 1"
@Slot
⁠
from the drop-down list — this is the
@Button Menu
⁠
we created earlier. Thus, if the
@Bot User
⁠
enters some text that does not match any button label, the
@Agent
⁠
will ask them to select one of the buttons displaying the same set of buttons again. ​
image.png
⁠
⁠
Following the
@button
⁠
@Subslot
⁠
labeled “No”, add a
@Text
⁠
@Slot
⁠
with the text “Okay. You can always come back later.” and
@Wait For Reaction
⁠
@Slot
⁠
— a
@Slot
⁠
designed to wait for a message from the
@Bot User
⁠
(). Thus, if the
@Bot User
⁠
sends a message, the
@Conversation
⁠
will restart from the beginning of the
@Script
⁠
, and the
@Agent
⁠
will invite the
@Bot User
⁠
to take the survey again. ​
image.png
⁠
⁠
After the
@button
⁠
@Subslot
⁠
labeled "Yes", add a
@Text
⁠
@Slot
⁠
containing the text of the first question: “1. How effective is the work of your manager (hereinafter — according to your personal assessment)?” There will be 7 questions in total. ​
image.png
⁠
⁠
Create a
@Button Menu
⁠
@Slot
⁠
labeled “buttons 2”. Use the buttons to specify the answer options: “Extremely effective” and “Quite effective”. ​
image.png
⁠
⁠
Next, click on the + button under the
@fallback
⁠
@Subslot
⁠
and add another
@button
⁠
@Subslot
⁠
. ​
image.png
⁠
⁠
Enter the button label “Moderately effective” in the
@Subslot
⁠
. ​
image.png
⁠
⁠
Similarly, add buttons “Not effective enough”, “Not effective at all”. ​
image.png
⁠
⁠
After the
@fallback
⁠
@Subslot
⁠
, add a
@Text
⁠
@Slot
⁠
with the text “Please click on one of the buttons.” and a
@Jump
⁠
@Slot
⁠
with a transition to a
@Button Menu
⁠
named “buttons 2”. ​
image.png
⁠
⁠
After the button named “Extremely effective” add a
@Text
⁠
@Slot
⁠
with the text of the second question: “2. How professional is your manager’s behavior?”, and after the other buttons add
@Jump
⁠
@Slot
⁠
s with a transition to this
@Text
⁠
@Slot
⁠
. ​
image.png
⁠
⁠
So, you have already learned how to create
@Text
⁠
@Slot
⁠
s,
@Button Menu
⁠
s with buttons and make transitions within the
@Script
⁠
using the
@Jump
⁠
@Slot
⁠
. Now you need to add the remaining survey questions and response options to the
@Script
⁠
. This can be done using the
@Slot
⁠
s and
@Script Branch
⁠
cloning feature, instead of adding all the
@Slot
⁠
s manually (read more: ). To do this, right-click on the
@Button Menu
⁠
@Slot
⁠
labeled “buttons 2” and select the “Clone to” option. ​
image.png
⁠
⁠
In the window for selecting a new
@Parent of a Script Branch
⁠
, select the
@Text
⁠
@Slot
⁠
with the text of the second question and click the CLONE SLOT button. ​
image.png
⁠
⁠
The entire
@Script Branch
⁠
will be copied after the selected
@Text
⁠
@Slot
⁠
. ​
image.png
⁠
​Important: After copying,
@Jump
⁠
@Slot
⁠
s referring to
@Slot
⁠
s from the
@Script Branch
⁠
being copied after copying will refer to the corresponding
@Slot
⁠
s in the newly created branch, thus retaining the script logic within the copied
@Script Branch
⁠
.
Now you need to edit
@Slot
⁠
s in the copied
@Script Branch
⁠
:
Replace button labels with the ones listed below:
Extremely professional
Quite professional
Moderately professional
Not professional enough
Not at all professional
replace the question in the cloned
@Text
⁠
@Slot
⁠
with “3. How attentive to detail is your manager?” ​
image.png
⁠
⁠
Similarly, using
@Script Branch
⁠
cloning, add the rest of the survey questions and answer options. All questions and their corresponding answer buttons are listed below.
3. How attentive to detail is your manager?
Extremely attentive
Quite attentive
Moderately attentive
Not attentive enough
Not at all attentive
4. How clear are the goals set by your manager to you?
Absolutely clear
Quite clear
Moderately clear
Not clear enough
Not at all clear
5. How willing is your manager to admit his mistakes?
Absolutely willing
Quite willing
Moderately willing
Not willing enough
Not ready to admit
6. How much do you trust your manager's ability to make good decisions?
I trust completely
I trust a lot
I relatively trust
I practically don’t trust
I don’t trust completely
7. How well does your manager contribute to your professional growth?
Extremely good
Good enough
Satisfactory good
Not very good
Absolutely not good
Replace the text in the last
@Text
⁠
@Slot
⁠
with “Thank you for your answers and have a nice day!” ​
image.png
⁠
⁠
Add a
@Wait For Reaction
⁠
@Slot
⁠
after this
@Text
⁠
@Slot
⁠
. This step finalizes the creation of the
@Agent
⁠
@Script
⁠
resulting in the following
@Script
⁠
: ​
image.png
⁠
⁠

Agent training and testing

After creating the
@Agent
⁠
@Script
⁠
, you need to train the
@Agent
⁠
and test its
@Script
⁠
.
To train the
@Agent
⁠
, click the TRAIN button located in the upper right corner of
@BotBuilder
⁠
. It will initiate the
@Script Validation
⁠
process. If the
@Script
⁠
meets the , the
@Agent
⁠
will be trained. Otherwise, the
@Script Validation
⁠
will fail and an error text will appear in the lower right corner. Read more: ​
image.png
⁠
⁠
If errors are detected in the
@Script
⁠
, identify problem areas using the guidelines outlined in the article and fix the errors. After this, train the
@Agent
⁠
again.
After successful
@Agent
⁠
Training, open the
@Debug Widget
⁠
by clicking the Debug button. ​
image.png
⁠
⁠
In the
@Debug Widget
⁠
that opens, send a message to the
@Agent
⁠
to start the
@Script
⁠
. ​
image.png
⁠
⁠
Communicate with the
@Agent
⁠
, going through all the steps of the
@Script
⁠
, while checking that there are no errors in the texts and the logic of the
@Script
⁠
is correct.
If you find errors, fix them, remembering to retrain the
@Agent
⁠
after each change so that it takes effect. If everything is correct, congratulations, your
@Agent
⁠
is ready!
⁠
Survey-Survey_bot-2024-01-18-13-58.cfg
16.4 kB
⁠
⁠

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.