WebSocketShard
A WebSocket Shard created within a Conduit.
Constructors
new WebSocketShard()
Builds up a WebSocketShard.
Parameters
Parameter | Type | Description |
---|---|---|
options ? | Pick <WebSocketConnectionOptions , "proxy" > | The options for the WebSocketShard. |
Returns
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:58
Properties
Property | Modifier | Type | Default value | Description |
---|---|---|---|---|
proxy | readonly | string | undefined | The proxy used for the WebSocket connection if it was specified. |
ws | public | WebSocketShardConnector | null | The WebSocket connector for this shard. |
Accessors
conduitId
The id of the Conduit which created this shard.
Returns
string
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:81
helixClient
The HelixClient to interact with the Twitch API of this shard.
Returns
HelixClient
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:89
sessionId
The session id of the shard.
Sets the session id of the shard.
Parameters
Parameter | Type |
---|---|
value | string |
Returns
string
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:67
shardId
The id of the shard.
Returns
string
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:96
Methods
connect()
Connects the shard to the WebSocket connection. The Promise resolves when the connection is established and the session_welcome message was received.
Returns
Promise
<void
>
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:103
makeDebug()
Sends a debug message to the parent thread.
Parameters
Parameter | Type | Description |
---|---|---|
…args | any [] | The arguments to send. |
Returns
void
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:122
sendPacket()
Sends a packet to the parent thread.
Parameters
Parameter | Type | Description |
---|---|---|
packet | object | The packet to send. |
Returns
void
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:130