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

255
Vistas
Expected the value to be an object, but received string instead

I’ve recently updated to v14 of discordjs (I think), and I’ve been getting tons of errors as this being one of many. And it seems a lot of stuff has changed since the last time I coded and I’m a bit confused about what I need to change in order for this ping slash command to work.

Error Expected the value to be an object, but received string instead

Code

const { EmbedBuilder } = require("discord.js");

module.exports = {
  name: "ping",
  description: "Displays Crimson's API and Latency ping!",
  options: null,
  run: async (client, interaction, args) => {    
    const pingEmbed1 = new EmbedBuilder()
      .setTitle("Pinging...")
      .setColor("#fb644c");

    const pingMsg = await interaction.reply({ embeds: [pingEmbed1], fetchReply: true });

    try {      
      const pingEmbed2 = new EmbedBuilder()
        .setTitle("Pong!")
        .setDescription(`⌛ Latency: \`${Math.floor(pingMsg.createdTimestamp - interaction.createdTimestamp)}ms\`\n⏲️ API: \`${Math.round(client.ws.ping)}ms\``)
        .setFooter(`Command Requested by: ${interaction.user.tag}`, interaction.user.displayAvatarURL())
        .setColor("#fb644c");
      await interaction.editReply({ embeds: [pingEmbed2] });
    } catch (err) {
        console.log(err);
        return interaction.editReply(`\`${err.message}\`.`);
    }
  },
};

Now just to be clear, so people don’t get mad at me for not trying… I did change a few things that were changed such as the new embed builder and so on.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

In discord.js v14, EmbedBuilder#setFooter() accepts a sole FooterOptions object. You will need to provide an object with a text and an iconURL keys:

const pingEmbed2 = new EmbedBuilder()
  .setTitle('Pong!')
  .setDescription(
    `⌛ Latency: \`${Math.floor(
      pingMsg.createdTimestamp - interaction.createdTimestamp,
    )}ms\`\n⏲️ API: \`${Math.round(client.ws.ping)}ms\``,
  )
  .setFooter({
    text: `Command Requested by: ${interaction.user.tag}`,
    iconURL: interaction.user.displayAvatarURL(),
  })
  .setColor('#fb644c');
about 4 years ago · Santiago Trujillo 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