From 4c6486219ef644ccdd597f588ac4c4c6981dbf0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:23:54 +0900 Subject: [PATCH] fix message --- context.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/context.go b/context.go index c0296be..a40b35a 100644 --- a/context.go +++ b/context.go @@ -78,8 +78,8 @@ func (ctx *Ctx) CheckSession() Rule { // Send 发送消息到对方 func (ctx *Ctx) Send(replytosender bool, post *MessagePost) (reply *Message, err error) { - msg, ok := ctx.Value.(*Message) - if ok && msg != nil { + msg := ctx.Message + if msg != nil { post.ReplyMessageID = msg.ID if replytosender { post.MessageReference = &MessageReference{ @@ -95,7 +95,7 @@ func (ctx *Ctx) Send(replytosender bool, post *MessagePost) (reply *Message, err } else { reply, err = ctx.PostMessageToChannel(msg.ChannelID, post) } - if ok && msg != nil && reply != nil && reply.ID != "" { + if msg != nil && reply != nil && reply.ID != "" { logtriggeredmessages(msg.ID, reply.ID) } return