Documentation ¶
Index ¶
- type Client
- func (c *Client) Handle(p packet.Packet)
- func (c *Client) OnDanmaku(f func(*message.Danmaku))
- func (c *Client) OnGift(f func(gift *message.Gift))
- func (c *Client) OnGuardBuy(f func(*message.GuardBuy))
- func (c *Client) OnLive(f func(*message.Live))
- func (c *Client) OnSuperChat(f func(*message.SuperChat))
- func (c *Client) OnUserToast(f func(*message.UserToast))
- func (c *Client) RegisterCustomEventHandler(cmd string, handler func(s string))
- func (c *Client) SetCookie(cookie string)
- func (c *Client) SetHost(host string)
- func (c *Client) Start() error
- func (c *Client) Stop()
- func (c *Client) UseDefaultHost()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { RoomID int Uid int Buvid string Cookie string // contains filtered or unexported fields }
func NewClientWithApi ¶
NewClient 创建一个新的弹幕 client
func (*Client) OnGuardBuy ¶
OnGuardBuy 添加 开通大航海事件 的处理器
func (*Client) OnSuperChat ¶
OnSuperChat 添加 醒目留言事件 的处理器
func (*Client) OnUserToast ¶
OnUserToast 添加 UserToast 的处理器
func (*Client) RegisterCustomEventHandler ¶
RegisterCustomEventHandler 注册 自定义事件 的处理器
需要提供事件名,可参考 knownCMD
func (*Client) UseDefaultHost ¶
func (c *Client) UseDefaultHost()
UseDefaultHost 使用默认 host broadcastlv.chat.bilibili.com
Click to show internal directories.
Click to hide internal directories.