Adding examples to dictionary if one is provided
This commit is contained in:
parent
34a842b707
commit
d85912e80d
@ -70,10 +70,18 @@ module.exports = {
|
||||
console.log("audio downloaded")
|
||||
console.log(response.body)
|
||||
data.meanings.forEach(wordData => {
|
||||
|
||||
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");
|
||||
|
Loading…
Reference in New Issue
Block a user