cleaning output

This commit is contained in:
Raven Scott 2022-09-25 06:45:06 -04:00
parent 47cb0dba9a
commit 7b8a015825

View File

@ -31,12 +31,11 @@ module.exports = {
})
.then((response) => {
let data = response.body[0]
console.log(data.meanings)
if (isNotDefined(data)) {
return interaction.editReply("Sorry, nothing was found!")
}
if (isNotDefined(data.phonetics)) {
if (isNotDefined(data.phonetics[1])) {
phonetic = ""
} else {
phonetic = data.phonetics[1].text
@ -62,7 +61,7 @@ module.exports = {
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("Results for " + word + ": " + phonetic)
.setTitle(word + ": " + phonetic)
.addFields(meaningsArray)
.setTimestamp()
.setFooter({
@ -99,13 +98,12 @@ module.exports = {
})
}
});
console.log(data)
const file = new AttachmentBuilder('./audio/' + rand + ".mp3");
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("Results for " + word + ": " + phonetic)
.setTitle(word + ": " + phonetic)
.addFields(meaningsArray)
.setTimestamp()
.setFooter({