SubredditRemovalReasons

class praw.models.reddit.removal_reasons.SubredditRemovalReasons(subreddit: Subreddit)

Provide a set of functions to a Subreddit’s removal reasons.

__getitem__(reason_id: str) → praw.models.reddit.removal_reasons.RemovalReason

Lazily return the Removal Reason for the subreddit with id reason_id.

Parameters:reason_id – The id of the removal reason

This method is to be used to fetch a specific removal reason, like so:

reason_id = '141vv5c16py7d'
reason = reddit.subreddit('NAME').mod.removal_reasons[reason_id]
print(reason)
__init__(subreddit: Subreddit)

Create a SubredditRemovalReasons instance.

Parameters:subreddit – The subreddit whose removal reasons to work with.
__iter__() → Generator[[praw.models.reddit.removal_reasons.RemovalReason, None], None]

Return a list of Removal Reasons for the subreddit.

This method is used to discover all removal reasons for a subreddit:

for removal_reason in reddit.subreddit('NAME').mod.removal_reasons:
    print(removal_reason)
add(message: str, title: str) → praw.models.reddit.removal_reasons.RemovalReason

Add a removal reason to this subreddit.

Parameters:
  • message – The message associated with the removal reason.
  • title – The title of the removal reason
Returns:

The RemovalReason added.

The message will be prepended with Hi u/username, automatically.

To add 'Test' to the subreddit 'NAME' try:

reddit.subreddit('NAME').removal_reasons.mod.add(
    message='Foobar',
    title='Test')