bilibot

package
v0.0.0-...-35d01cd Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoginInfo

func GetLoginInfo(QrcodeKey string) ([]*http.Cookie, error)

Types

type Author

type Author struct {
	Mid   uint   `json:"mid"`    // 作者ID
	Name  string `json:"name"`   // 作者名称
	Face  string `json:"face"`   // 作者头像
	PubTS uint64 `json:"pub_ts"` // 作者发布时间
}

type AuthorData

type AuthorData struct {
	Mid  uint   `json:"mid"`
	Name string `json:"name"`
	Sex  string `json:"sex"`
	Face string `json:"face"`
}

type AuthorInfo

type AuthorInfo struct {
	Code    int        `json:"code"`
	Message string     `json:"message"`
	Data    AuthorData `json:"data"`
}

func GetInfo

func GetInfo(mid string) (*AuthorInfo, error)

type BotData

type BotData struct {
	Mid     uint   `json:"mid"`
	Name    string `json:"uname"`
	IsLogin bool   `json:"isLogin"`
	Face    string `json:"face"`
}

type BotInfo

type BotInfo struct {
	Code    int     `json:"code"`
	Message string  `json:"message"`
	Data    BotData `json:"data"`
}

func GetBotInfo

func GetBotInfo(cookie *http.Cookie) (*BotInfo, error)

type Content

type Content struct {
	Desc struct {
		Text string `json:"text"` // 动态内容
	} `json:"desc"`
}

type Dynamic

type Dynamic struct {
	ID      string `json:"id_str"` // 动态ID
	Modules struct {
		Author  Author  `json:"module_author"`  // 动态作者
		Content Content `json:"module_dynamic"` // 动态内容
	} `json:"modules"`
}

func GetDynamic

func GetDynamic(mid string, offset string) ([]Dynamic, error)

type Dynamics

type Dynamics struct {
	Code int `json:"code"`
	Data struct {
		HasMore bool      `json:"has_more"` // 是否还有更多动态
		Items   []Dynamic `json:"items"`
		Offset  string    `json:"offset"` // 动态偏移量,触发下一页动态
	} `json:"data"`
}

type LoginData

type LoginData struct {
	RefreshToken string `json:"refresh_token"`
	TimeStamp    int    `json:"timestamp"`
	Code         int    `json:"code"`
	Message      string `json:"message"`
}

type LoginResponse

type LoginResponse struct {
	Code    int       `json:"code"`
	Message string    `json:"message"`
	Data    LoginData `json:"data"`
}

type QRCodeResponse

type QRCodeResponse struct {
	Code int `json:"code"`
	TS   int `json:"ts"`
	Data struct {
		Url       string `json:"url"`        // 二维码内容url
		QrcodeKey string `json:"qrcode_key"` // 扫码登录秘钥
	} `json:"data"`
}

func GetLoginUrl

func GetLoginUrl() (*QRCodeResponse, error)

type ReplyResponse

type ReplyResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		SuccessToast string      `json:"success_toast"`
		Emote        interface{} `json:"emote"`
	} `json:"data"`
}

func AddReply

func AddReply(cookie string, typeID int, oid string, message string) (*ReplyResponse, error)

func DynamicReply

func DynamicReply(cookie string, dynamicID string, message string) (*ReplyResponse, error)

Jump to

Keyboard shortcuts

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