cardboardbox/commands/Jokes/randomfact.js

37 lines
708 B
JavaScript
Raw Normal View History

2020-01-27 19:24:17 +00:00
exports.run = async (client, message, args, level) => {
2020-02-04 01:48:56 +00:00
const data = await fetchURL("https://uselessfacts.jsph.pl/random.json");
2020-01-27 19:24:17 +00:00
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"
};