Embed isn't sending #7848
-
Which package is this bug report for?discord.js Issue descriptionHello! I am writing a bot, and i have 2 commands, that sends embeds. No one of them sends embeds, what i don't want. You can look at codes of both in code samples. Code sample// First command with plain text
const membed = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle('MuzPro Help')
.setDescription('List of commands and aliases.')
.addFields({
name: '▶ Play',
value: 'Plays the specified song.\nAliases: p, go, m'
}, {
name: '⏹ Stop',
value: 'Disconnects the bot.\nAliases: s, disconnect, dis, d, stfu, shut'
}, {
name: '📘 Info [HELPER]',
value: 'Displays an info embed.',
inline: true
}, {
name: '📘 Help [HELPER]',
value: 'Displays this embed.',
inline: true
})
.setTimestamp()
.setFooter({
text: 'MuzPro'
});
message.channel.send('**Plain text**', {
embed: membed
}); // Sent plain text without embed
// Only embed
const membed = new Discord.MessageEmbed()
.setTitle("About MuzPro")
.setColor(0x00AE86)
.setDescription("Hello! This is a basic music bot! Run m!help for command list! Written by <@867220425276260353>.")
.setFooter("MuzPro bot", "https://i.imgur.com/7LxOFKY.png")
.setImage("https://i.imgur.com/7LxOFKY.png");
message.channel.send({
embed: membed
}) // Error:
Uncaught DiscordAPIError DiscordAPIError: Cannot send an empty message
at DiscordAPIError (undefined:9:5)
at execute (undefined:350:13)
at processTicksAndRejections (undefined:96:5) Package version:13.6.0 Node.js version:17.3.1 Operating system:Windows 10 Pro x64 Priority this issue should have:Medium (should be fixed soon) Which partials do you have configured?No Partials Which gateway intents are you subscribing to?Guilds, GuildVoiceStates, GuildMessages I have tested this issue on a development release:I did not |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
You need to use 'embeds' instead of 'embed'. - message.channel.send({ embed: [membed] })
+ message.channel.send({ embeds: [membed] }) |
Beta Was this translation helpful? Give feedback.
-
@Mateo-tem |
Beta Was this translation helpful? Give feedback.
-
Sending and editing now takes only a single object parameter - channel.send(embed);
+ channel.send({ embeds: [embed, embed2] });
- channel.send('Hello!', { embed });
+ channel.send({ content: 'Hello!', embeds: [embed, embed2] }); Full migration guide to discord.js v13: https://discordjs.guide/additional-info/changes-in-v13.html |
Beta Was this translation helpful? Give feedback.
Sending and editing now takes only a single object parameter
Full migration guide to discord.js v13: https://discordjs.guide/additional-info/changes-in-v13.html