SubredditCollectionsModeration
- class asyncpraw.models.reddit.collections.SubredditCollectionsModeration(reddit: asyncpraw.Reddit, subreddit: asyncpraw.models.Subreddit, _data: Optional[Dict[str, Any]] = None)
Class to represent moderator actions on a Subreddit’s Collections.
Obtain an instance via:
subreddit = await reddit.subreddit("SUBREDDIT") subreddit.collections.mod
- __init__(reddit: asyncpraw.Reddit, subreddit: asyncpraw.models.Subreddit, _data: Optional[Dict[str, Any]] = None)
Initialize the SubredditCollectionsModeration instance.
- await create(title: str, description: str)
Create a new
Collection
.The authenticated account must have appropriate moderator permissions in the subreddit this collection belongs to.
- Parameters
title – The title of the collection, up to 300 characters.
description – The description, up to 500 characters.
- Returns
The newly created
Collection
.
Example usage:
sub = await reddit.subreddit("SUBREDDIT") new_collection = await sub.collections.mod.create("Title", "desc") await new_collection.mod.add_post("bgibu9")
See also
- classmethod parse(data: Dict[str, Any], reddit: asyncpraw.Reddit) Any
Return an instance of
cls
fromdata
.- Parameters
data – The structured data.
reddit – An instance of
Reddit
.