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.
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)
| Parameter | Description |
|---|---|
chatType: Chat | Reference to the main Chat object. |
timetokenType: Long | Timetoken of the message that triggered an event. |
payloadType: 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). |
channelIdType: String | Target channel where this event is delivered. |
userIdType: String | Unique ID of the user that triggered the event. |
Use case
Events enable:
- Collecting historical chat events
- Creating custom events
- Building moderation dashboards for flagged messages
- Triggering business logic with Functions