Event Models¶
Property accessors return the nested model or None if absent or wrong event type.
event.user # User object (most events)
event.tip # Tip object (TIP only)
event.message # Message object (CHAT_MESSAGE, PRIVATE_MESSAGE)
event.media # Media object (MEDIA_PURCHASE)
event.room_subject # RoomSubject object (ROOM_SUBJECT_CHANGE)
event.broadcaster # Broadcaster username string, or None if missing
Warning
All string fields (e.g. message.message, user.username, tip.message)
originate from untrusted user input and are not sanitized by this library.
Escape or validate them before use in HTML, SQL, or shell contexts.
User¶
Carried by most event types. Check event.user before accessing fields.
Field |
Type |
Description |
|---|---|---|
|
|
Display name of the user. |
|
|
Whether the user is in the fan club. |
|
|
Whether the user is a moderator. |
|
|
Whether the user is a follower. |
|
|
Whether the user is the room owner. |
|
|
Whether the user has tokens. |
|
|
Whether the user is currently broadcasting. |
|
|
Whether the user is in a private show. |
|
|
Whether the user is spying on a private show. |
|
|
Whether the user is silenced. |
|
|
Whether the user has dark mode enabled. |
|
|
Whether fan club auto-renewal is enabled. |
|
|
Color group of the user. |
|
|
Gender of the user. |
|
|
Language preference of the user. |
|
|
Recent tip activity level. |
|
|
Subgender of the user. |
Tip¶
Present on TIP events only. Access via event.tip.
Field |
Type |
Description |
|---|---|---|
|
|
Number of tokens tipped. |
|
|
Whether the tip is anonymous. |
|
|
Optional message attached to the tip. |
Message¶
Present on CHAT_MESSAGE and PRIVATE_MESSAGE events. Access via
event.message.
Field |
Type |
Description |
|---|---|---|
|
|
Content of the message. |
|
|
Username of the sender (private messages only). |
|
|
Username of the recipient (private messages only). |
|
|
Text color of the message. |
|
|
Background color of the message. |
|
|
Font style of the message. |
|
|
Original (untranslated) message content. |
|
|
|
Media¶
Present on MEDIA_PURCHASE events. Access via event.media.
Field |
Type |
Description |
|---|---|---|
|
|
Identifier of the purchased media. |
|
|
Name of the purchased media. |
|
|
Type of the purchased media. |
|
|
Number of tokens spent on the purchase. |
RoomSubject¶
Present on ROOM_SUBJECT_CHANGE events. Access via event.room_subject.
Field |
Type |
Description |
|---|---|---|
|
|
The updated room subject or title. |