修复赋值未初始化map

This commit is contained in:
junleea 2025-03-22 16:36:45 +08:00
parent 33971ef5c7
commit e39bb7f65f
1 changed files with 3 additions and 0 deletions

View File

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