K
Docs
API ReferencePiecesRemove Role
🚫

Remove Role

base.role.removeBase SetUser

The flip side of Add Role — takes a role away from a user. Use it for role rotation, timed access, punishments, or when someone no longer meets the criteria for a role.

When to use this
  • The Error port fires if the user doesn't have the role — use it to gracefully handle edge cases

On the canvas

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

🚫
Remove Role
base.role.remove
User
userIdrequired
{{user.id}}
roleIdrequired
123456789012345
output
error

Config fields

FieldTypeReqWhat it does
userId
{{user.id}}
textyesWhose role to remove 👤
roleId
123456789012345
textyesWhich role (ID) 🚫

Output ports

outputRole removed, moving on
errorCouldn't remove the role — check IDs and permissions
📐

In TypeScript, this would be…

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

TypeScript
try {
  const member = await guild.members.fetch(userId);
  await member.roles.remove(roleId);
} catch {
  // Error port
}