Give a Discord Role That Expires Automatically

Updated · 6 min read

Temporary Roles is a Pro module that lets an authorized member grant a Discord role for a chosen duration. The bot saves the expiry and removes the role when it becomes due. This can end access granted by that role, but other roles or channel overrides may still allow access. Expiry depends on the bot running and retaining permission to remove the role.

Start free

Start free. Pro is $9.99/month.

Before you start

  1. Set up the module and role hierarchy

    Start through the sign-up link, connect your bot and enable Temporary Roles in Modules. Open Settings for the intended server. Choose an optional manager role and log channel, set the maximum duration and decide whether to enable expiry DMs. Save your settings.

    In Discord’s role settings, place the bot’s highest role above the role it will grant and remove. Give the bot Manage Roles. The command issuer also needs Manage Roles or the configured manager role, and must outrank the target role unless they own the server. Delegating the manager role does not bypass that hierarchy check.

  2. Assign a role with a supported duration

    Use /temprole add and fill the user, role and duration options. For example, choose a test member, a test-access role and 2h. The duration must be one positive whole number of minutes, hours or days followed by m, h or d: 30m, 2h and 7d are valid examples. Fractions, combined durations such as 1h30m, and week units are not accepted.

    The maximum defaults to 30 days and can be configured from 1 to 365 days. Each new grant must fit the saved maximum. The reply distinguishes an active grant from a queued operation; a queued reply does not mean Discord has already added the role.

    The bot refuses a duplicate saved grant for the same member and role. It also refuses to turn a role the member already holds into a timed grant. Choose a separate role for temporary access instead of expecting the bot to take ownership of an existing permanent assignment.

  3. Inspect grants and end one early

    Use /temprole list to see saved grants and their expiry times and states. The optional user option filters to one member. The response shows up to fifteen grants at a time and indicates when there are more. Listing requires the same Manage Roles or manager-role authorization.

    Worked example — grant → list → expiry: run /temprole add for a test member, a test-access role and 30m. Then run /temprole list with that member selected to check the saved grant, its relative expiry, and its state. Once the 30 minutes pass, the bot removes that tracked role; if it is offline at the deadline, removal waits until it is back online and can process the saved grant.

    Use /temprole remove with the user and role options to end a saved grant early. This checks role hierarchy again and removes only a grant tracked by Temporary Roles. If Discord prevents the removal, the operation stays queued for retry. Confirm both the saved state and the member’s role before treating access as ended.

  4. Choose logs and expiry DMs

    An optional log channel receives a message after a timed role ends, including an early manual removal. Expiry DMs are off by default. When enabled, the bot attempts to DM the member after automatic expiry; it does not send that expiry DM for an early manual removal.

    Notifications are best effort. A blocked DM or an inaccessible log channel does not undo a completed role removal. There is no grant-DM setting in this module, so do not use receipt of a private message as the test of whether a grant became active.

  5. Understand restarts and delayed expiry

    Grants and expiry timestamps are saved in the generated bot’s database. On startup and during periodic checks, the bot reconciles due operations. If an expiry passed while it was offline, removal can be attempted after it returns. Keep the bot’s persistent storage; replacing it with an empty database loses that saved schedule.

    An offline bot cannot remove Discord roles. Disabled modules pause processing, and missing permissions or role hierarchy changes can delay removal. Failed operations are retried. Restore the bot’s access and inspect the member’s role rather than assuming access vanished at the timestamp.

    Temporary Roles is a timed role manager. It does not collect payments, verify attendance or automatically grant a role when someone RSVPs to an event. Use it when an authorized person can select the member, role and duration explicitly.

Frequently asked questions

Is Temporary Roles available on Free?

No. Temporary Roles is a Pro module.

Can I give a role for a week?

Use 7d if it fits the configured maximum. The parser accepts minutes, hours and days; 1w is not a supported duration.

Can I extend an existing timed grant by adding it again?

No. Duplicate saved grants are rejected. To start a new duration, remove the tracked grant, confirm its removal and then create a new grant.

Will expiry happen while the bot is stopped?

No. The timestamp survives in the bot database, but Discord role removal must wait until the bot is running, the module is enabled and the necessary permissions are available.

Are members always sent a DM?

No. Expiry DMs are optional, disabled by default and best effort. Early manual removal does not send an expiry DM.

Can a manager grant a role above their own?

No. The manager must outrank the target role unless they are the server owner. The bot must still outrank it and have Manage Roles.

Ready to configure your bot?

Start free

Start free. Pro is $9.99/month.