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

Controller class for comment-related tasks. More...

Inheritance diagram for Reddit.Controllers.Comment:
Reddit.Controllers.Internal.Monitors Reddit.Controllers.BaseController Reddit.Controllers.Internal.Validators

Public Member Functions

 Comment (Dispatch dispatch, Things.Comment listing)
 Create a new comment controller instance from API return data. More...
 
 Comment (Dispatch dispatch, string subreddit, string author, string body, string parentFullname, string bodyHtml=null, string collapsedReason=null, bool collapsed=false, bool isSubmitter=false, List< Comment > replies=null, List< Things.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, populated manually. More...
 
 Comment (Dispatch dispatch, string fullname)
 Create a new comment controller instance, populated only with its fullname. More...
 
 Comment (Dispatch dispatch)
 Create an empty comment controller instance. More...
 
void SetBody (string value)
 Set the body manually without any automatic decoding. More...
 
void SetBodyHTML (string value)
 Set the body HTML manually without any automatic decoding. More...
 
Post GetRoot (string fullname=null)
 Get the post to which this comment belongs. More...
 
Comment Submit ()
 Submit this comment to Reddit. More...
 
async Task< CommentSubmitAsync ()
 Submit this comment to Reddit asynchronously. 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< Things.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 to this comment. 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< Things.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 to this comment asynchronously. More...
 
Comment BuildReply (string body, string bodyHtml=null, string author=null, string collapsedReason=null, bool collapsed=false, bool isSubmitter=false, List< Comment > replies=null, List< Things.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 comment reply object without submitting it to Reddit. More...
 
Comment About ()
 Return information about the current Comment instance. More...
 
Comment Info ()
 Return information about the current Comment instance via the api/info endpoint. More...
 
Comment Distinguish (string how, 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< CommentDistinguishAsync (string how, 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 Remove (bool spam=false)
 Redact and remove this comment from all subreddit comment listings. More...
 
async Task RemoveAsync (bool spam=false)
 Asynchronously redact and remove this comment from all subreddit comment listings. More...
 
void Delete ()
 Delete this comment. More...
 
async Task DeleteAsync ()
 Delete this comment asynchronously. More...
 
void Report (string additionalInfo, string banEvadingAccountsNames, string customText, bool fromHelpCenter, string otherReason, string reason, string ruleReason, string siteReason, string violatorUsername)
 Report this comment to the subreddit moderators. The comment 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 comment to the subreddit moderators asynchronously. The comment then becomes implicitly hidden, as well. More...
 
void Report (LinksAndCommentsReportInput linksAndCommentsReportInput)
 Report this comment to the subreddit moderators. The comment then becomes implicitly hidden, as well. More...
 
async Task ReportAsync (LinksAndCommentsReportInput linksAndCommentsReportInput)
 Report this comment to the subreddit moderators asynchronously. The comment then becomes implicitly hidden, as well. More...
 
void Save (string category)
 Save this comment. Saved things are kept in the user's saved listing for later perusal. More...
 
async Task SaveAsync (string category)
 Save this comment asynchronously. Saved things are kept in the user's saved listing for later perusal. More...
 
void EnableSendReplies ()
 Enable inbox replies for this comment. More...
 
async Task EnableSendRepliesAsync ()
 Enable inbox replies for this comment asynchronously. More...
 
void DisableSendReplies ()
 Disable inbox replies for this comment. More...
 
async Task DisableSendRepliesAsync ()
 Disable inbox replies for this comment asynchronously. More...
 
void Unsave ()
 Unsave this comment. This removes the thing from the user's saved listings as well. More...
 
async Task UnsaveAsync ()
 Unsave this comment asynchronously. This removes the thing from the user's saved listings as well. More...
 
Comment Edit (string text)
 Edit the body text of this comment. This instance will be automatically updated with the return data. More...
 
async Task< CommentEditAsync (string text)
 Edit the body text of this comment asynchronously. This instance will be automatically updated with the return data. More...
 
Things.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...
 
Things.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 Upvote ()
 Upvote this comment. 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 comment 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 comment. 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 comment 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 comment. 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 comment 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...
 
bool MonitorCommentScore (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 comment for any score changes. In order for the event to fire, both minScoreMonitoringThreshold AND scoreMonitoringPercentThreshold must be met. More...
 
bool CommentScoreIsMonitored ()
 Whether the comment score is currently 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)
 

Public Attributes

Things.Comment Listing
 Full comment data returned by the API. More...
 
- Public Attributes inherited from Reddit.Controllers.Internal.Monitors
int MonitoringWaitDelayMS = 1500
 

Protected Member Functions

virtual void OnCommentScoreUpdated (CommentUpdateEventArgs e)
 Invocation for CommentScoreUpdated event. 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 this comment exists. More...
 
string? Author [get, set]
 The username of the comment author. More...
 
string? Id [get, set]
 The comment ID36. More...
 
string? Fullname [get, set]
 The comment fullname. More...
 
string? Permalink [get, set]
 The permalink URL of the comment. More...
 
DateTime? Created [get, set]
 When the comment was created. More...
 
DateTime? Edited [get, set]
 When the comment was last edited. More...
 
int? Score [get, set]
 The comment score. More...
 
int? UpVotes [get, set]
 The number of upvotes received. More...
 
int? DownVotes [get, set]
 The number of downvotes received. More...
 
bool? Removed [get, set]
 Whether the comment has been removed. More...
 
bool? Spam [get, set]
 Whether the comment has been marked as spam. More...
 
List< Things.More > More [get, set]
 A list of Things.More objects. More...
 
string?? ParentId [get]
 The parent ID36. More...
 
string? ParentFullname [get, set]
 The parent fullname. More...
 
string? CollapsedReason [get, set]
 The reason the comment was collapsed (if applicable). More...
 
bool? Collapsed [get, set]
 Whether the comment was collapsed. More...
 
bool? IsSubmitter [get, set]
 Whether the comment was authored by the authenticated user. More...
 
bool? ScoreHidden [get, set]
 Whether the comment score should be hidden. More...
 
int? Depth [get, set]
 The comment depth. More...
 
Awards?? Awards [get]
 Any awards applied to the comment. More...
 
bool IsUpvoted [get]
 Whether the comment has been upvoted by the authenticated user. More...
 
bool IsDownvoted [get]
 Whether the comment has been downvoted by the authenticated user. More...
 
List< Comment >?? Replies [get, set]
 A list of comment replies. More...
 
List< Commentreplies [get]
 A list of comment replies that does not automatically query the API if null. More...
 
int????? NumReplies [get]
 The number of direct comment replies.
Unlike Replies, accessing this property does not require a separate API call. More...
 
string?? Body [get, set]
 The comment body. More...
 
string?? BodyHTML [get, set]
 The comment body in HTML format. More...
 
Post?? Root [get]
 The parent post. More...
 
Comments?? Comments [get]
 Comment replies to this comment. 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< CommentUpdateEventArgsCommentScoreUpdated
 Event handler for monitoring comment score. More...
 

Additional Inherited Members

- Protected Attributes inherited from Reddit.Controllers.Internal.Monitors
volatile bool Terminate = false
 

Detailed Description

Controller class for comment-related tasks.

Constructor & Destructor Documentation

◆ Comment() [1/4]

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

Create a new comment controller instance from API return data.

Parameters
dispatch
listing

◆ Comment() [2/4]

Reddit.Controllers.Comment.Comment ( Dispatch  dispatch,
string  subreddit,
string  author,
string  body,
string  parentFullname,
string  bodyHtml = null,
string  collapsedReason = null,
bool  collapsed = false,
bool  isSubmitter = false,
List< Comment replies = null,
List< Things.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, populated manually.

Parameters
dispatch
subredditThe subreddit to which the comment belongs
authorThe username of the comment's author
bodyThe comment text
parentFullnameFullname of the parent post or comment
bodyHtml
collapsedReason
collapsed
isSubmitter
replies
more
scoreHidden
depth
id
fullname
permalink
created
edited
score
upVotes
downVotes
removed
spam

◆ Comment() [3/4]

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

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

Parameters
dispatch
fullnameFullname of the comment

◆ Comment() [4/4]

Reddit.Controllers.Comment.Comment ( Dispatch  dispatch)

Create an empty comment controller instance.

Parameters
dispatch

Member Function Documentation

◆ About()

Comment Reddit.Controllers.Comment.About ( )

Return information about the current Comment instance.

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

◆ BuildReply()

Comment Reddit.Controllers.Comment.BuildReply ( string  body,
string  bodyHtml = null,
string  author = null,
string  collapsedReason = null,
bool  collapsed = false,
bool  isSubmitter = false,
List< Comment replies = null,
List< Things.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 comment reply object without submitting it to Reddit.

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 unsent comment reply instance.

◆ CommentScoreIsMonitored()

bool Reddit.Controllers.Comment.CommentScoreIsMonitored ( )

Whether the comment score is currently being monitored.

Returns
Whether the comment score is currently being monitored.

◆ CreateMonitoringThread()

override Thread Reddit.Controllers.Comment.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.Comment.Delete ( )

Delete this comment.

◆ DeleteAsync()

async Task Reddit.Controllers.Comment.DeleteAsync ( )

Delete this comment asynchronously.

◆ DisableSendReplies()

void Reddit.Controllers.Comment.DisableSendReplies ( )

Disable inbox replies for this comment.

◆ DisableSendRepliesAsync()

async Task Reddit.Controllers.Comment.DisableSendRepliesAsync ( )

Disable inbox replies for this comment asynchronously.

◆ Distinguish()

Comment Reddit.Controllers.Comment.Distinguish ( string  how,
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)
stickyboolean value
Returns
The distinguished comment object.

◆ DistinguishAsync()

async Task<Comment> Reddit.Controllers.Comment.DistinguishAsync ( string  how,
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)
stickyboolean value
Returns
The distinguished comment object.

◆ Downvote()

void Reddit.Controllers.Comment.Downvote ( )

Downvote this comment. 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.Comment.DownvoteAsync ( )

Downvote this comment 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.

◆ Edit()

Comment Reddit.Controllers.Comment.Edit ( string  text)

Edit the body text of this comment. This instance will be automatically updated with the return data.

Parameters
textraw markdown text
Returns
This instance populated with the modified post data returned by the API.

◆ EditAsync()

async Task<Comment> Reddit.Controllers.Comment.EditAsync ( string  text)

Edit the body text of this comment asynchronously. This instance will be automatically updated with the return data.

Parameters
textraw markdown text

◆ EnableSendReplies()

void Reddit.Controllers.Comment.EnableSendReplies ( )

Enable inbox replies for this comment.

◆ EnableSendRepliesAsync()

async Task Reddit.Controllers.Comment.EnableSendRepliesAsync ( )

Enable inbox replies for this comment asynchronously.

◆ GetRoot()

Post Reddit.Controllers.Comment.GetRoot ( string  fullname = null)

Get the post to which this comment belongs.

Parameters
fullnameThe fullname of the comment whose post data we're looking for
Returns
The parent post of this comment.

◆ Info()

Comment Reddit.Controllers.Comment.Info ( )

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

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

◆ MonitorCommentScore()

bool Reddit.Controllers.Comment.MonitorCommentScore ( 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 comment 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]

Things.MoreChildren Reddit.Controllers.Comment.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]

Things.MoreChildren Reddit.Controllers.Comment.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.

◆ OnCommentScoreUpdated()

virtual void Reddit.Controllers.Comment.OnCommentScoreUpdated ( CommentUpdateEventArgs  e)
protectedvirtual

Invocation for CommentScoreUpdated event.

Parameters
e

◆ Remove()

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

Redact and remove this comment from all subreddit comment listings.

◆ RemoveAsync()

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

Asynchronously redact and remove this comment from all subreddit comment listings.

◆ Reply()

Comment Reddit.Controllers.Comment.Reply ( string  body,
string  bodyHtml = null,
string  author = null,
string  collapsedReason = null,
bool  collapsed = false,
bool  isSubmitter = false,
List< Comment replies = null,
List< Things.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 to this comment.

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.Comment.ReplyAsync ( string  body,
string  bodyHtml = null,
string  author = null,
string  collapsedReason = null,
bool  collapsed = false,
bool  isSubmitter = false,
List< Comment replies = null,
List< Things.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 to this comment 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.Comment.Report ( LinksAndCommentsReportInput  linksAndCommentsReportInput)

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

Parameters
linksAndCommentsReportInputA valid LinksAndCommentsReportInput instance

◆ Report() [2/2]

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

Report this comment to the subreddit moderators. The comment 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.Comment.ReportAsync ( LinksAndCommentsReportInput  linksAndCommentsReportInput)

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

Parameters
linksAndCommentsReportInputA valid LinksAndCommentsReportInput instance

◆ ReportAsync() [2/2]

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

Report this comment to the subreddit moderators asynchronously. The comment 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.Comment.Save ( string  category)

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

Parameters
categorya category name

◆ SaveAsync()

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

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

Parameters
categorya category name

◆ SetBody()

void Reddit.Controllers.Comment.SetBody ( string  value)

Set the body manually without any automatic decoding.

Parameters
valueThe body value you wish to set

◆ SetBodyHTML()

void Reddit.Controllers.Comment.SetBodyHTML ( string  value)

Set the body HTML manually without any automatic decoding.

Parameters
valueThe body HTML value you wish to set

◆ Submit()

Comment Reddit.Controllers.Comment.Submit ( )

Submit this comment to Reddit.

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

◆ SubmitAsync()

async Task<Comment> Reddit.Controllers.Comment.SubmitAsync ( )

Submit this comment to Reddit asynchronously.

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

◆ Unsave()

void Reddit.Controllers.Comment.Unsave ( )

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

◆ UnsaveAsync()

async Task Reddit.Controllers.Comment.UnsaveAsync ( )

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

◆ Unvote()

void Reddit.Controllers.Comment.Unvote ( )

Unvote this comment. 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.Comment.UnvoteAsync ( )

Unvote this comment 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.Comment.Upvote ( )

Upvote this comment. 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.Comment.UpvoteAsync ( )

Upvote this comment 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.

Member Data Documentation

◆ Listing

Things.Comment Reddit.Controllers.Comment.Listing

Full comment data returned by the API.

Property Documentation

◆ Author

string? Reddit.Controllers.Comment.Author
getset

The username of the comment author.

◆ Awards

Awards?? Reddit.Controllers.Comment.Awards
get

Any awards applied to the comment.

◆ Body

string?? Reddit.Controllers.Comment.Body
getset

The comment body.

◆ BodyHTML

string?? Reddit.Controllers.Comment.BodyHTML
getset

The comment body in HTML format.

◆ Collapsed

bool? Reddit.Controllers.Comment.Collapsed
getset

Whether the comment was collapsed.

◆ CollapsedReason

string? Reddit.Controllers.Comment.CollapsedReason
getset

The reason the comment was collapsed (if applicable).

◆ Comments

Comments?? Reddit.Controllers.Comment.Comments
get

Comment replies to this comment.

◆ Created

DateTime? Reddit.Controllers.Comment.Created
getset

When the comment was created.

◆ Depth

int? Reddit.Controllers.Comment.Depth
getset

The comment depth.

◆ DownVotes

int? Reddit.Controllers.Comment.DownVotes
getset

The number of downvotes received.

◆ Edited

DateTime? Reddit.Controllers.Comment.Edited
getset

When the comment was last edited.

◆ Fullname

string? Reddit.Controllers.Comment.Fullname
getset

The comment fullname.

◆ Id

string? Reddit.Controllers.Comment.Id
getset

The comment ID36.

◆ IsDownvoted

bool Reddit.Controllers.Comment.IsDownvoted
get

Whether the comment has been downvoted by the authenticated user.

◆ IsSubmitter

bool? Reddit.Controllers.Comment.IsSubmitter
getset

Whether the comment was authored by the authenticated user.

◆ IsUpvoted

bool Reddit.Controllers.Comment.IsUpvoted
get

Whether the comment has been upvoted by the authenticated user.

◆ More

List<Things.More> Reddit.Controllers.Comment.More
getset

A list of Things.More objects.

◆ NumReplies

int????? Reddit.Controllers.Comment.NumReplies
get

The number of direct comment replies.
Unlike Replies, accessing this property does not require a separate API call.

◆ ParentFullname

string? Reddit.Controllers.Comment.ParentFullname
getset

The parent fullname.

◆ ParentId

string?? Reddit.Controllers.Comment.ParentId
get

The parent ID36.

◆ Permalink

string? Reddit.Controllers.Comment.Permalink
getset

The permalink URL of the comment.

◆ Removed

bool? Reddit.Controllers.Comment.Removed
getset

Whether the comment has been removed.

◆ Replies

List<Comment>?? Reddit.Controllers.Comment.Replies
getset

A list of comment replies.

◆ replies

List<Comment> Reddit.Controllers.Comment.replies
get

A list of comment replies that does not automatically query the API if null.

◆ Root

Post?? Reddit.Controllers.Comment.Root
get

The parent post.

◆ Score

int? Reddit.Controllers.Comment.Score
getset

The comment score.

◆ ScoreHidden

bool? Reddit.Controllers.Comment.ScoreHidden
getset

Whether the comment score should be hidden.

◆ Spam

bool? Reddit.Controllers.Comment.Spam
getset

Whether the comment has been marked as spam.

◆ Subreddit

string? Reddit.Controllers.Comment.Subreddit
getset

The subreddit in which this comment exists.

◆ UpVotes

int? Reddit.Controllers.Comment.UpVotes
getset

The number of upvotes received.

Event Documentation

◆ CommentScoreUpdated

EventHandler<CommentUpdateEventArgs> Reddit.Controllers.Comment.CommentScoreUpdated

Event handler for monitoring comment score.


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