CollectionModeration
- class praw.models.reddit.collections.CollectionModeration(reddit: praw.Reddit, collection_id: str)
Class to support moderation actions on a
Collection
.Obtain an instance via:
reddit.subreddit("test").collections("some_uuid").mod
- __init__(reddit: praw.Reddit, collection_id: str)
Initialize a
CollectionModeration
instance.- Parameters
collection_id – The ID of a
Collection
.
- add_post(submission: praw.models.Submission)
Add a post to the collection.
- Parameters
submission – The post to add, a
Submission
, its permalink as astr
, its fullname as astr
, or its ID as astr
.
Example usage:
collection = reddit.subreddit("test").collections("some_uuid") collection.mod.add_post("bgibu9")
See also
- delete()
Delete this collection.
Example usage:
reddit.subreddit("test").collections("some_uuid").mod.delete()
See also
- classmethod parse(data: Dict[str, Any], reddit: praw.Reddit) Any
Return an instance of
cls
fromdata
.- Parameters
data – The structured data.
reddit – An instance of
Reddit
.
- remove_post(submission: praw.models.Submission)
Remove a post from the collection.
- Parameters
submission – The post to remove, a
Submission
, its permalink as astr
, its fullname as astr
, or its ID as astr
.
Example usage:
collection = reddit.subreddit("test").collections("some_uuid") collection.mod.remove_post("bgibu9")
See also
- reorder(links: List[Union[str, praw.models.Submission]])
Reorder posts in the collection.
- Parameters
links – A list of
Submission
s or astr
that is either a fullname or an ID.
Example usage:
collection = reddit.subreddit("test").collections("some_uuid") current_order = collection.link_ids new_order = reversed(current_order) collection.mod.reorder(new_order)
- update_description(description: str)
Update the collection’s description.
- Parameters
description – The new description.
Example usage:
collection = reddit.subreddit("test").collections("some_uuid") collection.mod.update_description("Please enjoy these links!")
See also
- update_display_layout(display_layout: str)
Update the collection’s display layout.
- Parameters
display_layout – Either
"TIMELINE"
for events or discussions or"GALLERY"
for images or memes. PassingNone
will clear the set layout andcollection.display_layout
will beNone
, however, the collection will appear on Reddit as ifdisplay_layout
is set to"TIMELINE"
.
Example usage:
collection = reddit.subreddit("test").collections("some_uuid") collection.mod.update_display_layout("GALLERY")