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

103
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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