From b028aaf45fde6757f63ae4908cf56bb16cee483c Mon Sep 17 00:00:00 2001 From: filipnyquist Date: Sat, 4 Aug 2018 11:35:07 +0200 Subject: [PATCH] Replaced newline chars with spaces, this will parse the messages correctly even if newlines are in the tweet, fixes #10. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index f65edd3..a25cab2 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,7 @@ logger.info("Started LBRY twitter tipbot."); stream.on("tweet", function(tweet) { if(tweet.user.screen_name === config.get("bot.handle").substring(1)) return; let msg = checkTrunc(tweet); - msg = msg.slice(msg.lastIndexOf(config.get("bot.handle"))).split(" "); + msg = msg.replace(/[\n\\]/g, " ").slice(msg.lastIndexOf(config.get("bot.handle"))).split(" "); if (msg.length >= 2) checkTweet(tweet, msg); });