Documentation ¶
Index ¶
- func ParseCmd(d []byte) string
- 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) OnPacket(f func(*packet.Packet))
- func (c *Client) OnRawPackage(f func(*[]byte))
- 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()
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { RoomID int Uid int Buvid string Cookie string Config *Config // contains filtered or unexported fields }
func (*Client) OnGuardBuy ¶
OnGuardBuy 添加 开通大航海事件 的处理器
func (*Client) OnRawPackage ¶ added in v0.0.5
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
type Config ¶
type Config struct { UserAgent string Logger logrus.FieldLogger }
Click to show internal directories.
Click to hide internal directories.