Skip to content

Commit

Permalink
Merge pull request #87 from iMicknl/adapter/console
Browse files Browse the repository at this point in the history
[v1] Console Adapter
  • Loading branch information
szul authored Aug 10, 2019
2 parents ba6f537 + 57dadc3 commit 5727833
Show file tree
Hide file tree
Showing 16 changed files with 297 additions and 295 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
**/node_modules/**

libraries/botbuilder-adapters/**/*
libraries/botbuilder-dialog-prompts/**/*
libraries/botbuilder-spell-check-middleware/**/*
libraries/botbuilder-storage/**/*
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The following adapters can be used to expose your bot on additional channels not

| Name | Description | NPM |
| ---- | ----------- | ------- |
| [@botbuildercommunity/adapters](libraries/botbuilder-adapters/README.md) | Alternative platform adapters | [![NPM Version](https://img.shields.io/npm/v/@botbuildercommunity/adapters.svg)](https://www.npmjs.com/package/@botbuildercommunity/adapters) |
| [@botbuildercommunity/adapter-console](libraries/botbuilder-adapter-console/README.md) | A platform adapter for the console / terminal | [![NPM Version](https://img.shields.io/npm/v/@botbuildercommunity/adapter-console.svg)](https://www.npmjs.com/package/@botbuildercommunity/adapter-console) |
| [@botbuildercommunity/adapter-twilio-whatsapp](libraries/botbuilder-adapter-twilio-whatsapp/README.md) | A platform adapter for Twilio WhatsApp | [![NPM Version](https://img.shields.io/npm/v/@botbuildercommunity/adapter-twilio-whatsapp.svg)](https://www.npmjs.com/package/@botbuildercommunity/adapter-twilio-whatsapp) |

The following packages are available from [Botkit](https://github.com/howdyai/botkit), and work with both the Bot Framework and Botkit:
Expand All @@ -61,4 +61,4 @@ The following packages are available from [Botkit](https://github.com/howdyai/bo
| [botbuilder-adapter-webex](https://github.com/howdyai/botkit/tree/master/packages/botbuilder-adapter-webex#readme) | A platform adapter for Webex Teams| ![NPM Version](https://img.shields.io/npm/v/botbuilder-adapter-webex.svg)
| [botbuilder-adapter-hangouts](https://github.com/howdyai/botkit/tree/master/packages/botbuilder-adapter-hangouts#readme) | A platform adapter for Google | ![NPM Version](https://img.shields.io/npm/v/botbuilder-adapter-hangouts.svg)
| [botbuilder-adapter-twilio-sms](https://github.com/howdyai/botkit/tree/master/packages/botbuilder-adapter-twilio-sms#readme) | A platform adapter for Twilio SMS | ![NPM Version](https://img.shields.io/npm/v/botbuilder-adapter-twilio-sms.svg)
| [botbuilder-adapter-facebook](https://github.com/howdyai/botkit/tree/master/packages/botbuilder-adapter-facebook#readme) | A platform adapter for Facebook Messenger | ![NPM Version](https://img.shields.io/npm/v/botbuilder-adapter-facebook.svg)
| [botbuilder-adapter-facebook](https://github.com/howdyai/botkit/tree/master/packages/botbuilder-adapter-facebook#readme) | A platform adapter for Facebook Messenger | ![NPM Version](https://img.shields.io/npm/v/botbuilder-adapter-facebook.svg)
3 changes: 3 additions & 0 deletions libraries/botbuilder-adapter-console/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/lib
/node_modules
/.vscode
9 changes: 9 additions & 0 deletions libraries/botbuilder-adapter-console/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2019-??-??
### Added
- First release of Console adapter
27 changes: 27 additions & 0 deletions libraries/botbuilder-adapter-console/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Console Adapter
The console adapter lets you create a chatbot that works from the command line. This was built-in functionality in SDK v3, but was absent from the SDK v4 library. The console bot is limited in which functionality it can implement from the base adapter.

## Installation
To install:

npm install @botbuildercommunity/adapter-console --save

## Usage
Include it in your bot:

```typescript
import { ConsoleAdapter } from "@botbuildercommunity/adapter-console";
```
Create the adapter:
```typescript
const adapter: ConsoleAdapter = new ConsoleAdapter();
```

Listen for activities:
```typescript
adapter.processActivity(async (context: TurnContext) => {
...
});
```

From there you can pass the `context` to your bot logic's `onTurn()` method.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@botbuildercommunity/adapters",
"version": "0.2.5",
"description": "A collection of adapters for use with the Bot Framework, in order to handle different deployment and integration scenarios.",
"name": "@botbuildercommunity/adapter-console",
"version": "1.0.0",
"description": "Console adapter for the Bot Framework SDK v4.",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"directories": {
Expand Down Expand Up @@ -37,7 +37,8 @@
},
"devDependencies": {
"mocha": "^6.2.0",
"typescript": "^3.5.2"
"sinon": "^7.3.2",
"typescript": "^3.5.3"
},
"publishConfig": {
"access": "public"
Expand Down
Loading

0 comments on commit 5727833

Please sign in to comment.