Fixed bug in RSS engine

This commit is contained in:
Logan Cusano
2023-02-26 05:09:45 -05:00
parent 85b5ed02cf
commit a9bc2383ba
4 changed files with 38 additions and 53 deletions

View File

@@ -65,16 +65,17 @@ exports.sendPost = (post, channel, callback) => {
const title = post.title;
const link = post.link;
const content = NodeHtmlMarkdown.translate(post.content);
const guid = post.guid;
const pubDate = post.pubDate ?? new Date();
log.DEBUG("Sending an RSS post to discord", title, guid)
const postId = post.postId;
const pubDate = new Date(post.pubDate).toISOString() ?? new Date().toISOString();
log.DEBUG("Sending an RSS post to discord", title, postId)
const rssMessage = new EmbedBuilder()
.setColor(0x0099FF)
.setTitle(title)
.setURL(link)
.setDescription(content)
.setTimestamp(pubDate)
.setDescription(`${content}`)
.addFields({ name: 'Published', value: pubDate, inline: true })
.setTimestamp()
.setFooter({ text: 'Brought to you by Emmelia.' });
try{