youtubei.js / YTNodes / Comment
Class: Comment
Extends
Constructors
new Comment()
new Comment(
data
):Comment
Parameters
• data: RawNode
Returns
Overrides
Defined in
src/parser/classes/comments/Comment.ts:47
Properties
action_buttons
action_buttons:
null
|CommentActionButtons
Defined in
src/parser/classes/comments/Comment.ts:36
action_menu
action_menu:
null
|Menu
Defined in
src/parser/classes/comments/Comment.ts:35
author
author:
Author
Defined in
src/parser/classes/comments/Comment.ts:34
author_badge
author_badge:
null
|AuthorCommentBadge
Defined in
src/parser/classes/comments/Comment.ts:33
author_is_channel_owner
author_is_channel_owner:
boolean
Defined in
src/parser/classes/comments/Comment.ts:29
comment_id
comment_id:
string
Defined in
src/parser/classes/comments/Comment.ts:37
content
content:
Text
Defined in
src/parser/classes/comments/Comment.ts:27
current_user_reply_thumbnail
current_user_reply_thumbnail:
Thumbnail
[]
Defined in
src/parser/classes/comments/Comment.ts:30
is_disliked
is_disliked:
boolean
Defined in
src/parser/classes/comments/Comment.ts:42
is_hearted
is_hearted:
boolean
Defined in
src/parser/classes/comments/Comment.ts:43
is_liked
is_liked:
boolean
Defined in
src/parser/classes/comments/Comment.ts:41
is_member
is_member:
boolean
Defined in
src/parser/classes/comments/Comment.ts:45
is_pinned
is_pinned:
boolean
Defined in
src/parser/classes/comments/Comment.ts:44
paid_comment_chip
paid_comment_chip:
null
|PdgCommentChip
Defined in
src/parser/classes/comments/Comment.ts:32
published
published:
Text
Defined in
src/parser/classes/comments/Comment.ts:28
reply_count
reply_count:
number
Defined in
src/parser/classes/comments/Comment.ts:40
sponsor_comment_badge
sponsor_comment_badge:
null
|SponsorCommentBadge
Defined in
src/parser/classes/comments/Comment.ts:31
type
readonly
type:string
Inherited from
Defined in
vote_count
vote_count:
string
Defined in
src/parser/classes/comments/Comment.ts:39
vote_status
vote_status:
string
Defined in
src/parser/classes/comments/Comment.ts:38
type
static
type:string
='Comment'
Overrides
Defined in
src/parser/classes/comments/Comment.ts:23
Methods
as()
as<
T
,K
>(...types
):InstanceType
<K
[number
]>
Cast to one of the given types.
Type Parameters
• T extends YTNode
• K extends YTNodeConstructor
<T
>[]
Parameters
• ...types: K
Returns
InstanceType
<K
[number
]>
Inherited from
Defined in
dislike()
dislike():
Promise
<ApiResponse
>
Dislikes the comment.
Returns
Promise
<ApiResponse
>
Defined in
src/parser/classes/comments/Comment.ts:101
hasKey()
hasKey<
T
,R
>(key
):this is Comment & { [k in string]: R }
Check for a key without asserting the type.
Type Parameters
• T extends string
• R = any
Parameters
• key: T
The key to check
Returns
this is Comment & { [k in string]: R }
Whether the node has the key
Inherited from
Defined in
is()
is<
T
,K
>(...types
):this is InstanceType<K[number]>
Check if the node is of the given type.
Type Parameters
• T extends YTNode
• K extends YTNodeConstructor
<T
>[]
Parameters
• ...types: K
The type to check
Returns
this is InstanceType<K[number]>
whether the node is of the given type
Inherited from
Defined in
key()
key<
T
,R
>(key
):Maybe
Assert that the node has the given key and return it.
Type Parameters
• T extends string
• R = any
Parameters
• key: T
The key to check
Returns
The value of the key wrapped in a Maybe
Throws
If the node does not have the key
Inherited from
Defined in
like()
like():
Promise
<ApiResponse
>
Likes the comment.
Returns
Promise
<ApiResponse
>
Defined in
src/parser/classes/comments/Comment.ts:82
reply()
reply(
text
):Promise
<ApiResponse
>
Creates a reply to the comment.
Parameters
• text: string
Returns
Promise
<ApiResponse
>
Defined in
src/parser/classes/comments/Comment.ts:121
setActions()
setActions(
actions
):void
Parameters
• actions: undefined
| Actions
Returns
void
Defined in
src/parser/classes/comments/Comment.ts:176
translate()
translate(
target_language
):Promise
<ApiResponse
&object
>
Translates the comment to a given language.
Parameters
• target_language: string
Ex; en, ja
Returns
Promise
<ApiResponse
& object
>