not-an-aardvark / snoowrap

A JavaScript wrapper for the reddit API
MIT License
1.01k stars 125 forks source link

How to get post text content? #337

Closed nlanson closed 3 years ago

nlanson commented 3 years ago

I am trying to save the content (body) of a post using the Snoowrap.Submission class.

However, I am unable to do this.

I have tried:

let content = reddit.getSubmission(submissionID).body;
console.log(content); //undefined

let content = reddit.getSubmission(submissionID).fetch().then((post) => {
    return post.body;
});
console.log(content); //undefined

How can I make this work?

nlanson commented 3 years ago

Resolved.

It was reddit.getSubmission(submissionId).selftext