v5.0.0
$ban
Bans an user from the guild using their ID.
This function allows you to ban someone from the server using their user ID.

Fields

This function has 3 properties, 1 required and 2 optional.
  1. 1.
    User ID.
  2. 2.
    Reason (Optional)
  3. 3.
    MessagesToDelete(In days, optional)
Raw Usage: $ban[userID;reason (Optional);MessagesToDelete (Optional)

Options

  • UserID - The user the bot is banning
  • Reason - The reason in the audit logs
  • MessagesToDelete - How many of the messages over x days to delete of the banned user

Usage

1
bot.command({
2
name: "ban",
3
code: `
4
$username[$message] has been banned from the guild.
5
$ban[$message]
6
$argsCheck[1;Just enter the User ID of who you want to ban.]
7
`
8
});
Copied!
We recommend adding an $onlyPerms[ban;Error when no permissions.] at the bottom of the command!
This way only people who have permission to ban will be able to ban other members.
Example of the code with $onlyPerms[] to avoid bans without permissions:
1
bot.command({
2
name: "ban",
3
code: `
4
$username[$message] has been banned from the guild.
5
$ban[$message]
6
$argsCheck[1;Just enter the User ID of who you want to ban.]
7
$onlyPerms[ban;Only cool people with ban perms can use this!]
8
`
9
});
Copied!
Last modified 1mo ago
Copy link
Edit on GitHub