Introduction to bot scripting

Gupshup's IDE Bot Builder is used by thousands of bot makers around the world to create advanced and powerful bots. We're constantly improving our bot platform to ensure that our creators have access to cutting-edge technology. We have just launched v2 of our IDE Bot Builder with a ton of new features to improve the bot-building experience. Read our blogpost on some the new features that the new IDE provides.

A revolutionary feature of the new Bot Builder tool is the ability to create bot conversations using a scripting tool. This allows anyone to map out conversation paths between a bot and a user, without the need for any coding knowledge. The user's conversation has Auto-NLP enabled that matches it to the closest intent specified in the script file. The scripting tool uses Gupshup's own '[NLP on the fly]'(https://www.gupshup.io/developer/ent-apis) API. This guide will illustrate how you can use the bot scripting feature to create advanced bots with API calls, structured messages, entity extraction, slot filling and a whole lot more.

Terminology

Getting Started

To familiarise yourself with the layout of the new IDE, read this guide.

To get started with scripting your Hello World bot, create a new project in your dashboard. You will see an option to select your IDE. Click on the 'Yes' button.

fb2

The new IDE will open up. In the explore section locate the file named 'default.scr' which contains some template script. This file is where you will create your bot script. Clear the existing script and type [main] in the first line to create the Main module.

It is important to note that the bot scripting tool works on indentation.

Set the welcome message as 'Welcome to the scripting tool'. This line is what the bot sends to the user. The script alternates between what the bot says and what the user says (unless specified). The following line is the expected response from the user. Ensure that this is indented more than the previous line. Put the bot response 'Hello World' in the next line and make sure it is indented more than the previous line. This is how your script will look like:

[main]
        Welcome to the scripting tool!                 
            Hi
                Hello World!

The scripting tool automatically adds NLP to the user input, in this case 'Hi'.

To test the bot out, right click on your bot in the left Explore menu and select 'Start Server' from the menu that appears. Once the server is started, click on chat widget in the bottom bar. The chat widget will appear and in a few seconds, it will show the 'Welcome to the scripting tool!'. Type Hi and it will respond with Hello World.

fb2