Commit 19c93336 authored by nanahira's avatar nanahira

add wechaty-puppet-xp

parent 19225809
......@@ -16,8 +16,17 @@ npm install koishi-plugin-adapter-wechaty
plugins:
adapter-wechaty:
name: 'koishi' # Wechaty 配置文件保存路径。
puppet: 'wechaty-puppet-wechat' # 支持 wechat 和 xp 两种。xp 只在 WIndows 支持。
```
## 使用方法
### wechaty-puppet-wechat
启动插件,并在 Koishi 控制台的『日志』或是 stdout 中查看二维码,扫描登录。
### wechaty-puppet-xp
仅限 Windows 操作系统,需要安装 [特定版本微信](https://github.com/tom-snow/wechat-windows-versions/releases/download/v3.6.0.18/WeChatSetup-3.6.0.18.exe)
先在本地的微信中登录,然后启动该插件。
This diff is collapsed.
......@@ -51,7 +51,8 @@
"mime2ext": "^1.0.1",
"qrcode-terminal": "^0.12.0",
"wechaty": "^1.20.2",
"wechaty-puppet-wechat": "^1.18.4"
"wechaty-puppet-wechat": "^1.18.4",
"wechaty-puppet-xp": "^1.12.7"
},
"peerDependencies": {
"koishi": "^4.11.1"
......
......@@ -15,6 +15,7 @@ import { WechatyAdapter } from './adapter';
import { adaptContact, adaptMessage, adaptRoom, fileBoxToUrl } from './utils';
import { WechatyMessenger } from './message';
import qrcodeTerminal from 'qrcode-terminal';
import os from 'os';
declare module 'koishi' {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
......@@ -29,7 +30,13 @@ export class WechatyBotConfig {
@SchemaProperty({
default: 'wechaty-puppet-wechat',
description: 'Wechaty 使用的 Puppet。',
hidden: true,
hidden: os.platform() !== 'win32',
type: process.env.KOISHI_AGENT?.includes('Desktop')
? Schema.const([
'wechaty-puppet-wechat',
...(os.platform() === 'win32' ? ['wechaty-puppet-xp'] : []),
])
: String,
})
puppet: string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment