Files
xiao/commands/random/xiao.js
T
2018-03-06 23:34:58 +00:00

25 lines
643 B
JavaScript

const { Command } = require('discord.js-commando');
const { randomFromImgurAlbum } = require('../../util/Util');
module.exports = class XiaoCommand extends Command {
constructor(client) {
super(client, {
name: 'xiao',
aliases: ['xiao-pai', 'iao'],
group: 'random',
memberName: 'xiao',
description: 'Responds with a random image of Xiao Pai.',
clientPermissions: ['ATTACH_FILES']
});
}
async run(msg) {
try {
const xiao = await randomFromImgurAlbum('S4e3r');
return msg.say({ files: [xiao] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};