From 26b8d2b03a6caf995b3c529487c69b5a3e1b9288 Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Mon, 5 May 2025 02:53:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=20SendMsg=20?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E4=B8=AD=E7=9A=84=E6=B6=88=E6=81=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E6=94=AF=E6=8C=81=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E7=B1=BB=E5=9E=8B=E7=9A=84=20ReplyMsg=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E4=BB=A3=E7=A0=81=E7=81=B5=E6=B4=BB=E6=80=A7?= =?UTF-8?q?=E5=92=8C=E5=8F=AF=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action/action.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/action/action.go b/action/action.go index dc05a83..957697e 100644 --- a/action/action.go +++ b/action/action.go @@ -2,6 +2,7 @@ package action import ( "encoding/json" + "fmt" "log" "strconv" "sync" @@ -44,7 +45,12 @@ func (am *actionManager) SendMsg(reply *model.Reply) error { ID: int(reply.FromMsg.OriginMsgId), }, } - reply.ReplyMsg = append([]any{replyMsg}, reply.ReplyMsg) + switch reply.ReplyMsg.(type) { + case []any: + reply.ReplyMsg = append([]any{replyMsg}, reply.ReplyMsg) + case string: + reply.ReplyMsg = fmt.Sprintf("%s%s", replyMsg.ToCQString(), reply.ReplyMsg) + } } userID := strconv.FormatInt(reply.FromMsg.UserId, 10) if reply.FromMsg.UserId == 0 {