Reddit.NET  1.5
Reddit.NET is a .NET Standard library that provides easy access to the Reddit API with virtually no boilerplate code required.
Reddit.Controllers.Account Class Reference

Controller class for tasks pertaining to the authenticated user. More...

Inheritance diagram for Reddit.Controllers.Account:
Reddit.Controllers.BaseController Reddit.Controllers.Internal.Validators

Public Member Functions

 Account (Dispatch dispatch)
 Creates a new Account instance. Note that this is already taken care of in the main class. More...
 
User GetMe ()
 Returns a User instance with the data returned from a call to the "me" endpoint. More...
 
List< UserKarmaKarma ()
 Return a breakdown of subreddit karma. More...
 
AccountPrefs Prefs ()
 Return the preference settings of the logged in user. More...
 
AccountPrefs UpdatePrefs (AccountPrefsSubmit accountPrefs)
 Update preferences. More...
 
async Task< AccountPrefsUpdatePrefsAsync (AccountPrefsSubmit accountPrefs)
 Update preferences asynchronously. More...
 
List< AwardTrophies ()
 Return a list of trophies for the current user. More...
 
List< UserPrefsFriends (int limit=25, string after="", string before="", string show="all", bool srDetail=false, bool includeCategories=false, int count=0)
 Get users whom the current user has friended. More...
 
List< UserPrefsMessaging (int limit=25, string after="", string before="", string show="all", bool srDetail=false, bool includeCategories=false, int count=0)
 Get users with whom the current user is messaging. More...
 
List< UserPrefsBlocked (int limit=25, string after="", string before="", string show="all", bool srDetail=false, bool includeCategories=false, int count=0)
 Get users whom the current user has blocked. More...
 
List< UserPrefsTrusted (int limit=25, string after="", string before="", string show="all", bool srDetail=false, bool includeCategories=false, int count=0)
 Get users whom the current user has trusted. More...
 
void DeleteFriend (string username)
 Stop being friends with a user. More...
 
async Task DeleteFriendAsync (string username)
 Asynchronously stop being friends with a user. More...
 
UserActionResult GetFriend (string username)
 Get information about a specific 'friend', such as notes. More...
 
UserActionResult UpdateFriend (string username, string json="{}")
 Create or update a "friend" relationship. This operation is idempotent. It can be used to add a new friend, or update an existing friend (e.g., add/change the note on that friend). The JSON fields can only be included if you have a Reddit Gold subscription, for some reason. More...
 
async Task UpdateFriendAsync (string username, string json="{}")
 Create or update a "friend" relationship asynchronously. This operation is idempotent. It can be used to add a new friend, or update an existing friend (e.g., add/change the note on that friend). The JSON fields can only be included if you have a Reddit Gold subscription, for some reason. More...
 
List< LabeledMultiMultis (bool expandSrs=false)
 Fetch a list of multis belonging to the current user. More...
 
List< SubredditMySubscribedSubreddits (int limit=25, string after="", string before="", string show="all", bool srDetail=true, bool includeCategories=false, int count=0)
 Get subreddits that the current user is subscribed to. More...
 
List< SubredditMyContributingSubreddits (int limit=25, string after="", string before="", string show="all", bool srDetail=true, bool includeCategories=false, int count=0)
 Get subreddits that the current user is an approved submitter in. More...
 
List< SubredditMyModeratorSubreddits (int limit=25, string after="", string before="", string show="all", bool srDetail=true, bool includeCategories=false, int count=0)
 Get subreddits that the current user is a moderator of. More...
 
List< SubredditMyStreamingSubreddits (int limit=25, string after="", string before="", string show="all", bool srDetail=true, bool includeCategories=false, int count=0)
 Get subreddits that the current user is subscribed to that contain hosted video links. More...
 
Dictionary< string, ModmailSubredditModmailSubreddits ()
 Returns a list of srs that the user moderates that are also enrolled in the new modmail. More...
 
ModmailUnreadCount ModmailUnreadCount ()
 Endpoint to retrieve the unread conversation count by conversation state. More...
 
void AcceptLiveThreadInvite (string thread)
 Accept a pending invitation to contribute to a live thread. More...
 
async Task AcceptLiveThreadInviteAsync (string thread)
 Asynchronously accept a pending invitation to contribute to a live thread. More...
 
void AbandonLiveThread (string thread)
 Abdicate contributorship of the thread. More...
 
async Task AbandonLiveThreadAsync (string thread)
 Abdicate contributorship of the thread asynchronously. More...
 
