Skip to main content

User read message

This function is triggered when the system is alerted that a user has read a message. Inside this function, you can define custom logic to when a user reads a message in any channel, for example if the user who sent the message will see a read receipt.

async function handleEvent(event: UserReadMessageEvent, context: Context) {
}

The above function takes two parameters:

  1. The event object which in this case is the UserReadMessageEvent object. This object has three properties:

    • user: The user who read the message.
    • message: The message that was read by this user.
    • receipt: A receipt with details of the message read, including the time at which the message was read.
  2. A Context object.

note

This is a non-blocking chat function.