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.Models.Moderation Class Reference
Inheritance diagram for Reddit.Models.Moderation:
Reddit.Models.BaseModel Reddit.Models.Internal.Request

Public Member Functions

 Moderation (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null)
 
ModActionContainer GetLog (ModerationGetLogInput moderationGetLogInput, string subreddit=null)
 Get a list of recent moderation actions. Moderator actions taken within a subreddit are logged. This listing is a view of that log with various filters to aid in analyzing the information. The optional mod parameter can be a comma-delimited list of moderator names to restrict the results to, or the string a to restrict the results to admin actions taken within the subreddit. The type parameter is optional and if sent limits the log entries returned to only those of the type specified. This endpoint is a listing. More...
 
PostContainer ModQueue (ModerationModQueueInput moderationModQueueInput, string location="modqueue", string subreddit=null)
 Return a listing of posts relevant to moderators. reports: Things that have been reported. spam: Things that have been marked as spam or otherwise removed. modqueue: Things requiring moderator review, such as reported things and items caught by the spam filter. unmoderated: Things that have yet to be approved/removed by a mod. edited: Things that have been edited recently. Requires the "posts" moderator permission for the subreddit. This endpoint is a listing. More...
 
GenericContainer AcceptModeratorInvite (string subreddit=null)
 Accept an invite to moderate the specified subreddit. The authenticated user must have been invited to moderate the subreddit by one of its current moderators. See also: /api/friend and /subreddits/mine. More...
 
async Task< GenericContainerAcceptModeratorInviteAsync (string subreddit=null)
 Asynchronously accept an invite to moderate the specified subreddit. The authenticated user must have been invited to moderate the subreddit by one of its current moderators. See also: /api/friend and /subreddits/mine. More...
 
void Approve (string id)
 Approve a link or comment. If the thing was removed, it will be re-inserted into appropriate listings. Any reports on the approved thing will be discarded. See also: /api/remove. More...
 
async Task ApproveAsync (string id)
 Approve a link or comment asynchronously. If the thing was removed, it will be re-inserted into appropriate listings. Any reports on the approved thing will be discarded. See also: /api/remove. More...
 
Distinguish< T > (ModerationDistinguishInput moderationDistinguishInput)
 Distinguish a thing's author with a sigil. This can be useful to draw attention to and confirm the identity of the user in the context of a link or comment of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish. depends on user. The first time a top-level comment is moderator distinguished, the author of the link the comment is in reply to will get a notification in their inbox. sticky is a boolean flag for comments, which will stick the distingushed comment to the top of all comments threads. If a comment is marked sticky, it will override any other stickied comment for that link (as only one comment may be stickied at a time). Only top-level comments may be stickied. More...
 
async Task< T > DistinguishAsync< T > (ModerationDistinguishInput moderationDistinguishInput)
 Distinguish a thing's author with a sigil asynchronously. This can be useful to draw attention to and confirm the identity of the user in the context of a link or comment of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish. depends on user. The first time a top-level comment is moderator distinguished, the author of the link the comment is in reply to will get a notification in their inbox. sticky is a boolean flag for comments, which will stick the distingushed comment to the top of all comments threads. If a comment is marked sticky, it will override any other stickied comment for that link (as only one comment may be stickied at a time). Only top-level comments may be stickied. More...
 
PostResultContainer DistinguishPost (string how, string id)
 Distinguish a post's author with a sigil. This can be useful to draw attention to and confirm the identity of the user in the context of a link of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish. depends on user. More...
 
async Task< PostResultContainerDistinguishPostAsync (string how, string id)
 Distinguish a post's author with a sigil asynchronously. This can be useful to draw attention to and confirm the identity of the user in the context of a link of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish. depends on user. More...
 
CommentResultContainer DistinguishComment (string how, string id, bool? sticky=null)
 Distinguish a comment's author with a sigil. This can be useful to draw attention to and confirm the identity of the user in the context of a comment of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish.depends on user. The first time a top-level comment is moderator distinguished, the author of the link the comment is in reply to will get a notification in their inbox. sticky is a boolean flag for comments, which will stick the distingushed comment to the top of all comments threads. If a comment is marked sticky, it will override any other stickied comment for that link (as only one comment may be stickied at a time). Only top-level comments may be stickied. More...
 
