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.Post Class Reference

Base controller for posts. More...

Inheritance diagram for Reddit.Controllers.Post:
Reddit.Controllers.Internal.Monitors Reddit.Controllers.BaseController Reddit.Controllers.Internal.Validators Reddit.Controllers.LinkPost Reddit.Controllers.SelfPost

Public Member Functions

 Post (Dispatch dispatch, Things.Post listing)
 Create a new post controller instance from API return data. More...
 
 Post (Dispatch dispatch, string subreddit, string title=null, string author=null, string id=null, string fullname=null, string permalink=null, DateTime created=default(DateTime), DateTime edited=default(DateTime), int score=0, int upVotes=0, int downVotes=0, bool removed=false, bool spam=false, bool nsfw=false)
 Create a new post controller instance, populated manually. More...
 
 Post (Dispatch dispatch, string fullname)
 Create a new post controller instance, populated with only its fullname. More...
 
 Post (Dispatch dispatch, string fullname, string subreddit)
 Create a new post controller instance, populated with only its fullname and subreddit. More...
 
 Post (Dispatch dispatch)
 Create an empty post controller instance. More...
 
void SetTitle (string value)
 Set the title manually without any automatic decoding. More...
 
Comment Comment (string body, string bodyHtml=null, string author=null, string collapsedReason=null, bool collapsed=false, bool isSubmitter=false, List< Comment > replies=null, List< More > more=null, bool scoreHidden=false, int depth=0, string id=null, string fullname=null, string permalink=null, DateTime created=default(DateTime), DateTime edited=default(DateTime), int score=0, int upVotes=0, int downVotes=0, bool removed=false, bool spam=false)
 Create a new comment controller instance bound to this post, populated manually. More...
 
Comment Comment ()
 Create a new comment controller instance bound to this post. More...
 
Comment Reply (string body, string bodyHtml=null, string author=null, string collapsedReason=null, bool collapsed=false, bool isSubmitter=false, List< Comment > replies=null, List< More > more=null, bool scoreHidden=false, int depth=0, string id=null, string fullname=null, string permalink=null, DateTime created=default(DateTime), DateTime edited=default(DateTime), int score=0, int upVotes=0, int downVotes=0, bool removed=false, bool spam=false)
 Reply with a comment to this post. More...
 
async Task< CommentReplyAsync (string body, string bodyHtml=null, string author=null, string collapsedReason=null, bool collapsed=false, bool isSubmitter=false, List< Comment > replies=null, List< More > more=null, bool scoreHidden=false, int depth=0, string id=null, string fullname=null, string permalink=null, DateTime created=default(DateTime), DateTime edited=default(DateTime), int score=0, int upVotes=0, int downVotes=0, bool removed=false, bool spam=false)
 Reply with a comment to this post asynchronously. More...
 
Post About ()
 Return information about the current Post instance. More...
 
Post Info ()
 Return information about the current Post instance via the api/info endpoint. More...
 
void SetFlair (string flairText="", string flairTemplateId="")
 Sets the link flair. More...
 
void SetFlair (FlairSelectFlairInput flairSelectFlairInput)
 Sets the link flair. More...
 
Post Distinguish (string how)
 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< PostDistinguishAsync (string how)
 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...
 
void Remove (bool spam=false)
 Remove this post from all subreddit listings. More...
 
async Task RemoveAsync (bool spam=false)
 Asynchronously remove this post from all subreddit listings. More...
 
void Delete ()
 Delete this post. More...
 
async Task DeleteAsync ()
 Delete this post asynchronously. More...
 
void Hide ()
 Hide this post. This removes it from the user's default view of subreddit listings. More...
 
async Task HideAsync ()
 Hide this post asynchronously. This removes it from the user's default view of subreddit listings. More...
 
void Lock ()
 Lock this post. Prevents a post from receiving new comments. More...
 
async Task LockAsync ()
 Lock this post asynchronously. Prevents a post from receiving new comments. More...
 
void MarkNSFW ()
 Mark this post as NSFW. More...
 
async Task MarkNSFWAsync ()
 Mark this post as NSFW asynchronously. More...
 
MoreChildren MoreChildren (string children, bool limitChildren, string sort, string id=null)
 Retrieve additional comments omitted from a base comment tree. When a comment tree is rendered, the most relevant comments are selected for display first. Remaining comments are stubbed out with "MoreComments" links. This API call is used to retrieve the additional comments represented by those stubs, up to 100 at a time. The two core parameters required are link and children. link is the fullname of the link whose comments are being fetched. children is a comma-delimited list of comment ID36s that need to be fetched. If id is passed, it should be the ID of the MoreComments object this call is replacing. This is needed only for the HTML UI's purposes and is optional otherwise. NOTE: you may only make one request at a time to this API endpoint. Higher concurrency will result in an error being returned. If limit_children is True, only return the children requested. More...
 
