WebSocketShard
A WebSocket Shard created within a Conduit.
Constructors
new WebSocketShard()
1new WebSocketShard(options?: Pick<WebSocketConnectionOptions, "proxy">): 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
1get conduitId(): string
The id of the Conduit which created this shard.
Returns
string
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:81
helixClient
1get helixClient(): HelixClient
The HelixClient to interact with the Twitch API of this shard.
Returns
HelixClient
Source
twitchfy/packages/eventsub/src/structures/WebSocketShard.ts:89
sessionId
1get sessionId(): string
The session id of the shard.
1set sessionId(value: string): void
Sets 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(): string
The 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[]): void
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()
1sendPacket(packet: object): void
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