youtubei.js / Managers / InteractionManager
Class: InteractionManager
Constructors
new InteractionManager()
new InteractionManager(
actions
):InteractionManager
Parameters
• actions: Actions
Returns
Defined in
src/core/managers/InteractionManager.ts:16
Methods
comment()
comment(
video_id
,text
):Promise
<ApiResponse
>
Posts a comment on a given video.
Parameters
• video_id: string
The video ID
• text: string
The comment text
Returns
Promise
<ApiResponse
>
Defined in
src/core/managers/InteractionManager.ts:122
dislike()
dislike(
video_id
):Promise
<ApiResponse
>
Dislikes a given video.
Parameters
• video_id: string
The video ID
Returns
Promise
<ApiResponse
>
Defined in
src/core/managers/InteractionManager.ts:43
like()
like(
video_id
):Promise
<ApiResponse
>
Likes a given video.
Parameters
• video_id: string
The video ID
Returns
Promise
<ApiResponse
>
Defined in
src/core/managers/InteractionManager.ts:24
removeRating()
removeRating(
video_id
):Promise
<ApiResponse
>
Removes a like/dislike.
Parameters
• video_id: string
The video ID
Returns
Promise
<ApiResponse
>
Defined in
src/core/managers/InteractionManager.ts:62
setNotificationPreferences()
setNotificationPreferences(
channel_id
,type
):Promise
<ApiResponse
>
Changes notification preferences for a given channel. Only works with channels you are subscribed to.
Parameters
• channel_id: string
The channel ID.
• type: "PERSONALIZED"
| "ALL"
| "NONE"
The notification type.
Returns
Promise
<ApiResponse
>
Defined in
src/core/managers/InteractionManager.ts:181
subscribe()
subscribe(
channel_id
):Promise
<ApiResponse
>
Subscribes to a given channel.
Parameters
• channel_id: string
The channel ID
Returns
Promise
<ApiResponse
>
Defined in
src/core/managers/InteractionManager.ts:81
translate()
translate(
text
,target_language
,args
):Promise
<object
>
Translates a given text using YouTube's comment translate feature.
Parameters
• text: string
• target_language: string
an ISO language code
• args = {}
optional arguments
• args.comment_id?: string
• args.video_id?: string
Returns
Promise
<object
>
data
data:
IRawResponse
=response.data
status_code
status_code:
number
=response.status_code
success
success:
boolean
=response.success
translated_content
translated_content:
any
=mutation.translatedContent.content
Defined in
src/core/managers/InteractionManager.ts:154
unsubscribe()
unsubscribe(
channel_id
):Promise
<ApiResponse
>
Unsubscribes from a given channel.
Parameters
• channel_id: string
The channel ID
Returns
Promise
<ApiResponse
>