1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-11 05:30:24 +08:00

fix: message delete

This commit is contained in:
源文雨
2023-10-18 15:17:30 +09:00
parent 88aede89dc
commit a6a961da65
4 changed files with 37 additions and 45 deletions

View File

@@ -16,9 +16,12 @@ func newctrl(service string, o *ctrl.Options[*Ctx]) Rule {
c := m.NewControl(service, o)
return func(ctx *Ctx) bool {
ctx.State["manager"] = c
gid, _ := strconv.ParseUint(ctx.Message.ChannelID, 10, 64)
uid, _ := strconv.ParseUint(ctx.Message.Author.ID, 10, 64)
return c.Handler(int64(gid), int64(uid))
if ctx.Message != nil {
gid, _ := strconv.ParseUint(ctx.Message.ChannelID, 10, 64)
uid, _ := strconv.ParseUint(ctx.Message.Author.ID, 10, 64)
return c.Handler(int64(gid), int64(uid))
}
return false
}
}