Remove useless aliases, bug fixes

This commit is contained in:
Daniel Odendahl Jr
2018-11-03 18:21:19 +00:00
parent 01bc93b1ba
commit f9c37e7ea6
146 changed files with 206 additions and 312 deletions
+24
View File
@@ -0,0 +1,24 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
module.exports = class AdviceCommand extends Command {
constructor(client) {
super(client, {
name: 'advice',
aliases: ['advice-slip'],
group: 'random',
memberName: 'advice',
description: 'Responds with a random bit of advice.'
});
}
async run(msg) {
try {
const { text } = await request.get('http://api.adviceslip.com/advice');
const body = JSON.parse(text);
return msg.say(`${body.slip.advice} (#${body.slip.slip_id})`);
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};