chore: v5.0.0 release

This commit is contained in:
LuanRT
2023-04-29 05:15:47 +00:00
parent b19d687eed
commit 48dc99e28b
445 changed files with 4076 additions and 3578 deletions

View File

@@ -1,15 +1,17 @@
import Parser from '../../index.ts';
import Comment from './Comment.ts';
import ContinuationItem from '../ContinuationItem.ts';
import CommentReplies from './CommentReplies.ts';
import Button from '../Button.ts';
import type Actions from '../../../core/Actions.ts';
import type { ObservedArray } from '../../helpers.ts';
import ContinuationItem from '../ContinuationItem.ts';
import Comment from './Comment.ts';
import CommentReplies from './CommentReplies.ts';
import { InnertubeError } from '../../../utils/Utils.ts';
import { observe, YTNode } from '../../helpers.ts';
import type Actions from '../../../core/Actions.ts';
import type { ObservedArray } from '../../helpers.ts';
import type { RawNode } from '../../index.ts';
class CommentThread extends YTNode {
export default class CommentThread extends YTNode {
static type = 'CommentThread';
#actions?: Actions;
@@ -23,7 +25,7 @@ class CommentThread extends YTNode {
constructor(data: RawNode) {
super();
this.comment = Parser.parseItem<Comment>(data.comment, Comment);
this.comment = Parser.parseItem(data.comment, Comment);
this.comment_replies_data = Parser.parseItem(data.replies, CommentReplies);
this.is_moderated_elq_comment = data.isModeratedElqComment;
this.has_replies = !!this.comment_replies_data;
@@ -37,7 +39,7 @@ class CommentThread extends YTNode {
throw new InnertubeError('Actions instance not set for this thread.');
if (!this.comment_replies_data)
throw new InnertubeError('This comment has no replies.', { comment_id: this.comment?.comment_id });
throw new InnertubeError('This comment has no replies.', this);
const continuation = this.comment_replies_data.contents?.firstOfType(ContinuationItem);
@@ -87,7 +89,7 @@ class CommentThread extends YTNode {
return comment;
}));
this.#continuation = response.on_response_received_endpoints_memo.getType(ContinuationItem)?.[0];
this.#continuation = response.on_response_received_endpoints_memo.getType(ContinuationItem).first();
return this;
}
@@ -101,6 +103,4 @@ class CommentThread extends YTNode {
setActions(actions: Actions) {
this.#actions = actions;
}
}
export default CommentThread;
}