From: Elias Fleckenstein Date: Sun, 6 Mar 2022 14:47:41 +0000 (+0100) Subject: Add joke API that is actually funny X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=f657368ee29bdb8bab473e3cbedf936daec89cdd;p=furrybot-discord.git Add joke API that is actually funny --- diff --git a/http.js b/http.js index 36f2555..4572419 100644 --- a/http.js +++ b/http.js @@ -58,7 +58,7 @@ module.exports = { .then(data => msg.channel.send(`<@!${target}> ${data}`)) } }, - joke: { + chucknorris: { func: (msg, [first, last]) => { if (!first) { first = "Chuck" @@ -72,6 +72,11 @@ module.exports = { .then(data => msg.reply(data.value.joke.replace(/"/g, "\"").replace(/ /g, " "))) } }, + joke: { + func: msg => fetch("https://v2.jokeapi.dev/joke/Any") + .then(res => res.json()) + .then(data => msg.reply(data.type == "single" ? data.joke : data.setup + "\n" + "||" + data.delivery + "||")) + }, "8ball": { func: msg => fetch("https://8ball.delegator.com/magic/JSON/whatever") .then(res => res.json())