mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 08:22:37 +02:00
Cat Facts, Dog Facts
This commit is contained in:
@@ -35,6 +35,6 @@ module.exports = class PokemonFusionCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { body, palette }) {
|
run(msg, { body, palette }) {
|
||||||
return msg.say(`http://images.alexonsager.net/pokemon/fused/${body}/${body}.${palette}.png`);
|
return msg.say({ files: [`http://images.alexonsager.net/pokemon/fused/${body}/${body}.${palette}.png`] });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ module.exports = class CatCommand extends Command {
|
|||||||
try {
|
try {
|
||||||
const { body } = await snekfetch
|
const { body } = await snekfetch
|
||||||
.get('http://random.cat/meow');
|
.get('http://random.cat/meow');
|
||||||
return msg.say(body.file);
|
return msg.say({ files: [body.file] });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ module.exports = class DogCommand extends Command {
|
|||||||
async run(msg) {
|
async run(msg) {
|
||||||
try {
|
try {
|
||||||
const { body } = await snekfetch
|
const { body } = await snekfetch
|
||||||
.get('https://random.dog/woof.json');
|
.get('https://dog.ceo/api/breeds/image/random');
|
||||||
return msg.say(body.url);
|
return msg.say({ files: [body.message] });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
const snekfetch = require('snekfetch');
|
||||||
|
|
||||||
|
module.exports = class CatFactCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'cat-fact',
|
||||||
|
group: 'random-res',
|
||||||
|
memberName: 'cat-fact',
|
||||||
|
description: 'Responds with a cat fact.'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(msg) {
|
||||||
|
try {
|
||||||
|
const { body } = await snekfetch
|
||||||
|
.get('https://catfact.ninja/fact')
|
||||||
|
.query({ max_length: 2000 });
|
||||||
|
return msg.say(body.fact);
|
||||||
|
} catch (err) {
|
||||||
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
const snekfetch = require('snekfetch');
|
||||||
|
|
||||||
|
module.exports = class DogFactCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'dog-fact',
|
||||||
|
group: 'random-res',
|
||||||
|
memberName: 'dog-fact',
|
||||||
|
description: 'Responds with a dog fact.'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(msg) {
|
||||||
|
try {
|
||||||
|
const { body } = await snekfetch
|
||||||
|
.get('https://dog-api.kinduff.com/api/facts');
|
||||||
|
return msg.say(body.facts[0]);
|
||||||
|
} catch (err) {
|
||||||
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "40.4.1",
|
"version": "40.5.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Shard.js",
|
"main": "Shard.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user