fixing typo in return value

This commit is contained in:
Michael (GP) 2022-12-08 00:08:17 -05:00
parent 0df54e58b4
commit 47caf810d4

28
bot.js
View File

@ -34,24 +34,22 @@ async function postFeed() {
let postDate = new Date(timeline.data[0].created_at); let postDate = new Date(timeline.data[0].created_at);
let count = 0; let count = 0;
let feedResults = await Promise.all( feed.items.every(async (item) => {
feed.items.every(async (item) => { let pubDate = new Date(item.pubDate);
let pubDate = new Date(item.pubDate);
if (pubDate > postDate) { if (pubDate > postDate) {
count++; count++;
if (count > maxPostPerScan) return false; if (count > maxPostPerScan) return false;
let posts = await M.post("statuses", { await M.post("statuses", {
status: `${item.title}\n\n#NeoVibe #${process.env.POST_HASHTAG}\n\n${item.link}`, status: `${item.title}\n\n#NeoVibe #${process.env.POST_HASHTAG}\n\n${item.link}`,
}); });
return posts; return true;
} }
return false; return true;
}) });
);
return feedResults; return true;
} }