🐛 fix: anonymous danmu msg

This commit is contained in:
HarryWong
2023-07-08 10:22:49 +08:00
parent f56426ffa7
commit 8bc38ae586
6 changed files with 16 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"fmt"
"github.com/Akegarasu/blivedm-go/client"
_ "github.com/Akegarasu/blivedm-go/utils"
log "github.com/sirupsen/logrus"
@@ -9,12 +10,13 @@ import (
)
const roomId = "8792912"
const uid = 745493
var dumps = []string{"GUARD_BUY", "USER_TOAST_MSG"}
func main() {
log.SetLevel(log.DebugLevel)
c := client.NewClient(roomId)
c := client.NewClient(roomId, uid)
for _, v := range dumps {
vv := v
c.RegisterCustomEventHandler(vv, func(s string) {

View File

@@ -2,6 +2,7 @@ package main
import (
"fmt"
"github.com/Akegarasu/blivedm-go/api"
"github.com/Akegarasu/blivedm-go/client"
"github.com/Akegarasu/blivedm-go/message"
@@ -12,7 +13,7 @@ import (
func main() {
log.SetLevel(log.DebugLevel)
c := client.NewClient("732")
c := client.NewClient("732", 194484313)
//弹幕事件
c.OnDanmaku(func(danmaku *message.Danmaku) {
if danmaku.Type == message.EmoticonDanmaku {