Haha-Yes/commands/fun/ib.js

24 lines
588 B
JavaScript
Raw Permalink Normal View History

2018-12-30 01:20:24 +01:00
const { Command } = require('discord-akairo');
const fetch = require('node-fetch');
class InspiroBotCommand extends Command {
2019-01-02 08:09:45 +01:00
constructor() {
super('InspiroBot', {
aliases: ['inspirobot', 'ib'],
2019-03-30 04:43:44 +01:00
category: 'fun',
2019-11-09 12:04:01 +01:00
clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'],
2019-01-02 08:09:45 +01:00
description: {
2018-12-30 01:20:24 +01:00
content: 'Send images from Inspirobot',
usage: '',
examples: ['']
}
2019-01-02 08:09:45 +01:00
});
}
2018-12-30 01:20:24 +01:00
2019-01-02 08:09:45 +01:00
async exec(message) {
fetch('http://inspirobot.me/api?generate=true')
.then(res => res.text())
.then(body => message.channel.send({files: [body]}));
}
2018-12-30 01:20:24 +01:00
}
module.exports = InspiroBotCommand;