Return notes from this :class:`.Subreddit` for one or more redditors. :param redditors: One or more redditors to retrieve notes for. Must be either a :class:`.Redditor` or a redditor name. :param all_notes: Whether to return all notes or only the latest note (default:
(
self,
*redditors: Redditor | str,
all_notes: bool | None = None,
**generator_kwargs: Any,
)
| 632 | self.subreddit = subreddit |
| 633 | |
| 634 | def redditors( |
| 635 | self, |
| 636 | *redditors: Redditor | str, |
| 637 | all_notes: bool | None = None, |
| 638 | **generator_kwargs: Any, |
| 639 | ) -> Iterator[models.ModNote]: |
| 640 | """Return notes from this :class:`.Subreddit` for one or more redditors. |
| 641 | |
| 642 | :param redditors: One or more redditors to retrieve notes for. Must be either a |
| 643 | :class:`.Redditor` or a redditor name. |
| 644 | :param all_notes: Whether to return all notes or only the latest note (default: |
| 645 | ``True`` if only one redditor is provided otherwise ``False``). |
| 646 | |
| 647 | .. note:: |
| 648 | |
| 649 | Setting this to ``True`` will result in a request for each redditor. |
| 650 | |
| 651 | |
| 652 | :returns: A generator that yields the most recent :class:`.ModNote` (or ``None`` |
| 653 | if the user doesn't have any notes in this subreddit) per redditor in their |
| 654 | relative order. If ``all_notes`` is ``True``, this will yield all notes for |
| 655 | each redditor. |
| 656 | |
| 657 | For example, all the notes for u/spez in r/test can be iterated through like so: |
| 658 | |
| 659 | .. code-block:: python |
| 660 | |
| 661 | subreddit = reddit.subreddit("test") |
| 662 | |
| 663 | for note in subreddit.mod.notes.redditors("spez"): |
| 664 | print(f"{note.label}: {note.note}") |
| 665 | |
| 666 | For example, the latest note for u/spez and u/bboe from r/test can be iterated |
| 667 | through like so: |
| 668 | |
| 669 | .. code-block:: python |
| 670 | |
| 671 | subreddit = reddit.subreddit("test") |
| 672 | redditor = reddit.redditor("bboe") |
| 673 | |
| 674 | for note in subreddit.mod.notes.redditors("spez", redditor): |
| 675 | print(f"{note.label}: {note.note}") |
| 676 | |
| 677 | For example, **all** the notes for both u/spez and u/bboe in r/test can be |
| 678 | iterated through like so: |
| 679 | |
| 680 | .. code-block:: python |
| 681 | |
| 682 | subreddit = reddit.subreddit("test") |
| 683 | redditor = reddit.redditor("bboe") |
| 684 | |
| 685 | for note in subreddit.mod.notes.redditors("spez", redditor, all_notes=True): |
| 686 | print(f"{note.label}: {note.note}") |
| 687 | |
| 688 | """ |
| 689 | if len(redditors) == 0: |
| 690 | msg = "At least 1 redditor must be provided." |
| 691 | raise ValueError(msg) |