Copyright | (c) 2021 Rory Tyler Hayford |
---|---|
License | BSD-3-Clause |
Maintainer | rory.hayford@protonmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Actions related to the currently logged-in user, such as accounts, friends, etc... For actions related to other users, see Network.Reddit.User
Synopsis
- getMe :: MonadReddit m => m Account
- getPreferences :: MonadReddit m => m Preferences
- updatePreferences :: MonadReddit m => Preferences -> m Preferences
- getMySubreddit :: MonadReddit m => m Subreddit
- getMySubredditSettings :: MonadReddit m => m SubredditSettings
- setMySubredditSettings :: MonadReddit m => SubredditSettings -> m ()
- getMyOverview :: MonadReddit m => Paginator ItemID Item -> m (Listing ItemID Item)
- getMySaved :: MonadReddit m => Paginator ItemID Item -> m (Listing ItemID Item)
- getMyComments :: MonadReddit m => Paginator CommentID Comment -> m (Listing CommentID Comment)
- getMySubmissions :: MonadReddit m => Paginator SubmissionID Submission -> m (Listing SubmissionID Submission)
- getMyHidden :: MonadReddit m => Paginator ItemID Item -> m (Listing ItemID Item)
- getMyFriends :: MonadReddit m => m (Seq Friend)
- getMyFriend :: MonadReddit m => Username -> m Friend
- getMyBlocked :: MonadReddit m => m (Seq Friend)
- getMyKarma :: MonadReddit m => m (Seq Karma)
- makeFriend :: MonadReddit m => Maybe Text -> Username -> m Friend
- unFriend :: MonadReddit m => Username -> m ()
- trustUser :: MonadReddit m => Username -> m ()
- distrustUser :: MonadReddit m => Username -> m ()
- blockUser :: MonadReddit m => UserID -> m ()
- needsCaptcha :: MonadReddit m => m Bool
- getMyFlair :: MonadReddit m => SubredditName -> m (Maybe UserFlair)
- setMyFlair :: MonadReddit m => FlairSelection -> m ()
- getMySubscribed :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit)
- getMyModerated :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit)
- getMyContributing :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit)
- getMyMultireddits :: MonadReddit m => m (Seq Multireddit)
Actions
getMe :: MonadReddit m => m Account Source #
Get account information for the currently logged-in user. If you are using
an ApplicationOnly
client, calling this will throw an InvalidRequest
getPreferences :: MonadReddit m => m Preferences Source #
Get the user Preferences
for the currently authenticated user
updatePreferences :: MonadReddit m => Preferences -> m Preferences Source #
Update the authenticated users Preferences
. Returns the new preferences
upon success
Warning: Invalid fields or values are silently discarded by this endpoint. If you wish to check that an update has succeeded, consider an equality test between the existing preferences and the value returned by this action
getMySubreddit :: MonadReddit m => m Subreddit Source #
Get the special user Subreddit
associated with the authenticated account
getMySubredditSettings :: MonadReddit m => m SubredditSettings Source #
Get settings for the special user Subreddit
associated with the authenticated
account. Also see setMySubredditSettings
setMySubredditSettings :: MonadReddit m => SubredditSettings -> m () Source #
Set the SubredditSettings
for your special user subreddit. You can obtain the
existing settings using getMySubredditSettings
getMyOverview :: MonadReddit m => Paginator ItemID Item -> m (Listing ItemID Item) Source #
Get an overview of the authenticated user's Comment
s and Submission
s
getMySaved :: MonadReddit m => Paginator ItemID Item -> m (Listing ItemID Item) Source #
Get items that the authenticated user has saved
getMyComments :: MonadReddit m => Paginator CommentID Comment -> m (Listing CommentID Comment) Source #
Get an overview of the authenticated user's Comment
s
getMySubmissions :: MonadReddit m => Paginator SubmissionID Submission -> m (Listing SubmissionID Submission) Source #
Get an overview of the authenticated user's Submission
s
getMyHidden :: MonadReddit m => Paginator ItemID Item -> m (Listing ItemID Item) Source #
Get items that the authenticated user has hidden
getMyFriends :: MonadReddit m => m (Seq Friend) Source #
Get the Friend
s of the currently logged-in user
getMyFriend :: MonadReddit m => Username -> m Friend Source #
Get information about one of the authenticated user's friends. You must be
friends with the owner of the provided username, or an POSTError
will be
thrown
getMyBlocked :: MonadReddit m => m (Seq Friend) Source #
Get blocked users (as Friend
s) of the currently logged-in user
getMyKarma :: MonadReddit m => m (Seq Karma) Source #
Get a breakdown of the current user's karma
:: MonadReddit m | |
=> Maybe Text | Providing this requires Reddit premium |
-> Username | |
-> m Friend |
Make friends with another user. You must have Reddit premium to add a note
to the friendship. If you attempt to add the note without premium, you are
likely to get an APIException
(POSTError
)
unFriend :: MonadReddit m => Username -> m () Source #
Remove an existing friend
trustUser :: MonadReddit m => Username -> m () Source #
Add the user to your list of trusted users who may always send you PMs
distrustUser :: MonadReddit m => Username -> m () Source #
Remove the user from your list of trusted users
blockUser :: MonadReddit m => UserID -> m () Source #
Block another user. Note that this cannot be reversed through the API; the logged-in user would need to manually revoke the block by visiting Reddit's website
needsCaptcha :: MonadReddit m => m Bool Source #
Find out if the authenticated user needs to complete a captcha when performing certain transactions, such as submitting a link or sending a private message
getMyFlair :: MonadReddit m => SubredditName -> m (Maybe UserFlair) Source #
Get the authenticated user's current flair for the given subreddit, if such flair exists
setMyFlair :: MonadReddit m => FlairSelection -> m () Source #
Set the flair for the authenticated user, provided that the given subreddit
allows users to perform this action. The text
field is ignored unless it is
Just
and the textEditable
field of the contained FlairChoice
is True
getMySubscribed :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit) Source #
Get a listing of subreddits the currently authenticated user is subscribed to
getMyModerated :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit) Source #
Get a listing of subreddits the currently authenticated user is a mod in
getMyContributing :: MonadReddit m => Paginator SubredditID Subreddit -> m (Listing SubredditID Subreddit) Source #
Get a listing of subreddits the currently authenticated user is an approved user in
getMyMultireddits :: MonadReddit m => m (Seq Multireddit) Source #
Get all of the multireddits of the authenticated user