add AccountsSearchResolve
This commit is contained in:
parent
2aa0406a44
commit
f59d7e630f
2 changed files with 52 additions and 0 deletions
14
accounts.go
14
accounts.go
|
@ -284,6 +284,20 @@ func (c *Client) AccountsSearch(ctx context.Context, q string, limit int64) ([]*
|
|||
return accounts, nil
|
||||
}
|
||||
|
||||
func (c *Client) AccountsSearchResolve(ctx context.Context, q string, limit int64, resolve bool) ([]*Account, error) {
|
||||
params := url.Values{}
|
||||
params.Set("q", q)
|
||||
params.Set("limit", fmt.Sprint(limit))
|
||||
params.Set("resolve", fmt.Sprint(resolve))
|
||||
|
||||
var accounts []*Account
|
||||
err := c.doAPI(ctx, http.MethodGet, "/api/v1/accounts/search", params, &accounts, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return accounts, nil
|
||||
}
|
||||
|
||||
// FollowRemoteUser sends follow-request.
|
||||
func (c *Client) FollowRemoteUser(ctx context.Context, uri string) (*Account, error) {
|
||||
params := url.Values{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue