• Stars
    star
    781
  • Rank 58,232 (Top 2 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Starter Project Template for Wechaty works out-of-the-box

Wechaty Getting Started Powered by Wechaty

Node.js CI Node.js v16 TypeScript ES Modules

About Wechaty

Wechaty is a Conversational RPA(Robotic Process Automation) SDK(Software Development Kit) for Chatbot Makers. It's well designed with an easy to use API. It supports all operating systems including Linux, OSX, Win32, Docker, and lots of IMs(Instant Messaging services) including WeChat, WeCom, Whatsapp, Lark, Gitter, etc.

As a developer, you can use Wechaty to easily build your bot, effectively manage message sending and receiving, room creation and sending out invitations, contact friends, and delightfully add artificial intelligence between users and your bot.

About Wechaty Getting Started Project

If you are a total beginner to Wechaty, this project is the best starting point for you. You can run it on a Cloud IDE in a couple of steps or on a local setup on your machine as described in the sections below.

If you encounter difficulties or have any questions, you are welcome to ask for help in our Gitter room at https://gitter.im/wechaty/wechaty.

Notice: the current active version of Wechaty is v1.x which is not compatible with most of the v0.x modules.

Features of Wechaty Getting Started project

  1. It works out of the box on Linux, Mac or Windows.
  2. Supports all puppets like Web, Pad, Windows, and Mac.
  3. It replies with a dong message when it receives a ding message.

Running Wechaty Getting Started Project on a cloud based IDE

The fastest way to getting started with Wechaty is to use a Cloud based IDE for running the Wechaty Getting Started Project. You can either use Gitpod or Google Cloud Shell.

If you are a total beginner, then we recommed Gitpod.

Using Gitpod ❤️ Wechaty

Gitpod is an online and open source platform for automated and ready-to-code development environments. You can click the button below to access a complete setup of Wechaty Getting Started ding-dong BOT project on gitpod. If you have never used gitpod before, you will be required to login using your gitHub account.

GitPod Ready-to-Code

You can learn more about Gitpod ❤️ Wechaty from our blog: Getting Started Without Leaving Your Browser: Wechaty ❤️ Gitpod, @huan, Feb 06, 2021

Using Google Cloud Shell

Google Cloud Shell is an online development and operations environment accessible anywhere with your browser. You can run this project on Google Cloud Shell by clicking the button below.

Open in Cloud Shell

Generated via open-in-cloud-shell

After opening the Google Cloud Shell editor, there should be an open tutorial in the right panel which you can follow to learn more about Wechaty.

Learn more about running this project on Google Cloud Shell from our blog: Google Cloud Shell Tutorials for Wechaty, @huan, Feb 20, 2021

Running Wechaty Getting Started project on your local machine

Prerequisites

For you to run this project on your local machine, you need to:

  1. Have Node.js v16+ installed on your machine. You can run the command node -v on the terminal to check whether you have Node.js installed. If you have it, you should be able to see the version printed on the terminal like v16.13.0. Your version might be different from v16.13.0. If it is not installed or your version is below 16, You need to install the latest version by following the links below:

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

  2. Have Wechaty Puppet Service TOKEN if you want to use RPA protocols other than Web

Step 1: Clone this Repository

You need to clone this repository to your local machine and then switch to wechaty-getting-started directory by running the commands below.

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

Step 2: Install Dependencies

You need to install dependencies by running the command below.

npm install

Step 3: Run the Bot

You can use export to set environment variables in Linux, and use set in Windows. If you run into errors while running this command, check the troubleshooting tips in step 4.

Linux
export WECHATY_LOG=verbose
export WECHATY_PUPPET=wechaty-puppet-wechat
npm start
# the above is equals to the below command:
# npx ts-node examples/ding-dong-bot.ts
Windows
set WECHATY_LOG=verbose
set WECHATY_PUPPET=wechaty-puppet-wechat
npm start
# the above is equals to the below command:
# npx ts-node examples/ding-dong-bot.ts

You are all set!

Step 4: Troubleshooting

If you run into problems while following the above steps, try the options below. You are also welcome to ask questions in our gitter chatroom.

  1. You might also need windows-build-tool if you are using windows:

    npm install windows-build-tools

Working with Different Puppets

In our getting started example, the ding-dong BOT uses wechaty-puppet-wechat4u when WECHATY_PUPPET is not set, which is just for newcomer's convenience.

By default, Wechaty will use the Puppet Service for logging in your bot. You can use other Puppet Provider like Whatsapp Web protocol( wechaty-puppet-whatsapp).

If you want to use a Wechaty Puppet Provider for a different protocol, then you need to specify a puppet service provider name (the same as its NPM name) by setting the WECHATY_PUPPET environment variable.

Thanks to the great contributions from our community, there are many Wechaty Puppets which can be used by Wechaty. They have helped us use protocols like Web, Pad, Mac, and Windows.

Wechaty Puppets

Protocol NPM
Puppet Service wechaty-puppet-service
Whatsapp Web wechaty-puppet-whatsapp
WeChat Web wechaty-puppet-wechat
WeChat Pad wechaty-puppet-padlocal

Visit our website to learn more about Wechaty Puppet Service Providers

For example, if you want to use the padlocal puppet, you should set WECHATY_PUPPET=wechaty-puppet-padlocal before you run npm start. You also need a TOKEN for wechaty-puppet-padlocal which you need to set to the WECHATY_PUPPET_PADLOCAL_TOKEN environment variable. You can apply for the PadLocal TOKEN from here. The code snippets below illustrate what has been described above on Linux/ MacOS and on Windows.

On Linux / macOS

export WECHATY_PUPPET=wechaty-puppet-padlocal
export WECHATY_PUPPET_PADLOCAL_TOKEN='puppet_padlocal_your-token-here'
npm start

On Windows

set WECHATY_PUPPET=wechaty-puppet-padlocal
set WECHATY_PUPPET_PADLOCAL_TOKEN='puppet_padlocal_your-token-here'
npm start

Learn more about installing Wechaty on windows from this blog post.

Advanced tutorials

1. Wechaty Tutorial

Above is a 10 minute video tutorial. It is using version 0.14 or older versions of Wechaty therefore it is also outdated. It is a good way to start if you are new to Wechaty.

2. More Examples

Note: Before you attempt more examples, make sure you have tried out the wechaty getting started project in this repository.

API REFERENCE

  1. Official API Docs: https://wechaty.js.org/docs/api

MORE RESOURCES

1. Docker Wechaty Getting Started

Docker

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

2. Heroku Wechaty Getting Started

Heroku

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

3. Wechaty Home

https://wechaty.github.io

FAQ

1. I can not login with my Wechat account

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

Solution: You can use 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 components that help Wechaty to control Wechat and that's the reason why we call it puppet.

The plugins are named PuppetXXX, for example PuppetWeChat is using the google puppeteer to control the WeChat Web API via a chrome browser, PuppetPadchat uses the WebSocket protocol to connect with a Protocol Server for controlling the iPad Wechat program. For more details you can go to Puppet in wiki.

Learn more about Wechaty Puppet from our documentation at Wechaty Puppet

Wechaty Getting Started in Multiple Languages

Wechaty in Python Wechaty in Go Wechaty in Java Wechaty in Scala Wechaty in PHP Wechaty in .NET(C#)

History

main v1.18 (Mar 14, 2022)

Add CQRS Wechaty examples.

v1.11 (Oct 30, 2021)

Branch: v1.11: release v1.11 of Wechaty.

  1. v0.13: Enable ESM (ES Module) support (chatie/tsconfig#16)

v0.8 (Feb 20, 2021)

Open in Cloud Shell

Using Google Cloud Shell for a quick setup!

v0.6 (Feb 11, 2021)

GitPod Ready-to-Code

Using Gitpod for a quick setup!

v0.0.1 (Jan 12, 2017)

Init version

Contributors

contributor contributor contributor contributor contributor contributor contributor contributor

Maintainers

@wechaty/contributors

Copyright & License

  • Code & Docs © 2018-now Huan and Wechaty Contributors
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

More Repositories

1

wechaty

Conversational RPA SDK for Chatbot Makers. Join our Discord: https://discord.gg/7q8NBZbQzt
TypeScript
19,950
star
2

python-wechaty

Python Wechaty is a Conversational RPA SDK for Chatbot Makers written in Python
Python
1,568
star
3

puppet-padlocal

Puppet PadLocal is a Pad Protocol for WeChat
TypeScript
619
star
4

go-wechaty

Go Wechaty is a Conversational SDK for Chatbot Makers Written in Go
Go
480
star
5

puppet-xp

Wechaty Puppet WeChat Windows Protocol
JavaScript
449
star
6

java-wechaty

Java Wechaty is a Conversational SDK for Chatbot Makers Written in Kotlin
Kotlin
409
star
7

puppet-wechat

Wechaty Puppet Provider for WeChat
TypeScript
402
star
8

wechaty-puppet-padplus

DEPRECATED: One puppet based on iPad protocal for Wechaty
TypeScript
315
star
9

wechaty-puppet-padchat

Padchat Puppet for Wechaty
TypeScript
281
star
10

wechaty-puppet-padpro

TypeScript
238
star
11

puppet

Puppet Provider Abstraction for Wechaty
TypeScript
225
star
12

python-wechaty-getting-started

Python Wechaty Starter Project Template that Works Out-of-the-Box
Makefile
180
star
13

matrix-appservice

Wechaty [Matrix] Application Services Bridge
TypeScript
132
star
14

docusaurus

Wechaty Official Website for Documentations, Powered by Docusaurus.
MDX
112
star
15

puppet-wechat4u

Wechat4u Puppet for Wechaty
TypeScript
92
star
16

friday

Friday is an Assistant BOT Built on Wechaty for Serving our Community
TypeScript
81
star
17

dotnet-wechaty

.NET Wechaty is a Conversational SDK for Chatbot Makers Written in C#
C#
78
star
18

puppet-service

Wechaty Puppet Provider for providing/consuming the Wechaty Puppet Service
TypeScript
67
star
19

docker-getting-started

Getting Started Template for Docker Users
TypeScript
64
star
20

python-wechaty-template

getting started project template for python-wechaty
Python
56
star
21

php-wechaty

PHP Wechaty is a Conversational SDK for Chatbot Makers Written in PHP https://github.com/wechaty/docker-php-wechaty-getting-started
PHP
55
star
22

java-wechaty-getting-started

Java Wechaty Starter Project Template that Works Out-of-the-Box
Makefile
46
star
23

puppet-mock

Puppet Mocker for Wechaty (& A Puppet Template Starter)
TypeScript
45
star
24

go-wechaty-getting-started

Go Wechaty starter project template that works out-of-the-box
Makefile
44
star
25

bot5

Bot Friday Club - BOT5
TypeScript
39
star
26

python-wechaty-puppet-itchat

Python Wechaty Puppet Powered by Itchat
Python
38
star
27

jekyll

Wechaty Official Website for News, Blogs, Contributor Profiles, Powered by Jekyll.
Java
37
star
28

plugin-contrib

Wechaty Plugin Ecosystem Contrib Package
TypeScript
33
star
29

summer

Summer of Wechaty (SoW) is a program for connecting students with the Wechaty community for coding & tech writing.
32
star
30

chatbot-0-to-1

Chatbot Zero to One
TypeScript
31
star
31

puppet-supports

Wechaty Puppet Services (WPS)
31
star
32

rust-wechaty

Rust Wechaty is a Conversational RPA SDK for Chatbot Makers written in Rust
Rust
24
star
33

puppet-whatsapp

Wechaty Puppet for Whatsapp
TypeScript
24
star
34

puppet-lark

Wechaty Puppet for Lark
TypeScript
23
star
35

webwx-app-tracker

Live Tracking webwxApp Version Change
JavaScript
22
star
36

openapi

Wechaty REST API Server with OpenAPI Specification (aka. Swagger)
JavaScript
22
star
37

wechaty-electron

Wechaty for Desktop
JavaScript
18
star
38

puppet-official-account

Wechaty Puppet for WeChat Official Account
TypeScript
17
star
39

java-wechaty-bak

Java Wechaty is an RPA SDK for WeChat Individual Account
Java
15
star
40

botbuilder-wechaty-adapter

Microsoft Bot Framework v4 Adapter for Wechat Individual Account
TypeScript
15
star
41

puppet-oicq

Wechaty Puppet for QQ based on project takayama-lily/oicq-template
TypeScript
15
star
42

wechaty-weixin-openai

Wechaty plugin for integrate your bot with weixin openai-sdk
TypeScript
13
star
43

python-wechaty-plugin-contrib

Wechaty Plugin Ecosystem Contrib Package
Python
13
star
44

python-wechaty-puppet

Python Puppet Provider Abstraction for Wechaty
Python
12
star
45

dotnet-wechaty-getting-started

.NET Wechaty Starter Project Template that Works Out-of-the-Box
C#
11
star
46

heroku-wechaty-getting-started

Wechaty Starter Project Template with Heroku Deploy Button that Works Out-of-the-Box
TypeScript
10
star
47

puppet-walnut

Wechaty Puppet Walnut - 硬核桃5G消息
TypeScript
9
star
48

mac-wechat-app-tracker

macOS WeChat.app header files version history (automatic updated)
Objective-C
9
star
49

python-wechaty-puppet-service

Python Puppet Service Client for Wechaty
Python
8
star
50

wechaty-puppet-dingtalk

TypeScript
8
star
51

php-wechaty-getting-started

PHP Wechaty Starter Project Template that Works Out-of-the-Box
Makefile
8
star
52

scala-wechaty

Scala Wechaty is a Conversational SDK for Chatbot Makers Written in Scala
Scala
8
star
53

python-wechaty-puppet-padplus

Python Hostie Puppet for Wechaty
Python
7
star
54

easy-matrix-wechaty

A simple and fast temporary deployment solution for [matrix-appservice-wechaty](https://github.com/wechaty/matrix-appservice-wechat) with matrix. (Easy to be a multi bridge server for other matrix bridges.)
Shell
7
star
55

wishlist

Puppets, Bots, and other Tooling Requested by Community Members
6
star
56

im-aggregation

Aggregate WeCom, WeChat, and WhatsApp together.
TypeScript
6
star
57

chat

Friday BOT empowered by GPT-4 with maximum token length 32K, grounded with Wechaty SDK knowledge
5
star
58

wechaty-ui

Web UI for polyglot-wechaty based on the plugin system.
Vue
5
star
59

cqrs

An event-driven architecture wrapper for Wechaty that applies the CQS principle by using separate Query and Command messages to retrieve and modify the bot state, respectively.
TypeScript
5
star
60

vorpal-contrib

Wechaty Vorpal Chat CLI (Command Line Interface) Commands
TypeScript
4
star
61

PMC

Project Management Committees
Shell
4
star
62

wechaty-puppet-macOS

Wechaty Puppet Provider: macOS,make your macOS as a service provider for your self.
Objective-C
4
star
63

ha

High Available (HA) Wechaty is a Load Balance for providing High Availability for Wechaty Chatbot by spreading requests across multiple WeChat individual accounts.
TypeScript
4
star
64

redux

Wechaty Redux Plugin, Reducer Bundle, and Ducks Proposal Implementation.
TypeScript
4
star
65

wechaty-got-kicked-out

this is a wechaty plugin to monitor whether your bot is kicked out of group chat.
TypeScript
4
star
66

plugin-qnamaker

QnAMaker.ai Plugin for Wechaty
TypeScript
4
star
67

bot5-assistant

BOT Friday Club Meeting Assistant BOT
TypeScript
3
star
68

plugin-chatopera

🐸 Chatopera Plugin for Wechaty
TypeScript
3
star
69

sidecar-demos

Sidecar Demos & Examples
JavaScript
3
star
70

cli

Terminal Client for Wechaty
TypeScript
3
star
71

bot5-rasa-nlu

Rasa NLU for Bot5
Dockerfile
3
star
72

vorpal

CLI for Chatbot - Extensible Commands for ChatOps, Powered by Vorpal.
TypeScript
3
star
73

docker-php-wechaty-getting-started

Getting Started Template for Docker Users
Shell
2
star
74

puppet-discord

Discord Puppet for Wechaty
TypeScript
2
star
75

ducks-contrib

Wechaty Ducks Contrib
JavaScript
2
star
76

token

Wechaty Token-Based Authentication Manager
TypeScript
2
star
77

ngNext-hackthon-2020-Conversational-AI

2
star
78

plugin-freshdesk

Wechaty Freshdesk Plugin helps Freshdesk unifies conversations from WeChat, and helps you resolve issues across channels effortlessly!
TypeScript
2
star
79

chat-drive

Chat Drive is a conversational storage solution that allows you to save files from the WeChat room, and search & access them anytime by talking to our chatbot.
TypeScript
2
star
80

chatbot-1-to-2

the source code of chatbot-1-to-2
JavaScript
1
star
81

qrcode

Online QRCode Image Generator
HTML
1
star
82

php-grpc

PHP Stubs for Chatie GRPC (DO NOT EDIT: Code generated by grpc_php_plugin)
PHP
1
star
83

js.org

Wechaty Official Website for News, Blogs, Contributor Profiles, and Documentations.
1
star
84

rust-wechaty-getting-started

Rust Wechaty Starter Project Template that Works Out-of-the-Box
Makefile
1
star
85

OSSRH-56843

https://issues.sonatype.org/browse/OSSRH-56843
1
star
86

go-grpc

Go Stubs for Chatie GRPC (DO NOT EDIT: Code generated by protoc-gen-go)
1
star
87

python-wechaty-puppet-official-account

Wechaty Puppet for WeChat Official Account
Python
1
star
88

actor

Wechaty Actor Model, Powered by XState, Mailbox, and CQRS
JavaScript
1
star
89

plugin-intercom

Wechaty Intercom Plugin helps you build better customer relationships through WeChat across the customer journey.
TypeScript
1
star
90

wechaty-puppet-sidecar

A Universal Puppet Powered by Sidecar
TypeScript
1
star
91

puppet-gitter

Gitter.im Puppet for Wechaty
TypeScript
1
star
92

OSSRH-56865

https://issues.sonatype.org/browse/OSSRH-56865
1
star