MoreChildren MoreChildren (LinksAndCommentsMoreChildrenInput linksAndCommentsMoreChildrenInput)
 Retrieve additional comments omitted from a base comment tree. When a comment tree is rendered, the most relevant comments are selected for display first. Remaining comments are stubbed out with "MoreComments" links. This API call is used to retrieve the additional comments represented by those stubs, up to 100 at a time. The two core parameters required are link and children. link is the fullname of the link whose comments are being fetched. children is a comma-delimited list of comment ID36s that need to be fetched. If id is passed, it should be the ID of the MoreComments object this call is replacing. This is needed only for the HTML UI's purposes and is optional otherwise. NOTE: you may only make one request at a time to this API endpoint. Higher concurrency will result in an error being returned. If limit_children is True, only return the children requested. More...
 
void Report (string additionalInfo, string banEvadingAccountsNames, string customText, bool fromHelpCenter, string otherReason, string reason, string ruleReason, string siteReason, string violatorUsername)
 Report this post to the subreddit moderators. The post then becomes implicitly hidden, as well. More...
 
async Task ReportAsync (string additionalInfo, string banEvadingAccountsNames, string customText, bool fromHelpCenter, string otherReason, string reason, string ruleReason, string siteReason, string violatorUsername)
 Report this post to the subreddit moderators asynchronously. The post then becomes implicitly hidden, as well. More...
 
void Report (LinksAndCommentsReportInput linksAndCommentsReportInput)
 Report this post to the subreddit moderators. The post then becomes implicitly hidden, as well. More...
 
async Task ReportAsync (LinksAndCommentsReportInput linksAndCommentsReportInput)
 Report this post to the subreddit moderators asynchronously. The post then becomes implicitly hidden, as well. More...
 
void Save (string category)
 Save this post. Saved things are kept in the user's saved listing for later perusal. More...
 
async Task SaveAsync (string category)
 Save this post asynchronously. Saved things are kept in the user's saved listing for later perusal. More...
 
void EnableSendReplies ()
 Enable inbox replies for this post. More...
 
async Task EnableSendRepliesAsync ()
 Enable inbox replies for this post asynchronously. More...
 
void DisableSendReplies ()
 Disable inbox replies for this post. More...
 
async Task DisableSendRepliesAsync ()
 Disable inbox replies for this post asynchronously. More...
 
void EnableContestMode ()
 Enable contest mode for this post. More...
 
async Task EnableContestModeAsync ()
 Enable contest mode for this post asynchronously. More...
 
void DisableContestMode ()
 Disable contest mode for this post. More...
 
async Task DisableContestModeAsync ()
 Disable contest mode for this post asynchronously. More...
 
void SetSubredditSticky (int num, bool toProfile)
 Set this post as the sticky in its subreddit. The num argument is optional, and only used when stickying a post. It allows specifying a particular "slot" to sticky the post into, and if there is already a post stickied in that slot it will be replaced. If there is no post in the specified slot to replace, or num is None, the bottom-most slot will be used. More...
 
async Task SetSubredditStickyAsync (int num, bool toProfile)
 Set this post as the sticky in its subreddit asynchronously. The num argument is optional, and only used when stickying a post. It allows specifying a particular "slot" to sticky the post into, and if there is already a post stickied in that slot it will be replaced. If there is no post in the specified slot to replace, or num is None, the bottom-most slot will be used. More...
 
void UnsetSubredditSticky (int num, bool toProfile)
 Unset this post as the sticky in its subreddit. The num argument is optional, and only used when stickying a post. It allows specifying a particular "slot" to sticky the post into, and if there is already a post stickied in that slot it will be replaced. If there is no post in the specified slot to replace, or num is None, the bottom-most slot will be used. More...
 
async Task UnsetSubredditStickyAsync (int num, bool toProfile)
 Unset this post as the sticky in its subreddit asynchronously. The num argument is optional, and only used when stickying a post. It allows specifying a particular "slot" to sticky the post into, and if there is already a post stickied in that slot it will be replaced. If there is no post in the specified slot to replace, or num is None, the bottom-most slot will be used. More...
 
void SetSuggestedSort (string sort)
 Set a suggested sort for this post. Suggested sorts are useful to display comments in a certain preferred way for posts. For example, casual conversation may be better sorted by new by default, or AMAs may be sorted by Q&A. A sort of an empty string clears the default sort. More...
 
async Task SetSuggestedSortAsync (string sort)
 Set a suggested sort for this post asynchronously. Suggested sorts are useful to display comments in a certain preferred way for posts. For example, casual conversation may be better sorted by new by default, or AMAs may be sorted by Q&A. A sort of an empty string clears the default sort. More...
 
void Spoiler ()
 Mark this post as containing spoilers. More...
 
async Task SpoilerAsync ()
 Mark this post as containing spoilers asynchronously. More...
 
void Unhide ()
 Unhide this post. More...
 
async Task UnhideAsync ()
 Unhide this post asynchronously. More...
 
void Unlock ()
 Unlock this post. Allows this post to receive new comments. More...
 
async Task UnlockAsync ()
 Unlock this post asynchronously. Allows this post to receive new comments. More...
 
void UnmarkNSFW ()
 Remove the NSFW marking from this post. More...
 
async Task UnmarkNSFWAsync ()
 Remove the NSFW marking from this post asynchronously. More...
 
