Bans a user from the server


$ban[userID;reason;messages to delete (in days)]

If member can be banned by the bot:

Discord Moderator05/28/2024
!!exec $ban[$findMember[Unknown User];Spamming;7]

If member can NOT be banned by the bot Read Below why

Discord Moderator05/28/2024
!!exec $ban[$ownerID;I'm a bad moderator;7]
Custom Command Bot 05/28/2024
❌ Failed to ban undefined!


You can set days at maximum of 7 days, limitation from discord.

Why can't the bot ban a member?

It could be, that your bot role, is below the member role!

Discord prevents users (members/bots) from banning members above their highest role

Be really careful with adding this to a command!

EVERY member that can execute the command, this function is added in. Will be able to BAN everyone below the bot role!

We highly suggest, not putting the bot role above "Admin" and "head moderator"

Related Functions

$kick, to kick a member instead of banning him/here

$unban, to unban a member,which is banned

Function difficulty: Medium
Tags: ban punish member moderation moderator