Put CatFact and DogFact into the "Fun" category while also adding a discord disconnect and reconnect logger.
This commit is contained in:
Terryiscool160 2020-03-10 00:12:00 +00:00 committed by GitHub
parent a91d4774eb
commit e2403b6cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 3 deletions

View File

@ -3,7 +3,7 @@ const request = require("request");
exports.run = async (bot, message, args) => {
request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => {
if (error) throw new Error(error);
message.channel.send(`**Did you know?**\n ${body.facts[0]}`);
message.channel.send(`**Did you know?**\n ${body.data[0].facts}`);
});
};
@ -17,7 +17,7 @@ exports.conf = {
exports.help = {
name: "catfact",
category: "User",
category: "Fun",
description: "Sends a fun fact about a cat.",
usage: "catfact/kittenfact"
};

27
src/commands/dicerole.js Normal file
View File

@ -0,0 +1,27 @@
exports.run = async (bot, message, args) => {
if (args.length === 0) {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(6).keys()).random() + 1}.`);
} else {
if (args[0].match(/^\d+$/)) {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(parseInt(args[0])).keys()).random() + 1}.`);
} else {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(6).keys()).random() + 1}.`);
}
}
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["diceroll"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "dice",
category: "Fun",
description: "Rolls a dice.",
usage: "dice"
};

View File

@ -17,7 +17,7 @@ exports.conf = {
exports.help = {
name: "dogfact",
category: "User",
category: "Fun",
description: "Sends a fun fact about a doggo.",
usage: "dogfact/pupfact"
};

3
src/events/disconnect.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = client => { // logs if the bot gets disconnected from discord.
client.logger.warn(`Bot disconnected at ${new Date()}`);
};

View File

@ -0,0 +1,3 @@
module.exports = client => { // logs when the bot reconnects to discord
client.logger.info(`Reconnecting at ${new Date()}`);
};