From 9aff1f1d732f665c05abdca99d7f902db6eb3bb2 Mon Sep 17 00:00:00 2001 From: carol <34490428+rhearmas@users.noreply.github.com> Date: Mon, 27 Jan 2020 11:24:17 -0800 Subject: [PATCH] knowledge! --- commands/Jokes/randomfact.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 commands/Jokes/randomfact.js diff --git a/commands/Jokes/randomfact.js b/commands/Jokes/randomfact.js new file mode 100644 index 0000000..627161d --- /dev/null +++ b/commands/Jokes/randomfact.js @@ -0,0 +1,36 @@ +exports.run = async (client, message, args, level) => { + const data = await this.fetchURL("https://uselessfacts.jsph.pl/random.json"); + + return message.channel.send({ embed: client.embed(`Fun fact!`, data.text, [ + { + name: "Source", + value: data.source, + inline: true + }, + { + name: "Source URL", + value: data.source_url, + inline: true + } + ], + { + 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: "randomfact", + category: "Jokes", + description: "Knowledge is power!", + usage: "randomfact" +};