How can I make slack parse @someone
mentions as links to the user instead of plaintext. I've been reading slack documentation on message formatting but still haven't figured it out. Here's an example of what I'm getting now:
{
"text": "*username:* @alexis",
"response_type": "ephemeral"
}
Click the Slackbot tab, and you'll see an option to add new responses (provided your Slack administrator allows everyone to add new ones). You can put any text you like on the input side (what you type in a message) and output side (how Slackbot will respond).
Slack has a lot of built-in slash commands that act as shortcuts for specific actions in Slack. You simply need to type the slash key (/) then followed by some keywords in any Slack channel or direct message to trigger specific actions in Slack (e.g. type /away to mark your status to “away” quickly).
Mentioning users in messages The user mentioning syntax <@W123|bronte> is now deprecated and will eventually be removed. Slack will use the "display name" when rendering all mentions. Use the simpler user ID-only form <@W123> instead. Using link_names when posting messages is also deprecated.
To make a proper "clickable" mention, you need to pass the unique user ID and not the plaintext name.
The format of the user ID is: U024BE7LH
and a mention would look like this: <@U024BE7LH>
Ther user ID of the user that executed the slash command will be in the payload that slack sends to your endpoint. You can also look up user IDs by calling the users.list method, which will give you access to the user IDs of all the users in the team.
More information here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With