Bot Basics - microsoft-campus-community/workshop-shopping-list-bot GitHub Wiki

Motivation

Are you part of any group chats? Do you need to coordinate with friends & family? Do you sometimes forget to remember something? We do! Bots allow for new interactions with a message-centric interface. As such, they are a perfect answer to our questions. They can be part of group chats to coordinate with friends & family and keep us accountable for these small tasks in life.

At its core, a chatbot is a web service that listens to messages from messaging platforms to act on commands and return context-aware information to the chat through response messages. Therefore, the bot can interact as a chat participant. You can think of the bot as a different form of interaction than the traditional user interfaces we interact with daily. Bots do not replace user interfaces. However, they complement them and help specific scenarios, such as productivity on the go where screen space is limited, social interactions, adaptive response behavior.

Getting started

The Microsoft Bot Framework is a toolkit to support developers in creating intelligent bots for various messaging platforms. To learn more, you can check out the documentation. However, to complete this workshop, you will learn all information needed by following along this wiki documentation.

To create a basic bot file structure and start coding, usually use the Yeoman generator bot template. There is a quickstart tutorial available for that. However, for the simplicity of this workshop, please fork this repository and switch to the workshop branch. Open the shopping-list-bot folder in your IDE, e.g., Visual Studio Code.

Code Structure

  • In the root directory of the shopping-list-bot folder, you will find many configuration files for the NodeJS project, e.g., package.json. You do not need to change anything here for now.
  • In the src directory, you will find the code for the bot. The index.ts file contains all the plumbing for the webserver we mentioned in the beginning. Since this is all set up for you, you do not need to look at it for now. For curious minds, you can look at it after learning more through this workshop. The sub-folders will be described in the respective pages when the content is relevant. First up is the bot's dialog system found in the dialogs subfolder.

NEXT: Bot Dialog