fix username issues

https://github.com/lbryio/lbry-wunderbot/issues/87
This commit is contained in:
MSFTserver 2017-11-20 08:08:16 -08:00 committed by GitHub
parent 766cca7e49
commit 8d8ff5fe5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);