diff --git a/commands/search/neopets-item.js b/commands/search/neopets-item.js index e6d02039..20625ecd 100644 --- a/commands/search/neopets-item.js +++ b/commands/search/neopets-item.js @@ -23,9 +23,8 @@ module.exports = class NeopetItemCommand extends Command { async run(msg, { item }) { try { - const search = await this.fetchItem(item); - if (!search) return msg.say('Could not find any results'); - const data = await this.fetchItemDetails(search); + const data = await this.fetchItem(item); + if (!data) return msg.say('Could not find any results'); const embed = new MessageEmbed() .setColor(0xFFCE31) .setAuthor('Neopets', 'https://i.imgur.com/BP8qxJH.png', 'http://www.neopets.com/') @@ -51,21 +50,16 @@ module.exports = class NeopetItemCommand extends Command { const id = text.match(/\/item\/([0-9]+)/); if (!id) return null; const price = text.match(/([0-9,]+) (NP|NC)/); + const url = `https://items.jellyneo.net/item/${id[1]}/`; + const details = await snekfetch.get(url); return { id: id[1], - url: `https://items.jellyneo.net/item/${id[1]}/`, + url, + name: details.text.match(/