Custom actions for chat messages
We recently introduced a menu for message actions. It only contained the option to delete a message, but it's a great location to put many more actions that your users might want to perform.
So today, we're introducing the option to add custom message actions to this menu. You could add common messaging actions here like marking a message as a favourite, reporting it to a moderator, or some more application-specific actions, such as creating a to-do list item for a message or turning it into a meme.
You can define these actions in the Role editor. When a user is allowed to perform an action, it'll appear in the menu for that user. When they click the action, it triggers an event that you can listen for using our JavaScript SDK.
The code snippet would look something like this:
chatbox.onCustomMessageAction("report", event => {
// ... make backend request here
console.log("User reported: ", event.message.body);
});