epiforecasts / slack_bot

The source code for our friendly EpiForecasts bot
Other
2 stars 0 forks source link

Add ability to tag users #1

Closed Bisaloo closed 2 years ago

Bisaloo commented 2 years ago

This is not very straightforward. My understanding is that you cannot tag people directly using their username. You have to use their user ID instead. And the user ID cannot be guessed, we have to get it from slack itself.

We could either:

Resources: https://api.slack.com/reference/surfaces/formatting#mentioning-users

Bisaloo commented 2 years ago

I'm going with getting user ID from email addresses with this endpoint: https://api.slack.com/methods/users.list.

As noted there, the bot needs the users:read and users:read.email permissions. I've updated the bot accordingly. I don't think this is a privacy issue since as mentioned above, people joined with their LSHTM address, which is already public/known to anyone with access to the bot.

@sbfnk, the new permissions will be available after the bot is reinstalled. Could you do this whenever convenient please?

Bisaloo commented 2 years ago

https://github.com/epiforecasts/slack_bot/commit/e9ff70cc54a4410b7a10c51ca190e9922e99a601