K
Docs
API ReferencePiecesBan Member
🔨

Ban Member

mod.banThe Mod SquadModeration

Permanently bans a user. Unlike Kick, they cannot rejoin. Optionally deletes their recent messages (1–7 days). Use with care — you can always Unban later if needed.

When to use this
  • Set 'Delete messages days' to 1 to clean up spam without wiping older legit history
  • You can ban users who aren't in the server — just provide their ID
  • Always wire the Error port for graceful failure handling

On the canvas

This is what Ban Member looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

🔨
Ban Member
mod.ban
Moderation
userIdrequired
{{user.id}}
reason
Repeated rule violations
deleteMessageDays
0 (0–7 days)
output
error

Config fields

FieldTypeReqWhat it does
userId
{{user.id}}
textyesWho to ban 👤
reason
Repeated rule violations
textReason 📋
deleteMessageDays
0 (0–7 days)
numberDelete their recent messages (days) 🗑️

Output ports

outputBan applied
errorFailed — permissions or role hierarchy issue
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
try {
  await guild.members.ban(userId, {
    reason,
    deleteMessageSeconds: deleteMessageDays * 24 * 60 * 60,
  });
} catch {
  // Error port
}