Skip to content
Branch: master
Find file History

README.md

console-echo sample

Bot Framework v4 console echo sample.

This bot has been created using Bot Framework, it shows how to create a simple bot that you can talk to from the console window.

This sample shows a simple echo bot and demonstrates the bot working as a console app using a sample console adapter.

Prerequisites

  • .NET Core SDK version 2.1

    # determine dotnet version
    dotnet --version

To try this sample

  • Clone the repository

    git clone https://github.com/microsoft/botbuilder-samples.git
  • Run the bot from a terminal or from Visual Studio, choose option A or B.

    A) From a terminal

    # run the bot
    dotnet run

    B) Or from Visual Studio

    • Launch Visual Studio
    • File -> Open -> Project/Solution
    • Navigate to samples/csharp_dotnetcore/01.console-echo folder
    • Select Console-EchoBot.csproj file
    • Press F5 to run the project

Concepts introduced in this sample

What is a bot?

A bot is an app that users interact with in a conversational way using text, graphics (cards), or speech. It may be a simple question and answer dialog, or a sophisticated bot that allows people to interact with services in an intelligent manner using pattern matching, state tracking and artificial intelligence techniques well-integrated with existing business services.

Adapters

Adapters provide an abstraction for your bot to work with a variety of environments.

A bot is directed by it's adapter, which can be thought of as the conductor for your bot. The adapter is responsible for directing incoming and outgoing communication, authentication, and so on. The adapter differs based on it's environment (the adapter internally works differently locally versus on Azure) but in each instance it achieves the same goal.

In most situations we don't work with the adapter directly, such as when creating a bot from a template, but it's good to know it's there and what it does. The bot adapter encapsulates authentication processes and sends activities to and receives activities from the Bot Connector Service. When your bot receives an activity, the adapter wraps up everything about that activity, creates a context object, passes it to your bot's application logic, and sends responses generated by your bot back to the user's channel.

Further reading

You can’t perform that action at this time.