From 8d8ff5fe5d64c8306e55b5161fa252213aec0a84 Mon Sep 17 00:00:00 2001 From: MSFTserver Date: Mon, 20 Nov 2017 08:08:16 -0800 Subject: [PATCH 1/3] fix username issues https://github.com/lbryio/lbry-wunderbot/issues/87 --- bot/modules/lbrylink.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bot/modules/lbrylink.js b/bot/modules/lbrylink.js index f55ca57..506031e 100644 --- a/bot/modules/lbrylink.js +++ b/bot/modules/lbrylink.js @@ -10,10 +10,15 @@ exports.lbrylink = function(bot, msg, suffix) { return; } var link = msg.content.indexOf("lbry://"); + console.log(link); if (link != -1) { var text = msg.content.replace("lbry://", "https://open.lbry.io/"); + console.log(text); var message = GetWordByPos(text, link); - if (text.search("<") != -1) { + if (message === "https://open.lbry.io/") { + return; + } + if (message.search("<") != -1) { var name = "@" + msg.mentions.members.first().user.username; var trim = message.split("/").pop(); var trim2 = trim.substr(2); From ecff38eaad50a64ee68d005acfb0fd8d7a5fc74f Mon Sep 17 00:00:00 2001 From: MSFTserver Date: Mon, 20 Nov 2017 08:09:15 -0800 Subject: [PATCH 2/3] remove uneeded console.logs --- bot/modules/lbrylink.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/bot/modules/lbrylink.js b/bot/modules/lbrylink.js index 506031e..5d911a5 100644 --- a/bot/modules/lbrylink.js +++ b/bot/modules/lbrylink.js @@ -10,10 +10,8 @@ exports.lbrylink = function(bot, msg, suffix) { return; } var link = msg.content.indexOf("lbry://"); - console.log(link); if (link != -1) { var text = msg.content.replace("lbry://", "https://open.lbry.io/"); - console.log(text); var message = GetWordByPos(text, link); if (message === "https://open.lbry.io/") { return; From de003e670d469f47fa8c237b0c134567e0beef1b Mon Sep 17 00:00:00 2001 From: MSFTserver Date: Tue, 21 Nov 2017 10:28:03 -0800 Subject: [PATCH 3/3] remove username from message (causing mobile issues) --- bot/modules/lbrylink.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bot/modules/lbrylink.js b/bot/modules/lbrylink.js index 5d911a5..7975eff 100644 --- a/bot/modules/lbrylink.js +++ b/bot/modules/lbrylink.js @@ -52,8 +52,7 @@ exports.lbrylink = function(bot, msg, suffix) { } const embed = { description: - msg.author + - ", I see you tried to post a LBRY URL, here's a friendly hyperlink to share and for others to access your content with a single click: \n" + + "I see you tried to post a LBRY URL, here's a friendly hyperlink to share and for others to access your content with a single click: \n" + "[lbry://" + newname + "](" +