mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-18 20:50:12 +08:00
feat(aichat): add perm check for cross-group
Some checks are pending
自动更新 nix 依赖 / gomod2nix update (push) Waiting to run
打包最新版为 Docker Image / build docker (push) Waiting to run
最新版 / Build binary CI (386, linux) (push) Waiting to run
最新版 / Build binary CI (386, windows) (push) Waiting to run
最新版 / Build binary CI (amd64, linux) (push) Waiting to run
最新版 / Build binary CI (amd64, windows) (push) Waiting to run
最新版 / Build binary CI (arm, linux) (push) Waiting to run
最新版 / Build binary CI (arm64, linux) (push) Waiting to run
PushLint / lint (push) Waiting to run
Some checks are pending
自动更新 nix 依赖 / gomod2nix update (push) Waiting to run
打包最新版为 Docker Image / build docker (push) Waiting to run
最新版 / Build binary CI (386, linux) (push) Waiting to run
最新版 / Build binary CI (386, windows) (push) Waiting to run
最新版 / Build binary CI (amd64, linux) (push) Waiting to run
最新版 / Build binary CI (amd64, windows) (push) Waiting to run
最新版 / Build binary CI (arm, linux) (push) Waiting to run
最新版 / Build binary CI (arm64, linux) (push) Waiting to run
PushLint / lint (push) Waiting to run
This commit is contained in:
parent
f09f15937c
commit
8811df5968
@ -159,6 +159,17 @@ func init() {
|
||||
}
|
||||
logrus.Infoln("[aichat] agent do:", reqs)
|
||||
for _, req := range reqs {
|
||||
if req.Action == "send_group_msg" {
|
||||
gid, ok := req.Params["group_id"].(int64)
|
||||
if !ok {
|
||||
logrus.Warnln("[aichat] invalid", req.Action, req.Params)
|
||||
continue
|
||||
}
|
||||
if ctx.Event.GroupID != gid && !zero.SuperUserPermission(ctx) {
|
||||
logrus.Warnln("[aichat] refuse to send out of grp from", ctx.Event.GroupID, "to", gid)
|
||||
continue
|
||||
}
|
||||
}
|
||||
ctx.CallAction(req.Action, req.Params)
|
||||
process.SleepAbout1sTo2s()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user