- Public Member Functions inherited from Reddit.Controllers.BaseController
 BaseController ()
 Create a new Controller instance. More...
 
- Public Member Functions inherited from Reddit.Controllers.Internal.Validators
Exception BuildException (Exception ex, List< List< string >> errors)
 
dynamic Validate (dynamic obj)
 
GenericContainer Validate (GenericContainer genericContainer)
 
Generic Validate (Generic generic)
 
DynamicShortListingContainer Validate (DynamicShortListingContainer dynamicShortListingContainer)
 
DynamicShortListingData Validate (DynamicShortListingData dynamicShortListingData)
 
ImageUploadResult Validate (ImageUploadResult imageUploadResult)
 
LiveUpdateEventContainer Validate (LiveUpdateEventContainer liveUpdateEventContainer)
 
LiveThreadCreateResultContainer Validate (LiveThreadCreateResultContainer liveThreadCreateResultContainer)
 
LiveUpdateContainer Validate (LiveUpdateContainer liveUpdateContainer, int? minChildren=null)
 
SubredditSettingsContainer Validate (SubredditSettingsContainer subredditSettingsContainer)
 
SubredditSettings Validate (SubredditSettings subredditSettings)
 
List< ActionResultValidate (List< ActionResult > actionResults)
 
ActionResult Validate (ActionResult actionResult)
 
FlairListResultContainer Validate (FlairListResultContainer flairListResultContainer)
 
Flair Validate (Flair flair)
 
FlairV2 Validate (FlairV2 flairV2)
 
ModActionContainer Validate (ModActionContainer modActionContainer)
 
ModActionData Validate (ModActionData modActionData)
 
WikiPageRevisionContainer Validate (WikiPageRevisionContainer wikiPageRevisionContainer)
 
WikiPageRevisionData Validate (WikiPageRevisionData wikiPageRevisionData)
 
WikiPageSettingsContainer Validate (WikiPageSettingsContainer wikiPageSettingsContainer)
 
WikiPageSettings Validate (WikiPageSettings wikiPageSettings)
 
List< UserPrefsContainerValidate (List< UserPrefsContainer > userPrefsContainers)
 
UserPrefsContainer Validate (UserPrefsContainer userPrefsContainer)
 
UserPrefsData Validate (UserPrefsData userPrefsData)
 
PostResultShortContainer Validate (PostResultShortContainer postResultShortContainer)
 
PostResultShort Validate (PostResultShort postResultShort)
 
PostResultContainer Validate (PostResultContainer postResultContainer)
 
PostResult Validate (PostResult postResult)
 
JQueryReturn Validate (JQueryReturn jQueryReturn)
 
List<(PostContainer, CommentContainer)> Validate (List<(PostContainer, CommentContainer)> ps)
 
CommentResultContainer Validate (CommentResultContainer commentResultContainer)
 
SubredditContainer Validate (SubredditContainer subredditContainer)
 

Public Attributes

Dispatch Dispatch
 Allows direct access to the Models. More...
 

Properties

UserMe [get, set]
 The authenticated user's data. More...
 
PrivateMessages?? Messages [get, set]
 The authenticated user's private messages. More...
 
Modmail?? Modmail [get, set]
 The authenticated user's modmail conversations. More...
 
- Properties inherited from Reddit.Controllers.BaseController
Lists Lists [get, set]
 List-handling. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Reddit.Controllers.Internal.Validators
void CheckErrors (List< List< string >> errors)
 
void CheckErrors (List< string > errors)
 
void CheckNull (object res, string msg="Reddit API returned null response.")
 

Detailed Description

Controller class for tasks pertaining to the authenticated user.

Constructor & Destructor Documentation

◆ Account()

Reddit.Controllers.Account.Account ( Dispatch  dispatch)

Creates a new Account instance. Note that this is already taken care of in the main class.

Parameters
dispatch

Member Function Documentation

◆ AbandonLiveThread()

void Reddit.Controllers.Account.AbandonLiveThread ( string  thread)

Abdicate contributorship of the thread.

Parameters
threadid

◆ AbandonLiveThreadAsync()

async Task Reddit.Controllers.Account.AbandonLiveThreadAsync ( string  thread)

Abdicate contributorship of the thread asynchronously.

Parameters
threadid

◆ AcceptLiveThreadInvite()

void Reddit.Controllers.Account.AcceptLiveThreadInvite ( string  thread)

Accept a pending invitation to contribute to a live thread.

Parameters
threadid

◆ AcceptLiveThreadInviteAsync()

async Task Reddit.Controllers.Account.AcceptLiveThreadInviteAsync ( string  thread)

