Home > Software design >  Discord.js embedded message error while as far as I know everything is there
Discord.js embedded message error while as far as I know everything is there

Time:03-18

Can someone tell me why I keep getting an error? Says it can't send a empty message when running it.

Image 1

Image 2

CodePudding user response:

All you have to do is change message.channel.send(embed) to message.channel.send({ embeds: [embed] }) since when you use message.channel.send(embed), Discord thinks that the variable embed must be a string and tries to send it but it realises that it isn't and therefore the error happens.

CodePudding user response:

I'm not sure why, but the Discord API sends this error whenever an embed is sent (at least, every time I've send an embed). I'd be certain it has to do with the fact that an embed is not an actual message, and if you don't send a message with the embed, you haven't sent text, and thus returns the error. It should send the embed regardless with no visible bugs on the frontend. As long as is sends the embed, it should be fine. To get rid of the error, you will have to send a message with the embed.

  • Related