0

Afternoon all, Updating to discord.js v17 from v12. Current code is

client.embed = class Embed extends MessageEmbed { color = EMBED_COLOR }

but I can't work out what I need to change it to. This is in my index.js file. Error I'm getting is

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/home/container/index.js:26:36)

The only thing I can find on research is an EmbedBuilder, but I don't think that this is correct for the index.js?

After some playing around, I worked out that I need to include a module import, and have added

module. Imports = {
import (MessageEmbed)
};

but am getting the following error:

Node.js v17.9.1
I have no name!@f31bafba-a8b3-42cf-a06f-7a1f17054dcf:~$ node index.js
/home/container/index.js:7
    import (MessageEmbe) from 'discord.js'
                         ^^^^
SyntaxError: Unexpected identifier

Can anyone help?

  • 1
    `MessageEmbed` is `EmbedBuilder` now: https://stackoverflow.com/questions/73028854/discord-js-v13-code-breaks-when-upgrading-to-v14 – Zsolt Meszaros Mar 10 '23 at 13:17
  • That syntax is incorrect, you can read more on [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) – itzJOH_ Mar 16 '23 at 09:31

0 Answers0