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

222
Vistas
Error while doing an embed commands discord js

I was trying to ask the bot to send a report to a console chat when a command is executed but I end up with an unexpected error. I thought the error will be in the main file but instead the error is from node_modules

here's the code(part of)

       var CommandName1 = message.content
       var CommandName2 = CommandName1.replace(prefix, "") 
       let time = await date.toLocaleString('en-US');
       var user = message.author.tag
       var UserProfile = message.author.avatarURL()
       var UserID = message.author.id
       var MessageID = message.channel.id

       let report = new Discord.MessageEmbed()
       .setTitle("Report From Main Core File")
       .setColor("DARK_BUT_NOT_BLACK")
       .setDescription("command: `" + `${CommandName2}` + "` \n" + "execution: `successful` \nreport path: `Bot Core Assets/SCP bot assets/main.js` \ntime: `" + `${time}` + "` \n" + "user: `" + `${user}` + "`\n" + "user profile: `" + `${UserProfile}` + "`\n" + "user ID: " + `${UserID}\n` + "message ID: " + `${MessageID}`)

       clients.channels.cache.get("890166184979361792").send({embeds: [report]})

the error I got

C:\Users\1love\Dropbox\My PC (DESKTOP-MEST1TS)\Desktop\Bot Core Assets\SCP bot assets\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\1love\Dropbox\My PC (DESKTOP-MEST1TS)\Desktop\Bot Core Assets\SCP bot assets\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\1love\Dropbox\My PC (DESKTOP-MEST1TS)\Desktop\Bot Core Assets\SCP bot assets\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
    at async TextChannel.send (C:\Users\1love\Dropbox\My PC (DESKTOP-MEST1TS)\Desktop\Bot Core Assets\SCP bot assets\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:171:15) { 
  method: 'post',
  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: []
  }
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Check your version of discord.js. I suspect, you are still using V12, because I copied your code, and it works flawlessly for me.

Check your discord.js version by running

npm list discord.js

If it still says v12, run

npm install discord.js@latest

Also make sure you have node v16.6.0 or later installed.

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