$ban

Bans a user from the server.

Usage

$ban[userID;reason;messages to delete]
  1. userID - The ID of the user to ban.
  2. reason - The reason for the ban.
  3. messages to delete - The number of days to delete messages from this user. Maximum is 7 days, limited by Discord.

Examples

Sucessful ban

Successful ban with no response

User04/23/2025
!!exec $ban[123456789123456789;Spamming;7]

Unsucessful ban

Unsuccessful ban with error message

User04/23/2025
!!exec $ban[$ownerID;Just a test;0]
Custom Command Bot 04/23/2025
❌ bot is missing enough permissions at line 1

Permissions

Make sure that the bot does have sufficient permission. The bot also needs to be higher in role hierarchy then the user.

Important Note

If any member who can execute the command with this function, they will be able to ban any member below the bot's highest role. Do not place the bot's role above Admin or Head Moderator roles to avoid banning important member.

Function difficulty: Easy
Tags: ban punish member moderation moderator