Comparing version 2.3.0 to 2.3.1
@@ -94,3 +94,3 @@ const url = require('url'); | ||
if (!body || !body.data.length) { | ||
if (!body || !body.data || !body.data.length) { | ||
return callback(); | ||
@@ -119,3 +119,3 @@ } | ||
youtubeSearch(args, { key: process.env.GOOGLE_API_KEY }, function(err, results) { | ||
youtubeSearch(args, { key: process.env.GOOGLE_API_KEY, type: 'video' }, function(err, results) { | ||
if (err) { | ||
@@ -257,5 +257,6 @@ return callback(); | ||
var commandName = tokens[1]; | ||
var command = commands[commandName.toLowerCase()]; | ||
// If the /command isn't supported, return. | ||
if (!commands[commandName]) { | ||
if (!command) { | ||
return callback(); | ||
@@ -268,3 +269,3 @@ } | ||
// Execute the /command | ||
commands[commandName](args, (err, result) => { | ||
command(args, (err, result) => { | ||
if (err) { | ||
@@ -271,0 +272,0 @@ return callback(err); |
@@ -25,3 +25,3 @@ { | ||
}, | ||
"version": "2.3.0" | ||
"version": "2.3.1" | ||
} |
@@ -180,2 +180,9 @@ const assert = require('assert'); | ||
}); | ||
it('/SHRUG', function(done) { | ||
mehdown.render('/SHRUG', function(err, html) { | ||
assert.equal(html, '<p>¯\\\_(ツ)_/¯</p>'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
@@ -193,2 +200,9 @@ | ||
}); | ||
it('/youtube simon\'s cat', function(done) { | ||
mehdown.render('/youtube simon\'s cat', function(err, html) { | ||
assert.notEqual(html, '<a href="https://www.youtube.com/channel/UCH6vXjt-BA7QHl0KnfL-7RQ" rel="nofollow" target="_blank">https://www.youtube.com/channel/UCH6vXjt-BA7QHl0KnfL-7RQ</a>'); | ||
done(); | ||
}); | ||
}); | ||
} | ||
@@ -195,0 +209,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109945
1734