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