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