Fixed message size

This commit is contained in:
filipnyquist 2018-07-06 16:55:53 +02:00
parent d88df331f1
commit e16d827cec

View file

@ -42,9 +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.indexOf(config.get("bot.handle"))).split(" ");
msg = msg.filter(a => a !== config.get("bot.handle"));
msg.unshift(config.get("bot.handle"));
msg = msg.slice(msg.lastIndexOf(config.get("bot.handle"))).split(" ");
if (msg.length >= 2) checkTweet(tweet, msg);
});