Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 793 Bytes

Comment Replies Count.md

File metadata and controls

36 lines (20 loc) · 793 Bytes

Comment Replies Count

Author

Kris Craig

Required libraries

Overview

Starting in 1.4, it is possible to get the number of direct replies to a comment without making a separate API call. Here's how.

Library Installation

In the NuGet Package Manager console:

Install-Package Reddit

The Code

using Reddit;

...

var reddit = new RedditClient("YourRedditAppID", "YourBotUserRefreshToken");

// Get the number of direct replies to the top comment on the top post of r/AskReddit.  --Kris
int? numReplies = reddit.Subreddit("AskReddit").Posts.Top[0].Comments.Top[0].NumReplies;

Source File

Comment Replies Count.cs