reddit.multireddit¶
- class asyncpraw.models.MultiredditHelper(reddit: asyncpraw.Reddit, _data: dict[str, Any] | None)¶
Provide a set of functions to interact with multireddits.
- await __call__(*, name: str, redditor: str | asyncpraw.models.Redditor, fetch: bool = False) asyncpraw.models.Multireddit ¶
Return a lazy instance of
Multireddit
.If you need the object fetched right away (e.g., to access an attribute) you can do:
multireddit = await reddit.multireddit(redditor="redditor", name="multi", fetch=True) async for comment in multireddit.comments(limit=25): print(comment.author)
- Parameters:
name – The name of the multireddit.
redditor – A redditor name or
Redditor
instance who owns the multireddit.name – The name of the multireddit.
fetch – Determines if Async PRAW will fetch the object (default:
False
).
- __init__(reddit: asyncpraw.Reddit, _data: dict[str, Any] | None)¶
Initialize a
AsyncPRAWBase
instance.- Parameters:
reddit – An instance of
Reddit
.
- await create(*, description_md: str | None = None, display_name: str, icon_name: str | None = None, key_color: str | None = None, subreddits: str | asyncpraw.models.Subreddit, visibility: str = 'private', weighting_scheme: str = 'classic') asyncpraw.models.Multireddit ¶
Create a new
Multireddit
.- Parameters:
display_name – The display name for the new multireddit.
subreddits – Subreddits to add to the new multireddit. Can be a list of either
Subreddit
instances or subreddit display names.description_md – Description for the new multireddit, formatted in markdown.
icon_name – Can be one of:
"art and design"
,"ask"
,"books"
,"business"
,"cars"
,"comics"
,"cute animals"
,"diy"
,"entertainment"
,"food and drink"
,"funny"
,"games"
,"grooming"
,"health"
,"life advice"
,"military"
,"models pinup"
,"music"
,"news"
,"philosophy"
,"pictures and gifs"
,"science"
,"shopping"
,"sports"
,"style"
,"tech"
,"travel"
,"unusual stories"
,"video"
, orNone
.key_color – RGB hex color code of the form
"#FFFFFF"
.visibility – Can be one of:
"hidden"
,"private"
, or"public"
(default:"private"
).weighting_scheme – Can be one of:
"classic"
or"fresh"
(default:"classic"
).
- Returns:
The new
Multireddit
object.
- classmethod parse(data: dict[str, Any], reddit: asyncpraw.Reddit) AsyncPRAWBase ¶
Return an instance of
cls
fromdata
.- Parameters:
data – The structured data.
reddit – An instance of
Reddit
.