WebSocketShard
A WebSocket Shard created within a Conduit.
Constructors
new WebSocketShard()
1new WebSocketShard(options?: Pick<WebSocketConnectionOptions, "proxy">): WebSocketShardBuilds 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
1get conduitId(): stringThe id of the Conduit which created this shard.
Returns
string
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:81
helixClient
1get helixClient(): HelixClientThe HelixClient to interact with the Twitch API of this shard.
Returns
HelixClient
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:89
sessionId
1get sessionId(): stringThe session id of the shard.
1set sessionId(value: string): voidSets the session id of the shard.
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
string
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:67
shardId
1get shardId(): stringThe id of the shard.
Returns
string
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:96
Methods
connect()
1connect(): Promise<void>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()
1makeDebug(...args: any[]): voidSends 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()
1sendPacket(packet: object): voidSends 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