mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
32 lines
924 B
JavaScript
32 lines
924 B
JavaScript
const Command = require('../../framework/Command');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const images = fs.readdirSync(path.join(__dirname, '..', '..', 'assets', 'images', 'xiao'));
|
|
|
|
module.exports = class XiaoCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'xiao',
|
|
aliases: ['xiao-pai', 'iao'],
|
|
group: 'random-img',
|
|
memberName: 'xiao',
|
|
description: 'Responds with a random image of Xiao Pai.',
|
|
clientPermissions: ['ATTACH_FILES'],
|
|
albumID: XIAO_ALBUM_ID,
|
|
credit: [
|
|
{
|
|
name: 'Marvelous',
|
|
url: 'http://www.marv.jp/',
|
|
reasonURL: 'http://www.runefactory4.com/index1.html',
|
|
reason: 'Images, Original "Rune Factory 4" Game'
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg) {
|
|
const image = images[Math.floor(Math.random() * images.length)];
|
|
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'xiao', images[image])] });
|
|
}
|
|
};
|