Skip to content
Merged
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,18 @@

> 如果您对开发插件感兴趣,欢迎加入[ZeroBot-Plugin-Playground](https://github.com/FloatTech/ZeroBot-Plugin-Playground)

> webui持续开发中, 环境加入[ZeroBot-Plugin-Webui](https://github.com/guohuiyuan/ZeroBot-Plugin-Webui)
Comment thread
fumiama marked this conversation as resolved.
Outdated

## 命令行参数
> `[]`代表是可选参数
```bash
zerobot [-h] [-n nickname] [-t token] [-u url] [-p prefix] [-d|w] [-c|s config.json] [-l latency] [-r ringlen] [-x max process time] [qq1 qq2 qq3 ...] [&]
zerobot [-h] [-n nickname] [-t token] [-u url] [-g url] [-p prefix] [-d|w] [-c|s config.json] [-l latency] [-r ringlen] [-x max process time] [qq1 qq2 qq3 ...] [&]
```
- **-h**: 显示帮助
- **-n nickname**: 设置默认昵称,默认为`椛椛`
- **-t token**: 设置`AccessToken`,默认为空
- **-u url**: 设置`Url`,默认为`ws://127.0.0.1:6700`
- **-g url**: 设置`webuiUrl`,默认为`127.0.0.1:3000`
Comment thread
fumiama marked this conversation as resolved.
Outdated
- **-p prefix**: 设置命令前缀,默认为`/`
- **-d|w**: 开启 debug | warning 级别及以上日志输出
- **-c config.json**: 从`config.json`加载`bot`配置
Expand Down Expand Up @@ -132,6 +135,8 @@ zerobot [-h] [-n nickname] [-t token] [-u url] [-p prefix] [-d|w] [-c|s config.j

- [x] /设置服务列表显示行数 xx

- [x] /设置webui配置 zerobot 123456

默认值为9,该设置仅运行时有效,zbp重启后重置
- [x] @Bot 插件冲突检测 (会在本群发送一条消息并在约 1s 后撤回以检测其它同类 bot 中已启用的插件并禁用)

Expand Down
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"time"

"github.com/FloatTech/ZeroBot-Plugin/kanban" // 在最前打印 banner
webctrl "github.com/FloatTech/zbputils/control/web"
Comment thread
fumiama marked this conversation as resolved.
Outdated

// ---------以下插件均可通过前面加 // 注释,注释后停用并不加载插件--------- //
// ----------------------插件优先级按顺序从高到低---------------------- //
Expand Down Expand Up @@ -201,6 +202,7 @@ func init() {
d := flag.Bool("d", false, "Enable debug level log and higher.")
w := flag.Bool("w", false, "Enable warning level log and higher.")
h := flag.Bool("h", false, "Display this help.")
g := flag.String("g", "127.0.0.1:3000", "Set Url of webui.")
Comment thread
fumiama marked this conversation as resolved.
Outdated
// 直接写死 AccessToken 时,请更改下面第二个参数
token := flag.String("t", "", "Set AccessToken of WSClient.")
// 直接写死 URL 时,请更改下面第二个参数
Expand Down Expand Up @@ -237,6 +239,9 @@ func init() {
sus = append(sus, i)
}

// 启用 gui
go webctrl.RunGui(*g)

// 通过代码写死的方式添加主人账号
// sus = append(sus, 12345678)
// sus = append(sus, 87654321)
Expand Down