void Unsave ()
 Unsave this post. This removes the thing from the user's saved listings as well. More...
 
async Task UnsaveAsync ()
 Unsave this post asynchronously. This removes the thing from the user's saved listings as well. More...
 
void Unspoiler ()
 Remove spoiler. More...
 
async Task UnspoilerAsync ()
 Remove spoiler asynchronously. More...
 
void Upvote ()
 Upvote this post. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating. More...
 
async Task UpvoteAsync ()
 Upvote this post asynchronously. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating. More...
 
void Downvote ()
 Downvote this post. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating. More...
 
async Task DownvoteAsync ()
 Downvote this post asynchronously. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating. More...
 
void Unvote ()
 Unvote this post. This is equivalent to "un-voting" by clicking again on a highlighted arrow. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating. More...
 
async Task UnvoteAsync ()
 Unvote this post asynchronously. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating. More...
 
void Approve ()
 Approve this post. If the thing was removed, it will be re-inserted into appropriate listings. Any reports on the approved thing will be discarded. More...
 
FlairSelectorResultContainer FlairSelector (string username)
 Return information about a users's flair options. More...
 
bool MonitorPostData (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null)
 Monitor this post for any configuration changes. More...
 
bool MonitorPostScore (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, int? minScoreMonitoringThreshold=null, int? scoreMonitoringPercentThreshold=null, int? cancellationThresholdMinutes=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null)
 Monitor this post for any score changes. In order for the event to fire, both minScoreMonitoringThreshold AND scoreMonitoringPercentThreshold must be met. More...
 
bool PostDataIsMonitored ()
 Whether post data is being monitored. More...
 
bool PostScoreIsMonitored ()
 Whether post score is being monitored. More...
 
- Public Member Functions inherited from Reddit.Controllers.Internal.Monitors
 Monitors ()
 
void Wait (int ms)
 
bool IsMonitored (string key, string subKey)
 
bool IsScheduled ()
 
void WaitOrDie (string key, int timeout=60)
 
void WaitOrDie (Thread thread, int timeout=60)
 
void KillAllMonitoringThreads ()
 
- 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)
 

Protected Member Functions

virtual void OnPostDataUpdated (PostUpdateEventArgs e)
 Invoke monitoring event for post data. More...
 
virtual void OnPostScoreUpdated (PostUpdateEventArgs e)
 Invoke monitoring event for post score. More...
 
override Thread CreateMonitoringThread (string key, string subKey, int startDelayMs=0, int? monitoringDelayMs=null)
 Creates a new monitoring thread. More...
 
- Protected Member Functions inherited from Reddit.Controllers.Internal.Monitors
bool Monitor (string key, Thread thread, string subKey)
 
void RebuildThreads (string subKey)
 
void LaunchThreadIfNotNull (string key, Thread thread)
 
void KillThread (Thread thread)
 
void KillThread (string key)
 
void ResetThreads (List< string > oldThreads)
 
- 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.")
 

Properties

string? Subreddit [get, set]
 The subreddit in which the post exists. More...
 
string? Author [get, set]
 The username of the post author. More...
 
string? Id [get, set]
 The ID36 of the post. More...
 
string? Fullname [get, set]
 The fullname of the post. More...
 
string? Permalink [get, set]
 The permalink URL of the post. More...
 
DateTime? Created [get, set]
 When the post was created. More...
 
DateTime? Edited [get, set]
 When the post was last edited. More...
 
bool? Removed [get, set]
 Whether the post was removed. More...
 
bool? Spam [get, set]
 Whether the post was marked as spam. More...
 
bool? NSFW [get, set]
 Whether the post was marked as NSFW. More...
 
int? Score [get, set]
 The post score. More...
 
int? UpVotes [get, set]
 The number of upvotes received. More...
 
double? UpvoteRatio [get, set]
 The number of upvotes received divided by the total number of votes. More...
 
bool IsUpvoted [get]
 Whether the post has been upvoted by the authenticated user. More...
 
bool IsDownvoted [get]
 Whether the post has been downvoted by the authenticated user. More...
 
Awards Awards [get, set]
 Any awards applied to the post. More...
 
int DownVotes [get]
 The number of downvotes received. More...
 
string Title [get, set]
 The title of the post. More...
 
Things.Post Listing [get, set]
 The full Listing object returned by the Reddit API; More...
 
Comments?? Comments [get]
 Comment replies to this post. More...
 
- Properties inherited from Reddit.Controllers.Internal.Monitors
IDictionary< string, HashSet< string > > MonitoringCache [get, set]
 An optional cache for preventing the same post from appearing multiple times during monitoring. See: https://github.com/sirkris/Reddit.NET/issues/117#issuecomment-759501039 More...
 
- Properties inherited from Reddit.Controllers.BaseController
Lists Lists [get, set]
 List-handling. More...
 

Events

EventHandler< PostUpdateEventArgsPostDataUpdated
 Event handler for monitoring post data. More...
 
EventHandler< PostUpdateEventArgsPostScoreUpdated
 Event handler for monitoring post score. More...
 

Additional Inherited Members

