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

163
Views
DiscordJS Enviar Insertar en DM

Estoy trabajando en un comando para usuarios específicos de DM y una inserción que es un menú de ayuda en mi proyecto. ¡Envié correctamente mensajes normales pero no puedo obtener cómo enviar incrustaciones en DM! Leí que necesitaba otro tipo de incrustación.

 module.exports = { name: 'costietare', description: "This is a help command.", async execute(client, message, args, Discord) { message.delete({timeout: 10}); let dUser = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]); if (!dUser) return message.channel.send("Can't find user!"); if (!message.member.hasPermission('ADMINISTRATOR')) return message.reply("Insufficient Permissions!"); let embed = new Discord.MessageEmbed() .setTitle('General Information') .setColor('YELLOW') .addFields( {name: 'Developer', value: '[m1](https://steamcommunity.com/id/catshvh)', inline:false}, {name: '!commands', value: 'More Commands & Usage for the bot', inline:true}, {name: 'BUY/Support', value: "[Click here to buy](https://discord.gg/4Qt3238jCy)", inline:true}, ) .setTimestamp() dUser.send(`Sunt tare, stiu`); << Here is the normal message that its perfectly fine and dUser.send(`${embed}`); << this reply with **[object Object]** message.author.send( `${message.author} You have sent your message to ${dUser}` ); } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Suponiendo que está en Discord versión 12 o menos, use esto para enviar incrustaciones

 const embed = new Discord.MessageEmbed().setDescription('test'); message.channel.send(embed); // for users dUser.send(embed); //

si estas en discord version 13

 const embed = new Discord.MessageEmbed().setDescription('test'); message.channel.send({ embeds: [embed] }); //for users (dms) dUser.send({ embeds: [embed] });

envía el alcance del objeto, también conocido como [object Object] porque está envolviendo el objeto incrustado dentro de los literales de la plantilla ${} , simplemente pase el objeto incrustado como un parámetro normal y debería funcionar

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!