Expected the value to be an object, but received string instead & Message is not a Constructor Error

I Coded a /ping Command & It's This How To Fix the Errors v14 (^14.14.1)
const { SlashCommandBuilder } = require('@discordjs/builders');
const { EmbedBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('🏓 Check my ping!'),
async execute(interaction, client) {
try {
let embed = new EmbedBuilder()
.setTitle("Pong!")
.setColor('#2F3136')
.setThumbnail('https://media.discordapp.net/attachments/1116930073468080289/1180888416985038889/Zypher.png?ex=657f0f0a&is=656c9a0a&hm=2cc57e0d01717a37b09d6acb6993f58cc916d1c165572d0adbd975805abd344a&=&format=webp&quality=lossless')
.addFields(
{ name: '**Latency**', value: `\`\`\`ini\n[ ${Date.now() - interaction.createdTimestamp}ms ]\n\`\`\``, inline: true },
{ name: '**API Latency**', value: `\`\`\`ini\n[ ${Math.round(client.ws.ping)}ms ]\n\`\`\``, inline: true }
)
.setTimestamp()
.setFooter(`©️ Zyper`, 'https://media.discordapp.net/attachments/1116930073468080289/1180888416985038889/Zypher.png?ex=657f0f0a&is=656c9a0a&hm=2cc57e0d01717a37b09d6acb6993f58cc916d1c165572d0adbd975805abd344a&=&format=webp&quality=lossless');

await interaction.reply({
embeds: [embed]
});
} catch (error) {
console.error(`Error executing ping command: ${error.message}`);
}
},
};
const { SlashCommandBuilder } = require('@discordjs/builders');
const { EmbedBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('🏓 Check my ping!'),
async execute(interaction, client) {
try {
let embed = new EmbedBuilder()
.setTitle("Pong!")
.setColor('#2F3136')
.setThumbnail('https://media.discordapp.net/attachments/1116930073468080289/1180888416985038889/Zypher.png?ex=657f0f0a&is=656c9a0a&hm=2cc57e0d01717a37b09d6acb6993f58cc916d1c165572d0adbd975805abd344a&=&format=webp&quality=lossless')
.addFields(
{ name: '**Latency**', value: `\`\`\`ini\n[ ${Date.now() - interaction.createdTimestamp}ms ]\n\`\`\``, inline: true },
{ name: '**API Latency**', value: `\`\`\`ini\n[ ${Math.round(client.ws.ping)}ms ]\n\`\`\``, inline: true }
)
.setTimestamp()
.setFooter(`©️ Zyper`, 'https://media.discordapp.net/attachments/1116930073468080289/1180888416985038889/Zypher.png?ex=657f0f0a&is=656c9a0a&hm=2cc57e0d01717a37b09d6acb6993f58cc916d1c165572d0adbd975805abd344a&=&format=webp&quality=lossless');

await interaction.reply({
embeds: [embed]
});
} catch (error) {
console.error(`Error executing ping command: ${error.message}`);
}
},
};
2 Replies
d.js toolkit
d.js toolkit7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
d.js docs
d.js docs7mo ago
Tag suggestion for @JaNuK: v13 <MessageEmbed>.setFooter() and <MessageEmbed>.setAuthor() now each take an object:
- embed.setAuthor('This is an example text', 'https://example.com/icon.png', 'https://websiteofauthor.com')
+ embed.setAuthor({ name: 'This is an example text', url: 'https://websiteofauthor.com', iconURL: 'https://example.com/icon.png' })

- embed.setFooter('This is an example text', 'https://example.com/icon.png')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://example.com/icon.png' })
- embed.setAuthor('This is an example text', 'https://example.com/icon.png', 'https://websiteofauthor.com')
+ embed.setAuthor({ name: 'This is an example text', url: 'https://websiteofauthor.com', iconURL: 'https://example.com/icon.png' })

- embed.setFooter('This is an example text', 'https://example.com/icon.png')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://example.com/icon.png' })