/wechaty-getting-started

Wechaty Starter Project Template that Works Out-of-the-Box

Primary LanguageJavaScript

WECHATY-GETTING-STARTED

Node.js v10 Powered by Wechaty Build Status Windows Build Status 中文版本 Greenkeeper badge

Wechaty is a Wechat Bot SDK for Personal Account that lets you create software to extend the functionality of the Wechat, writen in Node.js with TypeScript, Support all platforms including Linux, OSX, Win32, and Docker.

As a developer, you can use Wechaty to easily build your bot on top of Wechat Personal Account, effectively manage message sending/receiving, room creating/inviting, contact friendship, and delightful add artificial intellengence between users and your bot.

This repository should work out-of-the-box, and is the best start point for Wechaty beginners.

REQUIREMENTS

  1. Node.js v10 or above
  2. Build Tools for your Platform

GETTING STARTED

0. Install Node.js (>=10)

If you have not installed Node.js(or version is below 10),You need to install the latest version of Node.js first by following the links below:

Instal Node.js for other platforms can be found at https://nodejs.org/en/download/package-manager/

1. Clone this Repository

git clone https://github.com/lijiarui/wechaty-getting-started.git
cd wechaty-getting-started

2. Install Dependencies

npm install

3. Run the Bot

npm start

# Or use node to run bot directly

node examples/starter-bot.js

You are all set!

ADVANCED

1. TypeScript

npm run start:ts

This will run examples/starter-bot.ts instead of examples/starter-bot.js for you.

2. Wechaty Tutorial

Above is a 10 minute video tutorial(a little outdated, it's running under v0.14 or older versions of Wechaty), which is a good way to start if you are new to Wechaty.

3. More Examples

Note: Please make sure you can run npm start with this repository first before you go furture with more examples!

API REFERENCE

  1. JSDoc: https://chatie.io/wechaty/

SEE ALSO

1. Docker Wechaty Getting Started

Docker

https://github.com/Chatie/docker-wechaty-getting-started

2. Heroku Wechaty Getting Started

Heroku

https://github.com/Chatie/heroku-wechaty-getting-started

FAQ

1. I can not login with my Wechat account

Wechat account that registered after 2017 will not be able to login via Web API. Learn more at wechaty/wechaty#872

Solution: Wechaty support protocols other than Web API, such as pad. Learn more at wechaty/wechaty#1296

2. What is a Puppet in Wechaty

The term Puppet in Wechaty is an Abstract Class for implementing protocol plugins. The plugins are the component that helps Wechaty to control the Wechat(that's the reason we call it puppet).

The plugins are named PuppetXXX, like PuppetPuppeteer is using the google puppeteer to control the WeChat Web API via a chrome browser, PuppetPadchat is using the WebSocket protocol to connect with a Protocol Server for controlling the iPad Wechat program. More detail you could go Puppet in wiki.