Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Home
/
Chat
/
JavaScript
/
Message
This is the new Docs for Chat SDK v4 for JavaScript. To see the previous Docs, click here.

Mention other users in a message

When a participant in an open channel or a member in a group channel wants to call the attention of other users in the channel, they can mention those users in a message. This is particularly useful for open channel users where push notifications are not allowed by default. Follow the steps below to mention other users in a message.

  1. Specify a list of the user IDs to mention.

  2. Add the list to either UserMessageCreateParams or FileMessageCreateParams which may contain options for further action.

  3. Pass the params to either sendUserMessage() or sendFileMessage().

  4. Then only up to ten participants mentioned in the message will be notified.

const params: UserMessageCreateParams = {
    message: MESSAGE;
    mentionedUserIds: ['Harry', 'Jay', 'Jin'],
};