We use WebSockets to send and receive updates to and from clients.
wss://sockets.betterttv.net/ws
join_channel
Joining a channel will subscribe you to its events, such as emote and user updates.
Field | Type | Description |
---|---|---|
name | ChannelName | The name of the channel to join. |
part_channel
Parting a channel will unsubscribe you from its events.
Field | Type | Description |
---|---|---|
name | ChannelName | The name of the channel to join. |
emote_create
Create events are sent when a new emote is uploaded to the subscribed channel, or when a new shared emote is added.
Field | Type | Description |
---|---|---|
emote | Emote | The emote that was created. |
channel | ChannelName | The channel that the emote was created in. |
emote_update
This event will be triggered when an emote's code is modified. In addition, this event will be emitted when a shared emote's code-alias is updated.
Field | Type | Description |
---|---|---|
emote.id | string | The ID of the emote that was updated. |
emote.code | string | The new code of the emote. |
channel | ChannelName | The channel that the emote was created in. |
emote_delete
This event will be triggered when an emote is deleted from a subscribed channel.
Field | Type | Description |
---|---|---|
emoteId | string | The ID of the emote that was deleted. |
channel | ChannelName | The channel that the emote was deleted from. |
broadcast_me
Broadcasts your user information, if any, to other clients in the same channel. This should be sent when messages are sent by the user.
Field | Type | Description |
---|---|---|
provider | Provider | The name of the platform. |
providerId | string | Platform user Id for specified provider. |
channel | ChannelName | The channel that the emote was created in. |
lookup_user
Usually on channel join, this is event is triggered when a user broadcasts themselves to other clients.
Field | Type | Description |
---|---|---|
name | string | User's platform username. |
providerId | string | User's platform user id. |
channel | ChannelName | The channel the change occured in. |
pro | boolean | Whether the user is a pro subscriber. |
emotes | Emote[] | List of the user's personal emotes. |
badge?.url | string | The URL of the user badge. |
badge?.startedAt? | string | Date when user first subscribed to Pro. |
Channel name is a concatted string, with provider
and providerId
.
{provider}:{providerId}
Field | Type | Description |
---|---|---|
provider | Provider | The name of the platform. |
providerId | string | Platform user Id for specified provider. |