MoreComments

This section describes the usage and members of the MoreComments model.

MoreComments stores a list of IDs pointing to Comment and further MoreComments. These can be retrieved using the comments() method or by iterating over the instance asynchronously:

comments = await more_comments.comments()
# or using asynchronous list comprehension:
comments = [c async for c in more_comments]
class apraw.models.MoreComments(reddit: Reddit, data: Dict[str, Any], link_id: str)

Represents the model for more comments in a thread.

Typical Attributes

This table describes attributes that typically belong to objects of this class. Attributes are dynamically provided by the aPRAWBase class and may vary depending on the status of the response and expected objects.

Attribute

Description

count

The number of comment or more children items in this thread.

name

The fullname that references this more comments model.

id

The ID of this more comments model.

parent_id

The ID of this more comments’ parent submission or comment.

depth

The depth this more comments model goes into.

children

A list of comment and more comment IDs available in this thread.

async comments() List[Union[apraw.models.reddit.comment.Comment, apraw.models.reddit.more_comments.MoreComments]]

Retrieve a list of all the Comment and further MoreComments in this thread.

Returns

comments – A list of all the Comment and further MoreComments in this thread.

Return type

List[Union[Comment, MoreComments]]

async fetch()

Fetch all the comments in this MoreComments thread.

property fullname

Get the ID prepended with its kind.

Returns

fullname – The item’s ID prepended with its kind such as t1_.

Return type

str

Retrieve the submission this item belongs to as a Submission.

Returns

submission – The item’s parent submission.

Return type

Submission

async parent() Union[apraw.models.reddit.submission.Submission, apraw.models.reddit.comment.Comment]

Retrieve the parent submission or comment of this MoreComments object.

Returns

parent – The parent submission or comment of this MoreComments object.

Return type

Submission or Comment

async submission() Submission

Retrieve the submission this item belongs to as a Submission.

Returns

submission – The item’s parent submission.

Return type

Submission