> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/BunnyNabbit/voxel-telephone/llms.txt
> Use this file to discover all available pages before exploring further.

# Moderation Tools for Voxel Telephone Server Operators

> Configure moderator roles and use in-game commands to review reports, purge turns, and fork game chains to keep your server's content appropriate.

Server operators can designate moderators to review flagged content, remove inappropriate turns, and restructure game chains. Moderation happens through in-game commands backed by a dedicated report collection in the database — no external dashboard is required.

## Roles

Moderation permissions are controlled by your server's `config.json`. Two relevant arrays exist:

* **`moderators`** — Usernames listed here receive the `moderator` permission, which unlocks `/purge`, `/diverge`, and the restricted view modes.
* **`hubEditors`** — Usernames listed here receive the `hubBuilder` permission for editing hub-level zones and portals; this is separate from content moderation.

```json theme={null}
{
  "moderators": ["Alice", "Bob"],
  "hubEditors": ["Charlie"]
}
```

Players are granted these permissions at login based on the arrays above. Changing the arrays requires a server restart to take effect for existing sessions.

## Mod View

Before using moderation commands, a moderator needs to navigate to the view gallery in the appropriate mode.

| Command        | Permission | Description                                                    |
| -------------- | ---------- | -------------------------------------------------------------- |
| `/view mod`    | Moderator  | Opens the gallery showing all games, including flagged content |
| `/view purged` | Moderator  | Opens the gallery showing previously purged turns              |
| `/view`        | Any player | Opens the standard public gallery                              |

Once inside a view, a moderator highlights a game by navigating to it. The highlighted (selected) game is the target for `/purge` and `/diverge`.

## Player Reporting

Any player in an active game turn can submit a report. Reports are visible to moderators in `/view mod`.

<AccordionGroup>
  <Accordion title="/report [reason]">
    **Usage:** `/report <reason>`

    Reports the current turn for moderation review. The `reason` argument is optional; if omitted, the report is filed with a placeholder reason `[ Empty report ]`.

    When a report is submitted, the server:

    1. Records a `skip` and a `report` interaction for the player against the current turn.
    2. Calls `deactivateGame` — sets the turn's `active` field to `false` in the database, preventing other players from being assigned that game.
    3. Inserts a document into the `voxelTelephoneReports` collection with the reporter's username, the turn ID, the reason, and `unresolved: true`.
    4. Removes the reporting player from the level and returns them to the hub.

    Reports remain in the database with `unresolved: true` until a moderator takes action. Abuse of this command may result in a moderation punishment; players are advised to review the server rules with `/rules` before reporting.
  </Accordion>
</AccordionGroup>

## Moderator Commands

The following commands require the `moderator` permission. Attempting to run them without the permission returns an error and takes no action.

<Warning>
  `/purge` and `/diverge` make permanent, irreversible changes to the game database. There is no built-in undo — exercise caution before confirming either action.
</Warning>

<AccordionGroup>
  <Accordion title="/purge [reason]">
    **Usage:** `/purge <reason>`

    **Aliases:** none

    **Requires:** Moderator permission, a game selected in the view gallery.

    Removes the most recent turn from the highlighted game chain and moves it into the `voxelTelephonePurged` collection for record-keeping. The `reason` argument is stored alongside the purged turn so it can be reviewed later in `/view purged`.

    After purging:

    * The previous turn in the chain is reactivated (`active: true`) so gameplay can continue.
    * A new `next` turn ID is generated for the reactivated turn.
    * The game's completion status is reset.
    * The view reloads automatically.

    <Warning>
      Purging removes the last turn only. If multiple turns need to be removed, run `/purge` repeatedly or consider using `/diverge` instead.
    </Warning>
  </Accordion>

  <Accordion title="/diverge [reason] (alias: /fork)">
    **Usage:** `/diverge <reason>`

    **Aliases:** `/fork`

    **Requires:** Moderator permission, a game selected in the view gallery. Cannot be used on a turn at depth 0 (the root turn).

    Creates a new, independent game chain starting from the currently highlighted turn. All turns from the highlighted point onward are detached from the original chain and re-rooted under a new game ID. The original chain is truncated at the turn before the divergence point and reactivated for new gameplay.

    This is useful when a game chain contains inappropriate content partway through — the offending segment and everything after it is forked off into a separate chain, while the earlier legitimate turns continue as a new active game.

    After diverging:

    * A new root ID is assigned to the diverged portion.
    * Depths are recalculated relative to the new root.
    * The previous turn in the original chain becomes active again with a new `next` ID.
    * Completion status is reset on both the original and diverged chains.
    * The view reloads automatically.

    <Warning>
      Diverging a game affects every turn from the selected point to the end of the chain. The diverged segment becomes its own game entry, not a deleted one. If you want to remove content outright, use `/purge` instead.
    </Warning>
  </Accordion>
</AccordionGroup>

## How Reports Are Stored

Reports are stored in the MongoDB collection `voxelTelephoneReports`. Each document has the following shape:

```json theme={null}
{
  "username": "ReporterName",
  "forId": "<turn ObjectId>",
  "reason": "The reason text",
  "unresolved": true
}
```

The `unresolved` flag is set to `true` on creation. It can be updated programmatically via `updateReportStatus`. Moderators can view all flagged games by entering `/view mod`, which displays games regardless of their `active` state, surfacing any chains that contain reported turns.

Purged content is stored separately in the `voxelTelephonePurged` collection and is viewable via `/view purged`. In that view, each purged build turn is shown alongside a synthetic description turn attributing the removal to "Moderator" and displaying the purge reason.
