Embed not being sent

^
34 Replies
d.js toolkit
d.js toolkit13mo 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
SuperPEKKA33613mo ago
. . . . didnt notice
sexy dark chocolate
RULES is undefined, most likely gonna be an error along the lines of "ModelType ...."
SuperPEKKA336
SuperPEKKA33613mo ago
SuperPEKKA336
SuperPEKKA33613mo ago
yes it is
sexy dark chocolate
RULES is apart of the EMBEDS object in your json, not the main json object itself
SuperPEKKA336
SuperPEKKA33613mo 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
SuperPEKKA33613mo 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
SuperPEKKA33613mo ago
embeds: EMBEDS.RULES?
sexy dark chocolate
Put it in an array
SuperPEKKA336
SuperPEKKA33613mo ago
embeds: [EMBEDS.RULES]?
sexy dark chocolate
Ye
SuperPEKKA336
SuperPEKKA33613mo ago
SuperPEKKA336
SuperPEKKA33613mo ago
invalid body form
sexy dark chocolate
Show the top of the error, the error message
SuperPEKKA336
SuperPEKKA33613mo ago
sexy dark chocolate
The color you put for the embed has to be a number
SuperPEKKA336
SuperPEKKA33613mo ago
ah wait not hexadecimel?
Not So Marv
Not So Marv13mo ago
Use resolveColor('hex')
SuperPEKKA336
SuperPEKKA33613mo ago
?
sexy dark chocolate
Remove the color from the string in the json "0x00..." => 0x00....
SuperPEKKA336
SuperPEKKA33613mo 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
SuperPEKKA33613mo ago
ok can i just define is as const BLUE = 0x0033ff and "color": BLUE
Not So Marv
Not So Marv13mo ago
It's always worth a shot but I don't think so.
SuperPEKKA336
SuperPEKKA33613mo ago
hm
SuperPEKKA336
SuperPEKKA33613mo ago
how would i do this?
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
SuperPEKKA336
SuperPEKKA33613mo ago
huh
Not So Marv
Not So Marv13mo 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 User13mo ago
Message Not Public
Sign In & Join Server To View