2020-03-26 04:31:32 +00:00
|
|
|
const fetch = require("node-fetch")
|
2020-03-09 22:20:45 +00:00
|
|
|
exports.run = async (bot, message, args) => {
|
2020-03-11 20:47:06 +00:00
|
|
|
message.channel.startTyping();
|
|
|
|
try{
|
2020-03-26 04:31:32 +00:00
|
|
|
fetch('https://catfact.ninja/facts')
|
|
|
|
.then(res => res.json())
|
|
|
|
.then(json => message.channel.send(`__**Did you know?**__\n${json.data[0].fact}`))
|
2020-03-16 01:14:33 +00:00
|
|
|
} catch(err) {
|
2020-03-26 04:31:32 +00:00
|
|
|
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
|
2020-03-16 01:14:33 +00:00
|
|
|
};
|
2020-03-26 14:04:34 +00:00
|
|
|
message.channel.stopTyping();
|
2020-03-09 22:20:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.conf = {
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: false,
|
|
|
|
aliases: ["kittenfact"],
|
|
|
|
permLevel: "User",
|
|
|
|
requiredPerms: []
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.help = {
|
|
|
|
name: "catfact",
|
2020-03-10 00:12:00 +00:00
|
|
|
category: "Fun",
|
2020-03-09 22:20:45 +00:00
|
|
|
description: "Sends a fun fact about a cat.",
|
|
|
|
usage: "catfact/kittenfact"
|
|
|
|
};
|