Skip to content

Commit

Permalink
Merge branch 'dev' into bot
Browse files Browse the repository at this point in the history
  • Loading branch information
KomeiDiSanXian committed Aug 5, 2023
2 parents 514a2c1 + 9bd9bc6 commit 67e642c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,13 @@

1. 前往 [release](https://github.com/KomeiDiSanXian/BFHelper/releases) 下载符合您系统的版本
2. 启动应用程序
> 第一次启动会生成配置文件 `botcongfig.yaml`,请修改该配置
> **注意**: 第一次启动会生成配置文件 `botcongfig.yaml`,请修改该配置
3. 修改配置后,重新启动应用,同时启动 OneBot 框架 (如 [go-cqhttp](https://github.com/Mrs4s/go-cqhttp))
4. 修改 `data/battlefield` 中的 `settings.yml`
> **注意**: 如果没有该文件,请使用一次本插件, 插件将会生成一份 `settings.yml`
>
> 修改后无需重启
### b. 本地编译

Expand Down
4 changes: 2 additions & 2 deletions bfhelper/internal/rule/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func readDictionary() error {
func generateConfig() {
logrus.Warnln("[battlefield]未找到配置或者出现错误, 正在重新生成...")
_ = os.WriteFile(engine.Engine.DataFolder()+"settings.yml", []byte(defaultConfig), 0o644)
logrus.Warnln("配置已生成! 请修改 botconfig.yaml")
logrus.Warnln("配置已生成! 请修改 settings.yml")
}

// Initialized 需要执行后才能使用插件
Expand All @@ -69,7 +69,7 @@ func Initialized() zero.Rule {
if err = setupSetting(); err != nil {
ctx.SendChain(message.Text("ERROR: 读取插件配置失败, 正在重新创建"))
generateConfig()
ctx.SendChain(message.Text("INFO: 插件配置已重新创建"))
ctx.SendChain(message.Text("INFO: 插件配置已重新创建, 请联系机器人主人修改"))
return false
}
// 建立数据库连接
Expand Down

0 comments on commit 67e642c

Please sign in to comment.