Fix content length bug when sending messages
This commit is contained in:
@@ -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 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user