2026-03-24 12:18:30 +08:00
|
|
|
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 {
|
2026-03-25 11:18:18 +08:00
|
|
|
ctx.SendPrivateMessage(ctx.Event.Sender.ID, err.Error())
|
|
|
|
|
|
2026-03-24 12:18:30 +08:00
|
|
|
} else {
|
2026-03-25 11:18:18 +08:00
|
|
|
ctx.SendPrivateMessage(ctx.Event.Sender.ID, "绑定成功")
|
|
|
|
|
|
2026-03-24 12:18:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|