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

fix message

This commit is contained in:
源文雨
2023-10-18 15:23:54 +09:00
parent a6a961da65
commit 4c6486219e

View File

@@ -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