Asynchronously accept a pending invitation to contribute to a live thread.

Parameters
threadid

◆ Blocked()

List<UserPrefs> Reddit.Controllers.Account.Blocked ( int  limit = 25,
string  after = "",
string  before = "",
string  show = "all",
bool  srDetail = false,
bool  includeCategories = false,
int  count = 0 
)

Get users whom the current user has blocked.

Parameters
limitthe maximum number of items desired (default: 25, maximum: 100)
afterfullname of a thing
beforefullname of a thing
show(optional) the string all
srDetail(optional) expand subreddits
includeCategoriesboolean value
counta positive integer (default: 0)
Returns
A list of users.

◆ DeleteFriend()

void Reddit.Controllers.Account.DeleteFriend ( string  username)

Stop being friends with a user.

Parameters
usernameA valid, existing reddit username

◆ DeleteFriendAsync()

async Task Reddit.Controllers.Account.DeleteFriendAsync ( string  username)

Asynchronously stop being friends with a user.

Parameters
usernameA valid, existing reddit username

◆ Friends()

List<UserPrefs> Reddit.Controllers.Account.Friends ( int  limit = 25,
string  after = "",
string  before = "",
string  show = "all",
bool  srDetail = false,
bool  includeCategories = false,
int  count = 0 
)

Get users whom the current user has friended.

Parameters
limitthe maximum number of items desired (default: 25, maximum: 100)
afterfullname of a thing
beforefullname of a thing
show(optional) the string all
srDetail(optional) expand subreddits
includeCategoriesboolean value
counta positive integer (default: 0)
Returns
A list of users.

◆ GetFriend()

UserActionResult Reddit.Controllers.Account.GetFriend ( string  username)

Get information about a specific 'friend', such as notes.

Parameters
usernameA valid, existing reddit username
Returns
An object containing basic info on the target user and the datetime of this action.

◆ GetMe()

User Reddit.Controllers.Account.GetMe ( )

Returns a User instance with the data returned from a call to the "me" endpoint.

◆ Karma()

List<UserKarma> Reddit.Controllers.Account.Karma ( )

Return a breakdown of subreddit karma.

Returns
A breakdown of subreddit karma.

◆ Messaging()

List<UserPrefs> Reddit.Controllers.Account.Messaging ( int  limit = 25,
string  after = "",
string  before = "",
string  show = "all",
bool  srDetail = false,
bool  includeCategories = false,
int  count = 0 
)

Get users with whom the current user is messaging.

Parameters
limitthe maximum number of items desired (default: 25, maximum: 100)
afterfullname of a thing
beforefullname of a thing
show(optional) the string all
srDetail(optional) expand subreddits
includeCategoriesboolean value
counta positive integer (default: 0)
Returns
A list of users.

◆ ModmailSubreddits()

Dictionary<string, ModmailSubreddit> Reddit.Controllers.Account.ModmailSubreddits ( )

Returns a list of srs that the user moderates that are also enrolled in the new modmail.

Returns
A list of subreddits.

◆ ModmailUnreadCount()

ModmailUnreadCount Reddit.Controllers.Account.ModmailUnreadCount ( )

Endpoint to retrieve the unread conversation count by conversation state.

Returns
An object with the int properties: highlighted, notifications, archived, new, inprogress, and mod.

◆ Multis()

List<LabeledMulti> Reddit.Controllers.Account.Multis ( bool  expandSrs = false)

Fetch a list of multis belonging to the current user.

Parameters
expandSrsboolean value
Returns
A list of multis.

◆ MyContributingSubreddits()

List<Subreddit> Reddit.Controllers.Account.MyContributingSubreddits ( int  limit = 25,
string  after = "",
string  before = "",
string  show = "all",
bool  srDetail = true,
bool  includeCategories = false,
int  count = 0 
)

Get subreddits that the current user is an approved submitter in.

Parameters
limitthe maximum number of items desired (default: 25, maximum: 100)
afterfullname of a thing
beforefullname of a thing
show(optional) the string all
srDetail(optional) expand subreddits
includeCategoriesboolean value
counta positive integer (default: 0)
Returns
A list of Subreddit objects.

◆ MyModeratorSubreddits()

List<Subreddit> Reddit.Controllers.Account.MyModeratorSubreddits ( int  limit = 25,
string  after = "",
string  before = "",
string  show = "all",
bool  srDetail = true,
bool  includeCategories = false,
int  count = 0 
)

Get subreddits that the current user is a moderator of.

