BaseModNotes

class praw.models.mod_notes.BaseModNotes(reddit)

Provides base methods to interact with moderator notes.

Parameters:

reddit (praw.Reddit)

__init__(reddit)

Initialize a BaseModNotes instance.

Parameters:

reddit (Reddit) – An instance of Reddit.

Return type:

None

create(*, label=None, note, redditor=None, subreddit=None, thing=None, **other_settings)

Create a ModNote for a redditor in the specified subreddit.

Parameters:
  • label (str | None) – The label for the note. As of this writing, this can be one of the following: "ABUSE_WARNING", "BAN", "BOT_BAN", "HELPFUL_USER", "PERMA_BAN", "SOLID_CONTRIBUTOR", "SPAM_WARNING", "SPAM_WATCH", or None (default: None).

  • note (str) – The content of the note. As of this writing, this is limited to 250 characters.

  • redditor (Redditor | str | None) –

    The redditor to create the note for (default: None).

    Note

    This parameter is required if thing is not provided or this is not called from a Redditor instance (e.g., reddit.redditor.notes).

  • subreddit (Subreddit | str | None) –

    The subreddit associated with the note (default: None).

    Note

    This parameter is required if thing is not provided or this is not called from a Subreddit instance (e.g., reddit.subreddit.mod).

  • thing (Comment | Submission | str | None) – Either the fullname of a comment/submission, a Comment, or a Submission to associate with the note.

  • other_settings (Any) – Additional keyword arguments can be provided to handle new parameters as Reddit introduces them.

Return type:

ModNote

Returns:

The new ModNote object.

For example, to create a note for u/spez in r/test:

reddit.subreddit("test").mod.notes.create(
    label="HELPFUL_USER", note="Test note", redditor="spez"
)
# or
reddit.redditor("spez").mod.notes.create(
    label="HELPFUL_USER", note="Test note", subreddit="test"
)
# or
reddit.notes.create(
    label="HELPFUL_USER", note="Test note", redditor="spez", subreddit="test"
)
delete(*, delete_all=False, note_id=None, redditor=None, subreddit=None)

Delete note(s) for a redditor.

Parameters:
  • delete_all (bool) –

    When True, delete all notes for the specified redditor in the specified subreddit (default: False).

    Note

    This will make a request for each note.

  • note_id (str | None) – The ID of the note to delete. This parameter is ignored if delete_all is True.

  • redditor (Redditor | str | None) –

    The redditor to delete the note(s) for (default: None). Can be a Redditor instance or a redditor name.

    Note

    This parameter is required if this method is not called from a Redditor instance (e.g., redditor.notes).

  • subreddit (Subreddit | str | None) –

    The subreddit to delete the note(s) from (default: None). Can be a Subreddit instance or a subreddit name.

    Note

    This parameter is required if this method is not called from a Subreddit instance (e.g., reddit.subreddit.mod).

Return type:

None

For example, to delete a note with the ID "ModNote_d324b280-5ecc-435d-8159-3e259e84e339", try:

reddit.subreddit("test").mod.notes.delete(
    note_id="ModNote_d324b280-5ecc-435d-8159-3e259e84e339", redditor="spez"
)
# or
reddit.redditor("spez").notes.delete(
    note_id="ModNote_d324b280-5ecc-435d-8159-3e259e84e339", subreddit="test"
)
# or
reddit.notes.delete(
    note_id="ModNote_d324b280-5ecc-435d-8159-3e259e84e339",
    subreddit="test",
    redditor="spez",
)

To delete all notes for u/spez, try:

reddit.subreddit("test").mod.notes.delete(delete_all=True, redditor="spez")
# or
reddit.redditor("spez").notes.delete(delete_all=True, subreddit="test")
# or
reddit.notes.delete(delete_all=True, subreddit="test", redditor="spez")