async Task< CommentResultContainerDistinguishCommentAsync (string how, string id, bool? sticky=null)
 Distinguish a comment's author with a sigil asynchronously. This can be useful to draw attention to and confirm the identity of the user in the context of a comment of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish.depends on user. The first time a top-level comment is moderator distinguished, the author of the link the comment is in reply to will get a notification in their inbox. sticky is a boolean flag for comments, which will stick the distingushed comment to the top of all comments threads. If a comment is marked sticky, it will override any other stickied comment for that link (as only one comment may be stickied at a time). Only top-level comments may be stickied. More...
 
void IgnoreReports (string id)
 Prevent future reports on a thing from causing notifications. Any reports made about a thing after this flag is set on it will not cause notifications or make the thing show up in the various moderation listings. See also: /api/unignore_reports. More...
 
async Task IgnoreReportsAsync (string id)
 Asynchronously future reports on a thing from causing notifications. Any reports made about a thing after this flag is set on it will not cause notifications or make the thing show up in the various moderation listings. See also: /api/unignore_reports. More...
 
void LeaveContributor (string id)
 Abdicate approved submitter status in a subreddit. See also: /api/friend. More...
 
async Task LeaveContributorAsync (string id)
 Abdicate approved submitter status in a subreddit asynchronously. See also: /api/friend. More...
 
void LeaveModerator (string id, string subreddit)
 Abdicate moderator status in a subreddit. See also: /api/friend. More...
 
async Task LeaveModeratorAsync (string id, string subreddit)
 Abdicate moderator status in a subreddit asynchronously. See also: /api/friend. More...
 
object MuteMessageAuthor (string id)
 For muting user via modmail. More...
 
void Remove (ModerationRemoveInput moderationRemoveInput)
 Remove a link, comment, or modmail message. If the thing is a link, it will be removed from all subreddit listings. If the thing is a comment, it will be redacted and removed from all subreddit comment listings. See also: /api/approve. More...
 
async Task RemoveAsync (ModerationRemoveInput moderationRemoveInput)
 Remove a link, comment, or modmail message asynchronously. If the thing is a link, it will be removed from all subreddit listings. If the thing is a comment, it will be redacted and removed from all subreddit comment listings. See also: /api/approve. More...
 
void UnignoreReports (string id)
 Allow future reports on a thing to cause notifications. See also: /api/ignore_reports. More...
 
async Task UnignoreReportsAsync (string id)
 Asynchronously allow future reports on a thing to cause notifications. See also: /api/ignore_reports. More...
 
object UnmuteMessageAuthor (string id)
 For unmuting user via modmail. More...
 
string Stylesheet (string subreddit=null)
 Redirect to the subreddit's stylesheet if one exists. See also: /api/subreddit_stylesheet. More...
 
- Public Member Functions inherited from Reddit.Models.BaseModel
 BaseModel (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null)
 
string Sr (string subreddit)
 
- Public Member Functions inherited from Reddit.Models.Internal.Request
 Request (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null)
 
SendRequest< T > (string url, dynamic parameters, Method method=Method.GET, string contentType="application/x-www-form-urlencoded")
 
async Task< T > SendRequestAsync< T > (string url, dynamic parameters, Method method=Method.GET, string contentType="application/x-www-form-urlencoded")
 
RestRequest PrepareIDRequest (string path, string id, Method method=Method.POST)
 
RestRequest PrepareJSONRequest (string path, Method method=Method.POST)
 
RestRequest PrepareRequest (string url, Method method=Method.GET, string contentType="application/x-www-form-urlencoded")
 
RestRequest PrepareRequest (string url, Method method, List< Parameter > parameters, List< FileParameter > files, string contentType="application/x-www-form-urlencoded")
 
