async function test() {
const limit = 10;
// Retrieve posts from the specified subreddit made in the last 15 minutes
const posts = await reddit.getSubreddit(subredditName).getNew({limit: 10});
console.log(posts.length);
}
test().then(() => console.log("DONE"));
Executing this yields
return target.apply(this, arguments);
^
TypeError: Cannot read properties of undefined (reading 'after')
at .../node_modules/snoowrap/dist/objects/Listing.js:233:47
...
The problem goes away if I remove the limit filter, but that returns too many posts, and I want the new ones only. Adding after: "" doesn't help.
here's my code
Executing this yields
The problem goes away if I remove the
limit
filter, but that returns too many posts, and I want the new ones only. Addingafter: ""
doesn't help.How can I get the new posts?