- Public Attributes inherited from Reddit.Controllers.Internal.Monitors
int MonitoringWaitDelayMS = 1500
 
- Protected Attributes inherited from Reddit.Controllers.Internal.Monitors
volatile bool Terminate = false
 

Detailed Description

Base controller for posts.

Constructor & Destructor Documentation

◆ Post() [1/5]

Reddit.Controllers.Post.Post ( Dispatch  dispatch,
Things.Post  listing 
)

Create a new post controller instance from API return data.

Parameters
dispatch
listing

◆ Post() [2/5]

Reddit.Controllers.Post.Post ( Dispatch  dispatch,
string  subreddit,
string  title = null,
string  author = null,
string  id = null,
string  fullname = null,
string  permalink = null,
DateTime  created = default(DateTime),
DateTime  edited = default(DateTime),
int  score = 0,
int  upVotes = 0,
int  downVotes = 0,
bool  removed = false,
bool  spam = false,
bool  nsfw = false 
)

Create a new post controller instance, populated manually.

Parameters
dispatch
subredditThe subreddit to which the post belongs
titleThe title of the post
authorThe post author's username
id
fullname
permalink
created
edited
score
upVotes
downVotes
removed
spam
nsfw

◆ Post() [3/5]

Reddit.Controllers.Post.Post ( Dispatch  dispatch,
string  fullname 
)

Create a new post controller instance, populated with only its fullname.

Parameters
dispatch
fullnameFullname of the post

◆ Post() [4/5]

Reddit.Controllers.Post.Post ( Dispatch  dispatch,
string  fullname,
string  subreddit 
)

Create a new post controller instance, populated with only its fullname and subreddit.

Parameters
dispatch
fullnameFullname of the post
subredditA valid subreddit name

◆ Post() [5/5]

Reddit.Controllers.Post.Post ( Dispatch  dispatch)

Create an empty post controller instance.

Parameters
dispatch

Member Function Documentation

◆ About()

Post Reddit.Controllers.Post.About ( )

Return information about the current Post instance.

Returns
An instance of this class populated with the retrieved data.

◆ Approve()

void Reddit.Controllers.Post.Approve ( )

Approve this post. If the thing was removed, it will be re-inserted into appropriate listings. Any reports on the approved thing will be discarded.

◆ Comment() [1/2]

Comment Reddit.Controllers.Post.Comment ( )

Create a new comment controller instance bound to this post.

Returns

◆ Comment() [2/2]

Comment Reddit.Controllers.Post.Comment ( string  body,
string  bodyHtml = null,
string  author = null,
string  collapsedReason = null,
bool  collapsed = false,
bool  isSubmitter = false,
List< Comment replies = null,
List< More more = null,
bool  scoreHidden = false,
int  depth = 0,
string  id = null,
string  fullname = null,
string  permalink = null,
DateTime  created = default(DateTime),
DateTime  edited = default(DateTime),
int  score = 0,
int  upVotes = 0,
int  downVotes = 0,
bool  removed = false,
bool  spam = false 
)

Create a new comment controller instance bound to this post, populated manually.

Parameters
bodyThe comment text
bodyHtml
authorThe username of the comment's author
collapsedReason
collapsed
isSubmitter
replies
more
scoreHidden
depth
id
fullname
permalink
created
edited
score
upVotes
downVotes
removed
spam
Returns

◆ CreateMonitoringThread()

override Thread Reddit.Controllers.Post.CreateMonitoringThread ( string  key,
string  subKey,
int  startDelayMs = 0,
int?  monitoringDelayMs = null 
)
protectedvirtual

Creates a new monitoring thread.

Parameters
keyMonitoring key
subKeyMonitoring subKey
startDelayMsHow long to wait before starting the thread in milliseconds (default: 0)
monitoringDelayMsHow long to wait between monitoring queries; pass null to leave it auto-managed (default: null)
Returns
The newly-created monitoring thread.

Implements Reddit.Controllers.Internal.Monitors.

◆ Delete()

void Reddit.Controllers.Post.Delete ( )

Delete this post.

◆ DeleteAsync()

async Task Reddit.Controllers.Post.DeleteAsync ( )

Delete this post asynchronously.

◆ DisableContestMode()

void Reddit.Controllers.Post.DisableContestMode ( )

Disable contest mode for this post.

◆ DisableContestModeAsync()

async Task Reddit.Controllers.Post.DisableContestModeAsync ( )

Disable contest mode for this post asynchronously.

◆ DisableSendReplies()

void Reddit.Controllers.Post.DisableSendReplies ( )

Disable inbox replies for this post.

◆ DisableSendRepliesAsync()

async Task Reddit.Controllers.Post.DisableSendRepliesAsync ( )

Disable inbox replies for this post asynchronously.

◆ Distinguish()

Post Reddit.Controllers.Post.Distinguish ( string  how)

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)
Returns
The distinguished post object.

◆ DistinguishAsync()

async Task<Post> Reddit.Controllers.Post.DistinguishAsync ( string  how)

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)
Returns
The distinguished post object.

◆ Downvote()

void Reddit.Controllers.Post.Downvote ( )

Downvote this post. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating.

