Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to get the number of followers that an account has? #167

Open
nmills3 opened this issue Oct 13, 2022 · 1 comment
Open

Is it possible to get the number of followers that an account has? #167

nmills3 opened this issue Oct 13, 2022 · 1 comment
Assignees
Labels
documentation Something in the docs needs improvement. enhancement New feature or request question Somebody asked a question.

Comments

@nmills3
Copy link

nmills3 commented Oct 13, 2022

I'm trying to get the follower count of the user that the bot is running as, but i can't seem to find a way to do it

@sirkris
Copy link
Owner

sirkris commented May 28, 2023

Yes, though it's kinda hard to find because the Reddit API hides it in a weird place. You're familiar with user subreddits, right? What you need to do is actually retrieve the data for that user's subreddit. The "Subscribers" property in this case is actually the user's follower count.

For example, here's a quick and dirty way to retrieve my follower count in C#:

Console.WriteLine($"KrisCraig has {reddit.Models.Subreddits.About("u_KrisCraig").Subscribers} followers.");

Now that I think of it, this is downright counter-intuitive. I think maybe I should go ahead and add a "Followers" property that performs the necessary API call and retrieves/caches the subscribers count.

@sirkris sirkris self-assigned this May 28, 2023
@sirkris sirkris added enhancement New feature or request question Somebody asked a question. documentation Something in the docs needs improvement. labels May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Something in the docs needs improvement. enhancement New feature or request question Somebody asked a question.
Projects
None yet
Development

No branches or pull requests

2 participants