1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-05 00:50:25 +08:00
This commit is contained in:
源文雨
2022-06-11 01:21:01 +08:00
parent cc43153a54
commit b60c37f627

11
rule.go
View File

@@ -20,17 +20,12 @@ import (
func newctrl(service string, o *ctrl.Options[*Ctx]) Rule {
c := m.NewControl(service, o)
return func(ctx *Ctx) bool {
msg, ok := ctx.Value.(*tgba.Message)
if !ok {
return false
}
ctx.State["manager"] = c
ctx.Message = msg
var gid int64 = 0
if !msg.Chat.IsPrivate() {
gid = msg.Chat.ID
if !ctx.Message.Chat.IsPrivate() {
gid = ctx.Message.Chat.ID
}
return c.Handler(uintptr(unsafe.Pointer(ctx)), gid, msg.From.ID)
return c.Handler(uintptr(unsafe.Pointer(ctx)), gid, ctx.Message.From.ID)
}
}