From 169ab93840dc8bbf1b0b0fdc39dbf2e6e225a72b Mon Sep 17 00:00:00 2001 From: NorthLan <6995syu@163.com> Date: Sun, 5 Jun 2022 01:55:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=B4=E6=97=B6=E4=BF=AE=E5=A4=8Ddanm?= =?UTF-8?q?aku=5Fmsg=E5=A4=9A=E5=86=85=E5=AE=B9=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bilibili/live.go | 5 +++++ config-dev.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bilibili/live.go b/bilibili/live.go index 22828ea..29bfe55 100644 --- a/bilibili/live.go +++ b/bilibili/live.go @@ -10,6 +10,7 @@ import ( "live-gateway/live" "live-gateway/ws" "net/http" + "strings" "time" ) @@ -145,6 +146,10 @@ func (l *LiveBilibili) HandlerMessage(v interface{}) { logger.SLog.Error("读取消息CMD错误") return } + // 暂时忽略CMD错误 + if strings.Contains(cmd.CMD, "DANMU_MSG") { + cmd.CMD = "DANMU_MSG" + } handler, ok := l.msgHandlerMapper[cmd.CMD] if !ok { logger.SLog.Debugf("未发现 %s 处理器", cmd.CMD) diff --git a/config-dev.yml b/config-dev.yml index 835c712..fd09f1d 100644 --- a/config-dev.yml +++ b/config-dev.yml @@ -7,7 +7,7 @@ Bilibili: RoomId: 8722013 Log: Console: - Level: info + Level: debug Format: console File: Enabled: true