Subreddit Banned¶
This section details the usage of models related to banned users of a subreddit.
Contents
SubredditBanned¶
A helper class to aid in interacting with a subreddit’s banned users.
BannedUser¶
Banned users can be fetched doing the following:
sub = await reddit.subreddit("aprawtest")
async for item in sub.banned(): # can also be streamed
print(type(item))
>>> apraw.models.BannedUser
- class apraw.models.BannedUser(reddit: Reddit, data: Dict, subreddit: Subreddit)¶
The model representing banned users on a subreddit. The Redditor 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
bannedThe parsed UTC date on which the user was banned.
dateThe UTC timestamp on which the user was banned.
days_leftThe number of days left for the ban.
0if permanent.idThe Redditor’s fullname (t2_ID).
nameThe Redditor’s name.
noteThe ban note added by the subreddit moderators.
rel_idstr- __str__()¶
Returns the Redditor’s name.
- Returns
name – The Redditor’s name.
- Return type
str
- async fetch()¶
Fetch this item’s information from a suitable API endpoint.
- Returns
self – The updated model.
- Return type
- 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
- async redditor() apraw.models.reddit.redditor.Redditor¶
Retrieve the Redditor this Moderator represents.
- Returns
redditor – The Redditor that is represented by this object.
- Return type