From d778e9eeb5dfe91db3009415832421bc473ba4fe Mon Sep 17 00:00:00 2001 From: "Johan M. Cos" Date: Tue, 13 Dec 2022 10:11:50 -0500 Subject: [PATCH] add GetOtherTeamInfoContext method --- team.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/team.go b/team.go index 62d242d44..d21a1b642 100644 --- a/team.go +++ b/team.go @@ -129,22 +129,27 @@ 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) { +// GetOtherTeamInfoContext gets Team information for any team with a custom context +func (api *Client) GetOtherTeamInfoContext(ctx context.Context, team string) (*TeamInfo, error) { if team == "" { - return api.GetTeamInfo() + return api.GetTeamInfoContext(ctx) } values := url.Values{ "token": {api.token}, } values.Add("team", team) - response, err := api.teamRequest(context.Background(), "team.info", values) + response, err := api.teamRequest(ctx, "team.info", values) if err != nil { return nil, err } return &response.Team, nil } +// GetOtherTeamInfo gets Team information for any team +func (api *Client) GetOtherTeamInfo(team string) (*TeamInfo, error) { + return api.GetOtherTeamInfoContext(context.Background(), team) +} + // GetTeamInfoContext gets the Team Information of the user with a custom context func (api *Client) GetTeamInfoContext(ctx context.Context) (*TeamInfo, error) { values := url.Values{