mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-24 10:40:09 +08:00
✨ 修正
This commit is contained in:
parent
087c6c0298
commit
f704cddae8
@ -4,11 +4,9 @@ import (
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
)
|
||||
|
||||
var m Control
|
||||
|
||||
func Register(service string, o *Options) *zero.Engine {
|
||||
engine := zero.New()
|
||||
m = *New(service, o)
|
||||
m := *New(service, o)
|
||||
engine.UsePreHandler(m.Handler())
|
||||
return engine
|
||||
}
|
||||
|
||||
@ -76,6 +76,7 @@ func (m *Control) Handler() zero.Rule {
|
||||
err := db.Find(m.service, &c, "WHERE gid = "+strconv.FormatInt(ctx.Event.GroupID, 10))
|
||||
if err == nil {
|
||||
m.RUnlock()
|
||||
logrus.Debugf("[control] plugin %s of grp %d : %d", m.service, c.GroupID, c.Disable)
|
||||
return c.Disable == 0
|
||||
} else {
|
||||
logrus.Errorf("[control] %v", err)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user