Clip
Represents a Twitch clip.
Extends
BaseClip
<T
>
Type parameters
Type parameter |
---|
T extends EventSubConnection |
Constructors
new Clip()
Creates a new instance of the clip.
Parameters
Parameter | Type | Description |
---|---|---|
chatbot | ChatBot <T > | The current instance of the chatbot. |
data | GetClip | The data of the clip returned from the API. |
Returns
Clip
<T
>
Overrides
Source
twitchfy/packages/chatbot/src/structures/Clip.ts:78
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
broadcaster | readonly | BaseUserWithoutUsername <T > | The user who broadcasted the clip. The user will not have an username because Twitch limitations. | - |
chatbot | readonly | ChatBot <T > | The current instance of the chatbot. | BaseClip .chatbot |
creator | readonly | BaseUserWithoutUsername <T > | The user who created the clip. The user will not have an username because Twitch limitations. | - |
duration | readonly | number | The duration of the clip in seconds. | - |
embedURL | readonly | string | The URL to embed the clip in a frame. | - |
gameId | readonly | string | The Id of the game which was played in the clip. | - |
id | readonly | string | The id of the clip. | BaseClip .id |
isFeatured | readonly | boolean | Whether the clip is featured. | - |
language | readonly | string | The language of the clip. | - |
thumbnailURL | readonly | string | The URL to the thumbnail of the clip. | - |
title | readonly | string | The title of the clip. | - |
url | readonly | string | The url of the clip. | BaseClip .url |
viewCount | readonly | number | The view count of the clip. | - |
vodOffset | readonly | null | number | The offset in the VOD where the clip starts. If the clip is not from a VOD, this will be null. | - |
Accessors
createdAt
When the clip was created. Returns a JavaScript Date object.
Returns
Date
Source
twitchfy/packages/chatbot/src/structures/Clip.ts:97
videoId
The Id of the video of the clip.
Returns
null
| string
Source
twitchfy/packages/chatbot/src/structures/Clip.ts:104
Methods
fetch()
Fetches the information of the clip from the API.
Returns
Promise
<null
| Clip
<T
>>
The fetched clip. Returns null if the clip was not found (probably because it was not cached yet).
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseClip.ts:47
stream()
Fetches the stream of the broadcaster of the clip.
Returns
Promise
<null
| Stream
<T
>>
The stream of the broadcaster of the clip. If the stream is offline, it will return null.
Source
twitchfy/packages/chatbot/src/structures/Clip.ts:121
toString()
Returns
string
The url of the clip.
Inherited from
Source
twitchfy/packages/chatbot/src/structures/BaseClip.ts:39
video()
Fetches the video of the clip.
Returns
Promise
<null
| Video
<T
>>
The video of the clip. Returns null if the video doesn’t exist.