Subreddit Moderation¶
This section details the usage of models related to subreddit moderation.
SubredditModerator¶
Subreddit moderators are usually retrieved as follows:
sub = await reddit.subreddit("aprawtest")
moderators = []
async for moderator in sub.moderators():
moderators.append(str(moderator))
-
class
apraw.models.SubredditModerator(reddit: Reddit, data: Dict)¶ The model representing subreddit moderators. Redditors can be retrieved via
redditor().Typical Attributes
This table describes attributes that typically belong to objects of this class. Attributes are dynamically provided by the
aPRAWBaseclass and may vary depending on the status of the response and expected objects.Attribute Description addedThe date on which the moderator was added. author_flair_css_classThe moderator’s flair CSS class in the respective subreddit. author_flair_textThe moderator’s flair text in the respective subreddit. idThe Redditor’s fullname (t2_ID). mod_permissionsA list of all the moderator permissions or ["all"].nameThe Redditor’s name.
SubredditModeration¶
Items in the modqueue can be fetched using the modqueue listing:
sub = await reddit.subreddit("aprawtest")
async for item in sub.mod.modqueue(): # can also be streamed
print(type(item))
>>> apraw.models.Comment or apraw.models.Submission
-
class
apraw.models.SubredditModeration(subreddit)¶ A helper class for grabbing listings to Subreddit moderation items.
- reports: ListingGenerator
- Returns an instance of
ListingGeneratormapped to grab reported items. - spam: ListingGenerator
- Returns an instance of
ListingGeneratormapped to grab items marked as spam. - modqueue: ListingGenerator
- Returns an instance of
ListingGeneratormapped to grab items in the modqueue. - unmoderated: ListingGenerator
- Returns an instance of
ListingGeneratormapped to grab unmoderated items. - edited: ListingGenerator
- Returns an instance of
ListingGeneratormapped to grab edited items. - log: ListingGenerator
- Returns an instance of
ListingGeneratormapped to grab mod actions in the subreddit log.
ModAction¶
-
class
apraw.models.ModAction(reddit, data, subreddit=None)¶ A model representing mod actions taken on specific items.
- reddit: Reddit
- The
Redditinstance with which requests are made. - data: Dict
- The data obtained from the /about endpoint.
- kind: str
- The item’s kind / type.
Typical Attributes
This table describes attributes that typically belong to objects of this class. Attributes are dynamically provided by the
aPRAWBaseclass and may vary depending on the status of the response and expected objects.Attribute Description actionThe type of action performed. created_utcThe parsed UTC datetime of when the action was performed. descriptionThe description added to the action if applicable. detailsThe details of the action performed. idThe ID of the mod action prepended with “ModAction”. mod_id36The ID36 of the moderator who performed the action. modThe username of the moderator who performed the action. sr_id36The ID36 of the subreddit the action was performed on. subreddit_name_prefixedThe name of the subreddit the action was performed on prefixed with “r/”. subredditThe name of the subreddit the action was performed on. target_authorThe author of the target item if applicable. target_bodyThe body of the target item if applicable. target_fullnameThe id of the target with its kind prepended. (e.g. “t3_d5229o”) target_permalinkThe target of the comment or submission if applicable. target_titleThe title of the submission if applicable.