r"""Return a :class:`.RedditorList` of friends or a :class:`.Redditor` in the friends list. :param user: Checks to see if you are friends with the redditor. Either an instance of :class:`.Redditor` or a string can be given. :returns: A list of :class:`.Redditor`\ s, or
(self, *, user: str | models.Redditor | None = None)
| 86 | return ListingGenerator(self._reddit, API_PATH["my_contributor"], **generator_kwargs) |
| 87 | |
| 88 | def friends(self, *, user: str | models.Redditor | None = None) -> list[models.Redditor] | models.Redditor: |
| 89 | r"""Return a :class:`.RedditorList` of friends or a :class:`.Redditor` in the friends list. |
| 90 | |
| 91 | :param user: Checks to see if you are friends with the redditor. Either an |
| 92 | instance of :class:`.Redditor` or a string can be given. |
| 93 | |
| 94 | :returns: A list of :class:`.Redditor`\ s, or a single :class:`.Redditor` if |
| 95 | ``user`` is specified. The :class:`.Redditor` instance(s) returned also has |
| 96 | friend attributes. |
| 97 | |
| 98 | :raises: An instance of :class:`.RedditAPIException` if you are not friends with |
| 99 | the specified :class:`.Redditor`. |
| 100 | |
| 101 | """ |
| 102 | endpoint = API_PATH["friends"] if user is None else API_PATH["friend_v1"].format(user=str(user)) |
| 103 | return self._reddit.get(endpoint) |
| 104 | |
| 105 | def karma(self) -> dict[models.Subreddit, dict[str, int]]: |
| 106 | r"""Return a dictionary mapping :class:`.Subreddit`\ s to their karma. |