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

help pls
19 Replies
d.js toolkit
d.js toolkit2y 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
MachadoDevOP2y 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/luna2y ago
use the ready event
d.js docs
d.js docs2y 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
MachadoDevOP2y ago
already did, but im using interaction and i cant use interaction on ready.js idk why
treble/luna
treble/luna2y 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
MachadoDevOP2y ago
no i cant use slash command i want to send the embed automatic
treble/luna
treble/luna2y ago
Then use the ready event and use the above code to send the embed
MachadoDev
MachadoDevOP2y 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/luna2y ago
by constructing it your ready event
MachadoDev
MachadoDevOP2y ago
any example?
treble/luna
treble/luna2y ago
import embedbuilder then construct it as you would in your interactionCreate EmbedBuilder isnt an interactionCreate thing
MachadoDev
MachadoDevOP2y ago
im not understanding yes but im using infos in the embed
treble/luna
treble/luna2y ago
this is rather basic js at this point
MachadoDev
MachadoDevOP2y ago
that requires interaction like interaction guild iconURL
treble/luna
treble/luna2y ago
Get the guild from cache
MachadoDev
MachadoDevOP2y ago
how forget it
treble/luna
treble/luna2y ago
<Client>.guilds.cache.get(id) Requires the Guilds intent

Did you find this page helpful?