How It Works
The full jail lifecycle from detention to release.
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:
- Snapshots the member's current roles
- Strips all roles
- Applies the jail role
- Sends a DM to the jailed member (with the configurable template)
- Posts an embed to the mod log channel
- 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-chatand 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:
| Method | Trigger | Case status |
|---|---|---|
| Sweeper | Timer expires, background job fires | expired |
| Manual | Mod runs /release | released |
| Appeal | Staff clicks Release in appeal channel | overturned |
On release:
- The jail role is removed
- Snapshot roles are restored (deleted roles are skipped)
- The case is marked as closed
- 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.