From 81f79ca0aa34f9b6fdee7efabd75899f08f15a85 Mon Sep 17 00:00:00 2001 From: carol <34490428+rhearmas@users.noreply.github.com> Date: Mon, 27 Jan 2020 11:00:28 -0800 Subject: [PATCH] oh yes, daddy --- commands/Jokes/dadjoke.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 commands/Jokes/dadjoke.js diff --git a/commands/Jokes/dadjoke.js b/commands/Jokes/dadjoke.js new file mode 100644 index 0000000..60bbf85 --- /dev/null +++ b/commands/Jokes/dadjoke.js @@ -0,0 +1,25 @@ +exports.run = async (client, message, args, level) => { + const { joke } = await this.fetchURL("https://icanhazdadjoke.com/", { headers: { Accept: "application/json" } }); + + return message.channel.send({ embed: client.embed(`Funny Dad Joke from ${client.user.username}`, joke.length < 1900 ? joke : `${joke.substring(0, 1900)}...`, + { + author: message.author.tag, + authorIcon: message.author.avatarURL, + thumbnail: "https://i.imgur.com/IxosIBh.png" + }) + }); +}; + +exports.conf = { + enabled: true, + guildOnly: false, + aliases: [], + permLevel: "User" +}; + +exports.help = { + name: "dadjoke", + category: "Jokes", + description: `Hey ${message.author}, I'm dad!`, + usage: "dadjoke" +};