slack-go / slack

Slack API in Go, originally by @nlopes; Maintainers needed, contact @parsley42
https://pkg.go.dev/github.com/slack-go/slack
BSD 2-Clause "Simplified" License
4.64k stars 1.13k forks source link

add GetOtherTeam method #1118

Closed johanmcos closed 1 year ago

johanmcos commented 1 year ago

I'm creating a chatbot that needs to be able to get information about users' teams to decide if/how to respond to them.

As has been noted in #980, the GetTeamInfo method doesn't expose the optional team argument that the Slack API accepts, meaning my bot can only get info about its own team.

981 attempted to fix this, but lacked backwards compatibility. This is an attempt to implement the functionality in a backwards-compatible way by creating a new GetOtherTeamInfo method, as had been suggested by @kanata2 in the discussion of #981

I'm frankly a little unsure how to implement a meaningful test for this unfortunately, but I can confirm that make pr-prep reported no issues.

kanata2 commented 1 year ago

GetOtherTeamInfoContext

This is put on hold as a future work.

johanmcos commented 1 year ago

@johanmcos

Thanks! Could you add GetOtherTeamInfoContext method that you can pass context.Context as an argument? 🙏

Sorry for the delay, I added the requested method in #1143