2018-11-28 00:10:08 +01:00
|
|
|
const { Command } = require('discord.js-commando');
|
|
|
|
const fetch = require('node-fetch')
|
2018-11-28 01:35:26 +01:00
|
|
|
const SelfReloadJSON = require('self-reload-json');
|
|
|
|
const blacklist = require('../../blacklist');
|
2018-11-28 00:10:08 +01:00
|
|
|
|
|
|
|
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) {
|
2018-11-28 01:35:26 +01:00
|
|
|
let blacklistJson = new SelfReloadJSON('json/blacklist.json');
|
|
|
|
if(blacklistJson[message.author.id])
|
|
|
|
return blacklist(blacklistJson[message.author.id] , message)
|
2018-11-28 00:10:08 +01:00
|
|
|
|
|
|
|
fetch('http://inspirobot.me/api?generate=true')
|
|
|
|
.then(res => res.text())
|
|
|
|
.then(body => message.channel.send({files: [body]}))
|
|
|
|
}}
|