◆ DownvoteAsync()

async Task Reddit.Controllers.Post.DownvoteAsync ( )

Downvote this post asynchronously. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating.

◆ EnableContestMode()

void Reddit.Controllers.Post.EnableContestMode ( )

Enable contest mode for this post.

◆ EnableContestModeAsync()

async Task Reddit.Controllers.Post.EnableContestModeAsync ( )

Enable contest mode for this post asynchronously.

◆ EnableSendReplies()

void Reddit.Controllers.Post.EnableSendReplies ( )

Enable inbox replies for this post.

◆ EnableSendRepliesAsync()

async Task Reddit.Controllers.Post.EnableSendRepliesAsync ( )

Enable inbox replies for this post asynchronously.

◆ FlairSelector()

FlairSelectorResultContainer Reddit.Controllers.Post.FlairSelector ( string  username)

Return information about a users's flair options.

Parameters
usernameA valid Reddit username
Returns
Flair results.

◆ Hide()

void Reddit.Controllers.Post.Hide ( )

Hide this post. This removes it from the user's default view of subreddit listings.

◆ HideAsync()

async Task Reddit.Controllers.Post.HideAsync ( )

Hide this post asynchronously. This removes it from the user's default view of subreddit listings.

◆ Info()

Post Reddit.Controllers.Post.Info ( )

Return information about the current Post instance via the api/info endpoint.

Returns
An instance of this class populated with the retrieved data.

◆ Lock()

void Reddit.Controllers.Post.Lock ( )

Lock this post. Prevents a post from receiving new comments.

◆ LockAsync()

async Task Reddit.Controllers.Post.LockAsync ( )

Lock this post asynchronously. Prevents a post from receiving new comments.

◆ MarkNSFW()

void Reddit.Controllers.Post.MarkNSFW ( )

Mark this post as NSFW.

◆ MarkNSFWAsync()

async Task Reddit.Controllers.Post.MarkNSFWAsync ( )

Mark this post as NSFW asynchronously.

◆ MonitorPostData()

bool Reddit.Controllers.Post.MonitorPostData ( int?  monitoringDelayMs = null,
int?  monitoringBaseDelayMs = null,
List< MonitoringSchedule schedule = null,
bool?  breakOnFailure = null,
DateTime?  monitoringExpiration = null 
)

Monitor this post for any configuration changes.

Parameters
monitoringDelayMsThe number of milliseconds between each monitoring query; leave null to auto-manage
monitoringBaseDelayMsThe number of milliseconds between each monitoring query PER THREAD (default: 1500)
scheduleA list of one or more timeframes during which monitoring of this object will occur (default: 24/7)
breakOnFailureIf true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false)
monitoringExpirationIf set, monitoring will automatically stop after the specified DateTime is reached
Returns
Whether monitoring was successfully initiated.

◆ MonitorPostScore()

bool Reddit.Controllers.Post.MonitorPostScore ( int?  monitoringDelayMs = null,
int?  monitoringBaseDelayMs = null,
int?  minScoreMonitoringThreshold = null,
int?  scoreMonitoringPercentThreshold = null,
int?  cancellationThresholdMinutes = null,
List< MonitoringSchedule schedule = null,
bool?  breakOnFailure = null,
DateTime?  monitoringExpiration = null 
)

Monitor this post for any score changes. In order for the event to fire, both minScoreMonitoringThreshold AND scoreMonitoringPercentThreshold must be met.

Parameters
monitoringDelayMsThe number of milliseconds between each monitoring query; leave null to auto-manage
monitoringBaseDelayMsThe number of milliseconds between each monitoring query PER THREAD (default: 1500)
minScoreMonitoringThresholdThe minimum change in score value between events (default: 4)
scoreMonitoringPercentThresholdThe minimum score percent change between events (default: 8)
cancellationThresholdMinutesIf not null, monitoring will automatically stop if more than this time elapses between score updates (default: null)
scheduleA list of one or more timeframes during which monitoring of this object will occur (default: 24/7)
breakOnFailureIf true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false)
monitoringExpirationIf set, monitoring will automatically stop after the specified DateTime is reached
Returns
Whether monitoring was successfully initiated.

◆ MoreChildren() [1/2]

MoreChildren Reddit.Controllers.Post.MoreChildren ( LinksAndCommentsMoreChildrenInput  linksAndCommentsMoreChildrenInput)

Retrieve additional comments omitted from a base comment tree. When a comment tree is rendered, the most relevant comments are selected for display first. Remaining comments are stubbed out with "MoreComments" links. This API call is used to retrieve the additional comments represented by those stubs, up to 100 at a time. The two core parameters required are link and children. link is the fullname of the link whose comments are being fetched. children is a comma-delimited list of comment ID36s that need to be fetched. If id is passed, it should be the ID of the MoreComments object this call is replacing. This is needed only for the HTML UI's purposes and is optional otherwise. NOTE: you may only make one request at a time to this API endpoint. Higher concurrency will result in an error being returned. If limit_children is True, only return the children requested.

Parameters
linksAndCommentsMoreChildrenInputA valid LinksAndCommentsMoreChildrenInput instance
Returns
The requested comments.

