ChatKitty
Search…
Mentions
Notify users of messages that need their attention directly.
Mentions are a direct way to notify users of things that need their attention in a message. Mentions can trigger notifications and are embedded inside a message.

Properties

Name
Type
Description
Required
type
string
The type of this message mention. CHANNEL, or USER
tag
string
The literal text referencing the mentioned entity inside the message
startPosition
number
The starting position of this mention reference inside the message
endPosition
number
The ending position of this mention reference inside the message

Mention types

There are two types of message mentions:

Channel mention

This notifies all members of a public or private channel.

Additional Properties

Name
Type
Description
Required
channel
Channel
The channel that was mentioned

User mention

Additional Properties

Name
Type
Description
Required
user
User
The user that was mentioned

Mentioning entities

Users can mention channels and users inside their messages using ChatKitty's mention syntax.

Mentioning a channel

You can mention a channel using the ChatKitty channel mention syntax inside a text message: <#channelName> where channelName is the name of the channel being mentioned.
1
const result = await kitty.sendMessage({
2
channel: channel,
3
body: 'Hello, <#my-public-channel>!',
4
});
5
6
if (result.succeeded) {
7
const message = result.message; // Handle message
8
}
9
10
if (result.failed) {
11
const error = result.error; // Handle error
12
}
Copied!

Mentioning a user

You can mention a user using the ChatKitty user mention syntax inside a text message: <@username> where username is the username of the user being mentioned.
1
const result = await kitty.sendMessage({
2
channel: channel,
3
body: 'Hello, <@[email protected]>!',
4
});
5
6
if (result.succeeded) {
7
const message = result.message; // Handle message
8
}
9
10
if (result.failed) {
11
const error = result.error; // Handle error
12
}
Copied!
Last modified 12d ago