fix: 临时修复danmaku_msg多内容导致的解析失败问题。

main
NorthLan 2 years ago
parent 657f3c800d
commit 169ab93840

@ -10,6 +10,7 @@ import (
"live-gateway/live" "live-gateway/live"
"live-gateway/ws" "live-gateway/ws"
"net/http" "net/http"
"strings"
"time" "time"
) )
@ -145,6 +146,10 @@ func (l *LiveBilibili) HandlerMessage(v interface{}) {
logger.SLog.Error("读取消息CMD错误") logger.SLog.Error("读取消息CMD错误")
return return
} }
// 暂时忽略CMD错误
if strings.Contains(cmd.CMD, "DANMU_MSG") {
cmd.CMD = "DANMU_MSG"
}
handler, ok := l.msgHandlerMapper[cmd.CMD] handler, ok := l.msgHandlerMapper[cmd.CMD]
if !ok { if !ok {
logger.SLog.Debugf("未发现 %s 处理器", cmd.CMD) logger.SLog.Debugf("未发现 %s 处理器", cmd.CMD)

@ -7,7 +7,7 @@ Bilibili:
RoomId: 8722013 RoomId: 8722013
Log: Log:
Console: Console:
Level: info Level: debug
Format: console Format: console
File: File:
Enabled: true Enabled: true

Loading…
Cancel
Save