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:
__init__(reddit, collection_id)

Initialize a CollectionModeration instance.

Parameters:
Return type:

None

add_post(submission)

Add a post to the collection.

Parameters:

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

Return type:

None

Example usage:

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

See also

remove_post()

delete()

Delete this collection.

Example usage:

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

See also

create()

Return type:

None

classmethod parse(data, reddit)

Return an instance of cls from data.

Parameters:
Return type:

PRAWBase

remove_post(submission)

Remove a post from the collection.

Parameters:

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

Return type:

None

Example usage:

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

See also

add_post()

reorder(links)

Reorder posts in the collection.

Parameters:

links (list[str | Submission]) – A list of Submissions or a str that is either a fullname or an ID.

Return type:

None

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.

Parameters:

description (str) – The new description.

Return type:

None

Example usage:

collection = reddit.subreddit("test").collections("some_uuid")
collection.mod.update_description("Please enjoy these links!")

See also

update_title()

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. Passing None will clear the set layout and collection.display_layout will be None, however, the collection will appear on Reddit as if display_layout is set to "TIMELINE".

Return type:

None

Example usage:

collection = reddit.subreddit("test").collections("some_uuid")
collection.mod.update_display_layout("GALLERY")
update_title(title)

Update the collection’s title.

Parameters:

title (str) – The new title.

Return type:

None

Example usage:

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