Return a :class:`.Redditor` instance for the authenticated user. :param use_cache: When ``True``, and if this function has been previously called, returned the cached version (default: ``True``). .. note:: If you change the :class:`.Reddit` instance's autho
(self, *, use_cache: bool = True)
| 124 | return karma_map |
| 125 | |
| 126 | def me(self, *, use_cache: bool = True) -> models.Redditor | None: |
| 127 | """Return a :class:`.Redditor` instance for the authenticated user. |
| 128 | |
| 129 | :param use_cache: When ``True``, and if this function has been previously |
| 130 | called, returned the cached version (default: ``True``). |
| 131 | |
| 132 | .. note:: |
| 133 | |
| 134 | If you change the :class:`.Reddit` instance's authorization, you might want |
| 135 | to refresh the cached value. Prefer using separate :class:`.Reddit` |
| 136 | instances, however, for distinct authorizations. |
| 137 | |
| 138 | """ |
| 139 | if self._reddit.read_only: |
| 140 | msg = "`user.me()` does not work in read_only mode" |
| 141 | raise ReadOnlyException(msg) |
| 142 | if "_me" not in self.__dict__ or not use_cache: |
| 143 | user_data = self._reddit.get(API_PATH["me"]) |
| 144 | self._me = Redditor(self._reddit, _data=user_data) |
| 145 | return self._me |
| 146 | |
| 147 | def moderator_subreddits(self, **generator_kwargs: Any) -> Iterator[models.Subreddit]: |
| 148 | """Return a :class:`.ListingGenerator` subreddits that the user moderates. |