Parameters
limitthe maximum number of items desired (default: 25, maximum: 100)
afterfullname of a thing
beforefullname of a thing
show(optional) the string all
srDetail(optional) expand subreddits
includeCategoriesboolean value
counta positive integer (default: 0)
Returns
A list of Subreddit objects.

◆ MyStreamingSubreddits()

List<Subreddit> Reddit.Controllers.Account.MyStreamingSubreddits ( int  limit = 25,
string  after = "",
string  before = "",
string  show = "all",
bool  srDetail = true,
bool  includeCategories = false,
int  count = 0 
)

Get subreddits that the current user is subscribed to that contain hosted video links.

Parameters
limitthe maximum number of items desired (default: 25, maximum: 100)
afterfullname of a thing
beforefullname of a thing
show(optional) the string all
srDetail(optional) expand subreddits
includeCategoriesboolean value
counta positive integer (default: 0)
Returns
A list of Subreddit objects.

◆ MySubscribedSubreddits()

List<Subreddit> Reddit.Controllers.Account.MySubscribedSubreddits ( int  limit = 25,
string  after = "",
string  before = "",
string  show = "all",
bool  srDetail = true,
bool  includeCategories = false,
int  count = 0 
)

Get subreddits that the current user is subscribed to.

Parameters
limitthe maximum number of items desired (default: 25, maximum: 100)
afterfullname of a thing
beforefullname of a thing
show(optional) the string all
srDetail(optional) expand subreddits
includeCategoriesboolean value
counta positive integer (default: 0)
Returns
A list of Subreddit objects.

◆ Prefs()

AccountPrefs Reddit.Controllers.Account.Prefs ( )

Return the preference settings of the logged in user.

Returns
The preference settings of the logged in user.

◆ Trophies()

List<Award> Reddit.Controllers.Account.Trophies ( )

Return a list of trophies for the current user.

Returns
A list of trophies for the current user.

◆ Trusted()

List<UserPrefs> Reddit.Controllers.Account.Trusted ( int  limit = 25,
string  after = "",
string  before = "",
string  show = "all",
bool  srDetail = false,
bool  includeCategories = false,
int  count = 0 
)

Get users whom the current user has trusted.

Parameters
limitthe maximum number of items desired (default: 25, maximum: 100)
afterfullname of a thing
beforefullname of a thing
show(optional) the string all
srDetail(optional) expand subreddits
includeCategoriesboolean value
counta positive integer (default: 0)
Returns
A list of users.

◆ UpdateFriend()

UserActionResult Reddit.Controllers.Account.UpdateFriend ( string  username,
string  json = "{}" 
)

Create or update a "friend" relationship. This operation is idempotent. It can be used to add a new friend, or update an existing friend (e.g., add/change the note on that friend). The JSON fields can only be included if you have a Reddit Gold subscription, for some reason.

Parameters
usernameA valid, existing reddit username
json{ "name": A valid, existing reddit username "note": a string no longer than 300 characters }
Returns
An object containing basic info on the target user and the datetime of this action.

◆ UpdateFriendAsync()

async Task Reddit.Controllers.Account.UpdateFriendAsync ( string  username,
string  json = "{}" 
)

Create or update a "friend" relationship asynchronously. This operation is idempotent. It can be used to add a new friend, or update an existing friend (e.g., add/change the note on that friend). The JSON fields can only be included if you have a Reddit Gold subscription, for some reason.

Parameters
usernameA valid, existing reddit username
json{ "name": A valid, existing reddit username "note": a string no longer than 300 characters }

◆ UpdatePrefs()

AccountPrefs Reddit.Controllers.Account.UpdatePrefs ( AccountPrefsSubmit  accountPrefs)

Update preferences.

Parameters
accountPrefsA valid AccountPrefs instance.
Returns
The updated preference settings of the logged in user.

◆ UpdatePrefsAsync()

async Task<AccountPrefs> Reddit.Controllers.Account.UpdatePrefsAsync ( AccountPrefsSubmit  accountPrefs)

Update preferences asynchronously.

Parameters
accountPrefsA valid AccountPrefs instance.

Member Data Documentation

◆ Dispatch

Dispatch Reddit.Controllers.Account.Dispatch

Allows direct access to the Models.

Property Documentation

◆ Me

User? Reddit.Controllers.Account.Me
getset

The authenticated user's data.

◆ Messages

PrivateMessages?? Reddit.Controllers.Account.Messages
getset

The authenticated user's private messages.

◆ Modmail

Modmail?? Reddit.Controllers.Account.Modmail
getset

The authenticated user's modmail conversations.


The documentation for this class was generated from the following file: