SubredditFilters

class asyncpraw.models.reddit.subreddit.SubredditFilters(subreddit)

Provide functions to interact with the special Subreddit’s filters.

Members of this class should be utilized via Subreddit.filters(). For example, to add a filter, run:

subreddit = await reddit.subreddit("all")
await subreddit.filters.add("test")
Parameters:

subreddit (asyncpraw.models.Subreddit)

__init__(subreddit)

Initialize a SubredditFilters instance.

Parameters:

subreddit (Subreddit) – The special subreddit whose filters to work with.

Return type:

None

As of this writing filters can only be used with the special subreddits all and mod.

await add(subreddit)

Add subreddit to the list of filtered subreddits.

Parameters:

subreddit (Subreddit | str) – The subreddit to add to the filter list.

Return type:

None

Items from subreddits added to the filtered list will no longer be included when obtaining listings for r/all.

Alternatively, you can filter a subreddit temporarily from a special listing in a manner like so:

await reddit.subreddit("all-redditdev-learnpython")
Raises:

asyncprawcore.NotFound when calling on a non-special subreddit.

Parameters:

subreddit (Subreddit | str)

Return type:

None

await remove(subreddit)

Remove subreddit from the list of filtered subreddits.

Parameters:

subreddit (Subreddit | str) – The subreddit to remove from the filter list.

Raises:

asyncprawcore.NotFound when calling on a non-special subreddit.

Return type:

None