Remove neopet-image-finder

This commit is contained in:
Dragon Fire
2019-06-28 18:09:11 -04:00
parent 9b2ad9fa80
commit 3c9d7a31c5
2 changed files with 4 additions and 5 deletions
+4 -4
View File
@@ -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!`);
}
}
-1
View File
@@ -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"