mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 22:40:23 +08:00
✏️ 修复 control 全局禁用
This commit is contained in:
parent
d4bceb1922
commit
f8ca9355d2
@ -94,7 +94,6 @@ func (m *Control) IsEnabledIn(gid int64) bool {
|
||||
m.RLock()
|
||||
err = db.Find(m.service, &c, "WHERE gid = "+strconv.FormatInt(gid, 10))
|
||||
m.RUnlock()
|
||||
logrus.Debugln("[control] db find gid =", c.GroupID)
|
||||
if err == nil && gid == c.GroupID {
|
||||
logrus.Debugf("[control] plugin %s of grp %d : %d", m.service, c.GroupID, c.Disable)
|
||||
return c.Disable == 0
|
||||
|
||||
@ -133,18 +133,15 @@ func (db *Sqlite) Find(table string, objptr interface{}, condition string) error
|
||||
if !rows.Next() {
|
||||
return errors.New("sql.Find: null result")
|
||||
}
|
||||
|
||||
err = rows.Scan(addrs(objptr)...)
|
||||
for rows.Next() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = rows.Scan(addrs(objptr)...)
|
||||
if err != nil {
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListTables 列出所有表名
|
||||
// 返回所有表名+错误
|
||||
|
||||
Loading…
Reference in New Issue
Block a user