bot.onBanAdd
An event that gets executed, if a user was banned on a server. To let the bot listen to the event, add one bot.onBanAdd() callback inside your mainfile.
This callback allows the bot to log every time someone gets banned from a server.

Usage:

1
bot.banAddCommand({ //command
2
channel: "channel id", //channel where it'll be logged
3
code: `your code` // your code
4
})
Copied!

Example Commands:

1
bot.banAddCommand({
2
channel: "772414449839636490",
3
code: `$username was banned in $serverName`
4
})
Copied!
If you have a server variable for logs, you can add this:
1
bot.banAddCommand({
2
channel: "$getServerVar[variable]", //Add getServerVar to get the servers log channel (if they set it ofcourse)
3
code: `
4
$username was banned in $serverName
5
`
6
})
Copied!
You can use amongst other functions these functions inside your banAddCommand to return data of the user that got banned and the server that banned the user:
Last modified 1mo ago
Copy link
Edit on GitHub