modified cooldowns and +inspire command
This commit is contained in:
parent
fd29ec5137
commit
2b8c67b16c
2 changed files with 27 additions and 3 deletions
|
@ -7,7 +7,8 @@ module.exports = class Garfield extends Command {
|
||||||
super (name, category);
|
super (name, category);
|
||||||
this.name = name,
|
this.name = name,
|
||||||
this.description = 'John I require lasagna',
|
this.description = 'John I require lasagna',
|
||||||
this.category = category;
|
this.category = category,
|
||||||
|
this.cooldown = 20000,
|
||||||
this.options = [
|
this.options = [
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
|
@ -71,10 +72,10 @@ module.exports = class Garfield extends Command {
|
||||||
.setColor(bot.user.hexAccentColor ?? bot.displayHexColor)
|
.setColor(bot.user.hexAccentColor ?? bot.displayHexColor)
|
||||||
.setImage(json.data.image.src);
|
.setImage(json.data.image.src);
|
||||||
interaction.editReply({ embeds: [embed] });
|
interaction.editReply({ embeds: [embed] });
|
||||||
}).catch(err => {
|
})
|
||||||
|
.catch(err => {
|
||||||
client.logger.error('GARFIELD_COMMAND_ERROR', `API err or err replying: ${err}`);
|
client.logger.error('GARFIELD_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.`);
|
return interaction.editReply(`${client.config.emojis.botError} An API error occurred, sorry! I've reported this to my developers.`);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
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…
Reference in a new issue