Skip to main content

Mentions

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

NameTypeDescriptionRequired
typestringThe type of this message mention. CHANNEL, or USER
tagstringThe literal text referencing the mentioned entity inside the message
startPositionnumberThe starting position of this mention reference inside the message
endPositionnumberThe 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

NameTypeDescriptionRequired
channelChannelThe channel that was mentioned

User mention

This notifies a user.

Additional Properties

NameTypeDescriptionRequired
userUserThe 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.

const result = await kitty.sendMessage({
channel: channel,
body: 'Hello, <#my-public-channel>!'
});

if (result.succeeded) {
const message = result.message; // Handle message
}

if (result.failed) {
const error = result.error; // Handle error
}

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.

const result = await kitty.sendMessage({
channel: channel,
body: 'Hello, <@jane@chatkitty.com>!'
});

if (result.succeeded) {
const message = result.message; // Handle message
}

if (result.failed) {
const error = result.error; // Handle error
}