reddit.subreddit¶
- class asyncpraw.models.SubredditHelper(reddit, _data)¶
Provide a set of functions to interact with Subreddits.
- Parameters:
reddit (asyncpraw.Reddit)
- await __call__(display_name, *, fetch=False)¶
Return an instance of
Subreddit.- Parameters:
- Return type:
If you need the object fetched right away (e.g., to access an attribute) you can do:
subreddit = await reddit.subreddit("test", fetch=True) print(subreddit.subscribers)
- __init__(reddit, _data)¶
Initialize a
AsyncPRAWBaseinstance.
- await create(name, *, link_type='any', subreddit_type='public', title=None, wikimode='disabled', **other_settings)¶
Create a new
Subreddit.- Parameters:
name (
str) – The name for the new subreddit.link_type (
str) – The types of submissions users can make. One of"any","link", or"self"(default:"any").subreddit_type (
str) – One of"archived","employees_only","gold_only","gold_restricted","private","public", or"restricted"(default:"public").title (
str|None) – The title of the subreddit. WhenNoneor""use the value ofname.wikimode (
str) – One of"anyone","disabled", or"modonly"(default:"disabled").other_settings (Any)
- Return type:
Any keyword parameters not provided, or set explicitly to
None, will take on a default value assigned by the Reddit server.See also
update()for documentation of other available settings.