Skip to content

Commit 7363ca1

Browse files
authored
Merge pull request #1856 from Watchful1/mod_notes
Mod notes
2 parents 275e722 + b22e1f5 commit 7363ca1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+10319
-10
lines changed

CHANGES.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ Unreleased
1414
- :meth:`.SubredditCollectionsModeration.create` keyword argument ``display_layout`` for
1515
specifying a display layout when creating a :class:`.Collection`.
1616
- :attr:`~.Message.parent` to get the parent of a :class:`.Message`.
17+
- :class:`.ModNote` to represent a moderator note.
18+
- :meth:`.ModNote.delete` to delete a single moderator note.
19+
- :class:`.RedditModNotes` to interact with moderator notes from a :class:`.Reddit`
20+
instance. This provides the ability to create and fetch notes for one or more
21+
redditors from one or more subreddits.
22+
- :class:`.RedditorModNotes` to interact with moderator notes from a :class:`.Redditor`
23+
instance.
24+
- :meth:`.RedditorModNotes.subreddits` to obtain moderator notes from multiple
25+
subreddits for a single redditor.
26+
- :class:`.SubredditModNotes` to interact with moderator notes from a
27+
:class:`.Subreddit` instance.
28+
- :meth:`.SubredditModNotes.redditors` to obtain moderator notes for multiple redditors
29+
from a single subreddit.
30+
- :meth:`~.BaseModNotes.create` to create a moderator note.
31+
- :attr:`.Redditor.notes` to interact with :class:`.RedditorModNotes`.
32+
- :attr:`.SubredditModeration.notes` to interact with :class:`.SubredditModNotes`.
33+
- :meth:`~.ModNoteMixin.create_note` create a moderator note from a :class:`.Comment` or
34+
:class:`.Submission`.
35+
- :meth:`~.ModNoteMixin.author_notes` to view the moderator notes for the author of a
36+
:class:`.Comment` or :class:`.Submission`.
1737

1838
**Changed**
1939

docs/code_overview/other.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ them bound to an attribute of one of the PRAW models.
3333
other/inlinemedia
3434
other/inlinevideo
3535

36+
.. toctree::
37+
:maxdepth: 2
38+
:caption: ModNotes
39+
40+
other/base_mod_notes
41+
other/mod_note
42+
other/mod_note_mixin
43+
other/reddit_mod_notes
44+
other/redditor_mod_notes
45+
other/subreddit_mod_notes
46+
3647
.. toctree::
3748
:maxdepth: 2
3849
:caption: Moderation Helpers
@@ -121,6 +132,7 @@ them bound to an attribute of one of the PRAW models.
121132
other/inboxablemixin
122133
other/listinggenerator
123134
other/mod_action
135+
other/mod_note
124136
other/moderatedlist
125137
other/modmail
126138
other/modmailmessage
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BaseModNotes
2+
============
3+
4+
.. autoclass:: praw.models.mod_notes.BaseModNotes
5+
:inherited-members:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ModNote
2+
=======
3+
4+
.. autoclass:: praw.models.ModNote
5+
:inherited-members:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ModNoteMixin
2+
============
3+
4+
.. autoclass:: praw.models.reddit.mixins.ModNoteMixin
5+
:members:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
RedditModNotes
2+
==============
3+
4+
.. autoclass:: praw.models.RedditModNotes
5+
:inherited-members:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
RedditorModNotes
2+
================
3+
4+
.. autoclass:: praw.models.RedditorModNotes
5+
:inherited-members:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SubredditModNotes
2+
=================
3+
4+
.. autoclass:: praw.models.SubredditModNotes
5+
:inherited-members:

praw/endpoints.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@
108108
"mentions": "message/mentions",
109109
"message": "message/messages/{id}/",
110110
"messages": "message/messages/",
111+
"mod_notes": "api/mod/notes",
112+
"mod_notes_bulk": "api/mod/notes/recent",
111113
"moderated": "user/{user}/moderated_subreddits/",
112114
"moderator_messages": "r/{subreddit}/message/moderator/",
113115
"moderator_unread": "r/{subreddit}/message/moderator/unread/",

praw/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from .listing.generator import ListingGenerator
1212
from .listing.listing import Listing, ModeratorListing, ModmailConversationsListing
1313
from .mod_action import ModAction
14+
from .mod_note import ModNote
15+
from .mod_notes import RedditModNotes, RedditorModNotes, SubredditModNotes
1416
from .preferences import Preferences
1517
from .reddit.collections import Collection
1618
from .reddit.comment import Comment

0 commit comments

Comments
 (0)