Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
May 17, 2018
Feb 15, 2018

NodeJS(Express) + Swagger + Multi-Language

Intro β˜•

MyBot can be easily configured in any Express project by adding the bot folder, installing dependencies and initializing it 🀘


Installation ⏯

Do you want to see this template in action? πŸ’»

  • Download the code here
  • To run the project execute the commands:
npm install
npm start

And remember install the following tools to debug your bot locally:


More examples with NodeJS:

Bots History 🌎

  • 1960: ELIZA
  • 1970: PARRY
  • 1980: Graphic interface
  • 1990: Search engines
  • 2000: Social/App stores
  • 2010: Bots and agents, human Interaction/Experience

Chatbots types

  • Utilities: It fulfills a function for the users and is measured according to the effectiveness of the answers.
  • Social: Success is measured according to the duration and level of user satisfaction, it is also possible to assess the level of satisfaction through APIs to recognize the level of emotion of users.
  • Assistants (Cortana, Siri, etc): Acts as a facilitator, usually comes integrated with the Operating System. Main features:
    • Utilities and social capacities
    • Continuous relationship with the user
    • Manage system functions

Communication flow

List the functions offered by the bot and describe a step by step for its execution:

  • Task
  • Objective
  • Motivation of the user
  • Steps
  • Forecasts

Experience components

  • Learning and memory
  • Perception and sense
  • Personality (Intelligence)
  • Logic and reason
  • Accessibility
  • Meaning and tone of text
  • Cards
  • Images
  • Emojis
  • Response time
  • Conversational branch


  • Inclusive design (Design for all types of public)
  • UX (Avatar)
  • Character with personality
  • Define the devices and channels to support (Cortana, Email, Facebook, etc)
  • Form flow (conversation follow-up, validate the data)
  • Prevent redirections


Bot Lifecycle

Bot Framework πŸ€–

Open Source Framework to create and connect bots (Cross channel, AI and Up-to-Date resources). Bot Framework

Bot Connector Service

Integrate the bot with different channels as Slack, Skype, Messenger, SMS, etc. Bot Connector

The Bot Connector can connect with the intelligence services and implement other functionalities such as:

  • Ability to store the state of the conversation.
  • Translate services.
  • Telemetry. Information about the service is collected, such as the number of requests, messages that have failed, etc.

Bot Builder

SDKs for .NET, NodeJS or we can use REST APIs to create and debug bots. It also includes the Bot Framework Emulator to test our bots and the Channel Inspector to preview the user experience of our bot on different channels. Integrate external services and Manage the conversation using LUIS (Language Understanding Intelligent Service).

Microsoft Cognitive Services 🌐

Set of APIs to create smart applications.

Vision πŸ‘€

Image-processing algorithms to smartly identify, caption and moderate your pictures.

  • Computer Vision (Images)
  • Emotion
  • Content Moderator
  • Face
  • Video

Speech πŸ’¬

Convert spoken audio into text, use voice for verification, or add speaker recognition to your app.

  • Custom Speech Service (CRIS)
  • Speaker Recognition
  • Speech
  • Translator

Language 🀝

Allow your apps to process natural language with pre-built scripts, evaluate sentiment and learn how to recognize what users want.

  • Bing Spell Check
  • Language Understanding
  • Linguistic Analysis
  • Text Analytics
  • Web Language Model

Videos πŸ“Ή

To Learn

Knowledge πŸ“–

Map complex information and data in order to solve tasks such as intelligent recommendations and semantic search.

  • Academic Knowledge
  • Entity Linking
  • Knowledge Exploration
  • Recommendations
  • QnA Maker

Search πŸ”Ž

Add Bing Search APIs to your apps and harness the ability to comb billions of webpages, images, videos, and news with a single API call.

  • Bing Autosuggest
  • Bing Image Search
  • Bing News Search
  • Bing Video Search
  • Bing Web Search

QnA Maker πŸ‘·

A free and easy-to-use REST API based on artificial intelligence to respond to users' questions in a natural way through an optimized learning logic (Machine Learning). It is a question and answer service with a graphical interface that allows it to be easy to administer.

.NET Example
public class QnADialog : QnAMakerDialog {

  public QnADialog() : 
  base(new QnAMakerService(new QnAMakerAttribute("subscriptionKey", "knowledgeId", "answer not found", 0.5)))

  protected override async Task RespondFromQnAMakerResultAsync(IDialogContext, IMessageActivity message, QnAMakerResult result)
    Activity response = ((Activity)context.Activity).CreateReply();

    var firstAnswer = result.Answers.FirstOrDefault()?.Answer;
    var data = firstAnswer.Split("---");

    if(data.Length == 1) {
      return await context.PostAsync(firstAnswer);

    //Example to get data with a separator
    var title = data[0];
    var description = data[1];
    var url = data[2];
    var image = data[3];

    CustomCard card = new CustomCard 
      Title = title, SubTitle = description

    card.Buttons = new List<CardAction>
      new CardAction(ActionTypes.OpenUrl, "text", value: url)

    card.Images = new List<CardImage>{
      new CardImage(url = image)


    return await context.PostAsync(response);


  • NodeJS via npm: botbuilder-cognitiveservices
  • .NET via Nuget package: Microsoft.Bot.Builder.CognitiveServices

QnA Maker Dialog

Personalization in the response to the user according to the reliability control.

[QnAMaker("subscriptionKey", "knowledgeId", "standard phrase when it doesn't satisfy the minimum response reliability index", 0.5, 1)]
public class QnADialogWithActiveLearning : QnAMakerDialog 


A channel is a connection between Bot Framework and communication applications.


  • Skype:

A Skype account is required, we can deploy bots to test.

  • Microsoft Teams:

An office 365 account is required. We need to enable the permissions to use external apps from the administration panel of Office 365 (Configuration/Services...).

  • Telegram:

A Telegram account is required. BotFather is an app that we need to install to create and manage our bots, check here.

  • Web Chat:

It's inserted using a HTML Iframe.

  • Slack:

It's required to create an app from Slack API, add a new Redirect URL to and enter the credentials.

Resources β›©

Credits πŸ‘

Contributing ✨

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated ❀️.
You can learn more about how you can contribute to this project in the contribution guide.

Collaborators πŸ₯‡

Juan Nicholls

Supporting 🍻

I believe in Unicorns πŸ¦„ Support me, if you do too.

License βš–οΈ

This repository is available under the MIT License.

Happy coding πŸ’―

Made with ❀️