🎨 ctx.Send -> ctx.SendChain

This commit is contained in:
Kanri
2021-10-15 21:43:47 +08:00
parent 2a1cca8ebb
commit c46ca1d4c2
13 changed files with 73 additions and 57 deletions

View File

@@ -140,10 +140,10 @@ func init() {
_ = ctx.Parse(&model)
service, ok := Lookup(model.Args)
if !ok {
ctx.Send("没有找到指定服务!")
ctx.SendChain(message.Text("没有找到指定服务!"))
}
service.Enable(ctx.Event.GroupID)
ctx.Send(message.Text("已启用服务: " + model.Args))
ctx.SendChain(message.Text("已启用服务: " + model.Args))
})
zero.OnCommandGroup([]string{"禁用", "disable"}, zero.AdminPermission, zero.OnlyGroup).
@@ -152,10 +152,10 @@ func init() {
_ = ctx.Parse(&model)
service, ok := Lookup(model.Args)
if !ok {
ctx.Send("没有找到指定服务!")
ctx.SendChain(message.Text("没有找到指定服务!"))
}
service.Disable(ctx.Event.GroupID)
ctx.Send(message.Text("已关闭服务: " + model.Args))
ctx.SendChain(message.Text("已关闭服务: " + model.Args))
})
zero.OnCommandGroup([]string{"用法", "usage"}, zero.AdminPermission, zero.OnlyGroup).
@@ -164,12 +164,12 @@ func init() {
_ = ctx.Parse(&model)
service, ok := Lookup(model.Args)
if !ok {
ctx.Send("没有找到指定服务!")
ctx.SendChain(message.Text("没有找到指定服务!"))
}
if service.options.Help != "" {
ctx.Send(service.options.Help)
ctx.SendChain(message.Text(service.options.Help))
} else {
ctx.Send("该服务无帮助!")
ctx.SendChain(message.Text("该服务无帮助!"))
}
})
@@ -187,7 +187,7 @@ func init() {
}
return true
})
ctx.Send(message.Text(msg))
ctx.SendChain(message.Text(msg))
})
}
}