Commit 67f09097 authored by nanahira's avatar nanahira

update logger

parent 33efe1d6
......@@ -17,3 +17,7 @@ plugins:
adapter-wechaty:
name: 'koishi' # Wechaty 配置文件保存路径。
```
## 使用方法
启动插件,并在 Koishi 控制台的『日志』或是 stdout 中查看二维码,扫描登录。
\ No newline at end of file
......@@ -3,12 +3,17 @@ import TargetPlugin from '../src';
import * as Help from '@koishijs/plugin-help';
import ExtrasInDev from './extras';
import fs from 'fs';
import Console from '@koishijs/plugin-console';
import LogProvider from '@koishijs/plugin-logger';
const app = new App({
prefix: '.',
port: 14514,
});
app.plugin(Help);
app.plugin(Console);
app.plugin(LogProvider);
// Some extras
app.plugin(ExtrasInDev);
......
This diff is collapsed.
......@@ -76,8 +76,13 @@ export default class WechatyBot extends Bot<
this.offline(error);
});
this.internal.on('scan', (qrcode, status) => {
this.logger.info(`Scan (${status}):`);
qrcodeTerminal.generate(qrcode);
qrcodeTerminal.generate(qrcode, { small: false }, (img) =>
this.logger.info(
`Scan (${status}): https://wechaty.js.org/qrcode/${encodeURIComponent(
qrcode,
)}\n` + img,
),
);
});
await this.internal.start();
}
......
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