Coder Social home page Coder Social logo

qa-bot's Introduction

This sample shows how to create a simple echo bot that you can talk to from the console window.

To try this sample

  • Clone the repository
    git clone https://github.com/microsoft/botbuilder-samples.git
  • In a terminal, navigate to samples/javascript_typescript/01.console-echo
    cd samples/javascript_typescript/01.console-echo
  • Install modules and start the bot
    npm i && npm start

Prerequisite

Install TypeScript

In order to run this sample, you must have TypeScript installed. To install TypeScript:

  • Navigate to the TypeScript portal.
  • Click the Download button.
  • Follow the installation instructions for your development environment.

Testing the bot

After running npm start, the bot presents a prompt directly in the console window.

Send messages to the bot by typing them into the console. The bot will echo your message back to you.

Adapters

Adapters such as the ConsoleAdapter provide an abstraction for your bot to work with a variety of environments and messaging platforms.

The adapter is responsible for directing incoming and outgoing communication, authentication, and so on. Adapters for different platforms and messaging technologies differ internally, but achieve the same goal - connecting bots to a stream of messages and events from users. 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.

In most situations, we don't work with the adapter directly, but it's good to know it's there and what it does. In this example, we're using the ConsoleAdapter, which provides a very simple way to exchange messages - they're sent and received via the console window. Using the ConsoleAdapter is a great way of getting started quickly with Botbuilder. It also allows you to build and test bots that operate on your local machine without any external API calls or client applications.

Other available adapters connect your bot to the web, or through the BotFramework Connector Service, to many popular messaging platforms.

Further reading

qa-bot's People

Contributors

mario8x avatar

Watchers

 avatar

qa-bot's Issues

test

I don't like snow hu hu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.