PRAW v7.0.0 Release Notes
Release Date: 2020-04-24 // almost 3 years ago-
โ Added
- ๐
config_interpolation
parameter for :class:.Reddit
supporting basic and extended modes. - โ Add :meth:
.Redditors.partial_redditors
that returns lightweight redditor objects that contain only a few fields. This is useful for resolving Redditor IDs to their usernames in bulk. - :meth:
.User.friends
has a new parameteruser
that takes either an instance of :class:.Redditor
or a string containing a redditor name and returns an instance of :class:.Redditor
if the authenticated user is friends with the user, otherwise throws an exception. - :meth:
.SubmissionModeration.flair
has the parameterflair_template_id
for applying flairs with template IDs. - โก๏ธ :meth:
~.Emoji.update
supports modifying an emoji's permissions. - ๐ :meth:
~.SubredditEmoji.add
now supports optionally passing booleans to set an emoji's permissions upon upload. - โก๏ธ Methods :meth:
.SubredditLinkFlairTemplates.update
and :meth:.SubredditRedditorFlairTemplates.update
contain a new parameter,fetch
, that toggles the automatic fetching of existing data from Reddit. It is set to True by default. - โก๏ธ Values in methods :meth:
.SubredditLinkFlairTemplates.update
and :meth:.SubredditRedditorFlairTemplates.update
that are left as the defaults will no longer be over-written if thefetch
parameter is set toTrue
, but will fill in existing values for the flair template. - The parameter
text
for methods :meth:.SubredditLinkFlairTemplates.update
and :meth:.SubredditRedditorFlairTemplates.update
is no longer required. - There is a new method, :meth:
.Subreddit.post_requirements
, to fetch a subreddit's post requirements. - Method :meth:
.SubmissionModeration.sticky
will now ignore the Confict exception generated by trying to sticky the same post multiple times. - A new method :meth:
.CommentModeration.show
will uncollapse a comment that was collapsed because of Crowd Control - Methods :meth:
.Subreddit.submit_image
and :meth:.Subreddit.submit_video
will throw :class:.TooLargeMediaException
if the submitted media is rejected by Reddit due to the size of the media. - Class :class:
.Reddit
has an attribute,validate_on_submit
, that can be set after class initialization that causes methods :meth:.Subreddit.submit
, :meth:.Subreddit.submit_image
, :meth:.Subreddit.submit_video
, and :meth:.Submission.edit
to check that the submission matches a subreddit's post validation rules. This attribute will be functionally useless once Reddit implements their change. This attribute will be deprecated on the next release after Reddit's change, and will be removed on the next major release after Reddit's change.
โ .. warning:: In May-June 2020, Reddit will force all submissions to run through a subreddit's validation rules.
- Introduced a data class, :class:
.RedditErrorItem
, to represent an individual error item returned from Reddit. - Class :class:
.RedditAPIException
now serves as a container for the :class:.RedditErrorItem
\ s. You can access the items by doingRedditAPIException.items
, which returns a list. - :class:
.APIException
is an alias to :class:.RedditAPIException
. - Parameter
discussion_type
to methods :meth:.Subreddit.submit
, :meth:.Subreddit.submit_image
, and :meth:.Subreddit.submit_video
to support submitting as a live discussion (set toCHAT
). - Instances of :class:
.Trophy
can be compared for equality with each other. - ๐ง :class:
.Reddit
has a new configurable parameter,timeout
. This defaults to 16 seconds. It controls how long PRAW will wait for a response before throwing an exception. - PRAW now handles ratelimit errors returned as instances of
:class:
.RedditAPIException
. - :class:
.Reddit
has one new parameter,ratelimit_seconds
. The parameter configures the maximum amount of seconds to catch ratelimits for. It defaults to 5 seconds when not specified.
๐ Changed
prawcore.BadRequest
should no longer be raised. Instead a more useful :class:.RedditAPIException
instance will be raised.- 0๏ธโฃ Set the default comment sort to
confidence
instead ofbest
because it turns outbest
isn't actually the correct value for the parameter.
๐ Deprecated
- ๐ :class:
.APIException
is deprecated and slated for removal in PRAW 8.0.
๐ Fixed
- โก๏ธ :meth:
.SubredditFlair.update
will not error out when the flair text contains quote marks.
โ Removed
- Converting :class:
.APIException
to string will no longer escape unicode characters. - Module
praw.models.modaction
no longer exists. Please use the modulepraw.models.mod_action
, or directly importModAction
frompraw.models
. - โก๏ธ Methods :meth:
.SubredditLinkFlairTemplates.update
and :meth:.SubredditRedditorFlairTemplates.update
will no longer create flairs that are using an invalid template id, but instead throw a :class:.InvalidFlairTemplateID
. - ๐ Method
reddit.user.moderator_subreddits
has been removed. Please use :meth:.Redditor.moderated
instead.
- ๐