NSFW Giphy in NSFW Channels

This commit is contained in:
Daniel Odendahl Jr
2017-05-25 22:38:18 +00:00
parent 8b3cdb386d
commit fa806047fb
+2 -1
View File
@@ -29,7 +29,8 @@ module.exports = class GiphyCommand extends Command {
.get('http://api.giphy.com/v1/gifs/search')
.query({
q: query,
api_key: GIPHY_KEY
api_key: GIPHY_KEY,
rating: msg.channel.nsfw ? 'r' : 'pg'
});
if (!body.data.length) throw new Error('No Results.');
const random = Math.floor(Math.random() * body.data.length) + 1;