Skip to content

Clip

Represents a Twitch clip.

Extends

Type parameters

Type parameter
T extends EventSubConnection

Constructors

new Clip()

1
new Clip<T>(chatbot: ChatBot<T>, data: GetClip): Clip<T>

Creates a new instance of the clip.

Parameters

ParameterTypeDescription
chatbotChatBot<T>The current instance of the chatbot.
dataGetClipThe data of the clip returned from the API.

Returns

Clip<T>

Overrides

BaseClip.constructor

Source

twitchfy/packages/chatbot/src/structures/Clip.ts:78

Properties

PropertyModifierTypeDescriptionInherited from
broadcasterreadonlyBaseUserWithoutUsername<T>The user who broadcasted the clip. The user will not have an username because Twitch limitations.-
chatbotreadonlyChatBot<T>The current instance of the chatbot.BaseClip.chatbot
creatorreadonlyBaseUserWithoutUsername<T>The user who created the clip. The user will not have an username because Twitch limitations.-
durationreadonlynumberThe duration of the clip in seconds.-
embedURLreadonlystringThe URL to embed the clip in a frame.-
gameIdreadonlystringThe Id of the game which was played in the clip.-
idreadonlystringThe id of the clip.BaseClip.id
isFeaturedreadonlybooleanWhether the clip is featured.-
languagereadonlystringThe language of the clip.-
thumbnailURLreadonlystringThe URL to the thumbnail of the clip.-
titlereadonlystringThe title of the clip.-
urlreadonlystringThe url of the clip.BaseClip.url
viewCountreadonlynumberThe view count of the clip.-
vodOffsetreadonlynull | numberThe offset in the VOD where the clip starts. If the clip is not from a VOD, this will be null.-

Accessors

createdAt

1
get createdAt(): Date

When the clip was created. Returns a JavaScript Date object.

Returns

Date

Source

twitchfy/packages/chatbot/src/structures/Clip.ts:97


videoId

1
get videoId(): null | string

The Id of the video of the clip.

Returns

null | string

Source

twitchfy/packages/chatbot/src/structures/Clip.ts:104

Methods

fetch()

1
fetch(): Promise<null | Clip<T>>

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

BaseClip.fetch

Source

twitchfy/packages/chatbot/src/structures/BaseClip.ts:47


stream()

1
stream(): Promise<null | Stream<T>>

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()

1
toString(): string

Returns

string

The url of the clip.

Inherited from

BaseClip.toString

Source

twitchfy/packages/chatbot/src/structures/BaseClip.ts:39


video()

1
video(): Promise<null | Video<T>>

Fetches the video of the clip.

Returns

Promise<null | Video<T>>

The video of the clip. Returns null if the video doesn’t exist.

Source

twitchfy/packages/chatbot/src/structures/Clip.ts:112