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

96
Views
How detect image in a message from the server users and reply?

Firts, sorry for my poor english

I start to learn js and I want to detect image in a message from the server users and reply this in an embed, bot message.content not working for that.

 if (msg.content.startsWith(`${prefi}tw`)) { // the command for te announcement
    const embed = new RichEmbed()
    .setColor("#3ded97") //message line color "Green"
    .setImage(msg.content()) //Image from the message 
    .setFooter(`God • ${dia.toLocaleDateString()}`); //The base from the text with date and the sender
msg.delete(); //Delete the message from the user 
msg.channel.send(embed);
}

Thanks my friends :'') H

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think you could get the image by using msg.attachments.url which returns the url of the message attachment (in this case an image)

Doc : https://discord.js.org/#/docs/discord.js/stable/class/MessageAttachment

Also, if you're using discord.js V13, to send embeds I think you should use msg.channel.send({ embeds: [embed] }) instead of msg.channel.send(embed)

Edit : If you're using discord.js V12 or greater, use MessageEmbed() instead of RichEmbed()

about 4 years ago · Juan Pablo Isaza 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!