On this page

Event object

Event represents a single piece of information emitted during chat operations: typing indicators, message receipts, mentions, or reports.

Unlike other Chat SDK entities, Event provides no methods - it only passes payloads emitted during chat operations.

Deprecated event types

Many EventContent subtypes (Typing, Report, Receipt, Mention, Invite, Custom, Moderation) are deprecated. Use entity-level methods instead (for example, channel.onTypingChanged(), user.onMentioned(), channel.onMessageReported()). See Custom events for the full mapping.

Properties

The Event interface has the following properties:

1class Event<T : EventContent>(
2 val chat: Chat,
3 val timetoken: Long,
4 val payload: T,
5 val channelId: String,
6 val userId: String
7)
ParameterDescription
chat
Type: Chat
Reference to the main Chat object.
timetoken
Type: Long
Timetoken of the message that triggered an event.
payload
Type: T
Data passed in an event (of EventContent subtype) that differ depending on the emitted event type (typing, report, receipt, mention, invite, custom, moderation, or text).
channelId
Type: String
Target channel where this event is delivered.
userId
Type: String
Unique ID of the user that triggered the event.
icon

Event structure

Use case

Events enable:

  • Collecting historical chat events
  • Creating custom events
  • Building moderation dashboards for flagged messages
  • Triggering business logic with Functions
On this page