diff --git a/CHANGELOG.md b/CHANGELOG.md index fbd62d6..dbf13d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## 更新日志 +### V4.2.7(2022-12-20) + +一、更新插件版本,增加ipad协议支持 ### V4.2.5(2022-12-07) diff --git a/README.md b/README.md index 9e05428..5dfaef1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ # ~~遗憾的通知~~ -uos 协议又可以重新使用了 +uos 协议又可以重新使用了,同时已经适配wechaty-puupet-padloacl的协议 ~~由于UOS桌面版协议微信已经关闭了,没法再继续用桌面版协议登录了,现在只能换回web协议了。可以登录网页版微信的账号可以继续用,不能登录网页版协议的就不能用了。或者你可以申请Wechaty 的ipad local协议的token可以免费试用7天 。申请地址: https://github.com/padlocal/wechaty-puppet-padlocal~~ ## 智能微秘书-插件版 (Wechaty 1.x版本) @@ -201,7 +201,15 @@ docker run -e AIBOTK_KEY="微秘书apikey" -e AIBOTK_SECRET="微秘书apiSecret" ### 其他协议运行 -Wechaty1.x版本暂不支持ipad协议,如需ipad协议运行,请移步:[https://github.com/leochen-g/wechat-assistant-pro-ipad](https://github.com/leochen-g/wechat-assistant-pro-ipad) +~~Wechaty1.x版本暂不支持ipad协议,如需ipad协议运行,请移步:[https://github.com/leochen-g/wechat-assistant-pro-ipad](https://github.com/leochen-g/wechat-assistant-pro-ipad)~~ + +如果你有ipad的token,可以执行以下命令 + +```shell + +docker run -d -e PAD_LOCAL_TOKEN="你申请的ipadlocal token" -e AIBOTK_KEY="微秘书apikey" -e AIBOTK_SECRET="微秘书apiSecret" --name=wechatbot aibotk/wechat-assistant + +``` ## 体验与交流 @@ -237,7 +245,6 @@ Wechaty1.x版本暂不支持ipad协议,如需ipad协议运行,请移步:[h ![](./doc/img/index.png) ![](./doc/img/roomasync.png) ![](./doc/img/everyday.png) -![](./doc/img/schedule.png) ![](./doc/img/event.png) ![](./doc/img/material.png) @@ -251,11 +258,11 @@ Wechaty1.x版本暂不支持ipad协议,如需ipad协议运行,请移步:[h 群消息同步 -![](./doc/img/async.png) + 群合影 -![](./doc/img/group.jpeg) + diff --git a/doc/img/event.png b/doc/img/event.png index 1410cc5..dfcbd55 100644 Binary files a/doc/img/event.png and b/doc/img/event.png differ diff --git a/doc/img/everyday.png b/doc/img/everyday.png index e444d0e..a09daab 100644 Binary files a/doc/img/everyday.png and b/doc/img/everyday.png differ diff --git a/doc/img/index.png b/doc/img/index.png index cbd24d0..33444f1 100644 Binary files a/doc/img/index.png and b/doc/img/index.png differ diff --git a/doc/img/material.png b/doc/img/material.png index 0104413..07d59d9 100644 Binary files a/doc/img/material.png and b/doc/img/material.png differ diff --git a/doc/img/roomasync.png b/doc/img/roomasync.png index 5a3c990..6374df9 100644 Binary files a/doc/img/roomasync.png and b/doc/img/roomasync.png differ diff --git a/package.json b/package.json index c4d1b0d..b80a0c0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wechat-assistant", - "version": "4.2.6", - "description": "微信小助手4.2.6", + "version": "4.2.7", + "description": "微信小助手4.2.7", "main": "index.js", "type": "module", "scripts": { @@ -30,6 +30,7 @@ "dependencies": { "wechaty": "^1.20.2", "wechaty-dice-king": "^1.0.16", + "wechaty-puppet-padlocal": "^1.20.1", "wechaty-puppet-wechat": "^1.18.4", "wechaty-web-panel": "^1.2.9" }, diff --git a/pm2.json b/pm2.json index 5b47962..c4052e0 100644 --- a/pm2.json +++ b/pm2.json @@ -4,6 +4,7 @@ "name": "wechaty-pro", "cwd": "./", "script": "./index.js", + "cron_restart": "0 0 * * *", "log_date_format": "YYYY-MM-DD HH:mm Z", "error_file": "./logs/app-err.log", "out_file": "./logs/app-out.log", diff --git a/src/index.js b/src/index.js index c9dc743..210e803 100644 --- a/src/index.js +++ b/src/index.js @@ -1,26 +1,37 @@ -import { WechatyBuilder } from 'wechaty' -import { WechatyWebPanelPlugin } from 'wechaty-web-panel' +import {WechatyBuilder} from 'wechaty' +import {WechatyWebPanelPlugin} from 'wechaty-web-panel' const name = 'wechat-assistant-pro'; let bot = ''; +let padLocalToken = '' // 如果申请了ipadlocal的token,可以直接填入 +if (process.env['PAD_LOCAL_TOKEN']) { + console.log('读取到环境变量中的ipadLocalToken') + padLocalToken = process.env['PAD_LOCAL_TOKEN'] +} -console.log('默认使用uos web版微信协议') -bot = WechatyBuilder.build({ - name, // generate xxxx.memory-card.json and save login data for the next login - puppetOptions: { - uos: true - }, - puppet: 'wechaty-puppet-wechat', -}); +if (padLocalToken) { + console.log('读取到环境变量中的ipad token 使用ipad协议启动') + bot = WechatyBuilder.build({ + name, // generate xxxx.memory-card.json and save login data for the next login + puppetOptions: { + token: padLocalToken + }, puppet: 'wechaty-puppet-padlocal', + }); +} else { + console.log('默认使用uos web协议启动') + bot = WechatyBuilder.build({ + name, // generate xxxx.memory-card.json and save login data for the next login + puppetOptions: { + uos: true + }, puppet: 'wechaty-puppet-wechat', + }); +} -bot.use( - WechatyWebPanelPlugin({ - apiKey: '***', - apiSecret: '****', - }) - ) -bot.start() - .catch((e) => console.error(e)); +bot.use(WechatyWebPanelPlugin({ + apiKey: '***', apiSecret: '****', +})) +bot.start() + .catch((e) => console.error(e)); \ No newline at end of file