CollectionModeration

class praw.models.reddit.collections.CollectionModeration(reddit: Reddit, collection_id: str)

Class to support moderation actions on a Collection.

Obtain an instance via:

reddit.subreddit("SUBREDDIT").collections("some_uuid").mod
__init__(reddit: Reddit, collection_id: str)

Initialize an instance of CollectionModeration.

Parameters:collection_id – The ID of a collection.
add_post(submission: praw.models.reddit.submission.Submission)

Add a post to the collection.

Parameters:submission – The post to add, a Submission, its permalink as a str, its fullname as a str, or its ID as a str.

Example usage:

collection = reddit.subreddit("SUBREDDIT").collections("some_uuid")
collection.mod.add_post("bgibu9")

See also

remove_post()

delete()

Delete this collection.

Example usage:

reddit.subreddit("SUBREDDIT").collections("some_uuid").mod.delete()

See also

create()

classmethod parse(data: Dict[str, Any], reddit: Reddit) → Any

Return an instance of cls from data.

Parameters:
  • data – The structured data.
  • reddit – An instance of Reddit.
remove_post(submission: praw.models.reddit.submission.Submission)

Remove a post from the collection.

Parameters:submission – The post to remove, a Submission, its permalink as a str, its fullname as a str, or its ID as a str.

Example usage:

collection = reddit.subreddit("SUBREDDIT").collections("some_uuid")
collection.mod.remove_post("bgibu9")

See also

add_post()

reorder(links: List[Union[str, praw.models.reddit.submission.Submission]])

Reorder posts in the collection.

Parameters:links – A list of submissions, as Submission, permalink as a str, fullname as a str, or ID as a str.

Example usage:

collection = reddit.subreddit("SUBREDDIT").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("SUBREDDIT").collections("some_uuid")
collection.mod.update_description("Please enjoy these links!")

See also

update_title()

update_title(title: str)

Update the collection’s title.

Parameters:title – The new title.

Example usage:

collection = reddit.subreddit("SUBREDDIT").collections("some_uuid")
collection.mod.update_title("Titley McTitleface")