diff --git a/CHANGES.rst b/CHANGES.rst index 1f05b713..694a3e19 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -25,6 +25,12 @@ Unreleased greater than 500 KiB, even when the parameters did not exceed their respective permitted maximum lengths. +**Deprecated** + +- Legacy modmail is slated for deprecation by Reddit in June 2021. See + https://www.reddit.com/r/modnews/comments/mar9ha/even_more_modmail_improvements/ for + more info. + 7.2.0 (2021/02/25) ------------------ diff --git a/asyncpraw/models/reddit/subreddit.py b/asyncpraw/models/reddit/subreddit.py index 66578b6b..c48a28c7 100644 --- a/asyncpraw/models/reddit/subreddit.py +++ b/asyncpraw/models/reddit/subreddit.py @@ -19,6 +19,7 @@ Union, ) from urllib.parse import urljoin +from warnings import warn from xml.etree.ElementTree import XML from aiohttp import ClientResponse @@ -2268,6 +2269,12 @@ def inbox( ) -> Iterator["asyncpraw.models.SubredditMessage"]: """Return a :class:`.ListingGenerator` for moderator messages. + .. warning:: + + Legacy modmail is being deprecated in June 2021. Please see + https://www.reddit.com/r/modnews/comments/mar9ha/even_more_modmail_improvements/ + for more info. + Additional keyword arguments are passed in the initialization of :class:`.ListingGenerator`. @@ -2286,6 +2293,13 @@ def inbox( print("From: {}, Body: {}".format(reply.author, reply.body)) """ + warn( + "Legacy modmail is being deprecated in June 2021. Please see" + " https://www.reddit.com/r/modnews/comments/mar9ha/even_more_modmail_improvements/" + " for more info.", + category=DeprecationWarning, + stacklevel=3, + ) return ListingGenerator( self.subreddit._reddit, API_PATH["moderator_messages"].format(subreddit=self.subreddit), @@ -2485,6 +2499,12 @@ def unread( ) -> Iterator["asyncpraw.models.SubredditMessage"]: """Return a :class:`.ListingGenerator` for unread moderator messages. + .. warning:: + + Legacy modmail is being deprecated in June 2021. Please see + https://www.reddit.com/r/modnews/comments/mar9ha/even_more_modmail_improvements/ + for more info. + Additional keyword arguments are passed in the initialization of :class:`.ListingGenerator`. @@ -2501,6 +2521,13 @@ def unread( print("From: {}, To: {}".format(message.author, message.dest)) """ + warn( + "Legacy modmail is being deprecated in June 2021. Please see" + " https://www.reddit.com/r/modnews/comments/mar9ha/even_more_modmail_improvements/" + " for more info.", + category=DeprecationWarning, + stacklevel=3, + ) return ListingGenerator( self.subreddit._reddit, API_PATH["moderator_unread"].format(subreddit=self.subreddit),