Submission Moderation¶
- class apraw.models.SubmissionModeration(reddit: Reddit, submission: apraw.models.reddit.submission.Submission)¶
A helper class to moderate submissions.
- async approve()¶
Approve the Reddit item.
- Returns
resp – The API response JSON.
- Return type
Dict
- async distinguish(how: apraw.models.enums.distinguishment_option.DistinguishmentOption = 'yes', sticky: bool = False)¶
Distinguish the Reddit item.
- Parameters
how (DistinguishmentOption) – The type of distinguishment to be added to the item.
sticky (bool, optional) – Whether the item should be stickied.
- Returns
resp – The API response JSON.
- Return type
Dict
- async flair(text: str, css_class: str = '')¶
Flair a submission.
- Parameters
text (str) – The flair text string no longer than 64 characters.
css_class (str) – A valid subreddit image name.
- Returns
resp – The API response JSON.
- Return type
Dict
- property fullname: str¶
Retrieve the fullname of the item this helper performs requests for.
- Returns
fullname – The ID prepended with the kind of the item this helper belongs to.
- Return type
str
- async ignore_reports()¶
Ignore reports on the Reddit item.
- Returns
resp – The API response JSON.
- Return type
Dict
- async lock()¶
Lock the item from further replies.
- Returns
resp – The API response JSON.
- Return type
Dict
- async mark_nsfw()¶
Mark the item as NSFW.
- Returns
resp – The API response JSON.
- Return type
Dict
- async mark_spoiler()¶
Mark the item as a spoiler.
- Returns
resp – The API response JSON.
- Return type
Dict
- async remove(spam: bool = False, mod_note: Optional[str] = '', reason: Optional[Union[str, apraw.models.subreddit.removal_reasons.SubredditRemovalReason]] = None)¶
Remove the Reddit item.
- Parameters
spam (bool) – When
True
, use the removal to help train the Subreddit’s spam filter (default:False
).mod_note (Optional[str]) – A message for the other moderators.
reason (str or SubredditRemovalReason) – The removal reason ID or a subreddit removal reason to add.
- Returns
resp – The API response JSON or a tuple of dictionaries if a removal reason / mod note was added as well.
- Return type
Dict or Tuple
- async sticky(position: int = 1, to_profile: bool = False)¶
Sticky a submission in its subreddit.
- Parameters
position (int) – The “slot” the submission will be stickied to.
to_profile (bool) – Whether the submission will be stickied to the user profile.
- Returns
resp – The API response JSON.
- Return type
Dict
- async undistinguish()¶
Undistinguish the Reddit item.
- Returns
resp – The API response JSON.
- Return type
Dict
- async unignore_reports()¶
Unignore previously ignored reports on the Reddit item.
- Returns
resp – The API response JSON.
- Return type
Dict
- async unlock()¶
Unlock the item from further replies.
- Returns
resp – The API response JSON.
- Return type
Dict
- async unmark_nsfw()¶
Unmark the item as NSFW.
- Returns
resp – The API response JSON.
- Return type
Dict
- async unmark_spoiler()¶
Unmark the item as a spoiler.
- Returns
resp – The API response JSON.
- Return type
Dict
- async unsticky(to_profile: bool = False)¶
Unsticky a submission from its subreddit.
- Parameters
to_profile (bool) – Whether the submission will be unstickied from the user profile.
- Returns
resp – The API response JSON.
- Return type
Dict