Skip to content

Commit

Permalink
批量查询用户与自己关系
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Oct 7, 2024
1 parent 615e89d commit f678f19
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,3 +717,16 @@ func (c *Client) GetUserRelation2(param GetUserRelation2Param) (*GetUserRelation
)
return execute[*GetUserRelation2Result](c, method, url, param, fillWbiHandler(c.wbi, c.GetCookies()))
}

type BatchGetUserRelationParam struct {
Fids []int `json:"fids"` // 目标用户 mid
}

// BatchGetUserRelation 批量查询用户与自己关系
func (c *Client) BatchGetUserRelation(param BatchGetUserRelationParam) (map[int]*RelationDetail, error) {
const (
method = resty.MethodGet
url = "https://api.bilibili.com/x/relation/relations"
)
return execute[map[int]*RelationDetail](c, method, url, param)
}

0 comments on commit f678f19

Please sign in to comment.