mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
优化
This commit is contained in:
parent
a004ed8064
commit
98a652f440
@ -43,12 +43,7 @@ func init() {
|
|||||||
db.DBPath = engine.DataFolder() + "anti_abuse.db"
|
db.DBPath = engine.DataFolder() + "anti_abuse.db"
|
||||||
err := db.Open(time.Hour * 4)
|
err := db.Open(time.Hour * 4)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("open db error: ", err))
|
ctx.SendChain(message.Text("ERROR: ", err))
|
||||||
return false
|
|
||||||
}
|
|
||||||
err = db.Create("banWord", &banWord{})
|
|
||||||
if err != nil {
|
|
||||||
ctx.SendChain(message.Text("create table error: ", err))
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
@ -70,7 +65,7 @@ func init() {
|
|||||||
ctx.SetGroupBan(gid, uid, 4*3600)
|
ctx.SetGroupBan(gid, uid, 4*3600)
|
||||||
ctx.SendChain(message.Text("检测到违禁词, 已封禁/屏蔽4小时"))
|
ctx.SendChain(message.Text("检测到违禁词, 已封禁/屏蔽4小时"))
|
||||||
} else {
|
} else {
|
||||||
ctx.SendChain(message.Text("block user error: ", err))
|
ctx.SendChain(message.Text("ERROR: block user: ", err))
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user