Merge pull request #14 from lbryio/tip-fix-newlines

Replaced newline chars with spaces, this will parse the messages corr…
This commit is contained in:
filipnyquist 2018-08-04 11:35:58 +02:00 committed by GitHub
commit 6bc58da4c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ logger.info("Started LBRY twitter tipbot.");
stream.on("tweet", function(tweet) { stream.on("tweet", function(tweet) {
if(tweet.user.screen_name === config.get("bot.handle").substring(1)) return; if(tweet.user.screen_name === config.get("bot.handle").substring(1)) return;
let msg = checkTrunc(tweet); 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); if (msg.length >= 2) checkTweet(tweet, msg);
}); });