YouTube.js
Guide
Discord
GitHub
Guide
Discord
GitHub

youtubei.js / YT / Comments

Class: Comments

Constructors

new Comments()

new Comments(actions, data, already_parsed): Comments

Parameters

• actions: Actions

• data: any

• already_parsed: boolean = false

Returns

Comments

Defined in

src/parser/youtube/Comments.ts:22

Properties

contents

contents: ObservedArray<CommentThread>

Defined in

src/parser/youtube/Comments.ts:20


header?

optional header: CommentsHeader

Defined in

src/parser/youtube/Comments.ts:19

Accessors

has_continuation

get has_continuation(): boolean

Returns

boolean

Defined in

src/parser/youtube/Comments.ts:116


page

get page(): INextResponse

Returns

INextResponse

Defined in

src/parser/youtube/Comments.ts:120

Methods

applySort()

applySort(sort): Promise<Comments>

Applies given sort option to the comments.

Parameters

• sort: "TOP_COMMENTS" | "NEWEST_FIRST"

Sort type.

Returns

Promise<Comments>

Defined in

src/parser/youtube/Comments.ts:52


createComment()

createComment(text): Promise<ApiResponse>

Creates a top-level comment.

Parameters

• text: string

Comment text.

Returns

Promise<ApiResponse>

Defined in

src/parser/youtube/Comments.ts:79


getContinuation()

getContinuation(): Promise<Comments>

Retrieves next batch of comments.

Returns

Promise<Comments>

Defined in

src/parser/youtube/Comments.ts:97

Edit this page
Last Updated:: 3/25/25, 8:08 PM
Contributors: EdamAme-x