Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
When i edit my embed, the wrong arguments get send

The command should be like this:

Me - "!note"

Bot - "Question 1"

Me - "Answer"

Bot - (Sends embed to a specific channel with the first answer as title)

Bot - "Question 2"

Me - "Answer 2"

Bot - (Edits the embed and adds a description with the second answer)

Code:

module.exports = {
    name: 'note',
    description: 'Note',
    async execute(client, message, args, Discord) {
        
        let filter = m => m.author.id === message.author.id
        message.channel.send(`Question 1`)

        let collected = await message.channel.awaitMessages({ filter, 
        max: 1,
        time: 10000,
        errors: ['time']
        });
        
            let answer = collected.first();
            let embed = new Discord.MessageEmbed()
            .setTitle(`${answer}`)
            .setDescription(`No second answer yet`)
            const notechannel = client.channels.cache.get("<channel id>")
            const sent = await notechannel.send({embeds:[embed]})
            
                await message.channel.send(`Second question - **${answer}**?`)
                let collected2 = await message.channel.awaitMessages({ filter, 
                max: 1,
                time: 10000,
                errors: ['time']
                });
        
                let answer2 = collected.first();
                let embed2 = new Discord.MessageEmbed()
                .setTitle(`${answer}`)
                .setDescription(`${answer2}`)
                sent.edit({embeds:[embed2]})
        }
    }

Now, everything works fine except for the last part. When i answer the second question, the bot edits the embed, but it edits the description with the first answer, not the second answer. Is there a way to solve this?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda