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

252
Views
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 answers
Answer question

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 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!