atri 插件 引入 control

This commit is contained in:
fumiama 2021-10-31 19:28:31 +08:00
parent ba9eb9c023
commit c1e87ace78

View File

@ -30,7 +30,7 @@ func init() { // 插件主体
zero.OnFullMatch("ATRI醒醒", zero.AdminPermission).SetBlock(true).SetPriority(prio).
Handle(func(ctx *zero.Ctx) {
c, ok := control.Lookup(servicename)
if ok {
if ok && !c.IsEnabledIn(ctx.Event.GroupID) {
c.Enable(ctx.Event.GroupID)
process.SleepAbout1sTo2s()
ctx.SendChain(message.Text("嗯呜呜……夏生先生……?"))
@ -39,7 +39,7 @@ func init() { // 插件主体
engine.OnFullMatch("ATRI睡吧", zero.AdminPermission).SetBlock(true).SetPriority(prio).
Handle(func(ctx *zero.Ctx) {
c, ok := control.Lookup(servicename)
if ok {
if ok && c.IsEnabledIn(ctx.Event.GroupID) {
c.Disable(ctx.Event.GroupID)
process.SleepAbout1sTo2s()
ctx.SendChain(message.Text("Zzz……Zzz……"))