Stream
Represents a Twitch stream.
Extends
BaseStream<T>
Type parameters
| Type parameter |
|---|
T extends EventSubConnection |
Constructors
new Stream()
1new Stream<T>(chatbot: ChatBot<T>, data: GetStream): Stream<T>Creates a new instance of the stream.
Parameters
| Parameter | Type | Description |
|---|---|---|
chatbot | ChatBot<T> | The current instance of the chatbot. |
data | GetStream | The data of the stream returned from the API. |
Returns
Stream<T>
Overrides
Source
twitchfy/packages/chatbot/src/structures/Stream.ts:49
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
broadcaster | readonly | BaseUser<T> | The broadcaster of the stream. | BaseStream.broadcaster |
chatbot | readonly | ChatBot<T> | The current instance of the chatbot. | BaseStream.chatbot |
game | readonly | Game | The game which is currently being played on the stream. | - |
id | readonly | string | The id of the stream. | BaseStream.id |
isMature | readonly | boolean | Whether the stream is marked as mature. | - |
language | readonly | string | The language of the stream. | - |
tags | readonly | string[] | The tags of the stream. | - |
type | readonly | string | The type of the stream. | BaseStream.type |
viewerCount | readonly | number | The amount of viewers watching 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
title
1get title(): null | stringThe title of the stream.
Returns
null | string
Source
twitchfy/packages/chatbot/src/structures/Stream.ts:62
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>>
Inherited from
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.
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseStream.ts:57
thumbnailURL()
1thumbnailURL(options?: ThumbailOptions): stringThe thumbnail URL of the stream.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | ThumbailOptions | The options for the thumbnail. |
Returns
string