mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-13 09:32:12 +00:00
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
1.2 KiB
1.2 KiB
Comments
YouTube.js has full support for comments, including comment actions such as liking, disliking, replying etc.
Usage
Get a Comments instance:
const comments = await yt.getComments(VIDEO_ID);
API
- Comments
- .contents ⇒
CommentThread[] - .createComment ⇒
function - .getContinuation ⇒
function - .page ⇒
getter
- .contents ⇒
contents
A list of comment threads. Note: More about comment threads here.
Type: CommentThread[]
createComment(text)
Creates a top-level comment.
| Param | Type | Description |
|---|---|---|
| text | string |
Comment content |
Returns: Promise<ActionsResponse>
getContinuation()
Retrieves next batch of comment threads.
Returns: Promise.<Comments>
page
Returns original InnerTube response (sanitized).
Returns: ParsedResponse
Example
See index.ts.