From c8f74fddf77b9cfcf8b7fa8aac364c23e37ff804 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sat, 13 Apr 2019 16:30:55 +0000 Subject: [PATCH] Fix --- commands/analyze/face.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/analyze/face.js b/commands/analyze/face.js index b7f4d57b..dc332f49 100644 --- a/commands/analyze/face.js +++ b/commands/analyze/face.js @@ -31,7 +31,9 @@ module.exports = class FaceCommand extends Command { const face = await this.detect(image); if (!face) return msg.reply('There are no faces in this image.'); const pronoun = face.gender.value === 'Male' ? 'He' : 'She'; - const emotion = emotionResponse[emotions.indexOf(emotions.sort((a, b) => face.emotion[b] - face.emotion[a])[0])]; + const emotion = emotionResponse[emotions.indexOf( + emotions.slice(0).sort((a, b) => face.emotion[b] - face.emotion[a])[0] + )]; const smile = face.smile.value > face.smile.threshold; const beautyScore = face.gender.value === 'Male' ? face.beauty.female_score : face.beauty.male_score; return msg.reply(oneLine`