Fix content length bug when sending messages

This commit is contained in:
Logan Cusano
2023-03-04 22:48:06 -05:00
parent 3d63d5733a
commit 2aa8620590

View File

@@ -72,7 +72,7 @@ exports.onError = (error) => {
exports.sendPost = (post, source, channel, callback) => {
const postTitle = post.title;
const postLink = post.link;
const postContent = NodeHtmlMarkdown.translate(post.content);
const postContent = NodeHtmlMarkdown.translate(post.content).length;
const postId = post.postId;
const postPubDate = new Date(post.pubDate).toISOString() ?? new Date().toISOString();
var postSourceLink = new URL(source.link);
@@ -84,7 +84,7 @@ exports.sendPost = (post, source, channel, callback) => {
.setColor(0x0099FF)
.setTitle(postTitle)
.setURL(postLink)
.addFields({ name: "Post Content", value: postContent, inline: false })
.addFields({ name: "Post Content", value: postContent.slice(0,1024), inline: false })
.addFields({ name: 'Published', value: postPubDate, inline: true })
.addFields({ name: 'Source', value: postSourceLink, inline: true });