gobridge / gopher

Slack bot for Gophers slack https://invite.slack.golangbridge.org
Apache License 2.0
95 stars 23 forks source link

Update github.com/nlopes/slack and use converstations.list API #62

Closed vcabbage closed 5 years ago

vcabbage commented 5 years ago

The channels.list and groups.list Slack APIs are deprecated and have a number of caveats. conversations.list is Slack's supported API to list public and private channels.

There have been a number of breaking changes in nlopes/slack that required touching many areas of the code. I've done my best to keep all logic the same but can't guarantee there aren't unintentional changes.

I also added printing of the channel names to IDs during startup. I think this will help diagnose issues with posting to channels in the future. I believe the previous issue with the now removed #golang_cls logic was that it's ID wasn't being returned by groups.list and the bot was attempting to send to a channel of "". Either that or the channel has been deleted/archived, it's is/was private so I can't tell. This is based on a log message from the previous version:

gerrit.go:196: Error Posting Message to : channel_not_found

I saw similar message from the GoTimeFM logic:

gotimefm.go:54: got error while notifying slack: channel_not_found
vcabbage commented 5 years ago

Excellent feedback. I'll follow up with another PR to address it.