mirror of
https://github.com/AynaLivePlayer/blivedm-go.git
synced 2025-12-06 19:32:49 +08:00
🐛 fix: anonymous danmu msg
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user