Cannot send an empty messag - embed

const embed = new MessageEmbed()
.setColor('#000033')
.setTitle('Achievements')
.setDescription('Here is a list of all the achievements you have earned.');

let fields = [];
for (const achievement of achievements) {
const achieved = data[achievement.id] > 0;
const name = achievement.name;
fields.push({
name,
value: achieved ? 'Achieved' : 'Not achieved'
})
}

embed.addFields(fields);
embed.setTimestamp()
embed.setFooter('Generated by Bard - Awelaw');

msg.channel.send({embed});
const embed = new MessageEmbed()
.setColor('#000033')
.setTitle('Achievements')
.setDescription('Here is a list of all the achievements you have earned.');

let fields = [];
for (const achievement of achievements) {
const achieved = data[achievement.id] > 0;
const name = achievement.name;
fields.push({
name,
value: achieved ? 'Achieved' : 'Not achieved'
})
}

embed.addFields(fields);
embed.setTimestamp()
embed.setFooter('Generated by Bard - Awelaw');

msg.channel.send({embed});
5 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
chewie
chewie2y ago
embeds: [embed]
V2
V2OP2y ago
:\Users\Ms6RB\Desktop\projects\Blocks-Achievements\node_modules\discord.js\src\structures\MessagePayload.js:203
embeds: this.options.embeds?.map(embed => new MessageEmbed(embed).toJSON()),
^

TypeError: this.options.embeds?.map is not a function
:\Users\Ms6RB\Desktop\projects\Blocks-Achievements\node_modules\discord.js\src\structures\MessagePayload.js:203
embeds: this.options.embeds?.map(embed => new MessageEmbed(embed).toJSON()),
^

TypeError: this.options.embeds?.map is not a function
msg.channel.send({embeds: embed});
msg.channel.send({embeds: embed});
chewie
chewie2y ago
Read my message again
V2
V2OP2y ago
oh thx ❤️
Want results from more Discord servers?
Add your server