Reputation: 2019
In this message formatting doc: https://api.slack.com/docs/message-formatting, you can use special control sequence characters <
and >
to perform server-side parsing (server-side as in Slack API's server-side).
So using <@U024BE7LH>
in your chat.postMessage()
call will get parsed to something like @bob
or whatever the username associated with that ID is, in the actual text that shows up in slack.
Unfortunately, this will cause a notification for the person you're referring to. How do I make it so that it doesn't notify the person? I've tried to enclose in a code block, i.e.:
`<@U024BE7LH>`
or
```
<@U024BE7LH>
```
But it still pings. I'm thinking the only way is to get a list of users and parse the name from the ID.
Upvotes: 2
Views: 570
Reputation: 6860
According to this, backticks should work but empirically it hasn't for me. The Slack employee says to just convert the user ID to their name and use that without the templating.
Upvotes: 2