Explicitly Declared Implicitly declared vars

This commit is contained in:
Ralph 2018-06-01 14:40:19 -04:00 committed by GitHub
parent 61198288fb
commit 54638a2e7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,7 @@ exports.lbrylink = function(bot, msg, suffix) {
} }
if (msg.content.includes('lbry://')) { if (msg.content.includes('lbry://')) {
//Extract URL from Message //Extract URL from Message
newURL = msg.content let newURL = msg.content
.replace('lbry://', 'https://open.lbry.io/') .replace('lbry://', 'https://open.lbry.io/')
.match(/\bhttps?:\/\/\S+/gi) .match(/\bhttps?:\/\/\S+/gi)
.toString(); .toString();
@ -28,8 +28,8 @@ exports.lbrylink = function(bot, msg, suffix) {
//Check if Username Was Supplied //Check if Username Was Supplied
if (newURL.includes('>')) { if (newURL.includes('>')) {
//Get rid of ID from message //Get rid of ID from message
parseID = newURL.split('>').pop(); let parseID = newURL.split('>').pop();
newURL = 'https://open.lbry.io' + parseID; let newURL = 'https://open.lbry.io' + parseID;
if (responseDebug) { if (responseDebug) {
console.log('Username Provided!'); console.log('Username Provided!');
console.log('parseID = ' + parseID); console.log('parseID = ' + parseID);
@ -45,8 +45,8 @@ exports.lbrylink = function(bot, msg, suffix) {
//Also check obscurity in username like ``@MSFTserver` vs `@MSFTserverPics` //Also check obscurity in username like ``@MSFTserver` vs `@MSFTserverPics`
if (parseID.includes('/')) { if (parseID.includes('/')) {
//parse out extra params before `/` like `<@123456789>Pics` //parse out extra params before `/` like `<@123456789>Pics`
parseID = parseID.split('/').pop(); let parseID = parseID.split('/').pop();
newURL = 'https://open.lbry.io/' + parseID; let newURL = 'https://open.lbry.io/' + parseID;
if (responseDebug) { if (responseDebug) {
console.log('Username no / check'); console.log('Username no / check');
console.log('parseID = ' + parseID); console.log('parseID = ' + parseID);