Skip to content

Commit

Permalink
Merge pull request #1118 from johanmcos/master
Browse files Browse the repository at this point in the history
add GetOtherTeam method
  • Loading branch information
kanata2 committed Dec 8, 2022
2 parents 657f4e7 + 1fdc136 commit 501365f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions team.go
Expand Up @@ -100,6 +100,22 @@ func (api *Client) GetTeamInfo() (*TeamInfo, error) {
return api.GetTeamInfoContext(context.Background())
}

// GetOtherTeamInfo gets Team information for any team
func (api *Client) GetOtherTeamInfo(team string) (*TeamInfo, error) {
if team == "" {
return api.GetTeamInfo()
}
values := url.Values{
"token": {api.token},
}
values.Add("team", team)
response, err := api.teamRequest(context.Background(), "team.info", values)
if err != nil {
return nil, err
}
return &response.Team, nil
}

// GetTeamInfoContext gets the Team Information of the user with a custom context
func (api *Client) GetTeamInfoContext(ctx context.Context) (*TeamInfo, error) {
values := url.Values{
Expand Down

0 comments on commit 501365f

Please sign in to comment.