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: .. code-block:: python reddito
| 508 | |
| 509 | |
| 510 | class RedditorModNotes(BaseModNotes): |
| 511 | """Provides methods to interact with moderator notes at the redditor level. |
| 512 | |
| 513 | .. note:: |
| 514 | |
| 515 | The authenticated user must be a moderator of the provided subreddit(s). |
| 516 | |
| 517 | For example, all the notes for u/spez in r/test can be iterated through like so: |
| 518 | |
| 519 | .. code-block:: python |
| 520 | |
| 521 | redditor = reddit.redditor("spez") |
| 522 | |
| 523 | for note in redditor.notes.subreddits("test"): |
| 524 | print(f"{note.label}: {note.note}") |
| 525 | |
| 526 | """ |
| 527 | |
| 528 | def __init__(self, reddit: praw.Reddit, redditor: Redditor | str) -> None: |
| 529 | """Initialize a :class:`.RedditorModNotes` instance. |
| 530 | |
| 531 | :param reddit: An instance of :class:`.Reddit`. |
| 532 | :param redditor: An instance of :class:`.Redditor`. |
| 533 | |
| 534 | """ |
| 535 | super().__init__(reddit) |
| 536 | self.redditor = redditor |
| 537 | |
| 538 | def subreddits( |
| 539 | self, |
| 540 | *subreddits: Subreddit | str, |
| 541 | all_notes: bool | None = None, |
| 542 | **generator_kwargs: Any, |
| 543 | ) -> Iterator[models.ModNote]: |
| 544 | """Return notes for this :class:`.Redditor` from one or more subreddits. |
| 545 | |
| 546 | :param subreddits: One or more subreddits to retrieve the notes from. Must be |
| 547 | either a :class:`.Subreddit` or a subreddit name. |
| 548 | :param all_notes: Whether to return all notes or only the latest note (default: |
| 549 | ``True`` if only one subreddit is provided otherwise ``False``). |
| 550 | |
| 551 | .. note:: |
| 552 | |
| 553 | Setting this to ``True`` will result in a request for each subreddit. |
| 554 | |
| 555 | |
| 556 | :returns: A generator that yields the most recent :class:`.ModNote` (or ``None`` |
| 557 | if this redditor doesn't have any notes) per subreddit in their relative |
| 558 | order. If ``all_notes`` is ``True``, this will yield all notes or ``None`` |
| 559 | from each subreddit for this redditor. |
| 560 | |
| 561 | For example, all the notes for u/spez in r/test can be iterated through like so: |
| 562 | |
| 563 | .. code-block:: python |
| 564 | |
| 565 | redditor = reddit.redditor("spez") |
| 566 | |
| 567 | for note in redditor.notes.subreddits("test"): |
no outgoing calls
no test coverage detected
searching dependent graphs…