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

326
Views
¿Cómo enviar imágenes en discord.js node js?

Tengo un problema con el envío de imágenes desde la url cuando trato de hacer discordia de bot, recibí los mensajes "Hola", pero no con las imágenes.

 require('dotenv').config(); const Discord = require("discord.js"); const client = new Discord.Client({intents: ["GUILDS", "GUILD_MESSAGES"]}); client.on("ready", () => { console.log(`Logged in as ${client.user.tag}!`) }) client.on("message", msg => { if (msg.content === "p") { msg.reply("Hello", {files: ["https://s.imgur.com/images/logo-1200-630.jpg?2"]}); } }) client.login(process.env.DISCORD_TOKEN);
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

así es como quieres escribirlo...

 msg.reply("Hello", { files: [ {attachment: "https://s.imgur.com/images/logo-1200-630.jpg?2", name: "image.jpg"}, ]});

Sin embargo, el enfoque de los files: puede ser incorrecto ... si eso no funciona, intente esto ...

 msg.reply("Hello https://s.imgur.com/images/logo-1200-630.jpg?2");
about 4 years ago · Juan Pablo Isaza Report

0

La mejor manera es usar MessageAttachment como pretendía discord.js.

 const image = new Discord.MessageAttachment("https://s.imgur.com/images/logo-1200-630.jpg?2","img.png"); msg.reply({ files : [image] })
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!