From c2592fbe885e72beb6755ade2ba58de41d111e19 Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Wed, 28 Nov 2018 00:10:08 +0100 Subject: [PATCH] Added inspirobot --- commands/fun/ib.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 commands/fun/ib.js diff --git a/commands/fun/ib.js b/commands/fun/ib.js new file mode 100644 index 00000000..3a241023 --- /dev/null +++ b/commands/fun/ib.js @@ -0,0 +1,23 @@ +const { Command } = require('discord.js-commando'); +const fetch = require('node-fetch') +const blacklist = require('../../json/blacklist.json') + +module.exports = class BadMemeCommand extends Command { + constructor(client) { + super(client, { + name: 'ib', + aliases: ['inspirobot'], + group: 'fun', + memberName: 'ib', + description: `Return a random inspiration from inspirobot`, + }); + } + + async run(message) { + if(blacklist[message.author.id]) + return message.channel.send("You are blacklisted") + + fetch('http://inspirobot.me/api?generate=true') + .then(res => res.text()) + .then(body => message.channel.send({files: [body]})) +}} \ No newline at end of file