RestRequest PrepareRequest (RestRequest restRequest, string contentType="application/x-www-form-urlencoded")
 
string GetVersion ()
 
string ExecuteRequest (string url, Method method=Method.GET)
 
async Task< string > ExecuteRequestAsync (string url, Method method=Method.GET)
 
string ExecuteRequest (RestRequest restRequest)
 
async Task< string > ExecuteRequestAsync (RestRequest restRequest)
 
void UpdateAccessToken (string accessToken)
 
void UpdateRequests (List< DateTime > requests)
 
void AddParamIfNotNull (string name, dynamic value, ref RestRequest restRequest)
 

Additional Inherited Members

- Protected Member Functions inherited from Reddit.Models.Internal.Request
virtual void OnTokenUpdated (TokenUpdateEventArgs e)
 
virtual void OnRequestsUpdated (RequestsUpdateEventArgs e)
 
- Events inherited from Reddit.Models.Internal.Request
EventHandler< TokenUpdateEventArgsTokenUpdated
 
EventHandler< RequestsUpdateEventArgsRequestsUpdated
 

Constructor & Destructor Documentation

◆ Moderation()

Reddit.Models.Moderation.Moderation ( string  appId,
string  appSecret,
string  refreshToken,
string  accessToken,
ref RestClient  restClient,
string  deviceId = null,
string  userAgent = null 
)

Member Function Documentation

◆ AcceptModeratorInvite()

GenericContainer Reddit.Models.Moderation.AcceptModeratorInvite ( string  subreddit = null)

Accept an invite to moderate the specified subreddit. The authenticated user must have been invited to moderate the subreddit by one of its current moderators. See also: /api/friend and /subreddits/mine.

Parameters
subredditThe subreddit being moderated
Returns
A generic response object indicating any errors.

◆ AcceptModeratorInviteAsync()

async Task<GenericContainer> Reddit.Models.Moderation.AcceptModeratorInviteAsync ( string  subreddit = null)

Asynchronously accept an invite to moderate the specified subreddit. The authenticated user must have been invited to moderate the subreddit by one of its current moderators. See also: /api/friend and /subreddits/mine.

Parameters
subredditThe subreddit being moderated
Returns
A generic response object indicating any errors.

◆ Approve()

void Reddit.Models.Moderation.Approve ( string  id)

Approve a link or comment. If the thing was removed, it will be re-inserted into appropriate listings. Any reports on the approved thing will be discarded. See also: /api/remove.

Parameters
idfullname of a thing

◆ ApproveAsync()

async Task Reddit.Models.Moderation.ApproveAsync ( string  id)

Approve a link or comment asynchronously. If the thing was removed, it will be re-inserted into appropriate listings. Any reports on the approved thing will be discarded. See also: /api/remove.

Parameters
idfullname of a thing

◆ Distinguish< T >()

T Reddit.Models.Moderation.Distinguish< T > ( ModerationDistinguishInput  moderationDistinguishInput)

Distinguish a thing's author with a sigil. This can be useful to draw attention to and confirm the identity of the user in the context of a link or comment of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish. depends on user. The first time a top-level comment is moderator distinguished, the author of the link the comment is in reply to will get a notification in their inbox. sticky is a boolean flag for comments, which will stick the distingushed comment to the top of all comments threads. If a comment is marked sticky, it will override any other stickied comment for that link (as only one comment may be stickied at a time). Only top-level comments may be stickied.

Parameters
moderationDistinguishInputA valid ModerationDistinguishInput instance
Returns
The distinguished post or comment object.

◆ DistinguishAsync< T >()

async Task<T> Reddit.Models.Moderation.DistinguishAsync< T > ( ModerationDistinguishInput  moderationDistinguishInput)

Distinguish a thing's author with a sigil asynchronously. This can be useful to draw attention to and confirm the identity of the user in the context of a link or comment of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish. depends on user. The first time a top-level comment is moderator distinguished, the author of the link the comment is in reply to will get a notification in their inbox. sticky is a boolean flag for comments, which will stick the distingushed comment to the top of all comments threads. If a comment is marked sticky, it will override any other stickied comment for that link (as only one comment may be stickied at a time). Only top-level comments may be stickied.

