mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 03:14:35 +02:00
Remove commands that no longer work, fix others
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class BirdCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'bird',
|
||||
aliases: ['birb'],
|
||||
group: 'random',
|
||||
memberName: 'bird',
|
||||
description: 'Responds with a random bird image.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
try {
|
||||
const { text } = await request.get('http://random.birb.pw/tweet.json/');
|
||||
return msg.say({ files: [`https://random.birb.pw/img/${JSON.parse(text).file}`] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -49,6 +49,7 @@ module.exports = class FactCommand extends Command {
|
||||
format: 'json',
|
||||
formatversion: 2
|
||||
});
|
||||
if (!body.query.random[0].title) return 'Facts are hard to find sometimes.';
|
||||
return body.query.random[0].title;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user