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.