CollectionModeration¶
- class praw.models.reddit.collections.CollectionModeration(reddit, collection_id)¶
Class to support moderation actions on a
Collection.Obtain an instance via:
reddit.subreddit("test").collections("some_uuid").mod
- Parameters:
reddit (praw.Reddit)
collection_id (str)
- __init__(reddit, collection_id)¶
Initialize a
CollectionModerationinstance.- Parameters:
collection_id (
str) – The ID of aCollection.reddit (Reddit)
- Return type:
None
- add_post(submission)¶
Add a post to the collection.
- Parameters:
submission (
Submission) – The post to add, aSubmission, its permalink as astr, its fullname as astr, or its ID as astr.- Return type:
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
- Return type:
- classmethod parse(data, reddit)¶
Return an instance of
clsfromdata.
- remove_post(submission)¶
Remove a post from the collection.
- Parameters:
submission (
Submission) – The post to remove, aSubmission, its permalink as astr, its fullname as astr, or its ID as astr.- Return type:
Example usage:
collection = reddit.subreddit("test").collections("some_uuid") collection.mod.remove_post("bgibu9")
See also
- reorder(links)¶
Reorder posts in the collection.
- Parameters:
links (
list[str|Submission]) – A list ofSubmissions or astrthat is either a fullname or an ID.- Return type:
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)¶
Update the collection’s 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)¶
Update the collection’s display layout.
- Parameters:
display_layout (
str) – Either"TIMELINE"for events or discussions or"GALLERY"for images or memes. PassingNonewill clear the set layout andcollection.display_layoutwill beNone, however, the collection will appear on Reddit as ifdisplay_layoutis set to"TIMELINE".- Return type:
Example usage:
collection = reddit.subreddit("test").collections("some_uuid") collection.mod.update_display_layout("GALLERY")
- update_title(title)¶
Update the collection’s title.
Example usage:
collection = reddit.subreddit("test").collections("some_uuid") collection.mod.update_title("Titley McTitleface")
See also