From 1fdc136cc04c6902a17ae5641e1daad9a7d3088a Mon Sep 17 00:00:00 2001 From: Johan Cos Date: Tue, 25 Oct 2022 08:31:26 -0400 Subject: [PATCH] add GetOtherTeam method --- team.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/team.go b/team.go index 029e2b5bc..18f35517e 100644 --- a/team.go +++ b/team.go @@ -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{