Replaced newline chars with spaces, this will parse the messages correctly even if newlines are in the tweet, fixes #10.
This commit is contained in:
parent
e16d827cec
commit
b028aaf45f
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue