diff --git a/bot/modules/commands.js b/bot/modules/commands.js index 82e9b68..bbfd58f 100644 --- a/bot/modules/commands.js +++ b/bot/modules/commands.js @@ -17,7 +17,7 @@ exports.commands = [ "name", "mining", "pricestance", - "publisher", + "youtuber", "publish", "random", "referrals", @@ -36,17 +36,20 @@ exports.commands = [ "email", "cli", "ipfstorrent" + "shapeshift" + "youtube" + "transactions" ]; exports.helpcommands = { usage: " ", description: - "Displays Helpful Commands:\n!what, !beta, !begging, !github, !appdownload, !daemondownload, !directories, !faq, !name, !mining, !pricestance, !publisher, !publish, !random, !referrals, !rewards, !rewardsvsreferrals, !cc, !verify, !verification, !logfile, !backup, !startup, !streamingissues, !ports, !migrate, !tipping, !email, !cli, !ipfstorrent", + "Displays Helpful Commands:\n!what, !beta, !begging, !github, !appdownload, !daemondownload, !directories, !faq, !name, !mining, !pricestance, !youtuber, !publish, !random, !referrals, !rewards, !rewardsvsreferrals, !cc, !verify, !verification, !logfile, !backup, !startup, !streamingissues, !ports, !migrate, !tipping, !email, !cli, !ipfstorrent, !shapeshift, !youtube, !transactions", process: function(bot, msg) { msg.channel.send({ embed: { description: - "**!what, !beta, !begging, !github, !appdownload, !daemondownload, !directories, !faq, !name, !mining, !pricestance, !publisher, !publish, !random, !referrals, !rewards, !rewardsvsreferrals, !cc, !verify, !verification, !logfile, !backup, !startup, !streamingissues, !ports, !migrate, !tipping, !email, !cli, !ipfstorrent**", + "**!what, !beta, !begging, !github, !appdownload, !daemondownload, !directories, !faq, !name, !mining, !pricestance, !youtuber, !publish, !random, !referrals, !rewards, !rewardsvsreferrals, !cc, !verify, !verification, !logfile, !backup, !startup, !streamingissues, !ports, !migrate, !tipping, !email, !cli, !ipfstorrent, !shapeshift, !youtube, !transactions**", color: 7976557, author: { name: "List of Helpful LBRY Commands", @@ -268,17 +271,17 @@ exports.pricestance = { } }; -exports.publisher = { +exports.youtuber = { usage: " ", - description: "Interested in publishing on LBRY?", + description: "Are you a Youtuber curious about LBRY?", process: function(bot, msg) { const embed = { description: - "Interested in publishing on LBRY? Have a look at [lbry.io/publish](https://lbry.io/publish)", + "Are you a Youtuber curious about LBRY? Have a look at [lbry.io/youtube](https://lbry.io/youtube)", color: 7976557, author: { - name: "Want to Publish?", - url: "https://lbry.io/publish", + name: "Are you a Youtuber?", + url: "https://lbry.io/youtube", icon_url: "https://i.imgur.com/yWf5USu.png" } }; @@ -346,11 +349,11 @@ exports.rewards = { process: function(bot, msg) { const embed = { description: - "Rewards are given to legitimate users who are using the system (and in turn are testing things for us). In order to redeem rewards, you may need to verify your identity through a Credit Card or other manual methods.\n Please see [lbry.io/faq/identity-requirements](https://lbry.io/faq/identity-requirements)", + "[Rewards](https://lbry.io/faq/rewards) are given to legitimate users who are using the system (and in turn are testing things for us). In order to redeem rewards, you may need to verify your identity through a Credit Card or other manual methods.\n Please see [lbry.io/faq/identity-requirements](https://lbry.io/faq/identity-requirements)", color: 7976557, author: { name: "Rewards", - url: "https://lbry.io/faq/identity-requirements", + url: "https://lbry.io/faq/rewards", icon_url: "https://i.imgur.com/yWf5USu.png" } }; @@ -417,18 +420,18 @@ exports.verification = { var message = "If you would like to be verified go to <#" + verificationChannel + - ">. After joining, post that you would like verification and a mod will get to your request as soon as possible. We appreciate your patience. Only one account per person is allowed access to LBRY Rewards. This channel is not for YouTube sync, which is a separate process that requires a minimum number of views on Youtube (If you restarted LBRY and didn't get verified, you most likely don't qualify)."; + ">. After joining, post that you would like verification and a mod will get to your request as soon as possible. We appreciate your patience. Only one account per person is allowed access to LBRY Rewards. Check out our [YouTube Sync](https://lbry.io/faq/youtube) for assistance with the YouTube Sync rewards verification method."; msg.channel.send(message); } }; exports.logfile = { usage: " ", - description: "How to fine LBRY-app Log File?", + description: "How to find LBRY-app Log File?", process: function(bot, msg) { const embed = { description: - "You can find your log files by following the tutorial [HERE](https://lbry.io/faq/how-to-find-lbry-log-file)", + "You can find your log files by following the guide [HERE](https://lbry.io/faq/how-to-find-lbry-log-file)", color: 7976557, author: { name: "How to find my LogFile?", @@ -621,3 +624,63 @@ exports.ipfstorrent = { }); } }; + +exports.shapeshift = { + usage: " ", + description: "How can I convert my crypto into LBC?", + process: function(bot, msg) { + const embed = { + description: + "Please see this guide on how to convert your crypto into LBC: [lbry.io/faq/shapeshift](https://lbry.io/faq/shapeshift)", + color: 7976557, + author: { + name: "How can I convert my crypto into LBC?", + url: "https://lbry.io/faq/shapeshift", + icon_url: "https://i.imgur.com/yWf5USu.png" + } + }; + msg.channel.send({ + embed + }); + } +}; + +exports.youtube = { + usage: " ", + description: "What is YouTube Sync?", + process: function(bot, msg) { + const embed = { + description: + "Please see this guide on how youtube sync works, check out [lbry.io/faq/youtube](https://lbry.io/faq/youtube)", + color: 7976557, + author: { + name: "What is YouTube Sync?", + url: "https://lbry.io/faq/youtube", + icon_url: "https://i.imgur.com/yWf5USu.png" + } + }; + msg.channel.send({ + embed + }); + } +}; +exports.transactions = { + usage: " ", + description: "What types of LBRY transactions are there?", + process: function(bot, msg) { + const embed = { + description: + "Please see this guide on [transaction types](https://lbry.io/faq/transaction-types)", + color: 7976557, + author: { + name: "What types of LBRY transactions are there?", + url: "https://lbry.io/faq/transaction-types", + icon_url: "https://i.imgur.com/yWf5USu.png" + } + }; + msg.channel.send({ + embed + }); + } +}; + diff --git a/bot/modules/lbrylink.js b/bot/modules/lbrylink.js index f55ca57..7975eff 100644 --- a/bot/modules/lbrylink.js +++ b/bot/modules/lbrylink.js @@ -13,7 +13,10 @@ exports.lbrylink = function(bot, msg, suffix) { if (link != -1) { var text = msg.content.replace("lbry://", "https://open.lbry.io/"); 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); @@ -49,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 + "](" + diff --git a/bot/modules/releasenotes.js b/bot/modules/releasenotes.js index f8078ba..52d4514 100644 --- a/bot/modules/releasenotes.js +++ b/bot/modules/releasenotes.js @@ -29,33 +29,138 @@ exports.releasenotes = { releasename = JSON.parse(body).name; releasedate = JSON.parse(body).published_at; releaseurl = JSON.parse(body).html_url; - message = { - embed: { - title: "*Download " + releasename + " here!*", - description: releasemessage, - url: releaseurl, - color: 7976557, - timestamp: releasedate, - author: { - name: "Lbry-app Release Notes for " + releasename, - icon_url: - "http://www.pngall.com/wp-content/uploads/2016/04/Github-PNG-Image.png" - }, - footer: { - icon_url: "https://i.imgur.com/yWf5USu.png", - text: "Lbry-app Updated " + if (releasemessage.length < 2000) { + message = { + embed: { + title: "*Download " + releasename + " here!*", + description: releasemessage, + url: releaseurl, + color: 7976557, + timestamp: releasedate, + author: { + name: "Lbry-app Release Notes for " + releasename, + icon_url: "http://www.pngall.com/wp-content/uploads/2016/04/Github-PNG-Image.png" + }, + footer: { + icon_url: "https://i.imgur.com/yWf5USu.png", + text: "Lbry-app Updated " + } } + }; + if (inPrivate(msg)) { + msg.channel.send(message); + return; + } + if (hasPerms(msg) && suffix === "post") { + bot.channels.get(ChannelID).send(message); + } else { + msg.channel.send(msg.author + " Release notes sent via DM"); + msg.author.send(message); } - }; - if (inPrivate(msg)) { - msg.channel.send(message); - return; - } - if (hasPerms(msg) && suffix === "post") { - bot.channels.get(ChannelID).send(message); } else { - msg.channel.send(msg.author + " Release notes sent via DM"); - msg.author.send(message); + message = releasemessage.trim().split("###").filter(function(n) { + return n !== ""; + }); + releasemessage1 = message[0]; + releasemessage2 = message[1]; + releasemessage3 = message[2]; + releasemessage4 = message[3]; + releasemessage5 = message[4]; + message1 = { + embed: { + title: "*Download " + releasename + " here!*", + description: releasemessage1, + url: releaseurl, + color: 7976557, + timestamp: releasedate, + author: { + name: "Lbry-app Release Notes for " + releasename, + icon_url: "http://www.pngall.com/wp-content/uploads/2016/04/Github-PNG-Image.png" + }, + footer: { + icon_url: "https://i.imgur.com/yWf5USu.png", + text: "Lbry-app Updated " + } + } + }; + message2 = { + embed: { + description: releasemessage2, + color: 7976557, + timestamp: releasedate, + author: { + icon_url: "http://www.pngall.com/wp-content/uploads/2016/04/Github-PNG-Image.png" + }, + footer: { + icon_url: "https://i.imgur.com/yWf5USu.png", + text: "Lbry-app Updated " + } + } + }; + message3 = { + embed: { + description: releasemessage3, + color: 7976557, + timestamp: releasedate, + author: { + icon_url: "http://www.pngall.com/wp-content/uploads/2016/04/Github-PNG-Image.png" + }, + footer: { + icon_url: "https://i.imgur.com/yWf5USu.png", + text: "Lbry-app Updated " + } + } + }; + message4 = { + embed: { + description: releasemessage4, + color: 7976557, + timestamp: releasedate, + author: { + icon_url: "http://www.pngall.com/wp-content/uploads/2016/04/Github-PNG-Image.png" + }, + footer: { + icon_url: "https://i.imgur.com/yWf5USu.png", + text: "Lbry-app Updated " + } + } + }; + message5 = { + embed: { + description: releasemessage5, + color: 7976557, + timestamp: releasedate, + author: { + icon_url: "http://www.pngall.com/wp-content/uploads/2016/04/Github-PNG-Image.png" + }, + footer: { + icon_url: "https://i.imgur.com/yWf5USu.png", + text: "Lbry-app Updated " + } + } + }; + if (inPrivate(msg)) { + msg.channel.send(message1); + msg.channel.send(message2); + msg.channel.send(message3); + msg.channel.send(message4); + msg.channel.send(message5); + return; + } + if (hasPerms(msg) && suffix === "post") { + bot.channels.get(ChannelID).send(message1); + bot.channels.get(ChannelID).send(message2); + bot.channels.get(ChannelID).send(message3); + bot.channels.get(ChannelID).send(message4); + bot.channels.get(ChannelID).send(message5); + } else { + msg.channel.send(msg.author + " Release notes sent via DM"); + msg.author.send(message1); + msg.author.send(message2); + msg.author.send(message3); + msg.author.send(message4); + msg.author.send(message5); + } } }); } diff --git a/bot/modules/rolesetter.js b/bot/modules/rolesetter.js index 706baeb..05ad91b 100644 --- a/bot/modules/rolesetter.js +++ b/bot/modules/rolesetter.js @@ -1,5 +1,6 @@ -var config = require("config"); -rolelist = config.get("rolelist"); +let config = require("config"); +let botconfig = config.get("bot"); +let rolelist = config.get("rolelist"); exports.commands = [ "addrole", // command that is in this file, every command needs it own export as shown below @@ -21,28 +22,34 @@ exports.addrole = { //console.log(rolelist); //console.log(rolelist.allowedroles); //console.log(config.get('allowedroles')); - if (rolelist.allowedroles.includes(suffix)) { - //console.log('Role is in allowed roles.'); - //console.log('Role to add: ' + newrole); - if (!msg.member.roles.find("name", suffix)) { - msg.member - .addRole(newrole) - .then( + if (suffix) { + if (rolelist.allowedroles.includes(suffix)) { + //console.log('Role is in allowed roles.'); + //console.log('Role to add: ' + newrole); + if (!msg.member.roles.find("name", suffix)) { + msg.member + .addRole(newrole) + .then( + msg.channel.send( + msg.member + " has been added to the " + suffix + " role!" + ) + ); + //console.log('Added role') + //msg.channel.send(msg.member + ' has been added to the ' + suffix + ' role!'); + } else { + msg.channel.send( + "It seems that you already have that role! Try removing it first with the " + botconfig.prefix + "delrole command!" + ); + } + } else { msg.channel.send( - msg.member + " has been added to the " + suffix + " role!" - ) - ); - //console.log('Added role') - //msg.channel.send(msg.member + ' has been added to the ' + suffix + ' role!'); - } else { - msg.channel.send( - "It seems that you already have that role! Try removing it first with the delrole command!" - ); - } + "That role isn't one you can add yourself too! Please run the " + botconfig.prefix + "roles command to find out which ones are allowed." + ); + } } else { - msg.channel.send( - "That role isn't one you can add yourself too! Please run the roles command to find out which ones are allowed." - ); + msg.channel.send ( + "Please specify a role. Type " + botconfig.prefix + "roles to see which you may add!" + ) } } }; @@ -56,24 +63,30 @@ exports.delrole = { //console.log('Delrole Event firing.'); //console.log(msg); //console.log('Printing Suffix! ' + suffix); - if (rolelist.allowedroles.includes(suffix)) { - if (msg.member.roles.find("name", suffix)) { - msg.member - .removeRole(oldrole) - .then( + if (suffix) { + if (rolelist.allowedroles.includes(suffix)) { + if (msg.member.roles.find("name", suffix)) { + msg.member + .removeRole(oldrole) + .then( + msg.channel.send( + msg.member + " has been removed from the " + suffix + " role!" + ) + ); + } else { + msg.channel.send( + "You don't seem to have that role! Try adding it first with the " + botconfig.prefix + "addrole command!" + ); + } + } else { msg.channel.send( - msg.member + " has been removed from the " + suffix + " role!" - ) - ); - } else { - msg.channel.send( - "You don't seem to have that role! Try adding it first with the addrole command!" - ); - } + "That role isn't one you can add yourself too! Please run the " + botconfig.prefix + "roles command to find out which ones are allowed." + ); + } } else { - msg.channel.send( - "That role isn't one you can add yourself too! Please run the roles command to find out which ones are allowed." - ); + msg.channel.send( + "Please specify a role. Type " + botconfig.prefix + "roles to see which you may add!" + ) } } }; diff --git a/config/default.json.example b/config/default.json.example index 873c6af..8cc9366 100644 --- a/config/default.json.example +++ b/config/default.json.example @@ -77,8 +77,8 @@ }, "rolelist": { "allowedroles": [ - "Role1", - "Role2" + "Reward Scammer", + "Reported Scammer" ] }, "claimbot": {