update example

This commit is contained in:
aynakeya
2025-11-09 21:49:27 +08:00
parent 79ce0bb3c1
commit cc4a4ca071

View File

@@ -2,6 +2,7 @@ package main
import ( import (
"fmt" "fmt"
"os"
"github.com/AynaLivePlayer/blivedm-go/client" "github.com/AynaLivePlayer/blivedm-go/client"
_ "github.com/AynaLivePlayer/blivedm-go/utils" _ "github.com/AynaLivePlayer/blivedm-go/utils"
@@ -9,14 +10,14 @@ import (
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
) )
const roomId = 8792912 const roomId = 3819533
var dumps = []string{"GUARD_BUY", "USER_TOAST_MSG"} var dumps = []string{"GUARD_BUY", "USER_TOAST_MSG"}
func main() { func main() {
log.SetLevel(log.DebugLevel) log.SetLevel(log.DebugLevel)
c := client.NewClient(roomId) c := client.NewClient(roomId)
c.SetCookie("") c.SetCookie(os.Getenv("bilibili_cookie"))
for _, v := range dumps { for _, v := range dumps {
vv := v vv := v
c.RegisterCustomEventHandler(vv, func(s string) { c.RegisterCustomEventHandler(vv, func(s string) {