Subreddit Banned

This section details the usage of models related to banned users of a subreddit.

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 aPRAWBase class and may vary depending on the status of the response and expected objects.

Attribute

Description

banned

The parsed UTC date on which the user was banned.

date

The UTC timestamp on which the user was banned.

days_left

The number of days left for the ban. 0 if permanent.

id

The Redditor’s fullname (t2_ID).

name

The Redditor’s name.

note

The ban note added by the subreddit moderators.

rel_id

str

__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

aPRAWBase

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

Redditor