Hi everyone, I'm trying to map messages from Discord.js to an array, but array field is missing, here is my function:
const embeds = () => {
let array = [] as any[];
m.embeds.forEach(e => {
array.push({
author: {
name: e.author?.name,
iconURL: () => {
return e.author?.iconURL || null;
},
proxyIconURL: () => {
return e.author?.proxyIconURL || null;
},
url: e.author?.url || null
},
description: e.description || null,
fields: () => {
let fieldsembed = [] as any[];
e.fields.forEach(f => {
fieldsembed.push({
inline: f.inline,
name: f.name,
value: f.value
})
})
return fieldsembed;
},
footer: {
iconURL: e.footer?.iconURL,
proxyIconURL: e.footer?.proxyIconURL,
text: e.footer?.text
},
hexColor: e.hexColor || null,
image: {
proxyURL: e.image?.proxyURL,
url: e.image?.url
},
timestamp: e.timestamp,
thumbnail: {
proxyURL: e.thumbnail?.proxyURL,
url: e.thumbnail?.url
},
title: e.title || null,
url: e.url || null
})
})
};
Every other field is there, can you help me?