Skip to content
Advertisement

Send a message to my private channel on join & leave

Heyo,

I want my bot to send a embed message to my private discord server when it joins & leaves a server. But the problem is that it does not send anything anywhere. My code looks like this:

JavaScript

Advertisement

Answer

Your code doesn’t activate upon joining the server. For that you have a nice event (that has a misleading name) guildCreate – it is emitted whenever the client joins a guild.

So, your code should look something like this

JavaScript

Same works for leaving the guild, use guildDelete event.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement