modified cooldowns and +inspire command
This commit is contained in:
parent
fd29ec5137
commit
2b8c67b16c
2 changed files with 27 additions and 3 deletions
23
bot/commands/Fun/inspire.js
Normal file
23
bot/commands/Fun/inspire.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const Command = require('../../base/Command.js');
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
module.exports = class Inspire extends Command {
|
||||
constructor (name, category) {
|
||||
super (name, category);
|
||||
this.name = name,
|
||||
this.description = 'Generates a (likely terrible) inspirational quote.',
|
||||
this.category = category,
|
||||
this.cooldown = 10000;
|
||||
}
|
||||
|
||||
async run (client, interaction, data) { //eslint-disable-line no-unused-vars
|
||||
interaction.deferReply();
|
||||
fetch('http://inspirobot.me/api?generate=true', { headers: { 'User-Agent': client.config.userAgent }})
|
||||
.then(res => res.text())
|
||||
.then(body => interaction.editReply(body))
|
||||
.catch(err => {
|
||||
client.logger.error('INSPIRE_COMMAND_ERROR', `API err or err replying: ${err}`);
|
||||
return interaction.editReply(`${client.config.emojis.botError} An API error occurred, sorry! I've reported this to my developers.`);
|
||||
});
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue