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 toolkit2y 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.
JollyJohn
JollyJohnOP2y ago
how would I do that
Kinect3000
Kinect30002y ago
Check client.guilds.cache on ready
JollyJohn
JollyJohnOP2y ago
what does that do?
Kinect3000
Kinect30002y ago
It’s a Collection of Guilds the bot is in
JollyJohn
JollyJohnOP2y ago
Ok and check if they have data or not? how would i use it tho with my question
MENIX
MENIX2y 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
Want results from more Discord servers?
Add your server