diff --git a/handlers/send_private_msg.go b/handlers/send_private_msg.go index 1eb52e4c..443e4f86 100644 --- a/handlers/send_private_msg.go +++ b/handlers/send_private_msg.go @@ -187,7 +187,7 @@ func HandleSendPrivateMsg(client callapi.Client, api openapi.OpenAPI, apiv2 open singleItem[imageType] = []string{imageUrl} msgseq := echo.GetMappingSeq(messageID) echo.AddMappingSeq(messageID, msgseq+1) - groupReply := generatePrivateMessage(messageID, eventID, singleItem, "", msgseq+1, apiv2, message.Params.UserID.(string)) + groupReply := generatePrivateMessage(messageID, eventID, singleItem, "", msgseq+1, apiv2, UserID) // 进行类型断言 richMediaMessage, ok := groupReply.(*dto.RichMediaMessage) if !ok { @@ -233,7 +233,7 @@ func HandleSendPrivateMsg(client callapi.Client, api openapi.OpenAPI, apiv2 open if messageText != "" { msgseq := echo.GetMappingSeq(messageID) echo.AddMappingSeq(messageID, msgseq+1) - groupReply := generatePrivateMessage(messageID, eventID, nil, messageText, msgseq+1, apiv2, message.Params.UserID.(string)) + groupReply := generatePrivateMessage(messageID, eventID, nil, messageText, msgseq+1, apiv2, UserID) // 进行类型断言 groupMessage, ok := groupReply.(*dto.MessageToCreate) @@ -261,7 +261,7 @@ func HandleSendPrivateMsg(client callapi.Client, api openapi.OpenAPI, apiv2 open //mylog.Println("singleItem:", singleItem) msgseq := echo.GetMappingSeq(messageID) echo.AddMappingSeq(messageID, msgseq+1) - groupReply := generatePrivateMessage(messageID, eventID, singleItem, "", msgseq+1, apiv2, message.Params.UserID.(string)) + groupReply := generatePrivateMessage(messageID, eventID, singleItem, "", msgseq+1, apiv2, UserID) // 进行类型断言 richMediaMessage, ok := groupReply.(*dto.RichMediaMessage) if !ok { @@ -328,7 +328,7 @@ func HandleSendPrivateMsg(client callapi.Client, api openapi.OpenAPI, apiv2 open if config.GetSendError() { //把报错当作文本发出去 msgseq := echo.GetMappingSeq(messageID) echo.AddMappingSeq(messageID, msgseq+1) - groupReply := generatePrivateMessage(messageID, eventID, nil, err.Error(), msgseq+1, apiv2, message.Params.UserID.(string)) + groupReply := generatePrivateMessage(messageID, eventID, nil, err.Error(), msgseq+1, apiv2, UserID) // 进行类型断言 groupMessage, ok := groupReply.(*dto.MessageToCreate) if !ok {