Multireddit

class praw.models.Multireddit(reddit, _data)

A class for users’ multireddits.

This is referred to as a “Custom Feed” on the Reddit UI.

Typical Attributes

Note

This table describes attributes that typically belong to objects of this class. PRAW dynamically provides the attributes that Reddit returns via the API. Since those attributes are subject to change on Reddit’s end, PRAW makes no effort to document any new/removed/changed attributes, other than to instruct you on how to discover what is available. As a result, this table of attributes may not be complete. See Determine Available Attributes of an Object for detailed information.

If you would like to add an attribute to this table, feel free to open a pull request.

Attribute

Description

can_edit

A bool representing whether or not the authenticated user may edit the multireddit.

copied_from

The multireddit that the multireddit was copied from, if it exists, otherwise None.

created_utc

When the multireddit was created, in Unix Time.

description_html

The description of the multireddit, as HTML.

description_md

The description of the multireddit, as Markdown.

display_name

The display name of the multireddit.

name

The name of the multireddit.

over_18

A bool representing whether or not the multireddit is restricted for users over 18.

subreddits

A list of Subreddits that make up the multireddit.

visibility

The visibility of the multireddit, either "private", "public", or "hidden".

Parameters:
__init__(reddit, _data)

Initialize a Multireddit instance.

Parameters:
Return type:

None

add(subreddit)

Add a subreddit to this multireddit.

Parameters:

subreddit (Subreddit) – The subreddit to add to this multi.

Return type:

None

For example, to add r/test to multireddit bboe/test:

subreddit = reddit.subreddit("test")
reddit.multireddit(redditor="bboe", name="test").add(subreddit)
comments()

Provide an instance of CommentHelper.

For example, to output the author of the 25 most recent comments of r/test execute:

for comment in reddit.subreddit("test").comments(limit=25):
    print(comment.author)
Return type:

CommentHelper

controversial(*, time_filter='all', **generator_kwargs)

Return a ListingGenerator for controversial items.

Parameters:
  • time_filter (str) – Can be one of: "all", "day", "hour", "month", "week", or "year" (default: "all").

  • generator_kwargs (str | int | dict[str, str])

Raises:

ValueError if time_filter is invalid.

Return type:

Iterator[Any]

Additional keyword arguments are passed in the initialization of ListingGenerator.

This method can be used like:

reddit.domain("imgur.com").controversial(time_filter="week")
reddit.multireddit(redditor="samuraisam", name="programming").controversial(
    time_filter="day"
)
reddit.redditor("spez").controversial(time_filter="month")
reddit.redditor("spez").comments.controversial(time_filter="year")
reddit.redditor("spez").submissions.controversial(time_filter="all")
reddit.subreddit("all").controversial(time_filter="hour")
copy(*, display_name=None)

Copy this multireddit and return the new multireddit.

Parameters:

display_name (str | None) – The display name for the copied multireddit. Reddit will generate the name field from this display name. When not provided the copy will use the same display name and name as this multireddit.

Return type:

Multireddit

To copy the multireddit bboe/test with a name of "testing":

reddit.multireddit(redditor="bboe", name="test").copy(display_name="testing")
delete()

Delete this multireddit.

For example, to delete multireddit bboe/test:

reddit.multireddit(redditor="bboe", name="test").delete()
Return type:

None

hot(**generator_kwargs)

Return a ListingGenerator for hot items.

Additional keyword arguments are passed in the initialization of ListingGenerator.

This method can be used like:

reddit.domain("imgur.com").hot()
reddit.multireddit(redditor="samuraisam", name="programming").hot()
reddit.redditor("spez").hot()
reddit.redditor("spez").comments.hot()
reddit.redditor("spez").submissions.hot()
reddit.subreddit("all").hot()
Return type:

Iterator[Any]

Parameters:

generator_kwargs (str | int | dict[str, str])

new(**generator_kwargs)

Return a ListingGenerator for new items.

Additional keyword arguments are passed in the initialization of ListingGenerator.

This method can be used like:

reddit.domain("imgur.com").new()
reddit.multireddit(redditor="samuraisam", name="programming").new()
reddit.redditor("spez").new()
reddit.redditor("spez").comments.new()
reddit.redditor("spez").submissions.new()
reddit.subreddit("all").new()
Return type:

Iterator[Any]

Parameters:

generator_kwargs (str | int | dict[str, str])

classmethod parse(data, reddit)

Return an instance of cls from data.

Parameters:
Return type:

PRAWBase

remove(subreddit)

Remove a subreddit from this multireddit.

Parameters:

subreddit (Subreddit) – The subreddit to remove from this multi.

Return type:

None

For example, to remove r/test from multireddit bboe/test:

subreddit = reddit.subreddit("test")
reddit.multireddit(redditor="bboe", name="test").remove(subreddit)
rising(**generator_kwargs)

Return a ListingGenerator for rising submissions.

Additional keyword arguments are passed in the initialization of ListingGenerator.

For example, to get rising submissions for r/test:

for submission in reddit.subreddit("test").rising():
    print(submission.title)
Return type:

Iterator[Submission]

Parameters:

generator_kwargs (str | int | dict[str, str])

static sluggify(title)

Return a slug version of the title.

Parameters:

title (str) – The title to make a slug of.

Return type:

str

Adapted from Reddit’s utils.py.

stream()

Provide an instance of SubredditStream.

Streams can be used to indefinitely retrieve new comments made to a multireddit, like:

for comment in reddit.multireddit(redditor="spez", name="fun").stream.comments():
    print(comment)

Additionally, new submissions can be retrieved via the stream. In the following example all new submissions to the multireddit are fetched:

for submission in reddit.multireddit(
    redditor="bboe", name="games"
).stream.submissions():
    print(submission)
Return type:

SubredditStream

top(*, time_filter='all', **generator_kwargs)

Return a ListingGenerator for top items.

Parameters:
  • time_filter (str) – Can be one of: "all", "day", "hour", "month", "week", or "year" (default: "all").

  • generator_kwargs (str | int | dict[str, str])

Raises:

ValueError if time_filter is invalid.

Return type:

Iterator[Any]

Additional keyword arguments are passed in the initialization of ListingGenerator.

This method can be used like:

reddit.domain("imgur.com").top(time_filter="week")
reddit.multireddit(redditor="samuraisam", name="programming").top(time_filter="day")
reddit.redditor("spez").top(time_filter="month")
reddit.redditor("spez").comments.top(time_filter="year")
reddit.redditor("spez").submissions.top(time_filter="all")
reddit.subreddit("all").top(time_filter="hour")
update(**updated_settings)

Update this multireddit.

Keyword arguments are passed for settings that should be updated. They can any of:

Parameters:
  • display_name – The display name for this multireddit. Must be no longer than 50 characters.

  • subreddits – Subreddits for this multireddit.

  • description_md – Description for this multireddit, formatted in Markdown.

  • icon_name – Can be one of: "art and design", "ask", "books", "business", "cars", "comics", "cute animals", "diy", "entertainment", "food and drink", "funny", "games", "grooming", "health", "life advice", "military", "models pinup", "music", "news", "philosophy", "pictures and gifs", "science", "shopping", "sports", "style", "tech", "travel", "unusual stories", "video", or None.

  • key_color – RGB hex color code of the form "#FFFFFF".

  • visibility – Can be one of: "hidden", "private", or "public".

  • weighting_scheme – Can be one of: "classic" or "fresh".

  • updated_settings (str | list[str | Subreddit | dict[str, str]])

Return type:

None

For example, to rename multireddit "bboe/test" to "bboe/testing":

reddit.multireddit(redditor="bboe", name="test").update(display_name="testing")