cmd

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorInfo

type AnchorInfo struct {
	// 收礼主播uid
	//
	// Deprecated: 已废弃,固定为0
	UID      int64  `json:"uid"`
	OpenID   string `json:"open_id"` // 收礼主播open_id
	Username string `json:"uname"`   // 收礼主播昵称
	Uface    string `json:"uface"`   // 收礼主播头像

}

type Cmd

type Cmd[T any] struct {
	Cmd  CmdType `json:"cmd"`
	Data T       `json:"data"`

	Info json.RawMessage `json:"info"`
}

type CmdType

type CmdType string
const (
	CmdDanmu        CmdType = "LIVE_OPEN_PLATFORM_DM"              // 获取弹幕信息
	CmdGift         CmdType = "LIVE_OPEN_PLATFORM_SEND_GIFT"       // 获取礼物信息
	CmdSuperChat    CmdType = "LIVE_OPEN_PLATFORM_SUPER_CHAT"      // 获取付费留言
	CmdDelSuperChat CmdType = "LIVE_OPEN_PLATFORM_SUPER_CHAT_DEL"  // 付费留言下线
	CmdGuard        CmdType = "LIVE_OPEN_PLATFORM_GUARD"           // 付费大航海
	CmdLike         CmdType = "LIVE_OPEN_PLATFORM_LIKE"            // 点赞信息
	CmdEnd          CmdType = "LIVE_OPEN_PLATFORM_INTERACTION_END" // 消息推送结束通知
)

type ComboInfo

type ComboInfo struct {
	BaseNum int64  `json:"combo_base_num"` // 每次连击赠送的道具数量
	Count   int64  `json:"combo_count"`    // 连击次数
	ID      string `json:"combo_id"`       // 连击id
	Timeout int64  `json:"combo_timeout"`  //连击有效期秒
}

type Danmu

type Danmu struct {
	MsgBase
	UserInfo
	Msg   string    `json:"msg"`           // 弹幕内容
	Emoji string    `json:"emoji_img_url"` // 表情包图片地址
	Type  DanmuType `json:"dm_type"`       // 弹幕类型 0:普通弹幕 1:表情包弹幕
}

type DanmuType

type DanmuType int64
const (
	DanmuNormal DanmuType = 0 // 0: 普通弹幕
	DanmuEmoji  DanmuType = 1 // 1:表情包弹幕
)

type DelSuperChat

type DelSuperChat struct {
	RoomID     int64   `json:"room_id"`     // 直播间id
	MessageIDs []int64 `json:"message_ids"` // 要撤回的留言id
	MsgID      string  `json:"msg_id"`      // 消息唯一id
}

type FansMedal

type FansMedal struct {
	WearingStatus bool   `json:"fans_medal_wearing_status"` // 该房间粉丝勋章佩戴情况
	Name          string `json:"fans_medal_name"`           // 粉丝勋章名
	Level         int64  `json:"fans_medal_level"`          // 对应房间勋章信息
}

type Gift

type Gift struct {
	MsgBase
	UserInfo
	GiftInfo
	Price      int64      `json:"price"`       // 支付金额(1000 = 1元 = 10电池),盲盒:爆出道具的价值
	Paid       bool       `json:"paid"`        // 是否是付费道具
	AnchorInfo AnchorInfo `json:"anchor_info"` // 主播信息
	ComboGift  bool       `json:"combo_gift"`  // 是否是combo道具
	ComboInfo  ComboInfo  `json:"combo_info"`  // 连击信息
}

type GiftInfo

type GiftInfo struct {
	ID   int64  `json:"gift_id"`   // 道具id(盲盒:爆出道具id)
	Name string `json:"gift_name"` // 道具名(盲盒:爆出道具名)
	Num  int64  `json:"gift_num"`  // 赠送道具数量
	Icon string `json:"gift_icon"` // 道具icon
}

type Guard

type Guard struct {
	MsgBase
	UserInfo AnchorInfo `json:"user_info"` // 用户信息
	GuardInfo
	FansMedal
}

type GuardInfo

type GuardInfo struct {
	Level GuardLevel `json:"guard_level"` // 大航海等级
	Num   int64      `json:"guard_num"`   // 大航海数量
	Unit  string     `json:"guard_unit"`  // 大航海单位
	Price int64      `json:"price"`       // 大航海金瓜子
}

type GuardLevel

type GuardLevel int64
const (
	GuardLv1 GuardLevel = 1 + iota // 1: 总督
	GuardLv2                       // 2: 提督
	GuardLv3                       // 3: 舰长
)

func (GuardLevel) String added in v0.0.10

func (lv GuardLevel) String() string

type Like

type Like struct {
	MsgBase // 文档上没写有 msg_id
	AnchorInfo
	LikeText  string `json:"like_text"`  // 点赞文案( “xxx点赞了”)
	LikeCount string `json:"like_count"` // 对单个用户最近2秒的点赞次数聚合
	FansMedal
}

type MsgBase

type MsgBase struct {
	RoomID    int64  `json:"room_id"`   // 房间号
	Timestamp int64  `json:"timestamp"` // 时间戳
	MsgId     string `json:"msg_id"`    // 消息唯一id
}

type SuperChat

type SuperChat struct {
	MsgBase
	UserInfo
	MessageID int64  `json:"message_id"` // 留言id(风控场景下撤回留言需要)
	Message   string `json:"message"`    // 留言内容
	Rmb       int64  `json:"rmb"`        // 支付金额(元)
	StartTime int64  `json:"start_time"` // 生效开始时间
	EndTime   int64  `json:"end_time"`   // 生效结束时间
}

type UserInfo

type UserInfo struct {
	// 用户uid
	//
	// Deprecated: 已废弃,固定为0
	UID        int64  `json:"uid"`
	Username   string `json:"uname"`       // 用户昵称
	OpenID     string `json:"open_id"`     // 用户open_id
	Uface      string `json:"uface"`       // 用户头像
	GuardLevel int64  `json:"guard_level"` // 对应房间大航海等级
	FansMedal
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL