Embed not being sent

^
34 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
sexy dark chocolate
Looks like you have an error in your console
SuperPEKKA336
SuperPEKKA336OP2y ago
. . . . didnt notice
sexy dark chocolate
RULES is undefined, most likely gonna be an error along the lines of "ModelType ...."
SuperPEKKA336
SuperPEKKA336OP2y ago
SuperPEKKA336
SuperPEKKA336OP2y ago
yes it is
sexy dark chocolate
RULES is apart of the EMBEDS object in your json, not the main json object itself
SuperPEKKA336
SuperPEKKA336OP2y ago
so?
sexy dark chocolate
Well, json.RULES doesn't exist, so it's undefined. You're deatructuring RULES from the json not from EMBEDS json.EMBEDS.RULES exist
SuperPEKKA336
SuperPEKKA336OP2y ago
so how do i define that
sexy dark chocolate
Lol you don't gotta ghost ping, n I already told you how to
SuperPEKKA336
SuperPEKKA336OP2y ago
embeds: EMBEDS.RULES?
sexy dark chocolate
Put it in an array
SuperPEKKA336
SuperPEKKA336OP2y ago
embeds: [EMBEDS.RULES]?
SuperPEKKA336
SuperPEKKA336OP2y ago
SuperPEKKA336
SuperPEKKA336OP2y ago
invalid body form
sexy dark chocolate
Show the top of the error, the error message
SuperPEKKA336
SuperPEKKA336OP2y ago
sexy dark chocolate
The color you put for the embed has to be a number
SuperPEKKA336
SuperPEKKA336OP2y ago
ah wait not hexadecimel?
Not So Marv
Not So Marv2y ago
Use resolveColor('hex')
SuperPEKKA336
SuperPEKKA336OP2y ago
?
sexy dark chocolate
Remove the color from the string in the json "0x00..." => 0x00....
SuperPEKKA336
SuperPEKKA336OP2y ago
what does it want in the "color" property? an int?
sexy dark chocolate
Wait I jus remembered, I don't think json accepts hexadecimal numbers embeds: [{ color: ...., ...EMBEDS.RULES }] try that
SuperPEKKA336
SuperPEKKA336OP2y ago
ok can i just define is as const BLUE = 0x0033ff and "color": BLUE
Not So Marv
Not So Marv2y ago
It's always worth a shot but I don't think so.
SuperPEKKA336
SuperPEKKA336OP2y ago
hm
SuperPEKKA336
SuperPEKKA336OP2y ago
how would i do this?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA336OP2y ago
huh
Not So Marv
Not So Marv2y ago
You need to send an array of objects ([ {} ]) not an object of arrays ({ [] }) So you need
embeds: [ { color: 0x0033ff, ...EMBEDS:RULES } ]
embeds: [ { color: 0x0033ff, ...EMBEDS:RULES } ]
Be sure to remove the color from the embed itself in your json.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server