import { CommentParts } from '../types/Parts'; import { PageOptions, PaginatedResponse, YouTube } from '..'; import { youtube_v3 } from '@googleapis/youtube'; export declare class Comment { /** * The name of the endpoint used for this entity. */ static endpoint: string; /** * The parts to request for this entity. */ static part: string; /** * The fields to request for this entity. */ static fields: string; /** * The YouTube object used to create the comment. */ youtube: YouTube; /** * The raw data from the YouTube API of the comment. */ data: any; /** * The comment's unique YouTube ID. */ id: string; /** * Whether or not this a full comment object. */ full: boolean; /** * The comment's author. */ author: { /** * The author's YouTube username. May not be unique. */ username: string; /** * The author's avatar URL. */ avatar: string; /** * The author's channel ID. */ channelId: string; /** * The author's channel URL. */ channelUrl: string; }; /** * The comment's content. */ text: { /** * What YouTube displays to the user viewing the comment. */ displayed: string; /** * The comment's plain text. */ original: string; }; /** * Whether or not you can like/dislike the comment. */ rateable: boolean; /** * Either YouTube thinks it's popular, or it has at least 100 likes. */ popular: boolean; /** * The number of likes the comment has received. */ likes: number; /** * The url of the comment. */ url?: string; /** * The date the comment was published. */ datePublished: Date; /** * Either the date the comment was last edited, or the date it was * posted. */ dateEdited: Date; /** * The ID of the channel that uploaded the video this comment is on, if any. * **Currently broken**, [see here](https://issuetracker.google.com/issues/288239809). */ channelId?: string; /** * The ID of the video that this comment is on, if any. */ videoId?: string; /** * If this comment is a reply, then this is the ID of the comment it is replying to. */ parentCommentId?: string; /** * Replies directed to the comment. If the comment was fetched from a video, * then this will be partially filled. You'll need to use [Comment.fetchReplies](./Comment#fetchreplies) * to get all of the replies, though. */ replies: PaginatedResponse; /** * If this comment was fetched from a video, then this is the number of replies on it. */ replyCount?: number; constructor(youtube: YouTube, data: youtube_v3.Schema$Comment, full?: boolean); /** * @ignore */ private _init; /** * Fetches replies to the comment from the API. * @param pageOptions The number of pages and maximum number of items per page. * Fetches the maximum number of items allowed by the API per page by default. * Set pages to a value {'<='}0 to fetch all. * @param parts The parts of the object to fetch (saves quota if you aren't using certain properties!) */ fetchReplies(pageOptions?: PageOptions, parts?: CommentParts): Promise>; /** * Edits the comment. * Must be using an access token with correct scopes. * @param text The new text of the comment. */ edit(text: string): Promise; /** * Replies to the comment. * Must be using an access token with correct scopes. * @param text The text of the reply. */ reply(text: string): Promise; /** * Marks the comment as spam. * Must be using an access token with correct scopes. */ markAsSpam(): Promise; /** * Sets the comment's moderation status. * Must be using an access token with correct scopes. * @param status The status to set the comment to. * @param banAuthor Whether or not to ban the author of the comment from commenting again. * Defaults to false. */ setModerationStatus(status?: 'heldForReview' | 'published' | 'rejected', banAuthor?: boolean): Promise; /** * Deletes the comment. * Must be using an access token with correct scopes. */ delete(): Promise; }