27 lines
457 B
Go
27 lines
457 B
Go
|
|
package robot
|
||
|
|
|
||
|
|
import (
|
||
|
|
"blazing/modules/base/service"
|
||
|
|
"strings"
|
||
|
|
|
||
|
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||
|
|
)
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
zero.OnCommand("绑定").
|
||
|
|
Handle(func(ctx *zero.Ctx) {
|
||
|
|
msgs := strings.Fields(ctx.Event.Message.String())
|
||
|
|
if len(msgs) > 2 {
|
||
|
|
|
||
|
|
err := service.NewBaseSysUserService().BindQQ(msgs[1], msgs[2], ctx.Event.Sender.ID)
|
||
|
|
if err != nil {
|
||
|
|
ctx.Send(err.Error())
|
||
|
|
} else {
|
||
|
|
ctx.Send("绑定成功")
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
})
|
||
|
|
}
|