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}
| Parameter | Description |
|---|---|
TimeTokenType: string | Timetoken of the message that triggered an event. |
TypeType: PubnubChatEventType | Type of action that emits an event: Typing, Report, Receipt, Mention, Invite, Custom, and Moderation. |
ChannelIdType: string | Target channel where this event is delivered. |
UserIdType: string | Unique ID of the user that triggered the event. |
PayloadType: 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