Embed Builder Not Defined When Using BroadcastEval
I want to send a message with an embed to a channel that might be in another shard.
How can I get Embed Builder or my own embed class to work? Passing it in the context didn't work so far either.
Thanks for any help.
24 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!
- ✅
Marked as resolved by OPI think it should be possible to require it from within the function
I'll try
Importing it won't work because it's not at the top of the script
unless there is another way
you dont have to import things at the top of the script
for es6?
how exactly to I call it
like
import("what here")
See above
discord.js
Importing that created a loop.
Due to the sharding manager I think
i'll try npm:@discordjs/builders
still
this shouldn't be as hard as it is
what are you importing from it
Thats not how you use it
const { EmbedBuilder } = await import("discord.js")
oh pff
429 is a rate limit, so thats a different issue right there
I didn't think it was the same
yeah
it was looping
For some reason, if I import something which ( I guess) uses the sharding manager script (index file), it goes into a loop
I mean, I did link you the documentation on it
Not quite sure what you mean here
I might be wrong and you cant import inside a broadcast, that was just my first idea
I didn't see an example
My bad
trying it
There are 9 examples on the MDN page
missed them
¯\_(ツ)_/¯
yeah i'm looking at them right now and not one I see shows it being the same as a variable
the way you showed it
might be one
great
npm:
is needed for deno as far as I am awareAhh okay, yeah I was mistaken then
Cant dynamic import a module maybe
just use JSON? or construct the embed outside the broadcast and pass it in as context
How would I properly pass it if I construct the embed outside
do I need to specifically use .toJSON or something
Nevermind, got it
This worked.
Thank you