Dokumentation / Sentinel / Befehle / /temp-role
Moderation Server only

/temp-role

Give a member a role for a limited time

Usage

Generated
/temp-role <member> <role> <duration> [reason]
OptionTypErforderlichBeschreibung
member member Ja Member to receive the role
role role Ja Role to grant temporarily
duration text Ja How long: 60s, 10m, 1h, 1d, 7d
reason text Nein Reason (shown in audit log)

Who can run it

Generated
Discord defaultMembers with Manage Roles
Command Access presetModerator roles
Always allowedThe server owner and, by default, Administrators
Change itDashboard, Services, Sentinel, Commands

The Moderation preset limits it to the roles you mark as moderators. Server owners and Administrators can always run it. How Command Access works.

What the bot needs

Generated

Sentinel is granted these permissions by the invite link. A command that finds one missing replies privately with what it could not do and changes nothing.

Kick MembersBan MembersManage ServerView ChannelSend MessagesManage MessagesEmbed LinksManage NicknamesManage RolesTimeout Members

Verhalten

Checked against the code 2026-09-21

Gives a member a role for a limited time and takes it away again when the time is up. Discord shows the command only to members with Manage Roles by default. The bot checks Command Access rules, that the Moderation service is enabled ("Sentinel is not enabled for this server."), and that the moderator is an Administrator or holds a moderator role from the Settings page ("No permission."). The reason is optional, defaults to "Temporary role", and appears in Discord's audit log entry for the role change.

The duration takes s, m, h, d or w units. It must be at least 30 seconds ("Invalid duration. Use something like 10m, 2h, 7d (min 30s).") and at most one year ("Max duration is 1 year."). Longer grants should be permanent roles.

Several roles are refused: a role at or above the bot's highest role, a role managed by an integration ("That role is managed by an integration and can't be assigned."), a role at or above the moderator's own highest role unless the moderator is the server owner ("You can only grant a role positioned below your own highest role."), and any role carrying Administrator, Manage Server, Manage Roles, Ban Members, Kick Members or Manage Channels.

The role is added at once and its removal is scheduled. The reply is "@member has @role for 2h." If the removal cannot be scheduled, the bot takes the role back and tells the moderator to remove it by hand or retry. No case is opened, no DM is sent and nothing is posted to the moderation log channel.

Good to know

  • When the time is up the bot removes the role. If the bot can no longer manage that role by then, the role stays and staff remove it by hand.
  • There is no command to end the grant early; remove the role in Discord.
  • While an anti-nuke panic lockdown is on, only the server owner and the anti-nuke exempt users and roles can run it.
YourBot docs Reference tables are generated from the code that is running. Ask in Discord Suggest a correction