From 9f17bc5b07f44fc5ab63e5ff56c78125422880ca Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Fri, 20 Jul 2018 11:09:25 -0400 Subject: [PATCH 1/2] remove period from deposit tweet for easier copy/paste --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index f65edd3..7e3c45f 100644 --- a/index.js +++ b/index.js @@ -123,7 +123,7 @@ async function doBalance(tweet, msg) { async function doDeposit(tweet, msg) { try { const post = await T.post("statuses/update", { - status: `@${tweet.user.screen_name} Your deposit address is ${await getAddress(id(tweet.user.id_str))}.`, + status: `@${tweet.user.screen_name} Your deposit address is ${await getAddress(id(tweet.user.id_str))}`, in_reply_to_status_id: tweet.id_str }); logger.info( -- 2.45.2 From b028aaf45fde6757f63ae4908cf56bb16cee483c Mon Sep 17 00:00:00 2001 From: filipnyquist Date: Sat, 4 Aug 2018 11:35:07 +0200 Subject: [PATCH 2/2] 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); }); -- 2.45.2