YouTube.js
Guide
Discord
GitHub
Guide
Discord
GitHub

youtubei.js / Managers / InteractionManager

Class: InteractionManager

Constructors

new InteractionManager()

new InteractionManager(actions): InteractionManager

Parameters

• actions: Actions

Returns

InteractionManager

Defined in

src/core/managers/InteractionManager.ts:10

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:119


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:38


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:18


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:58


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:174


subscribe()

subscribe(channel_id): Promise<ApiResponse>

Subscribes to the given channel.

Parameters

• channel_id: string

The channel ID

Returns

Promise<ApiResponse>

Defined in

src/core/managers/InteractionManager.ts:78


translate()

translate(text, target_language, args): Promise<object>

Translates a given text using YouTube's comment translation feature.

Parameters

• text: string

The text to translate

• 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:151


unsubscribe()

unsubscribe(channel_id): Promise<ApiResponse>

Unsubscribes from the given channel.

Parameters

• channel_id: string

The channel ID

Returns

Promise<ApiResponse>

Defined in

src/core/managers/InteractionManager.ts:98

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