I’m creating a bot using Discord.js and Node.js, and I want to detect when it’s added to a guild.
How do I detect that?
Everything is working fine except that.
>Solution :
You can detect it by guildCreate event
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-guildCreate
client.on("guildCreate", async guild => {
console.log("I added to a guild");
console.log(guild);
});