GuildJoinEvent

I have my bot creating some database schemes when the bot is added to a server and then when it leaves, it will all delete, if the bot is offline when the bot leaves or joins a server, how could I ensure that the guild still gets the schemes and still deletes?
7 Replies
d.js toolkit
d.js toolkit15mo 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.
Baconburger998
Baconburger99815mo ago
how would I do that
Kinect3000
Kinect300015mo ago
Check client.guilds.cache on ready
Baconburger998
Baconburger99815mo ago
what does that do?
Kinect3000
Kinect300015mo ago
It’s a Collection of Guilds the bot is in
Baconburger998
Baconburger99814mo ago
Ok and check if they have data or not? how would i use it tho with my question
MENIX
MENIX14mo ago
No code provided, hard to know. Also how you will manage things regards to your data, is most likely not related to DiscordJS anyways. - But as Kinect says, check the guilds on the ready event and do x or y if guild is found or not found in relation to your database data. #useful-servers