Add GetFavouritedBy
This commit is contained in:
parent
3cb20b5925
commit
74901c994c
2 changed files with 47 additions and 1 deletions
12
status.go
12
status.go
|
@ -85,7 +85,7 @@ func (c *Client) GetStatusCard(id string) (*Card, error) {
|
|||
return &card, nil
|
||||
}
|
||||
|
||||
// GetRebloggedBy returns the account of the user who re-blogged.
|
||||
// GetRebloggedBy returns the account list of the user who reblogged the toot of id.
|
||||
func (c *Client) GetRebloggedBy(id int64) ([]*Account, error) {
|
||||
var accounts []*Account
|
||||
err := c.doAPI(http.MethodGet, fmt.Sprintf("/api/v1/statuses/%d/reblogged_by", id), nil, &accounts)
|
||||
|
@ -95,6 +95,16 @@ func (c *Client) GetRebloggedBy(id int64) ([]*Account, error) {
|
|||
return accounts, nil
|
||||
}
|
||||
|
||||
// GetFavouritedBy returns the account list of the user who liked the toot of id.
|
||||
func (c *Client) GetFavouritedBy(id int64) ([]*Account, error) {
|
||||
var accounts []*Account
|
||||
err := c.doAPI(http.MethodGet, fmt.Sprintf("/api/v1/statuses/%d/favourited_by", id), nil, &accounts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return accounts, nil
|
||||
}
|
||||
|
||||
// GetTimelineHome return statuses from home timeline.
|
||||
func (c *Client) GetTimelineHome() ([]*Status, error) {
|
||||
var statuses []*Status
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue