From f9093f568120740c3b9c1f0f7581422e01aa54e7 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Sun, 25 Sep 2022 02:51:42 -0400 Subject: [PATCH] Prettify --- commands/untils/dictionary.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/commands/untils/dictionary.js b/commands/untils/dictionary.js index f3b7f46..952d25c 100644 --- a/commands/untils/dictionary.js +++ b/commands/untils/dictionary.js @@ -30,21 +30,18 @@ module.exports = { 'Content-Type': 'application/json', }) .then((response) => { - let data = response.body[0] - - if (isNotDefined(data)){ - - return interaction.editReply("Sorry, nothing was found!") - } - + let data = response.body[0] - if (isNotDefined(data.phonetics[1])){ - phonetic = "" + if (isNotDefined(data)) { + return interaction.editReply("Sorry, nothing was found!") + } + + if (isNotDefined(data.phonetics[1])) { + phonetic = "" } else { - phonetic = data.phonetics[1].text - + phonetic = data.phonetics[1].text } - + let audio = data.phonetics[0].audio if (!audio) { const embed = new EmbedBuilder()