Shard
A shard created within a Conduit.
Constructors
new Shard()
Builds up a Shard.
Parameters
Parameter | Type | Description |
---|---|---|
conduit | Conduit | The Conduit that created this shard. |
data | ConduitShardData & object | The data from the API. If the shard is of type ‘webhook’, it aditionally includes the secret which is not returned by the API. |
Returns
Source
twitchfy/packages/eventsub/src/structures/Shard.ts:49
Properties
Property | Modifier | Type | Description |
---|---|---|---|
callback? | readonly | string | The callback of the shard. Only present in webhook type. |
conduit | readonly | Conduit | The Conduit that created this shard. |
id | readonly | string | The id of the shard. Starting from 0. |
secret? | readonly | string | The secret of the shard. Only present in webhook type. |
sessionId? | readonly | string | The session id of the shard. Only present in websocket type. |
status | readonly | string | The status of the shard. Probably ‘enabled’. |
type | readonly | "websocket" | "webhook" | The type of transport of the shard. |
Methods
delete()
Deletes the shard.
Returns
Promise
<Shard
[]>
Source
twitchfy/packages/eventsub/src/structures/Shard.ts:86
toAPI()
Converts the shard to the API format.
Returns
object
The shard into API format.
Member | Type | Value |
---|---|---|
id | string | … |
transport | object | … |
transport.callback | string | … |
transport.method | "websocket" | "webhook" | … |
transport.secret | string | … |
transport.session_id | string | … |