Git Product home page Git Product logo

wechaty-getting-started's Introduction

Wechaty Getting Started Powered by Wechaty

Node.js CI Node.js v12 TypeScript

Wechaty is a Conversational AI RPA SDK for Chatbot that lets you create software to extend the functionality of the WeChat, written 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 intelligence between users and your bot.

GitPod Ready-to-Code

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

Features

  1. Works out-of-the-box under Linux/Mac/Windows.
  2. Supports all puppets like Web, Pad, Windows, and Mac.
  3. Reply a dong message when it received a ding.

Requirements

  1. Node.js v12+
  2. Build Tools for your platform

Getting Started

1 Install Node.js (>=12)

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/

2 Clone this Repository

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

3 Install Dependencies

npm install

4 Run the Bot

npm start

Or use node to run bot directly

# Linux: export WECHATY_LOG=verbose
# Win32: set WECHATY_LOG=verbose
npx ts-node examples/ding-dong-bot.ts

You are all set!

Working with Different Puppets

By default, the Wechaty will use the Web protocol (wechaty-puppet-puppeteer) for logging in bot.

If you want to use other protocols instead of the Web protocol, then you need to specified a puppet service provider other than the wechaty-puppet-puppeteer.

Thanks for the great contributions from our great community, there are many puppet service providers can be used by Wechaty, which helps us to use protocols like Web, Pad, Mac, and Windows.

In order to specify a puppet service provider, you can set the environment WECHATY_PUPPET to the specific NPM module name.

Wechaty Puppet Service Providers

Protocol NPM
Web wechaty-puppet-puppeteer
Hostie wechaty-puppet-hostie
Pad wechaty-puppet-padplus

For example, if you want to use the Hostie puppet, you should set WECHATY_PUPPET=wechaty-puppet-hostie before you run npm start.

You also need a TOKEN for the wechaty-puppet-hostie, and set it to the WECHATY_PUPPET_HOSTIE_TOKEN environment variable.

Linux

export WECHATY_PUPPET=wechaty-puppet-hostie
export WECHATY_PUPPET_HOSTIE_TOKEN='your_token_here'
npm start

Windows

set WECHATY_PUPPET=wechaty-puppet-hostie
set WECHATY_PUPPET_HOSTIE_TOKEN='your_token_here'
npm start

Advanced

1 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.

2 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. GitBook: https://wechaty.js.org/api

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

3 Wechaty Home

https://wechaty.github.io

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.

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#)

Contributors

contributor contributor contributor contributor contributor contributor contributor contributor

Maintainers

@wechaty/contributors

Copyright & License

  • Code & Docs © 2018 Wechaty Contributors (https://github.com/wechaty)
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

wechaty-getting-started's People

Contributors

huan avatar lijiarui avatar dependabot-preview[bot] avatar qhduan avatar suntong avatar greenkeeper[bot] avatar snyk-bot avatar limingth avatar tbht avatar windmemory avatar d-vr avatar judaschrist avatar

Watchers

James Cloos avatar

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.