diff --git a/commands/untils/dictionary.js b/commands/untils/dictionary.js index f40ce5d..9c6fd69 100644 --- a/commands/untils/dictionary.js +++ b/commands/untils/dictionary.js @@ -70,10 +70,18 @@ module.exports = { console.log("audio downloaded") console.log(response.body) data.meanings.forEach(wordData => { - meaningsArray.push({ - "name": wordData.partOfSpeech, - "value": wordData.definitions[0].definition - }) + + if (wordData.definitions[0].example) { + meaningsArray.push({ + "name": wordData.partOfSpeech, + "value": wordData.definitions[0].definition + "\nExample: " + wordData.definitions[0].example + }) + } else { + meaningsArray.push({ + "name": wordData.partOfSpeech, + "value": wordData.definitions[0].definition + }) + } }); const file = new AttachmentBuilder('./audio/' + rand + ".mp3");