Search code examples
botschatbotslackslack-api

Slack API - how to parse users without notifying


Whenever we parse a user by their ID with <@Usomething>, it will automatically parse that user ID and replace it with the associated name in channel.

Sometimes you just want to parse the name and not have the person be notified. Is there a way to do a silent parse?


Solution

  • You could accomplish this by using the Slack API method users.info: pass the user ID into that method, retrieve the user's name attribute, and then use that in your Slack message.