Extending EmbedBuilder class
Hello I created this Embed class to always have the same color and footer on my embeds. However, I'd like the setFooter to override only when it's not specified when calling the class. How could I make this ?
15 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!You can type the manual fields first then place the
...args
so:
So it means that if in args I have .setFooter this will overwrite the actual
footer: {text: "Influence * ${DateNow}"}}
Iirc it should do so
I'm getting this error when passing no setColor in the new instance
I tried with color not footer yet
tried 0xffffff too
Use the
Colors
import from discord.js and then use Colors.whitewhat if I wanted a custom color ?
0x didn't work? I believe that's what I use unless I have changed
I tried 0xffffff and #ffffff too
The above is the correct syntax
hex string
DiscordAPIError[50035]: Invalid Form Body
embeds[0].color[NUMBER_TYPE_COERCE]: Value "0xffffff" is not int.
Ah my bad, here is the correct documentation. https://old.discordjs.dev/#/docs/discord.js/14.12.1/class/Embed?scrollTo=color
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
correct syntax was just
color: 0xffffff
no quote
thanks for the help 🙂Ah, I thought you removed the quote, my apologies
There shouldn't be obe