K
Docs
API ReferencePiecesUnban User
🔓

Unban User

mod.unbanThe Mod SquadModeration

Removes a ban by user ID. They won't automatically rejoin — they'll need a fresh invite. Perfect for /unban commands where a mod reinstates a previously banned member.

When to use this
  • Unbanned users won't auto-rejoin — provide a fresh invite link
  • The Error port fires if the user wasn't banned — always connect it

On the canvas

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

🔓
Unban User
mod.unban
Moderation
userIdrequired
{{input.options.target_id}}
reason
Appeal accepted
output
error

Config fields

FieldTypeReqWhat it does
userId
{{input.options.target_id}}
textyesUser ID to unban 👤
reason
Appeal accepted
textReason 📋

Output ports

outputBan lifted
errorUser wasn't banned, or the bot lacks permission
📐

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.unban(userId, reason);
} catch {
  // Error port — user wasn't banned
}