From 2aa8620590920d68250e45197f0fd5ccf8071ead Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sat, 4 Mar 2023 22:48:06 -0500 Subject: [PATCH] Fix content length bug when sending messages --- libUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libUtils.js b/libUtils.js index 63b6728..3baf970 100644 --- a/libUtils.js +++ b/libUtils.js @@ -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 });