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.

Properties

The Event interface has the following properties:

1public protocol Event<T> {
2 associatedtype C: Chat
3 associatedtype T: EventContent
4
5 var chat: C { get }
6 var timetoken: Timetoken { get }
7 var payload: T { get }
8 var channelId: String { get }
9 var userId: String { get }
10}
ParameterDescription
chat
Type: C
Reference to the main ChatImpl object.
timetoken
Type: Timetoken
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, or Moderation).
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
Last updated on
On this page