Please describe the problem you are having in as much detail as possible:
Since TextChannel#sendEmbed() is deprecated, I began the migration to TextChannel#send() instead. However, when I attempt to send a RichEmbed, I recieve an error: Cannot send an empty message
This error still occurs on RichEmbeds that would otherwise send fine using sendEmbed().
Include a reproducible code sample here, if possible:
let channel // any ol' TextChannel
let embed = new RichEmbed({ /* ... */ })
channel.send(embed).then(console.log).catch(console.error)
// error: Cannot send an empty message
Further details:
11.1.06.0.0Ubuntu 16.04 LTS, 64-bitYou have to pass the embed as part of the MessageOptions, instead of just passing the embed.
.send({ embed })
See:
https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=send
https://discord.js.org/#/docs/main/stable/typedef/MessageOptions
There is also a list of deprecations and "What do to":
https://github.com/hydrabolt/discord.js/releases/tag/11.1.0
For further questions regarding deprecations are you probably better
of asking those questions at the official discord.js Discord server.
It is hard asking questions on your Discord server while your moderators are allowing trolls like this @iCrawl . https://gyazo.com/624a144983cef2266f1076237003dbb1
I'm glad this question was also asked here as well, thank you @SpaceEEC
You could use the appropriate support channels to get your question answered, or even ping Helpers instead of asking your question in the general chat of the server where people just want to hang out and not necessarily help others.
Rule #1: "No spamming, advertising, or NSFW content. Don't be a jerk or generally obnoxious - nobody likes trolls."
I had a general question which i placed in the general chat. If I was wrong for that, someone could have pointed me to the appropriate chat. I didn't include the messages which I was called a dumbass in that screenshot either.
Also, the documentation is slightly misleading with its wording on the options object. The description for the object states, "Options for the message, can also be just a RichEmbed or Attachment." At least when I read this it made me believe that simply .send({RichEmbed}) would work.
This is neither the place to discuss this nor does this issue correctly answer your question.
Since 11.2.1 .send(RichEmbed) works perfectly fine, don't put it in an object literal and you are good to go. If you prefer to make a variable you can also just pass the embed itself with .send(embed).
Or you go the long way and do .send({ embed }), .send({ embed: RichEmbed }).
I'm pretty sure the documentation states this correctly.
It doesn't works...