Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!