ContributorRelationship
- class asyncpraw.models.reddit.subreddit.ContributorRelationship(subreddit: asyncpraw.models.Subreddit, relationship: str)
Provides methods to interact with a
Subreddit’s contributors.Contributors are also known as approved submitters.
Contributors of a subreddit can be iterated through like so:
subreddit = await reddit.subreddit("test") async for contributor in subreddit.contributor(): print(contributor)
- __call__(redditor: Optional[Union[asyncpraw.models.Redditor, str]] = None, **generator_kwargs) AsyncIterator[asyncpraw.models.Redditor]
Return a
ListingGeneratorforRedditors in the relationship.- Parameters
redditor – When provided, yield at most a single
Redditorinstance. This is useful to confirm if a relationship exists, or to fetch the metadata associated with a particular relationship (default:None).
Additional keyword arguments are passed in the initialization of
ListingGenerator.
- __init__(subreddit: asyncpraw.models.Subreddit, relationship: str)
Initialize a
SubredditRelationshipinstance.- Parameters
subreddit – The
Subredditfor the relationship.relationship – The name of the relationship.
- await add(redditor: Union[str, asyncpraw.models.Redditor], **other_settings: Any)
Add
redditorto this relationship.- Parameters
redditor – A redditor name or
Redditorinstance.
- await leave()
Abdicate the contributor position.
- await remove(redditor: Union[str, asyncpraw.models.Redditor])
Remove
redditorfrom this relationship.- Parameters
redditor – A redditor name or
Redditorinstance.