RedditorModNotes

class asyncpraw.models.RedditorModNotes(reddit: asyncpraw.Reddit, redditor: Redditor | str)

Provides methods to interact with moderator notes at the redditor level.

Note

The authenticated user must be a moderator of the provided subreddit(s).

For example, all the notes for u/spez in r/test can be iterated through like so:

redditor = await reddit.redditor("spez")

async for note in redditor.notes.subreddits("test"):
    print(f"{note.label}: {note.note}")
__init__(reddit: asyncpraw.Reddit, redditor: Redditor | str)

Initialize a RedditorModNotes instance.

Parameters:
  • reddit – An instance of Reddit.

  • redditor – An instance of Redditor.

await create(*, label: str | None = None, note: str, redditor: Redditor | str | None = None, subreddit: asyncpraw.models.Subreddit | str | None = None, thing: Comment | Submission | str | None = None, **other_settings: Any) asyncpraw.models.ModNote

Create a ModNote for a redditor in the specified subreddit.

Parameters:
  • label – 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 – The content of the note. As of this writing, this is limited to 250 characters.

  • redditor

    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

    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 – Either the fullname of a comment/submission, a Comment, or a Submission to associate with the note.

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

Returns:

The new ModNote object.

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

subreddit = await reddit.subreddit("test")
await subreddit.mod.notes.create(
    label="HELPFUL_USER", note="Test note", redditor="spez"
)
# or
redditor = await reddit.redditor("spez")
await redditor.mod.notes.create(
    label="HELPFUL_USER", note="Test note", subreddit="test"
)
# or
await reddit.notes.create(
    label="HELPFUL_USER", note="Test note", redditor="spez", subreddit="test"
)
await delete(*, delete_all: bool = False, note_id: str | None = None, redditor: Redditor | str | None = None, subreddit: asyncpraw.models.Subreddit | str | None = None)

Delete note(s) for a redditor.

Parameters:
  • delete_all

    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 – The ID of the note to delete. This parameter is ignored if delete_all is True.

  • redditor

    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

    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).

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

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

To delete all notes for u/spez, try:

subreddit = await reddit.subreddit("test")
await subreddit.mod.notes.delete(delete_all=True, redditor="spez")
# or
redditor = await reddit.redditor("spez")
await redditor.notes.delete(delete_all=True, subreddit="test")
# or
await reddit.notes.delete(delete_all=True, subreddit="test", redditor="spez")
subreddits(*subreddits: asyncpraw.models.Subreddit | str, all_notes: bool | None = None, **generator_kwargs: Any) AsyncGenerator[asyncpraw.models.ModNote, None]

Return notes for this Redditor from one or more subreddits.

Parameters:
  • subreddits – One or more subreddits to retrieve the notes from. Must be either a Subreddit or a subreddit name.

  • all_notes

    Whether to return all notes or only the latest note (default: True if only one subreddit is provided otherwise False).

    Note

    Setting this to True will result in a request for each subreddit.

Returns:

A generator that yields the most recent ModNote (or None if this redditor doesn’t have any notes) per subreddit in their relative order. If all_notes is True, this will yield all notes or None from each subreddit for this redditor.

For example, all the notes for u/spez in r/test can be iterated through like so:

redditor = await reddit.redditor("spez")

async for note in redditor.notes.subreddits("test"):
    print(f"{note.label}: {note.note}")

For example, the latest note for u/spez from r/test and r/redditdev can be iterated through like so:

redditor = await reddit.redditor("spez")
subreddit = await reddit.subreddit("redditdev")

async for note in redditor.notes.subreddits("test", subreddit):
    print(f"{note.label}: {note.note}")

For example, all the notes for u/spez in r/test and r/redditdev can be iterated through like so:

redditor = await reddit.redditor("spez")
subreddit = await reddit.subreddit("redditdev")

async for note in redditor.notes.subreddits("test", subreddit, all_notes=True):
    print(f"{note.label}: {note.note}")