tanium / octobot

github bot with slack and jira integration
MIT License
25 stars 16 forks source link

Use slack ids to message users #317

Closed matthauck closed 2 years ago

matthauck commented 2 years ago

There are some usernames that don't seem to match up for some reason. And slack is deprecating referencing users by name.

So: change the user add/edit workflow to accept an email address and lookup the corresponding slack name / id.

Also perform a mass migration on startup.

matthauck commented 2 years ago

deprecation warning:

Passing a "username" as a channel value is deprecated, along with the whole concept of usernames on Slack. Please always use channel-like IDs instead to make sure your message gets to where it's going.

https://api.slack.com/methods/chat.postMessage#channels__post-to-a-direct-message-channel

matthauck commented 2 years ago

was thinking of also doing channels after this PR. If anything, i thought it would be nice for the UI to verify a channel is valid when adding to the repos list.

However:

  1. slack says that channel id's may not be stable: https://api.slack.com/docs/conversations-api#issues
  2. there is no lookup-channel-by-name API afaict. You have to fetch all the channels, which is kinda a bummer. 😕