Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

200
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda