How to send a embed automatic, when the bot is started

help pls
19 Replies
d.js toolkit
d.js toolkit17mo ago
- 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!
<MachadoDev />
<MachadoDev />OP17mo ago
i have that interaction create that creates the embed and sends it but is not doing that when the bot starts
treble/luna
treble/luna17mo ago
use the ready event
d.js docs
d.js docs17mo ago
const channel = client.channels.cache.get("222086648706498562");
const channel = guild.channels.cache.find(channel => channel.name === "general");
const channel = client.channels.cache.get("222086648706498562");
const channel = guild.channels.cache.find(channel => channel.name === "general");
- Caches in discord.js are Collections which extend the native Map structure. - learn more
<MachadoDev />
<MachadoDev />OP17mo ago
already did, but im using interaction and i cant use interaction on ready.js idk why
treble/luna
treble/luna17mo ago
because the ready event fires with a client for the interactionCreate event to fire you need an interaction such as a slash command
<MachadoDev />
<MachadoDev />OP17mo ago
no i cant use slash command i want to send the embed automatic
treble/luna
treble/luna17mo ago
Then use the ready event and use the above code to send the embed
<MachadoDev />
<MachadoDev />OP17mo ago
but how can i get to the embed i try to do export const but it gives me an error how do i do the embed and called it on the ready.js
treble/luna
treble/luna17mo ago
by constructing it your ready event
<MachadoDev />
<MachadoDev />OP17mo ago
any example?
treble/luna
treble/luna17mo ago
import embedbuilder then construct it as you would in your interactionCreate EmbedBuilder isnt an interactionCreate thing
<MachadoDev />
<MachadoDev />OP17mo ago
im not understanding yes but im using infos in the embed
treble/luna
treble/luna17mo ago
this is rather basic js at this point
<MachadoDev />
<MachadoDev />OP17mo ago
that requires interaction like interaction guild iconURL
treble/luna
treble/luna17mo ago
Get the guild from cache
<MachadoDev />
<MachadoDev />OP17mo ago
how forget it
treble/luna
treble/luna17mo ago
<Client>.guilds.cache.get(id) Requires the Guilds intent
Want results from more Discord servers?
Add your server