question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to mention a user?

See original GitHub issue

Hi, I need to mention a user using the format <@ABC123> which work on blockit but I cant get it to work on jsx… may I ask how it can be done?

block kit sample:

{
  "type": "section",
  "text": {
    "type": "mrkdwn",
    "text": "Approvers:\nRelease Management Team: Approved by <@WJNQ0AL9L>"
    "verbatim": true
  }
},

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yhattcommented, Sep 12, 2021

@leoyli-headsup jsx-slack components are basically based on Block Kit and I’m not thinking to add the alias component for mrkdwn syntaxes. But if you want, it’s very easy to define aliases by user side as same as React.

const Link = ({ children, href }) => <a href={href}>{children}</a>
const Mention = ({ id }) => <a href={`@${id}`} />

console.log(
  <Blocks>
    <Section>
      <Mention id="U0123456789" /> <Link href="https://example.com">Link</Link>
    </Section>
  </Blocks>
)
[
  {
    type: 'section',
    text: {
      type: 'mrkdwn',
      text: '<@U0123456789> <https://example.com|Link>',
      verbatim: true
    }
  }
]
0reactions
yhattcommented, Aug 14, 2022

@deepansh946 Did you read the Slack’s article I’ve shared? Slack has phased out mention through user names, and now you can no longer mention without user ID. You should always use user ID to mention through Slack apps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to mention a user in a message with discord.js?
The documentation recommends this way to mention a user: const message = `${user} has been muted`;. The example above uses template strings, ...
Read more >
Mention a user in HubSpot
To @ mention a user in HubSpot, just start typing @ and the users' name, and you'll see a list of users in...
Read more >
Parsing mention arguments - Discord.js v12 Guide
Discord uses a special syntax to embed mentions in a message. For user mentions, it is the user's ID with <@ at the...
Read more >
Mention Users' Permissions
Assign the right access status to your Team members!
Read more >
Use @mention in comments to tag someone for feedback
Tip: To be more casual, feel free to delete everything except the person's first name in the @mention. To include more people, type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found