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

579
Views
Discord.js send file after embed

Currently, my bot sends a file before the embed, but I want it the opposite way. This is my discord.js v12 code:

msg.send({embed: {
     "title": "Success",
     "description": `Successfully added ${args[1]}` + "\n Use `m!stock` to see it.",
     "color": "#22ba4a"
   }, files: [free]})

Current

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

<Message>.send() is a promise, meaning that you can use .then() functions after your message is sent. For example, your code would look something like this:

msg.send({
    embed: {
        "title": "Success",
        "description": `Successfully added ${args[1]}\nUse \`m!stock\` to see it.`,
        "color": "#22ba4a"
    },
}).then(() => {
    msg.send({
        files: [free]
    });
});

More on Promises

Promise

More on .then()

Promise.then()

over 4 years ago · Santiago Trujillo Report
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!