BaseStream
The base class for a stream.
Extends
Base<T>
Extended by
Type parameters
| Type parameter |
|---|
T extends EventSubConnection |
Constructors
new BaseStream()
1new BaseStream<T>(chatbot: ChatBot<T>, data: BaseStreamData): BaseStream<T>Creates a new instance of the base stream.
Parameters
| Parameter | Type | Description |
|---|---|---|
chatbot | ChatBot<T> | The current instance of the chatbot. |
data | BaseStreamData | The base data of the stream. |
Returns
BaseStream<T>
Overrides
Base<T>.constructor
Source
twitchfy/packages/chatbot/src/structures/BaseStream.ts:37
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
broadcaster | readonly | BaseUser<T> | The broadcaster of the stream. | - |
chatbot | readonly | ChatBot<T> | The current instance of the chatbot. | Base.chatbot |
id | readonly | string | The id of the stream. | - |
type | readonly | string | The type of the stream. | - |
Accessors
startedAt
1get startedAt(): DateWhen the stream has started. Returns a JavaScript Date object.
Returns
Date
Source
twitchfy/packages/chatbot/src/structures/BaseStream.ts:67
Methods
createClip()
1createClip(delay?: boolean): Promise<BaseClip<T>>Creates a new clip of the stream.
Parameters
| Parameter | Type | Description |
|---|---|---|
delay? | boolean | Whether to delay few seconds the clip or not. |
Returns
Promise<BaseClip<T>>
Source
twitchfy/packages/chatbot/src/structures/BaseStream.ts:49
fetch()
1fetch(): Promise<null | Stream<T>>Fetches the current stream from the API.
Returns
Promise<null | Stream<T>>
The current stream or null if the stream is offline.