From 49224db7a76c7f03ae4d0bdb4881b19a2934725a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sun, 9 Sep 2018 01:17:11 +0200 Subject: [PATCH] Added fun fact --- commands/fun/funfact.js | 18 ++++++++++++++++++ funfact.json | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 commands/fun/funfact.js create mode 100644 funfact.json diff --git a/commands/fun/funfact.js b/commands/fun/funfact.js new file mode 100644 index 0000000..4317e9b --- /dev/null +++ b/commands/fun/funfact.js @@ -0,0 +1,18 @@ +const { Command } = require('discord.js-commando'); +const responseObject = require("../../funFact.json"); +module.exports = class FunFactCommand extends Command { + constructor(client) { + super(client, { + name: 'funfact', + group: 'fun', + memberName: 'funfact', + description: 'Replies with a some fun fact.', + }); + } + + run(message) { + const number = 2; + const funFactNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1; + message.channel.send(`Fun fact: ${responseObject[funFactNumber]}`); + } +}; \ No newline at end of file diff --git a/funfact.json b/funfact.json new file mode 100644 index 0000000..d4d7857 --- /dev/null +++ b/funfact.json @@ -0,0 +1,4 @@ +{ + "1": "When i first did the badmeme command the bot used to stock the pic locally lole good thing i fixed after that.", + "2": "There is only 1 fun fact ( or 2 if you count that one ). If you want to see your own fun fact you can dm @Supositware | Baguette#82110." +} \ No newline at end of file