Parameters
moderationDistinguishInputA valid ModerationDistinguishInput instance
Returns
The distinguished post or comment object.

◆ DistinguishComment()

CommentResultContainer Reddit.Models.Moderation.DistinguishComment ( string  how,
string  id,
bool?  sticky = null 
)

Distinguish a comment's author with a sigil. This can be useful to draw attention to and confirm the identity of the user in the context of a comment of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish.depends on user. The first time a top-level comment is moderator distinguished, the author of the link the comment is in reply to will get a notification in their inbox. sticky is a boolean flag for comments, which will stick the distingushed comment to the top of all comments threads. If a comment is marked sticky, it will override any other stickied comment for that link (as only one comment may be stickied at a time). Only top-level comments may be stickied.

Parameters
howone of (yes, no, admin, special)
idfullname of a thing
stickyboolean value
Returns
The distinguished comment object.

◆ DistinguishCommentAsync()

async Task<CommentResultContainer> Reddit.Models.Moderation.DistinguishCommentAsync ( string  how,
string  id,
bool?  sticky = null 
)

Distinguish a comment's author with a sigil asynchronously. This can be useful to draw attention to and confirm the identity of the user in the context of a comment of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish.depends on user. The first time a top-level comment is moderator distinguished, the author of the link the comment is in reply to will get a notification in their inbox. sticky is a boolean flag for comments, which will stick the distingushed comment to the top of all comments threads. If a comment is marked sticky, it will override any other stickied comment for that link (as only one comment may be stickied at a time). Only top-level comments may be stickied.

Parameters
howone of (yes, no, admin, special)
idfullname of a thing
stickyboolean value
Returns
The distinguished comment object.

◆ DistinguishPost()

PostResultContainer Reddit.Models.Moderation.DistinguishPost ( string  how,
string  id 
)

Distinguish a post's author with a sigil. This can be useful to draw attention to and confirm the identity of the user in the context of a link of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish. depends on user.

Parameters
howone of (yes, no, admin, special)
idfullname of a thing
Returns
The distinguished post object.

◆ DistinguishPostAsync()

async Task<PostResultContainer> Reddit.Models.Moderation.DistinguishPostAsync ( string  how,
string  id 
)

Distinguish a post's author with a sigil asynchronously. This can be useful to draw attention to and confirm the identity of the user in the context of a link of theirs. The options for distinguish are as follows: yes - add a moderator distinguish([M]). only if the user is a moderator of the subreddit the thing is in. no - remove any distinguishes. admin - add an admin distinguish([A]). admin accounts only. special - add a user-specific distinguish. depends on user.

Parameters
howone of (yes, no, admin, special)
idfullname of a thing
Returns
The distinguished post object.

◆ GetLog()

ModActionContainer Reddit.Models.Moderation.GetLog ( ModerationGetLogInput  moderationGetLogInput,
string  subreddit = null 
)

Get a list of recent moderation actions. Moderator actions taken within a subreddit are logged. This listing is a view of that log with various filters to aid in analyzing the information. The optional mod parameter can be a comma-delimited list of moderator names to restrict the results to, or the string a to restrict the results to admin actions taken within the subreddit. The type parameter is optional and if sent limits the log entries returned to only those of the type specified. This endpoint is a listing.

Parameters
moderationGetLogInputA valid ModerationGetLogInput instance
subredditThe subreddit being moderated
Returns
A listing of recent moderation actions.

◆ IgnoreReports()

void Reddit.Models.Moderation.IgnoreReports ( string  id)

Prevent future reports on a thing from causing notifications. Any reports made about a thing after this flag is set on it will not cause notifications or make the thing show up in the various moderation listings. See also: /api/unignore_reports.

Parameters
idfullname of a thing

◆ IgnoreReportsAsync()

async Task Reddit.Models.Moderation.IgnoreReportsAsync ( string  id)

