Learn more about Wechaty Puppet Services from https://wechaty.js.org/docs/puppet-services
You can use Wechaty with other puppet services like WXWork, Rock, PadLocal, etc as well.
Hello, dear developers!
In order to better provide services, JuziBot Puppet Service plans to conduct a major upgrade of wechaty-puppet-padplus on November 30.
If you are using the wechaty-puppet-padplus service, you need to perform the following upgrade operations. (If you are not using wechaty-puppet-padplus, you can safely ignore this notice)
Wechaty-puppet-padplus upgrade instructions are as follows:
Uninstall wechaty-puppet-padplus, install wechaty-puppet-hostie
In the code, wechaty-puppet-padplus that starts wechaty is replaced with wechaty-puppet-hostie
Detailed description: wechaty-puppet-padplus will be offline on November 30. Paid users can upgrade to the following two puppets:
wechaty-puppet-donut: Personal WeChat based on Windows, in addition to the basic functions of padplus, it also supports receiving corporate WeChat messages. For details, see https://github.com/juzibot/donut-tester
wechaty-puppet-wxwork: Enterprise WeChat based on Windows client. For details, see https://github.com/juzibot/wxwork-tester
If the code base is not upgraded before November 30, the wechaty-puppet-padplus service will stop at 00:00 on December 1, making your hosted WeChat unavailable. Therefore, it is strongly recommended to upgrade the code in advance to avoid robot accidents. Termination of service.
If you have any questions, please contact our customer service in time, WeChat: juzibot
For details, see: https://github.com/wechaty/puppet-service-providers/issues/11
Our Mission: Make it easy to build a WeChat Chatbot for developers.
We provide a free token for the developers who have a strong will and ability to build a valuable chatbot for users.
See more: Token Support, Everything about wechaty
Node
version firstnode --version // v10.16.0
for windows system
To make sure you could install wechaty-puppet-padplus
successfully, you have to start PowerShell as Administrator and run these commands:
npm install -g windows-build-tools npm install -g node-gyp
mkdir my-padplus-bot && cd my-padplus-bot npm init -y npm install ts-node typescript -g tsc --init --target ES6 touch bot.ts // copy the example code to it
npm install wechaty@latest npm install wechaty-puppet-padplus@latest
Or some new features developing version:
npm install wechaty@next npm install wechaty-puppet-padplus@next
There's no need to install
wechaty-puppet
in my-padplus-bot
npm install qrcode-terminal ...
If you want to see detail logs about your bot, just run:
BROLOG_LEVEL=silly ts-node bot.ts
or
BROLOG_LEVEL=silly node bot.js
wechaty-puppet-padplus use flash-store or mongo as cache store
flash-store[default]
mongo
If you want to use mongo as cache sotre, just set the cacheOption, like this:
const puppet: Puppet = new PuppetPadplus({ token, cacheOption: {type: 'mongo',url: 'mongodb://127.0.0.1:27017/testdb', },})
When you use mongo as cache store, wechaty-puppet-cache use some tables which have wechaty-cache
prefix. detail>>
Set environment in windows
$Env:BROLOG_LEVEL='silly'ts-node bot.ts
If step 1~3 can not help you install successfully, please try this suggestion, otherwise just skip it please.
rm -rf node_modules package-lock.json npm install
// bot.tsimport { Contact, Message, Wechaty } from 'wechaty'import { ScanStatus } from 'wechaty-puppet'import { PuppetPadplus } from 'wechaty-puppet-padplus'import QrcodeTerminal from 'qrcode-terminal'const token = ' your-token'const puppet = new PuppetPadplus({ token,})const name = 'your-bot-name'const bot = new Wechaty({ puppet, name, // generate xxxx.memory-card.json and save login data for the next login})bot .on('scan', (qrcode, status) => {if (status === ScanStatus.Waiting) { QrcodeTerminal.generate(qrcode, {small: true })} }) .on('login', (user: Contact) => {console.log(`login success, user: ${user}`) }) .on('message', (msg: Message) => {console.log(`msg : ${msg}`) }) .on('logout', (user: Contact, reason: string) => {console.log(`logout user: ${user}, reason : ${reason}`) }) .start()
Please use environment variable PADPLUS_REPLAY_MESSAGE
to activate this function.
PADPLUS_REPLAY_MESSAGE=true node bot.js
Function | padpro | padplus | macpro |
---|---|---|---|
<message> | |||
Send and receive texts | ✅ | ✅ | ✅ |
Send and receive personal business cards | ✅ | ✅ | ✅ |
Send and receive graphic links | ✅ | ✅ | ✅ |
Send pictures and files | ✅ | ✅(There is a size limit on the content, below 20M) | ✅ |
Receive pictures and files | ✅ | ✅(There is a size limit for content, below 25M) | ✅ |
Send video | ✅ | ✅ | ✅ |
receive video | ✅ | ✅ | ✅ |
Send applet | ✅ | ✅ | |
Receive animated pictures | ✅ | ✅ | |
Send GIF | ✅ | ✅ | |
Receive voice messages | ✅ | ✅ | ✅ |
Send voice message | ✅ | ||
forward text | ✅ | ✅ | ✅ |
Forward pictures | ✅ | ✅ | ✅ |
Forward image and text link | ✅ | ✅ | ✅ |
Forward audio | ✅ | ✅ | |
Forward video | ✅ | ✅ | ✅ |
Forward files | ✅ | ✅ | ✅ |
Redirect the diagram | |||
Forward mini program | ✅ | ||
<group> | |||
Create group chat | ✅ | ✅ | ✅ |
Set up group announcements | ✅ | ✅ | ✅ |
Get group announcements | ✅ | ||
Group QR code | ✅ | ✅ | ✅ |
Invite people into the group | ✅ | ✅ | ✅ |
Kick someone out of the group | ✅ | ✅ | ✅ |
Exit group chat | ✅ | ✅ | ✅ |
Change group name | ✅ | ✅ | ✅ |
Group entry event | ✅ | ✅ | ✅ |
outlier events | ✅ | ✅ | ✅ |
Group name change event | ✅ | ✅ | ✅ |
@group member | ✅ | ✅ | ✅ |
Group list | ✅ | ✅ | ✅ |
Group member list | ✅ | ✅ | ✅ |
Group details | ✅ | ✅ | ✅ |
<Contact> | |||
Modify remarks | ✅ | ✅ | ✅ |
Add friends | ✅ | ✅ | ✅ |
Automatically pass friends | ✅ | ✅ | |
Add friends | ✅ | ✅ | ✅ |
friends list | ✅ | ✅ | ✅ |
Friend details | ✅ | ✅ | ✅ |
<Others> | |||
Log in to WeChat | ✅ | ✅ | ✅ |
Scan code status | ✅ | ✅ | |
Log out of WeChat | ✅ | ✅ | ✅ |
Depend on protocol | iPad | iPad | Mac |