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

ChatEvent has the following properties:

1public struct ChatEvent
2{
3 public string TimeToken;
4 public PubnubChatEventType Type;
5 public string ChannelId;
6 public string UserId;
7 public string Payload;
8}
ParameterDescription
TimeToken
Type: string
Timetoken of the message that triggered an event.
Type
Type: PubnubChatEventType
Type of action that emits an event: Typing, Report, Receipt, Mention, Invite, Custom, and Moderation.
ChannelId
Type: string
Target channel where this event is delivered.
UserId
Type: string
Unique ID of the user that triggered the event.
Payload
Type: string
Data passed in an event that differ depending on the event type.

For details, refer to the chat events documentation.

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