◆ MoreChildren() [2/2]

MoreChildren Reddit.Controllers.Post.MoreChildren ( string  children,
bool  limitChildren,
string  sort,
string  id = null 
)

Retrieve additional comments omitted from a base comment tree. When a comment tree is rendered, the most relevant comments are selected for display first. Remaining comments are stubbed out with "MoreComments" links. This API call is used to retrieve the additional comments represented by those stubs, up to 100 at a time. The two core parameters required are link and children. link is the fullname of the link whose comments are being fetched. children is a comma-delimited list of comment ID36s that need to be fetched. If id is passed, it should be the ID of the MoreComments object this call is replacing. This is needed only for the HTML UI's purposes and is optional otherwise. NOTE: you may only make one request at a time to this API endpoint. Higher concurrency will result in an error being returned. If limit_children is True, only return the children requested.

Parameters
childrena comma-delimited list of comment ID36s
limitChildrenboolean value
sortone of (confidence, top, new, controversial, old, random, qa, live)
id(optional) id of the associated MoreChildren object
Returns
The requested comments.

◆ OnPostDataUpdated()

virtual void Reddit.Controllers.Post.OnPostDataUpdated ( PostUpdateEventArgs  e)
protectedvirtual

Invoke monitoring event for post data.

Parameters
eA valid PostUpdateEventArgs instance

◆ OnPostScoreUpdated()

virtual void Reddit.Controllers.Post.OnPostScoreUpdated ( PostUpdateEventArgs  e)
protectedvirtual

Invoke monitoring event for post score.

Parameters
eA valid PostUpdateEventArgs instance

◆ PostDataIsMonitored()

bool Reddit.Controllers.Post.PostDataIsMonitored ( )

Whether post data is being monitored.

Returns
Whether post data is being monitored.

◆ PostScoreIsMonitored()

bool Reddit.Controllers.Post.PostScoreIsMonitored ( )

Whether post score is being monitored.

Returns
Whether post score is being monitored.

◆ Remove()

void Reddit.Controllers.Post.Remove ( bool  spam = false)

Remove this post from all subreddit listings.

Parameters
spamboolean value

◆ RemoveAsync()

async Task Reddit.Controllers.Post.RemoveAsync ( bool  spam = false)

Asynchronously remove this post from all subreddit listings.

◆ Reply()

Comment Reddit.Controllers.Post.Reply ( string  body,
string  bodyHtml = null,
string  author = null,
string  collapsedReason = null,
bool  collapsed = false,
bool  isSubmitter = false,
List< Comment replies = null,
List< More more = null,
bool  scoreHidden = false,
int  depth = 0,
string  id = null,
string  fullname = null,
string  permalink = null,
DateTime  created = default(DateTime),
DateTime  edited = default(DateTime),
int  score = 0,
int  upVotes = 0,
int  downVotes = 0,
bool  removed = false,
bool  spam = false 
)

Reply with a comment to this post.

Parameters
bodyThe comment reply text
bodyHtml
author
collapsedReason
collapsed
isSubmitter
replies
more
scoreHidden
depth
id
fullname
permalink
created
edited
score
upVotes
downVotes
removed
spam
Returns
The newly-created comment reply.

◆ ReplyAsync()

async Task<Comment> Reddit.Controllers.Post.ReplyAsync ( string  body,
string  bodyHtml = null,
string  author = null,
string  collapsedReason = null,
bool  collapsed = false,
bool  isSubmitter = false,
List< Comment replies = null,
List< More more = null,
bool  scoreHidden = false,
int  depth = 0,
string  id = null,
string  fullname = null,
string  permalink = null,
DateTime  created = default(DateTime),
DateTime  edited = default(DateTime),
int  score = 0,
int  upVotes = 0,
int  downVotes = 0,
bool  removed = false,
bool  spam = false 
)

Reply with a comment to this post asynchronously.

Parameters
bodyThe comment reply text
bodyHtml
author
collapsedReason
collapsed
isSubmitter
replies
more
scoreHidden
depth
id
fullname
permalink
created
edited
score
upVotes
downVotes
removed
spam

◆ Report() [1/2]

void Reddit.Controllers.Post.Report ( LinksAndCommentsReportInput  linksAndCommentsReportInput)

Report this post to the subreddit moderators. The post then becomes implicitly hidden, as well.

Parameters
linksAndCommentsReportInputA valid LinksAndCommentsReportInput instance

◆ Report() [2/2]

void Reddit.Controllers.Post.Report ( string  additionalInfo,
string  banEvadingAccountsNames,
string  customText,
bool  fromHelpCenter,
string  otherReason,
string  reason,
string  ruleReason,
string  siteReason,
string  violatorUsername 
)

Report this post to the subreddit moderators. The post then becomes implicitly hidden, as well.

Parameters
additionalInfoa string no longer than 2000 characters
banEvadingAccountsNamesa string no longer than 1000 characters
customTexta string no longer than 250 characters
fromHelpCenterboolean value
otherReasona string no longer than 100 characters
reasona string no longer than 100 characters
ruleReasona string no longer than 100 characters
siteReasona string no longer than 100 characters
violatorUsernameA valid Reddit username

