mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 00:04:48 +02:00
Remove neopet-image-finder
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const petImage = require('neopet-image-finder');
|
||||
const request = require('node-superfetch');
|
||||
const { list } = require('../../util/Util');
|
||||
const moods = {
|
||||
happy: 1,
|
||||
@@ -45,10 +45,10 @@ module.exports = class NeopetCommand extends Command {
|
||||
|
||||
async run(msg, { pet, mood }) {
|
||||
try {
|
||||
const data = await petImage(pet, { mood: moods[mood] });
|
||||
if (!data) return msg.say('Could not find any results.');
|
||||
return msg.say({ files: [{ attachment: data.data, name: `${pet}.png` }] });
|
||||
const { body } = await request.get(`http://pets.neopets.com/cpn/${encodeURIComponent(name)}/${mood}/5.png`);
|
||||
return msg.say({ files: [{ attachment: body, name: `${pet}-${mood}.png` }] });
|
||||
} catch (err) {
|
||||
if (err.status === 404) return msg.say('Could not find any results.');
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
"moment": "^2.24.0",
|
||||
"moment-duration-format": "^2.3.2",
|
||||
"moment-timezone": "^0.5.25",
|
||||
"neopet-image-finder": "^5.0.2",
|
||||
"node-superfetch": "^0.1.9",
|
||||
"random-js": "^2.1.0",
|
||||
"winston": "^3.2.1"
|
||||
|
||||
Reference in New Issue
Block a user