Skip to main content

Class: VideoComments

Continuable of videos inside a Video

Example

const video = await youtube.getVideo(VIDEO_ID);
await video.comments.next();
console.log(video.comments) // first 20 comments

let newComments = await video.comments.next();
console.log(newComments) // 20 loaded comments
console.log(video.comments) // first 40 comments

await video.comments.next(0); // load the rest of the comments in the video

Param

How many times to load the next comments. Set 0 to load all comments (might take a while on a video with many comments!)

Hierarchy

Properties

client

client: Client

An instance of Client

Inherited from

Continuable.client


continuation

Optional continuation: null | string

Inherited from

Continuable.continuation


items

items: Comment[] = []

Inherited from

Continuable.items


video

video: Video

The playlist this videos belongs to

Methods

next

next(count?): Promise<Comment[]>

Fetch next items using continuation token

Parameters

NameTypeDefault value
countnumber1

Returns

Promise<Comment[]>

Inherited from

Continuable.next