bot.onGuildJoin
An event that gets executed, if the bot joins a server. To let the bot listen to the event, add one bot.onGuildJoin() callback inside your mainfile.
This callback will allow the bot to log a message whenever it joins a server.

Usage:

1
bot.botJoinCommand({//command
2
channel: "channel id",//the channel where <code> will be sent to
3
code: `your code`//message sent to <channel>
4
})
Copied!

Example Command:

1
bot.botJoinCommand({
2
channel: "772414449839636490",
3
code: `
4
Ive joined $serverName!
5
`
6
})
Copied!
You can also have it send in the server where it joined by using $systemChannelID or $randomChannelID.
1
bot.botJoinCommand({
2
channel: "$systemChannelID",
3
code: `
4
Hi i am Awesome Bot and I can do many things.
5
`
6
7
})
Copied!
Keep in mind: Not all servers have a system channel!
You can use all guild based functions like $serverName or $guildID or $getServerInvite in these commands.
Last modified 1mo ago
Copy link
Edit on GitHub