mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Fox Command
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class FoxCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'fox',
|
||||
group: 'random',
|
||||
memberName: 'fox',
|
||||
description: 'Responds with a random fox image.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
try {
|
||||
const { body } = await request.get('https://randomfox.ca/floof/');
|
||||
return msg.say({ files: [body.image] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user