en esta forma si es posible
client.on('messageUpdate', (oldMessage, newMessage) => { const words = ['word1', 'word2'] });Intenté usar embed.title.includes('word') pero no funcionó
Si hay una inserción en un mensaje, puede obtener los datos de la inserción a través de message.embeds . Esto devuelve una matriz de MessageEmbed en el mensaje si existe o nulo si no hay incrustación. Ahora simplemente verifique cada inserción, analícela en JSON y obtenga sus propiedades ( embed.title , embed.description , etc.).
Aquí hay un ejemplo de cómo obtener datos de incrustaciones:
const embeds = message.embeds?.map(embed => embed?.toJSON()); // Get array of message embeds parsed to JSON if (!embeds) return; // Return if no embed in the message let include = false; // Define the variable to check in each embed for(let i = 0; i < embeds.length; i++) { // Loop through the embeds gotten from message const embed = embeds[i]; // The variables below are the embed's part which can contain string const title = embed.title; const description = embed.description; const footer = embed.footer?.text; // footer maybe null, put ? after footer won't throw error "Can not read property of null (reading 'text')" if (title?.includes('word') || description?.includes('word') || footer?.includes('word')) { // Check if the embed contains 'word' or not include = true; // The embed contains the word, so set `include` to true break; // We now have what we need, destroy the loop } } if (include) console.log('The message embeds contain the `word` word!'); else { console.log('The message embeds don\'t contain the `word` word.'); }