Beginner

5 minute read

You should read this first.

What are ChatBots

Bot Framework SDK

Bot Framework is a collection of SDK’s for bot development in various languages mentioned in the previous article. It provides tools to build, test, deploy and manage bots. The SDK acronym stands for „Software Development Kid“ and it is exactly that, a kit that supplies you with libraries, documentation, guides and code samples. Bot framework SDK is basically all you need to start building your bot.

Bot Framework Diagram

Bot initialization

Choose your programming language and technology

We are gonna work on Windows machine and choose Javascript with NodeJS and NPM. For C#, the process is almost the same, but you don’t use NodeJS and NPM, instead you use .NET and Visual Studio.

NOTE: We recommend that you read our Introduction to NodeJS if you’re not already familiar with Node.

So, let’s begin. First, you need to install NodeJS,  go to NodeJS download and download the latest NodeJS for Windows. For Linux machines, install NodeJS with your package manager, apt for Ubuntu or Debian, yum for CentOS and so on.

Now we need a bot generator to generate our bot,  so we install Yeoman globally. According to Yeoman website: „Yeoman is a generic scaffolding system allowing the creation of any kind of app“. Yeoman is great because it’s language agnostic, which means it can generate projects in any programming language. You can use a console like Git bash to install Yeoman, just type:

Copy to Clipboard

Than we need to install a generator for our bot:

Copy to Clipboard

Initialize your bot

With Yeoman installed, we can generate our bot, but first, make a new directory where you want your bot. Then, inside that directory, use console to call:

Copy to Clipboard

And there you have it, you have your bot.. not so fast. You need to provide some answers to a list of questions, mostly simple questions like on the picture bellow.

NOTE: You’ll have a provided answers to input when you press Enter. Be careful to pick the right language and to pick the right template, you have a few to choose from, but we are gonna pick Echo Bot.

Bot framework bot initialization

Development

More on this in our next article. We’ll just explain the basics here.

Our file structure looks like this:

file structure in bot framework sdk bot

If you generated your bot for C# or Python, the file structure and code will be different. As for typescript bot, it’s file structure is pretty much the same, the files just have typerscript extensions and maybe slight code differences.

Important things to know before you start your bot development:

  • index.js is the file you run to run your bot

  • You can change your PORT and other options in index.js

  • Write your scripts and dialogs in bot.js

  • You can define environment variables in .env file

Up next.

Bot development