Skip to content

Commit

Permalink
🔖 v1.3.2-fix3: 无法设置主人账号
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Apr 2, 2022
1 parent 3cd8af5 commit d0aa0f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 11 additions & 5 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strconv"

"github.com/FloatTech/ZeroBot-Plugin/kanban" // 在最前打印 banner
"github.com/sirupsen/logrus"

// ---------以下插件均可通过前面加 // 注释,注释后停用并不加载插件--------- //
// ----------------------插件优先级按顺序从高到低---------------------- //
Expand Down Expand Up @@ -33,6 +34,7 @@ import (
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/thesaurus" // 词典匹配回复

_ "github.com/FloatTech/zbputils/job" // 定时指令触发器
"github.com/FloatTech/zbputils/process"

// ^^^^ //
// ^^^^^^^^^^^^^^ //
Expand Down Expand Up @@ -180,11 +182,7 @@ func init() {
}
}

driver.RegisterServer(func(s string, f func(driver.CQBot)) {
servers.RegisterCustom(s, func(c *coolq.CQBot) { f((*CQBot)(c)) })
})

driver.NewFuncallClient("zbp", newcaller, func(f *driver.FCClient) {
_ = driver.NewFuncallClient("zbp", newcaller, func(f *driver.FCClient) {
// 帮助
zero.OnFullMatchGroup([]string{"/help", ".help", "菜单"}, zero.OnlyToMe).SetBlock(true).FirstPriority().
Handle(func(ctx *zero.Ctx) {
Expand All @@ -204,5 +202,13 @@ func init() {
Driver: []zero.Driver{f},
},
)
logrus.Debugln("[bot] set superusers:", qqs)
})

driver.RegisterServer(func(s string, f func(driver.CQBot)) {
servers.RegisterCustom(s, func(c *coolq.CQBot) {
f((*CQBot)(c))
process.GlobalInitMutex.Unlock()
})
})
}
5 changes: 0 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
_ "github.com/Mrs4s/go-cqhttp/db/leveldb" // leveldb
_ "github.com/Mrs4s/go-cqhttp/modules/mime" // mime检查模块
_ "github.com/Mrs4s/go-cqhttp/modules/silk" // silk编码模块

"github.com/FloatTech/zbputils/process"
)

var (
Expand Down Expand Up @@ -74,9 +72,6 @@ func main() {
gocq.PrintBanner()
gocq.CheckKey(gocq.ParseCommand())
gocq.LoadDevice()

process.GlobalInitMutex.Unlock()

gocq.Main()
}

Expand Down

0 comments on commit d0aa0f4

Please sign in to comment.