Asynchronously future reports on a thing from causing notifications. Any reports made about a thing after this flag is set on it will not cause notifications or make the thing show up in the various moderation listings. See also: /api/unignore_reports.

Parameters
idfullname of a thing

◆ LeaveContributor()

void Reddit.Models.Moderation.LeaveContributor ( string  id)

Abdicate approved submitter status in a subreddit. See also: /api/friend.

Parameters
idfullname of a thing

◆ LeaveContributorAsync()

async Task Reddit.Models.Moderation.LeaveContributorAsync ( string  id)

Abdicate approved submitter status in a subreddit asynchronously. See also: /api/friend.

Parameters
idfullname of a thing

◆ LeaveModerator()

void Reddit.Models.Moderation.LeaveModerator ( string  id,
string  subreddit 
)

Abdicate moderator status in a subreddit. See also: /api/friend.

Parameters
fullnamefullname of the abdicating user
subredditThe name of the subreddit being abdicated

◆ LeaveModeratorAsync()

async Task Reddit.Models.Moderation.LeaveModeratorAsync ( string  id,
string  subreddit 
)

Abdicate moderator status in a subreddit asynchronously. See also: /api/friend.

Parameters
fullnamefullname of the abdicating user
subredditThe name of the subreddit being abdicated

◆ ModQueue()

PostContainer Reddit.Models.Moderation.ModQueue ( ModerationModQueueInput  moderationModQueueInput,
string  location = "modqueue",
string  subreddit = null 
)

Return a listing of posts relevant to moderators. reports: Things that have been reported. spam: Things that have been marked as spam or otherwise removed. modqueue: Things requiring moderator review, such as reported things and items caught by the spam filter. unmoderated: Things that have yet to be approved/removed by a mod. edited: Things that have been edited recently. Requires the "posts" moderator permission for the subreddit. This endpoint is a listing.

Parameters
locationOne of (reports, spam, modqueue, unmoderated, edited)
moderationModQueueInputA valid ModerationModQueueInput instance
subredditThe subreddit being moderated
Returns
A listing of posts relevant to moderators.

◆ MuteMessageAuthor()

object Reddit.Models.Moderation.MuteMessageAuthor ( string  id)

For muting user via modmail.

Parameters
idfullname of a thing
Returns
(TODO - Untested)

◆ Remove()

void Reddit.Models.Moderation.Remove ( ModerationRemoveInput  moderationRemoveInput)

Remove a link, comment, or modmail message. If the thing is a link, it will be removed from all subreddit listings. If the thing is a comment, it will be redacted and removed from all subreddit comment listings. See also: /api/approve.

Parameters
moderationRemoveInputA valid ModerationRemoveInput instance

◆ RemoveAsync()

async Task Reddit.Models.Moderation.RemoveAsync ( ModerationRemoveInput  moderationRemoveInput)

Remove a link, comment, or modmail message asynchronously. If the thing is a link, it will be removed from all subreddit listings. If the thing is a comment, it will be redacted and removed from all subreddit comment listings. See also: /api/approve.

Parameters
moderationRemoveInputA valid ModerationRemoveInput instance

◆ Stylesheet()

string Reddit.Models.Moderation.Stylesheet ( string  subreddit = null)

Redirect to the subreddit's stylesheet if one exists. See also: /api/subreddit_stylesheet.

Parameters
subredditThe subreddit being moderated
Returns
The subreddit's CSS.

◆ UnignoreReports()

void Reddit.Models.Moderation.UnignoreReports ( string  id)

Allow future reports on a thing to cause notifications. See also: /api/ignore_reports.

Parameters
idfullname of a thing

◆ UnignoreReportsAsync()

async Task Reddit.Models.Moderation.UnignoreReportsAsync ( string  id)

Asynchronously allow future reports on a thing to cause notifications. See also: /api/ignore_reports.

Parameters
idfullname of a thing

◆ UnmuteMessageAuthor()

object Reddit.Models.Moderation.UnmuteMessageAuthor ( string  id)

For unmuting user via modmail.

Parameters
idfullname of a thing
Returns
(TODO - Untested)

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