api

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Addr = "https://www.douyu.com"

	RoomYYF = 9999

	GiftGlowSticks     = 268  // 粉丝荧光棒
	GiftFansGlowSticks = 2358 // 钻粉粉丝荧光棒
)

Variables

This section is empty.

Functions

func Exec

func Exec[T any](r *resty.Request, method, path string) (t T, _ error)

Types

type Badge

type Badge struct {
	Room     int       // 房间号
	Anchor   string    // 主播名称
	Name     string    // 名称
	Level    int       // 等级
	Intimacy float64   // 亲密度
	Rank     int       // 排名
	AccessAt time.Time // 获得时间
}

Badge 徽章

type Client

type Client struct {
	Uid      string // cookie: acf_uid
	Auth     string // cookie: acf_auth
	Stk      string // cookie: acf_stk
	Ltkid    string // cookie: acf_ltkid
	Username string // cookie: acf_username
	// contains filtered or unexported fields
}

func NewClient

func NewClient(account config.Account) *Client

func (*Client) ListBadges

func (c *Client) ListBadges() ([]*Badge, error)

func (*Client) ListGift

func (c *Client) ListGift() (*GiftList, error)

func (*Client) R

func (c *Client) R() *resty.Request

func (*Client) Refresh

func (c *Client) Refresh() error

func (*Client) SendGift

func (c *Client) SendGift(rootId, giftId, count int) (*GiftList, error)

type Gift

type Gift struct {
	Id       int    `json:"id"`       // id
	Name     string `json:"name"`     // 名称
	Count    int    `json:"count"`    // 现有数量
	Exp      int    `json:"exp"`      // 经验
	Intimate int    `json:"intimate"` // 亲密度
	Met      int    `json:"met"`      // 过期时间

	Price     int `json:"price"     table:",ignored"` // 价值
	PriceType int `json:"priceType" table:",ignored"` // 价值类型(不确定)2-免费礼物
	PropType  int `json:"propType"  table:",ignored"` // 礼物类型(不确定)2-免费礼物 5-等级礼包 6-分区喇叭
}

func (*Gift) GetCount

func (g *Gift) GetCount() int

func (*Gift) TodayExpired

func (g *Gift) TodayExpired() bool

type GiftList

type GiftList struct {
	List []*Gift `json:"list"`
}

func (*GiftList) Find

func (gl *GiftList) Find(id int) *Gift

func (*GiftList) FirstNotEmpty

func (gl *GiftList) FirstNotEmpty(ids ...int) int

Jump to

Keyboard shortcuts

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