diff --git a/service/imService.go b/service/imService.go index 55a8dd4..1ed5d50 100644 --- a/service/imService.go +++ b/service/imService.go @@ -108,6 +108,9 @@ func WSReceiveMessageService(userID, sessionID int, channel string, msg proto.WS robotMsg += resp.Response if resp.Done { //该消息完成 actx = resp.Context + if actxMap == nil { + actxMap = make(map[int][]int) + } actxMap[sessionID] = actx //创建消息 err2, msgID := CreateMessage(2, sessionID, 2, userID, robotMsg, 1) //机器人id为2,消息类型为2,状态为1