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

Unable to get authornames of child comments replying to my comments, or authornames of the comments/posts I've replied to #230

Open
steviecs opened this issue Mar 9, 2020 · 3 comments

Comments

@steviecs
Copy link

steviecs commented Mar 9, 2020

The code I have attempted with isn't quite getting me there - just wanting to know if I'm making a mistake, or if this isn't currently supported. I also keep getting the following exception System.InvalidOperationException: Enumerator is in an invalid state;

        var myComments = reddit.User.GetComments(7).Where(i => i.More.Children.Any() || i.Parent != null);

        myComments.ForEach(comment =>
        {
            foreach (var property in comment.More.Children)
            {
                Console.WriteLine(property);
            }
        });


        myComments.ForEach(comments =>
        {
            foreach (var comment in comments.Comments)
            {
                Console.WriteLine(comment.AuthorName);
            }
        });

I can't grab any properties relating to children author names off of property or comment. I've tried a couple different ways, but I was able to do this with people who replied to my posts - just not those who have replied to my comments.

Any insight is welcome, thanks!

@CrustyJew
Copy link
Owner

What version are you using? And what exactly is throwing that exception. Nothing's catching my eye that's wrong.

@steviecs
Copy link
Author

steviecs commented Mar 11, 2020

What version are you using? And what exactly is throwing that exception. Nothing's catching my eye that's wrong.

The line throwing that exception is:
var myComments = reddit.User.GetComments(7).Where(i => i.More.Children.Any() || i.Parent != null);

I just now determined that the version I've been using was 1.0.0, which seems suspect given that you asked which version.

I also see 1.0.4 available, which I just installed - as well as a 2.0.0 from which I think is not your library:

image

I'm using Rider, but I can't imagine that matters at all.

@CrustyJew
Copy link
Owner

That 2.0 version looks correct, I haven't done nuget in VSCode (at least that what your IDE looks like). Try using that instead first. I need to just push it to a non pre-release state and get over it >.<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants