Skip to content

How It Works

The full jail lifecycle from detention to release.

2 min readCore Features

JSD follows a strict lifecycle for every detention. Understanding this flow helps you troubleshoot issues and set expectations for your moderation team.

Lifecycle

1. Detention

A jail moderator runs /jail and fills in the form:

  • Member: the target Discord user
  • Duration: amount + unit (seconds through years, or Forever)
  • Reason: free-text explanation
  • Category: Spam, Harassment, NSFW, Other, or any custom category

JSD then:

  1. Snapshots the member's current roles
  2. Strips all roles
  3. Applies the jail role
  4. Sends a DM to the jailed member (with the configurable template)
  5. Posts an embed to the mod log channel
  6. Opens a case record in the database

2. Containment

Once jailed, the member's access is severely restricted:

  • The jail role is denied view and send in every channel except jail chat
  • If the member opens an appeal, a private channel is created under the appeal category
  • The member can only communicate in #jsd-jail-chat and their appeal channel

3. Appeal (optional)

The jailed member can run /appeal at any time. This creates a private channel visible only to the member and staff with the jail mod role. Staff controls include:

  • Release: free the member, restore all roles
  • Close (Deny): keep them jailed, close the appeal channel
  • Ban: ban them from the server entirely

4. Release

Release happens in one of three ways:

MethodTriggerCase status
SweeperTimer expires, background job firesexpired
ManualMod runs /releasereleased
AppealStaff clicks Release in appeal channeloverturned

On release:

  1. The jail role is removed
  2. Snapshot roles are restored (deleted roles are skipped)
  3. The case is marked as closed
  4. A release embed posts to the mod log

The sweeper

A background job checks for expired cases on a configurable interval (default 30 seconds). It also runs once at bot startup. Releases use a conditional database update so the sweeper and /release can never double-release the same case.

DM notifications

JSD attempts to DM the jailed member when they are detained and when they are released. Failed DMs never abort an action; they are noted in the mod log. Members can disable DMs; JSD handles this gracefully.