SubmissionModeration

class praw.models.reddit.submission.SubmissionModeration(submission)

Provide a set of functions pertaining to Submission moderation.

__init__(submission)

Create a SubmissionModeration instance.

Parameters:submission – The submission to moderate.
approve()

Approve a Comment or Submission.

Approving a comment or submission reverts a removal, resets the report counter, adds a green check mark indicator (only visible to other moderators) on the website view, and sets the approved_by attribute to the authenticated user.

contest_mode(state=True)

Set contest mode for the comments of this submission.

Parameters:state – (boolean) True enables contest mode, False, disables (default: True).
Contest mode have the following effects:
  • The comment thread will default to being sorted randomly.
  • Replies to top-level comments will be hidden behind “[show replies]” buttons.
  • Scores will be hidden from non-moderators.
  • Scores accessed through the API (mobile apps, bots) will be obscured to “1” for non-moderators.
distinguish(how='yes', sticky=False)

Distinguish a Comment or Submission.

Parameters:
  • how – One of ‘yes’, ‘no’, ‘admin’, ‘special’. ‘yes’ adds a moderator level distinguish. ‘no’ removes any distinction. ‘admin’ and ‘special’ require special user privileges to use.
  • sticky – Comment is stickied if True, placing it at the top of the comment page regardless of score. If thing is not a top-level comment, this parameter is silently ignored.
flair(text='', css_class='')

Set flair for the submission.

Parameters:
  • text – The flair text to associate with the Submission (default: ‘’).
  • css_class – The css class to associate with the flair html (default: ‘’).

This method can only be used by an authenticated user who is a moderator of the Submission’s Subreddit.

Example:

submission.mod.flair(text='PRAW', css_class='bot')
ignore_reports()

Ignore future reports on a Comment or Submission.

Calling this method will prevent future reports on this Comment or Submission from both triggering notifications and appearing in the various moderation listings. The report count will still increment on the Comment or Submission.

lock()

Lock the submission.

nsfw()

Mark as not safe for work.

This method can be used both by the submission author and moderators of the subreddit that the submission belongs to.

Example:

submission = reddit.subreddit('test').submit('nsfw test',
                                             selftext='nsfw')
submission.mod.nsfw()
remove(spam=False)

Remove a Comment or Submission.

Parameters:spam – When True, use the removal to help train the Subreddit’s spam filter (default: False).
sfw()

Mark as safe for work.

This method can be used both by the submission author and moderators of the subreddit that the submission belongs to.

Example:

submission = reddit.submission(id='5or86n')
submission.mod.sfw()
spoiler()

Indicate that the submission contains spoilers.

This method can be used both by the submission author and moderators of the subreddit that the submission belongs to.

Example:

submission = reddit.submission(id='5or86n')
submission.mod.spoiler()
sticky(state=True, bottom=True)

Set the submission’s sticky state in its subreddit.

Parameters:
  • state – (boolean) True sets the sticky for the submission, false unsets (default: True).
  • bottom – (boolean) When true, set the submission as the bottom sticky. If no top sticky exists, this submission will become the top sticky regardless (default: True).

This submission will replace an existing stickied submission if one exists.

Example:

submission.mod.sticky()
suggested_sort(sort='blank')

Set the suggested sort for the comments of the submission.

Parameters:sort – Can be one of: confidence, top, new, controversial, old, random, qa, blank (default: blank).
undistinguish()

Remove mod, admin, or special distinguishing on object.

unignore_reports()

Resume receiving future reports on a Comment or Submission.

Future reports on this Comment or Submission will cause notifications, and appear in the various moderation listings.

unlock()

Unlock the submission.

unspoiler()

Indicate that the submission does not contain spoilers.

This method can be used both by the submission author and moderators of the subreddit that the submission belongs to.

Example:

submission = reddit.subreddit('test').submit('not spoiler',
                                             selftext='spoiler')
submission.mod.unspoiler()