# botbuilder-wechaty-connector

> Microsoft Bot Framework v3 Connector for Wechat PERSONAL Account

Latest version **3.0.2** (published 2019-01-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install botbuilder-wechaty-connector
pnpm add botbuilder-wechaty-connector
yarn add botbuilder-wechaty-connector
bun add botbuilder-wechaty-connector
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2019-01-15 |
| First published | 2018-04-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 36.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Huan LI |
| Maintainers | chatie, zixia |
| Keywords | weixin, wechat, wechaty, botbuilder, connector |

## Links

- npm: https://www.npmjs.com/package/botbuilder-wechaty-connector
- Repository: https://github.com/zixia/botbuilder-wechaty-connector
- Homepage: https://github.com/zixia/botbuilder-wechaty-connector#readme
- Issues: https://github.com/zixia/botbuilder-wechaty-connector/issues
- npm.io page: https://npm.io/package/botbuilder-wechaty-connector

## Dependencies (3)

- [wechaty](https://npm.io/package/wechaty.md) ^0.22.1
- [botbuilder](https://npm.io/package/botbuilder.md) ^3.2.0
- [qrcode-terminal](https://npm.io/package/qrcode-terminal.md) ^0.12.0

## Recent versions

- 3.0.2 (latest) — 2019-01-15
- 0.1.8 (next) — 2018-05-14
- 3.0.1 — 2019-01-11
- 0.4.6 — 2018-11-27
- 0.4.5 — 2018-09-16
- 0.4.4 — 2018-09-08
- 0.4.3 — 2018-07-15
- 0.4.2 — 2018-07-15
- 0.4.1 — 2018-07-15
- 0.2.4 — 2018-06-14
- 0.2.3 — 2018-05-14
- 0.2.2 — 2018-05-14
- 0.2.1 — 2018-05-14
- 0.1.4 — 2018-04-20
- 0.1.3 — 2018-04-20
- … 9 more at https://npm.io/package/botbuilder-wechaty-connector/versions

## README

# BOTBUILDER-WECHATY-CONNECTOR

[![npm version](https://badge.fury.io/js/botbuilder-wechaty-connector.svg)](https://badge.fury.io/js/botbuilder-wechaty-connector)
[![Powered by Wechaty](https://img.shields.io/badge/Powered%20By-Wechaty-green.svg)](https://github.com/chatie/wechaty)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)
[![Greenkeeper badge](https://badges.greenkeeper.io/zixia/botbuilder-wechaty-connector.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.com/zixia/botbuilder-wechaty-connector.svg?branch=master)](https://travis-ci.com/zixia/botbuilder-wechaty-connector)
[![Build Status](https://zixia.visualstudio.com/zixia/_apis/build/status/zixia.botbuilder-wechaty-connector)](https://zixia.visualstudio.com/zixia/_build/latest?definitionId=3)

Microsoft Bot Framework v3 connector for Wechat **PERSONAL** Account

## FEATURES

* Ready for Microsoft Bot Framework v3
* **no need a registered bot** on [dev.botframework.com](https://dev.botframework.com/), but require a wechat personal(NOT official!) account.
* Powered by [wechaty](https://github.com/chatie/wechaty)
* Support receiving and sending almost any wechat message types(WIP)

## TODO

* [ ] Add Room Message Support
* [ ] Add Full Message Types Support(current we only support text messages)

## INSTALLATION

```shell
npm install botbuilder-wechaty-connector
```

## Preparation

We assume that, you already have a wechat personal account.

## Usage

**Step 1**, create your bot with wechaty connector

```ts
import { UniversalBot }     from 'botbuilder'
import { WechatyConnector } from 'botbuilder-wechaty-connector'

const wechatyConnector = new WechatyConnector()
wechatyConnector.listen()

const bot = new UniversalBot(wechatyConnector)
```

**Step 2**, add dialogs and you can see `message` in session object include wechat message content you sent.

```ts
bot.dialog('/', function (session) {
  console.log('Wechat message: ', session.message)
})
```

And, you can find media content like image, voice, video, etc in `message.attachments` of session object.(Not implement yet)

```ts
bot.dialog('/', function (session) {
  console.log('Wechat media: ', session.message.attachments)
});
```

**Step 4**, sending message out is the same.

Send text message

```ts
bot.dialog('/', function (session) {
  session.send("Im a wechaty bot!");
});
```

### Attachment

To Be Supported.

## EXAMPLE

An example is located at `examples/` directory. Using following command to run it.

```shell
npm run example
```

## THANKS

This package is greatly inspired by:

1. [botbuilder-wechat-connector](https://github.com/jyfcrw/botbuilder-wechat-connector), so thanks @jyfcrw.
1. [botbuilder-wechat](https://github.com/markusf/botbuilder-wechat), so thanks @markusf.

## ISSUES

Please feel free to [open issues](https://github.com/zixia/botbuilder-wechaty-connector/issues/new), if you have any suggestion.

## SEE ALSO

* [Create a bot with the Bot Builder SDK for Node.js](https://docs.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-quickstart)
* [Key concepts in the Bot Builder SDK for Node.js](https://docs.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-concepts)
* [VIDEO: Become a Bot Builder with Microsoft Bot Framework - James Mann speaking at dotnetsheff in April, 2017](https://pusher.com/sessions/meetup/dotnetsheff/become-a-bot-builder-with-microsoft-bot-framework)

## CHANGELOG

### v3.0 (Jan 2019)

1. Release v3.0 for BotBuild v3

### v0.2 (Apr 19, 2018)

1. Skip messages from other than a personal account(like official account, and SYS message)
1. Refactoring all the code from `ConsoleConnector`

### v0.0.1 (Apr 17, 2018)

1. Working with Wechaty Personal Text Messages.
1. An example run by `npm run example`

## AUTHOR

[Huan LI](http://linkedin.com/in/zixia) \<zixia@zixia.net\>

<a href="https://stackexchange.com/users/265499">
  <img src="https://stackexchange.com/users/flair/265499.png" width="208" height="58" alt="profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites" title="profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites">
</a>

## COPYRIGHT & LICENSE

* Code & Docs © 2016-2018 Huan LI \<zixia@zixia.net\>
* Code released under the Apache-2.0 License
* Docs released under Creative Commons

---
_Source: https://npm.io/package/botbuilder-wechaty-connector · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
