Trim articles that are too long rather than skipping them

This commit is contained in:
Yotam Barnoy 2018-06-04 16:33:53 -04:00 committed by GitHub
parent ac29bd801d
commit 01a60db602
1 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ function formatPost(article) {
let message = "";
if (article.title) message += `\n**${article.title}**`;
if (article.content) message += article.content.length > Config.charLimit ? "\nArticle content too long for a single Discord message!" : `\n${article.content}`;
if (article.content) message += article.content.length > Config.charLimit ? `\n${article.content.substr(0, Config.charLimit)}...` : `\n${article.content}`;
if (article.link) message += `\n\n${normaliseUrlForDiscord(article.link)}`;
return message;