mirror of
https://github.com/AynaLivePlayer/blivedm-go.git
synced 2025-12-06 11:22:50 +08:00
update example
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user