diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-03-05 21:01:36 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-03-05 21:01:36 +0100 |
commit | 2e797dd24009c52fa712317038900663a5aa32ac (patch) | |
tree | ce47e0bbe7d3ad4c2f9c1a1a1be7e9612e5723ed /http.js | |
parent | cbfeba348cff6eacb0b7f530ba370170ef22bda0 (diff) | |
download | furrybot-discord-2e797dd24009c52fa712317038900663a5aa32ac.tar.xz |
Safe search
Diffstat (limited to 'http.js')
-rw-r--r-- | http.js | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -6,10 +6,9 @@ module.exports = { google: { params: "<keyword> [...]", help: "Google Image Search", - func: (msg, keywords) => { - google_images.searchRandom(keywords.join(" ")) + func: (msg, keywords) => + google_images.searchRandom(keywords.join(" "), true) .then(result => msg.reply(result.image.url)) - } }, verse: { func: msg => fetch("https://labs.bible.org/api/?type=json&passage=random") @@ -17,7 +16,7 @@ module.exports = { .then(data => msg.reply(`${data[0].text} [${data[0].bookname} ${data[0].chapter}, ${data[0].verse}]`)) }, define: { - func: (msg, [word]) => word ? fetch("https://api.dictionaryapi.dev/api/v1/entries/en_US/" + word) + func: (msg, term) => term.length > 0 ? fetch("https://api.dictionaryapi.dev/api/v1/entries/en_US/" + term.join(" ")) .then(res => res.json()) .then(data => { let def = data[0] @@ -35,7 +34,7 @@ module.exports = { : msg.reply("You need to specify a word") }, urban: { - func: (msg, [word]) => word ? fetch("https://api.urbandictionary.com/v0/define?term=" + word) + func: (msg, term) => term.length > 0 ? fetch("https://api.urbandictionary.com/v0/define?term=" + term.join(" ")) .then(res => res.json()) .then(data => { let def = common.choose(data.list) |