From 68ae8bbc7d872889de39586ca579eb24cd8adffb Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sun, 17 Dec 2017 02:54:11 +0000 Subject: [PATCH] Fix --- assets/json/rotten-tomatoes.json | 4 ++-- commands/search/rotten-tomatoes.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/json/rotten-tomatoes.json b/assets/json/rotten-tomatoes.json index f8757609..313f613a 100644 --- a/assets/json/rotten-tomatoes.json +++ b/assets/json/rotten-tomatoes.json @@ -5,7 +5,7 @@ "rotten": "<:splat_tomato:391778462194728961>" }, "audience": { - "fresh": "<:standing_popcorn:391778463045910538>", - "rotten": "<:tipped_popcorn:391778462312169472>" + "Upright": "<:standing_popcorn:391778463045910538>", + "Spilled": "<:tipped_popcorn:391778462312169472>" } } diff --git a/commands/search/rotten-tomatoes.js b/commands/search/rotten-tomatoes.js index 1126766e..393e0c53 100644 --- a/commands/search/rotten-tomatoes.js +++ b/commands/search/rotten-tomatoes.js @@ -36,8 +36,8 @@ module.exports = class RottenTomatoesCommand extends Command { const urlID = find.url.replace('/m/', ''); const { text } = await snekfetch.get(`https://www.rottentomatoes.com/api/private/v1.0/movies/${urlID}`); const body = JSON.parse(text); - const criticScre = body.ratingSummary.allCritics; - const audienceScre = body.ratingSummary.audience; + const criticS = body.ratingSummary.allCritics; + const audienceS = body.ratingSummary.audience; const embed = new MessageEmbed() .setColor(0xFFEC02) .setTitle(`${body.title} (${body.year})`) @@ -46,9 +46,9 @@ module.exports = class RottenTomatoesCommand extends Command { .setDescription(shorten(body.ratingSummary.consensus)) .setThumbnail(body.posters.original) .addField('❯ Critic Score', - criticScre.meterValue ? `${critic[criticScre.meterClass]} ${criticScre.meterValue}%` : '???', true) + criticS.meterValue ? `${critic[criticS.meterClass]} ${criticS.meterValue}%` : '???', true) .addField('❯ Audience Score', - audienceScre.meterValue ? `${audience[audienceScre.meterClass]} ${audienceScre.meterValue}%` : '???', true); + audienceS.meterScore ? `${audience[body.ratings.audience_rating]} ${audienceS.meterScore}%` : '???', true); return msg.embed(embed); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);