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

92
Views
(nodo: 25372) DeprecationWarning: el evento de mensaje está en desuso. Utilice messageCreate en su lugar

Soy nuevo con node.js y javascript y quería codificar un Discord Bot para mi servidor. Estoy trabajando en Embeds y me quedo atascado. Cada vez que quiero ejecutar mi código, esto aparece aquí :

 (node:15928) DeprecationWarning: The message event is deprecated. Use messageCreate instead (Use `node --trace-deprecation ...` to show where the warning was created) C:\Users\Lusor\OneDrive\Desktop\dcbot\node_modules\discord.js\src\rest\RequestHandler.js:298 throw new DiscordAPIError(data, res.status, request); ^ DiscordAPIError: Cannot send an empty message at RequestHandler.execute (C:\Users\Lusor\OneDrive\Desktop\dcbot\node_modules\discord.js\src\rest\RequestHandler.js:298:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (C:\Users\Lusor\OneDrive\Desktop\dcbot\node_modules\discord.js\src\rest\RequestHandler.js:50:14) at async TextChannel.send (C:\Users\Lusor\OneDrive\Desktop\dcbot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:171:15) { method: 'post', path: '/channels/872588467211763804/messages', code: 50006, httpStatus: 400, requestData: { json: { content: undefined, tts: false, nonce: undefined, embeds: undefined, components: undefined, username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined }, files: [] } }

Y aquí está mi código:

 const { Client, Attachment, Message, MessageEmbed } = require("discord.js"); module.exports = { name: "rules", description: "Embeds!", execute(message, args, Discord) { const newEmbed = new MessageEmbed() .setColor('#e38f0e') .setTitle('Rules') .setDescription("Welcome in Valhalla's Game Center! Please read the Rules caredfully!") .addFields( { name: 'Regular field title', value: 'Some value here' }, { name: 'u200B', value: 'u200B' }, { name: 'Inline field title', value: 'Some value here'}, { name: 'Inline field title', value: 'Some value here'}, ) .setImage('https://i.imgur.com/AfFp7pu.png') .setTimestamp() .setFooter('Some footer text here', 'https://i.imgur.com/AfFp7pu.png'); message.channel.send(newEmbed); } }

Literalmente intenté todo y no pude encontrar nada útil.

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

0

Encontré la respuesta a su pregunta, incluso si no era lo que estaba causando su problema.

donde tienes

 client.on('message', message =>......

cambie el 'message' a 'messageCreate' . No tienes que cambiar más mensajes a messageCreate, solo ese. A mí también me estaba molestando.

about 4 years ago · Juan Pablo Isaza Report

0

Parece que la técnica para enviar un "mensaje incrustado" a un canal (desde aquí ) es

 channel.send({ embeds: [exampleEmbed] });

Entonces, para su código, intente cambiar

 message.channel.send(newEmbed);

a

 message.channel.send({ embeds: [newEmbed] });
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!