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.
親愛的開發者,您好!
為了更好的提供服務,JuziBot Puppet Service 計劃於11月30日進行一次wechaty-puppet-padplus 重大升級。
如您正在使用wechaty-puppet-padplus服務, 則需要進行以下升級操作。 (如未使用wechaty-puppet-padplus,可安全的忽視本通知)
wechaty-puppet-padplus 升級說明如下:
卸載wechaty-puppet-padplus, 安裝wechaty-puppet-hostie
代碼中啟動wechaty的wechaty-puppet-padplus 更換成wechaty-puppet-hostie
詳細說明: wechaty-puppet-padplus 將會在11月30日下線,已付費的用戶可以升級到下面的兩個puppet:
wechaty-puppet-donut: 基於windows 的個人微信,除了padplus 的基礎功能外,還支援接受企業微信訊息,詳細資訊請見https://github.com/juzibot/donut-tester
wechaty-puppet-wxwork: 基於windows 用戶端的企業微信,詳細資訊請見https://github.com/juzibot/wxwork-tester
如在11月30日前沒有升級程式碼庫,wechaty-puppet-padplus 服務將會在12月1日00:00停止服務,導致您託管的微信不可用,所以強烈建議提前進行程式碼升級,以避免機器人意外終止服務。
如果您有任何問題,請及時與我們的客服聯繫,微信: juzibot
詳情請見: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
功能 | padpro | padplus | macpro |
---|---|---|---|
<訊息> | |||
收發文字 | ✅ | ✅ | ✅ |
收發個人名片 | ✅ | ✅ | ✅ |
收發圖文鏈接 | ✅ | ✅ | ✅ |
傳送圖片、文件 | ✅ | ✅(對內容有大小限制,20M以下) | ✅ |
接收圖片、文件 | ✅ | ✅(對內容有大小限制,25M以下) | ✅ |
傳送影片 | ✅ | ✅ | ✅ |
接收視訊 | ✅ | ✅ | ✅ |
發送小程式 | ✅ | ✅ | |
接收動圖 | ✅ | ✅ | |
發送動圖 | ✅ | ✅ | |
接收語音訊息 | ✅ | ✅ | ✅ |
傳送語音訊息 | ✅ | ||
轉發文字 | ✅ | ✅ | ✅ |
轉發圖片 | ✅ | ✅ | ✅ |
轉發圖文鏈接 | ✅ | ✅ | ✅ |
轉發音訊 | ✅ | ✅ | |
轉發視頻 | ✅ | ✅ | ✅ |
轉發文件 | ✅ | ✅ | ✅ |
轉動圖 | |||
轉發小程式 | ✅ | ||
<群組> | |||
建立群聊 | ✅ | ✅ | ✅ |
設定群公告 | ✅ | ✅ | ✅ |
獲取群公告 | ✅ | ||
群二維碼 | ✅ | ✅ | ✅ |
拉人進群 | ✅ | ✅ | ✅ |
踢人出群 | ✅ | ✅ | ✅ |
退出群聊 | ✅ | ✅ | ✅ |
改群名稱 | ✅ | ✅ | ✅ |
入群事件 | ✅ | ✅ | ✅ |
離群事件 | ✅ | ✅ | ✅ |
群組名稱變更事件 | ✅ | ✅ | ✅ |
@群組成員 | ✅ | ✅ | ✅ |
群組列表 | ✅ | ✅ | ✅ |
群組成員列表 | ✅ | ✅ | ✅ |
群詳情 | ✅ | ✅ | ✅ |
<聯絡人> | |||
修改備註 | ✅ | ✅ | ✅ |
新增好友 | ✅ | ✅ | ✅ |
自動通過好友 | ✅ | ✅ | |
新增好友 | ✅ | ✅ | ✅ |
好友列表 | ✅ | ✅ | ✅ |
好友詳情 | ✅ | ✅ | ✅ |
<其他> | |||
登入微信 | ✅ | ✅ | ✅ |
掃碼狀態 | ✅ | ✅ | |
退出微信 | ✅ | ✅ | ✅ |
依賴協定 | iPad | iPad | Mac |