LiveThread¶
-
class
praw.models.LiveThread(reddit: Reddit, id: Optional[str] = None, _data: Optional[Dict[str, Any]] = None)¶ An individual LiveThread object.
Typical Attributes
This table describes attributes that typically belong to objects of this class. Since attributes are dynamically provided (see Determine Available Attributes of an Object), there is not a guarantee that these attributes will always be present, nor is this list necessarily comprehensive.
Attribute Description created_utcThe creation time of the live thread, in Unix Time. descriptionDescription of the live thread, as Markdown. description_htmlDescription of the live thread, as HTML. idThe ID of the live thread. nsfwA boolrepresenting whether or not the live thread is marked as NSFW.-
__getitem__(update_id: str) → _LiveUpdate¶ Return a lazy
LiveUpdateinstance.Parameters: update_id – A live update ID, e.g., '7827987a-c998-11e4-a0b9-22000b6a88d2'.Usage:
thread = reddit.live('ukaeu1ik4sw5') update = thread['7827987a-c998-11e4-a0b9-22000b6a88d2'] update.thread # LiveThread(id='ukaeu1ik4sw5') update.id # '7827987a-c998-11e4-a0b9-22000b6a88d2' update.author # 'umbrae'
-
__init__(reddit: Reddit, id: Optional[str] = None, _data: Optional[Dict[str, Any]] = None)¶ Initialize a lazy
LiveThreadinstance.Parameters: - reddit – An instance of
Reddit. - id – A live thread ID, e.g.,
'ukaeu1ik4sw5'
- reddit – An instance of
-
contrib¶ Provide an instance of
LiveThreadContribution.Usage:
thread = reddit.live('ukaeu1ik4sw5') thread.contrib.add('### update')
-
contributor¶ Provide an instance of
LiveContributorRelationship.You can call the instance to get a list of contributors which is represented as
RedditorListinstance consists ofRedditorinstances. Those Redditor instances havepermissionsattributes as contributors:thread = reddit.live('ukaeu1ik4sw5') for contributor in thread.contributor(): # prints `(Redditor(name='Acidtwist'), [u'all'])` print(contributor, contributor.permissions)
-
discussions(**generator_kwargs) → Generator[[Submission, None], None]¶ Get submissions linking to the thread.
Parameters: generator_kwargs – keyword arguments passed to ListingGeneratorconstructor.Returns: A ListingGeneratorobject which yieldsSubmissionobject.Additional keyword arguments are passed in the initialization of
ListingGenerator.Usage:
thread = reddit.live('ukaeu1ik4sw5') for submission in thread.discussions(limit=None): print(submission.title)
-
classmethod
parse(data: Dict[str, Any], reddit: Reddit) → Any¶ Return an instance of
clsfromdata.Parameters: - data – The structured data.
- reddit – An instance of
Reddit.
-
report(type: str)¶ Report the thread violating the Reddit rules.
Parameters: type – One of 'spam','vote-manipulation','personal-information','sexualizing-minors','site-breaking'.Usage:
thread = reddit.live('xyu8kmjvfrww') thread.report('spam')
-
updates(**generator_kwargs) → Generator[[_LiveUpdate, None], None]¶ Return a
ListingGeneratoryieldsLiveUpdates.Parameters: generator_kwargs – keyword arguments passed to ListingGeneratorconstructor.Returns: A ListingGeneratorobject which yieldsLiveUpdateobject.Additional keyword arguments are passed in the initialization of
ListingGenerator.Usage:
thread = reddit.live('ukaeu1ik4sw5') after = 'LiveUpdate_fefb3dae-7534-11e6-b259-0ef8c7233633' for submission in thread.updates(limit=5, params={'after': after}): print(submission.body)
-
Note
This list of attributes is not complete. PRAW dynamically provides the attributes that Reddit returns via the API. Because those attributes are subject to change on Reddit’s end, PRAW makes no effort to document them, other than to instruct you on how to discover what is available. See Determine Available Attributes of an Object for detailed information.