◆ ReportAsync() [1/2]

async Task Reddit.Controllers.Post.ReportAsync ( LinksAndCommentsReportInput  linksAndCommentsReportInput)

Report this post to the subreddit moderators asynchronously. The post then becomes implicitly hidden, as well.

Parameters
linksAndCommentsReportInputA valid LinksAndCommentsReportInput instance

◆ ReportAsync() [2/2]

async Task Reddit.Controllers.Post.ReportAsync ( string  additionalInfo,
string  banEvadingAccountsNames,
string  customText,
bool  fromHelpCenter,
string  otherReason,
string  reason,
string  ruleReason,
string  siteReason,
string  violatorUsername 
)

Report this post to the subreddit moderators asynchronously. The post then becomes implicitly hidden, as well.

Parameters
additionalInfoa string no longer than 2000 characters
banEvadingAccountsNamesa string no longer than 1000 characters
customTexta string no longer than 250 characters
fromHelpCenterboolean value
otherReasona string no longer than 100 characters
reasona string no longer than 100 characters
ruleReasona string no longer than 100 characters
siteReasona string no longer than 100 characters
violatorUsernameA valid Reddit username

◆ Save()

void Reddit.Controllers.Post.Save ( string  category)

Save this post. Saved things are kept in the user's saved listing for later perusal.

Parameters
categorya category name

◆ SaveAsync()

async Task Reddit.Controllers.Post.SaveAsync ( string  category)

Save this post asynchronously. Saved things are kept in the user's saved listing for later perusal.

Parameters
categorya category name

◆ SetFlair() [1/2]

void Reddit.Controllers.Post.SetFlair ( FlairSelectFlairInput  flairSelectFlairInput)

Sets the link flair.

Parameters
flairSelectFlairInputThe text to be displayed in the flair

◆ SetFlair() [2/2]

void Reddit.Controllers.Post.SetFlair ( string  flairText = "",
string  flairTemplateId = "" 
)

Sets the link flair.

Parameters
flairTextThe text to be displayed in the flair
flairTemplateId(optional) A flair template ID

◆ SetSubredditSticky()

void Reddit.Controllers.Post.SetSubredditSticky ( int  num,
bool  toProfile 
)

Set this post as the sticky in its subreddit. The num argument is optional, and only used when stickying a post. It allows specifying a particular "slot" to sticky the post into, and if there is already a post stickied in that slot it will be replaced. If there is no post in the specified slot to replace, or num is None, the bottom-most slot will be used.

Parameters
numan integer between 1 and 4
toProfileboolean value

◆ SetSubredditStickyAsync()

async Task Reddit.Controllers.Post.SetSubredditStickyAsync ( int  num,
bool  toProfile 
)

Set this post as the sticky in its subreddit asynchronously. The num argument is optional, and only used when stickying a post. It allows specifying a particular "slot" to sticky the post into, and if there is already a post stickied in that slot it will be replaced. If there is no post in the specified slot to replace, or num is None, the bottom-most slot will be used.

Parameters
numan integer between 1 and 4
toProfileboolean value

◆ SetSuggestedSort()

void Reddit.Controllers.Post.SetSuggestedSort ( string  sort)

Set a suggested sort for this post. Suggested sorts are useful to display comments in a certain preferred way for posts. For example, casual conversation may be better sorted by new by default, or AMAs may be sorted by Q&A. A sort of an empty string clears the default sort.

Parameters
sortone of (confidence, top, new, controversial, old, random, qa, live, blank)

◆ SetSuggestedSortAsync()

async Task Reddit.Controllers.Post.SetSuggestedSortAsync ( string  sort)

Set a suggested sort for this post asynchronously. Suggested sorts are useful to display comments in a certain preferred way for posts. For example, casual conversation may be better sorted by new by default, or AMAs may be sorted by Q&A. A sort of an empty string clears the default sort.

Parameters
sortone of (confidence, top, new, controversial, old, random, qa, live, blank)

◆ SetTitle()

void Reddit.Controllers.Post.SetTitle ( string  value)

Set the title manually without any automatic decoding.

Parameters
valueThe title value you wish to set

◆ Spoiler()

void Reddit.Controllers.Post.Spoiler ( )

Mark this post as containing spoilers.

◆ SpoilerAsync()

async Task Reddit.Controllers.Post.SpoilerAsync ( )

Mark this post as containing spoilers asynchronously.

◆ Unhide()

void Reddit.Controllers.Post.Unhide ( )

Unhide this post.

◆ UnhideAsync()

async Task Reddit.Controllers.Post.UnhideAsync ( )

Unhide this post asynchronously.

◆ Unlock()

void Reddit.Controllers.Post.Unlock ( )

Unlock this post. Allows this post to receive new comments.

◆ UnlockAsync()

async Task Reddit.Controllers.Post.UnlockAsync ( )

Unlock this post asynchronously. Allows this post to receive new comments.

◆ UnmarkNSFW()

void Reddit.Controllers.Post.UnmarkNSFW ( )

Remove the NSFW marking from this post.

