Skip to content

WebsocketResponseEvent

Triggered when any event is received from the WebSocket. Carries the raw ``ProtoMessageFetchResult`` envelope this event was extracted from on ``self.raw`` for callers that want to inspect the underlying response fields (cursor, fetch_interval, ws_params, etc.).

Triggered when any event is received from the WebSocket. Carries the raw ProtoMessageFetchResult envelope this event was extracted from on self.raw for callers that want to inspect the underlying response fields (cursor, fetch_interval, ws_params, etc.).

The previous design subclassed ProtoMessageFetchResult directly; that produced empty fields in practice (the constructor was fed the inner per-message envelope, not the outer fetch result) and additionally tripped betterproto2’s metadata machinery whenever the subclass lived in a different module from the upstream definition.

class WebsocketResponseEvent(BaseEvent)
WebsocketResponseEvent(raw: Optional[ProtoMessageFetchResult] = None)
from TikTokLive.events import WebsocketResponseEvent

TikTokLive/events/custom_events.py:11