Files
xiao/commands/random/shiba.js
T
Daniel Odendahl Jr d4be43bfd7 Random Bird and Shiba
2018-09-26 23:40:23 +00:00

31 lines
759 B
JavaScript

const Command = require('../../structures/Command');
const request = require('node-superfetch');
module.exports = class ShibaCommand extends Command {
constructor(client) {
super(client, {
name: 'shiba',
aliases: ['shiba-inu', 'shibe', 'shibe-inu', 'doge'],
group: 'random',
memberName: 'shiba',
description: 'Responds with a random image of a Shiba Inu.',
clientPermissions: ['ATTACH_FILES']
});
}
async run(msg) {
try {
const { body } = await request
.get('https://shibe.online/api/shibes')
.query({
count: 1,
urls: true,
httpsUrls: true
});
return msg.say({ files: [body[0]] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};