Discord.js: RichEmbed constructor don't accept MessageEmbed argument

Created on 26 Nov 2018  Â·  2Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
RichEmbed constructor don't accept MessageEmbed argument.

Include a reproducible code sample here, if possible:

const embeds: MessageEmbed[] = message.embeds;
const newEmbed: RichEmbed = new RichEmbed(embeds[0])
// error TS2345: Argument of type 'MessageEmbed' is not assignable to parameter of type 'RichEmbedOptions'.

Further details:

  • discord.js version: 11.4.2
  • Node.js version: 10.6.0
  • Operating system: Ubuntu (18.04)
  • Priority this issue should have – please be realistic and elaborate if possible: Medium, we can bypass this issue by rewriting manually the whole RichEmbed properties instead of passing MessageEmbed as argument.
  • [ ] I have also tested the issue on latest master, commit hash:
low already fixed typings bug

Most helpful comment

Now i use the master branch, the issue is fixed on it by moving RichEmbed to MessageEmbed :)

All 2 comments

Should be fixed with the referenced commit.
In the meantime as a workaround you can cast the MessageEmbed to any before passing it to the constructor to not have to manually rewrite the whole thing.

Now i use the master branch, the issue is fixed on it by moving RichEmbed to MessageEmbed :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xCuzImPro picture xCuzImPro  Â·  3Comments

Lombra picture Lombra  Â·  3Comments

shukriadams picture shukriadams  Â·  3Comments

BrandonCookeDev picture BrandonCookeDev  Â·  3Comments

Dmitry221060 picture Dmitry221060  Â·  3Comments