◆ UnmarkNSFWAsync()

async Task Reddit.Controllers.Post.UnmarkNSFWAsync ( )

Remove the NSFW marking from this post asynchronously.

◆ Unsave()

void Reddit.Controllers.Post.Unsave ( )

Unsave this post. This removes the thing from the user's saved listings as well.

◆ UnsaveAsync()

async Task Reddit.Controllers.Post.UnsaveAsync ( )

Unsave this post asynchronously. This removes the thing from the user's saved listings as well.

◆ UnsetSubredditSticky()

void Reddit.Controllers.Post.UnsetSubredditSticky ( int  num,
bool  toProfile 
)

Unset this post as the sticky in its subreddit. The num argument is optional, and only used when stickying a post. It allows specifying a particular "slot" to sticky the post into, and if there is already a post stickied in that slot it will be replaced. If there is no post in the specified slot to replace, or num is None, the bottom-most slot will be used.

Parameters
numan integer between 1 and 4
toProfileboolean value

◆ UnsetSubredditStickyAsync()

async Task Reddit.Controllers.Post.UnsetSubredditStickyAsync ( int  num,
bool  toProfile 
)

Unset this post as the sticky in its subreddit asynchronously. The num argument is optional, and only used when stickying a post. It allows specifying a particular "slot" to sticky the post into, and if there is already a post stickied in that slot it will be replaced. If there is no post in the specified slot to replace, or num is None, the bottom-most slot will be used.

Parameters
numan integer between 1 and 4
toProfileboolean value

◆ Unspoiler()

void Reddit.Controllers.Post.Unspoiler ( )

Remove spoiler.

◆ UnspoilerAsync()

async Task Reddit.Controllers.Post.UnspoilerAsync ( )

Remove spoiler asynchronously.

◆ Unvote()

void Reddit.Controllers.Post.Unvote ( )

Unvote this post. This is equivalent to "un-voting" by clicking again on a highlighted arrow. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating.

◆ UnvoteAsync()

async Task Reddit.Controllers.Post.UnvoteAsync ( )

Unvote this post asynchronously. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating.

◆ Upvote()

void Reddit.Controllers.Post.Upvote ( )

Upvote this post. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating.

◆ UpvoteAsync()

async Task Reddit.Controllers.Post.UpvoteAsync ( )

Upvote this post asynchronously. Please note that votes must be cast by humans. Automated bot-voting violates Reddit's rules. That is, API clients proxying a human's action one-for-one are OK, but bots deciding how to vote on content or amplifying a human's vote are not. See the Reddit rules for more details on what constitutes vote cheating.

Property Documentation

◆ Author

string? Reddit.Controllers.Post.Author
getset

The username of the post author.

◆ Awards

Awards Reddit.Controllers.Post.Awards
getset

Any awards applied to the post.

◆ Comments

Comments?? Reddit.Controllers.Post.Comments
get

Comment replies to this post.

◆ Created

DateTime? Reddit.Controllers.Post.Created
getset

When the post was created.

◆ DownVotes

int Reddit.Controllers.Post.DownVotes
get

The number of downvotes received.

◆ Edited

DateTime? Reddit.Controllers.Post.Edited
getset

When the post was last edited.

◆ Fullname

string? Reddit.Controllers.Post.Fullname
getset

The fullname of the post.

◆ Id

string? Reddit.Controllers.Post.Id
getset

The ID36 of the post.

◆ IsDownvoted

bool Reddit.Controllers.Post.IsDownvoted
get

Whether the post has been downvoted by the authenticated user.

◆ IsUpvoted

bool Reddit.Controllers.Post.IsUpvoted
get

Whether the post has been upvoted by the authenticated user.

◆ Listing

Things.Post Reddit.Controllers.Post.Listing
getset

The full Listing object returned by the Reddit API;

◆ NSFW

bool? Reddit.Controllers.Post.NSFW
getset

Whether the post was marked as NSFW.

◆ Permalink

string? Reddit.Controllers.Post.Permalink
getset

The permalink URL of the post.

◆ Removed

bool? Reddit.Controllers.Post.Removed
getset

Whether the post was removed.

◆ Score

int? Reddit.Controllers.Post.Score
getset

The post score.

◆ Spam

bool? Reddit.Controllers.Post.Spam
getset

Whether the post was marked as spam.

◆ Subreddit

string? Reddit.Controllers.Post.Subreddit
getset

The subreddit in which the post exists.

◆ Title

string Reddit.Controllers.Post.Title
getset

The title of the post.

◆ UpvoteRatio

double? Reddit.Controllers.Post.UpvoteRatio
getset

The number of upvotes received divided by the total number of votes.

◆ UpVotes

int? Reddit.Controllers.Post.UpVotes
getset

The number of upvotes received.

Event Documentation

◆ PostDataUpdated

EventHandler<PostUpdateEventArgs> Reddit.Controllers.Post.PostDataUpdated

Event handler for monitoring post data.

◆ PostScoreUpdated

EventHandler<PostUpdateEventArgs> Reddit.Controllers.Post.PostScoreUpdated

Event handler for monitoring post score.


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